From 91db76066470dddd3c1c8828c0b6822c008ea732 Mon Sep 17 00:00:00 2001 From: Darigov Research <30328618+darigovresearch@users.noreply.github.com> Date: Sat, 3 Dec 2022 22:50:07 +0000 Subject: [PATCH 1/3] fix: Adjusts wording to suggested format Format from feedback in https://github.com/freesewing/freesewing/pull/3115 --- markdown/dev/tutorials/pattern-design/adding-measurements/en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/dev/tutorials/pattern-design/adding-measurements/en.md b/markdown/dev/tutorials/pattern-design/adding-measurements/en.md index 05e4df0e87e..2dd90048b09 100644 --- a/markdown/dev/tutorials/pattern-design/adding-measurements/en.md +++ b/markdown/dev/tutorials/pattern-design/adding-measurements/en.md @@ -42,7 +42,7 @@ Now everybody knows this part requires the `head` measurement. This change will also get picked up by the development environment, and you'll now see this screen: -![This screen tells you you are missing some required measurements](./required-measurements.png) +![This screen tells you that you are missing some required measurements](./required-measurements.png) Since it's just one measurement, let's simply enter a value by hand. For example `38` as 38cm is a realistic head circumference measurement for a baby. From 85bd7f142fccbae57fa2f3ca64093cef55515c2c Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 4 Dec 2022 13:19:42 +0100 Subject: [PATCH 2/3] chore: more in upstream changes --- package.json | 2 - sites/backend/tests/index.mjs | 2 +- sites/backend/tests/shared.mjs | 1 + sites/dev/components/footer.js | 15 +- sites/dev/components/header.js | 1 - sites/dev/components/layouts/docs.js | 6 +- sites/dev/components/navigation/primary.js | 195 ++++++------------ sites/dev/components/search.js | 36 ++-- sites/dev/package.json | 19 +- sites/lab/package.json | 1 - sites/org/package.json | 1 - sites/shared/components/navigation/primary.js | 16 +- sites/shared/components/page-link.js | 6 +- sites/shared/components/worm.js | 2 +- sites/shared/package.json | 2 + 15 files changed, 107 insertions(+), 198 deletions(-) diff --git a/package.json b/package.json index 5b7fe8a1732..02ac5abf1fc 100644 --- a/package.json +++ b/package.json @@ -95,8 +95,6 @@ "prettier": "^2.7.1", "pretty-quick": "^3.0.0", "prop-types": "^15.7.2", - "react": "^17.0.2", - "react-dom": "^17.0.2", "rehype-format": "^4.0.1", "remark": "^14.0.2", "remark-frontmatter": "^4.0.1", diff --git a/sites/backend/tests/index.mjs b/sites/backend/tests/index.mjs index 8f3401cfc54..a37c7f6e5fb 100644 --- a/sites/backend/tests/index.mjs +++ b/sites/backend/tests/index.mjs @@ -12,7 +12,7 @@ const runTests = async (...params) => { //await apikeyTests(...params) //await accountTests(...params) //await personTests(...params) - await patternTests(...params) + //await patternTests(...params) } // Load initial data required for tests diff --git a/sites/backend/tests/shared.mjs b/sites/backend/tests/shared.mjs index 9a6b1652a75..0fe5677246d 100644 --- a/sites/backend/tests/shared.mjs +++ b/sites/backend/tests/shared.mjs @@ -70,6 +70,7 @@ export const setup = async () => { console.log('Failed at account confirmation request', err) process.exit() } + console.log(JSON.stringify(result.data, null ,2)) store[acc].token = result.data.token store[acc].username = result.data.account.username store[acc].id = result.data.account.id diff --git a/sites/dev/components/footer.js b/sites/dev/components/footer.js index 9f455aaafc9..435b55fa75d 100644 --- a/sites/dev/components/footer.js +++ b/sites/dev/components/footer.js @@ -107,19 +107,12 @@ const Footer = ({ app }) => {
{/* Social icons */}
- - - - + + {Object.keys(social).map((item) => ( - - - {social[item].icon} - + + {social[item].icon} ))}
diff --git a/sites/dev/components/header.js b/sites/dev/components/header.js index 80a0b9e1e20..edfee4567ad 100644 --- a/sites/dev/components/header.js +++ b/sites/dev/components/header.js @@ -1,6 +1,5 @@ import { useState, useEffect } from 'react' import FreeSewingIcon from 'shared/components/icons/freesewing.js' -import Link from 'next/link' import ThemePicker from 'shared/components/theme-picker.js' import CloseIcon from 'shared/components/icons/close.js' import MenuIcon from 'shared/components/icons/menu.js' diff --git a/sites/dev/components/layouts/docs.js b/sites/dev/components/layouts/docs.js index abb2c6f8db2..4972e37e235 100644 --- a/sites/dev/components/layouts/docs.js +++ b/sites/dev/components/layouts/docs.js @@ -19,11 +19,7 @@ const DefaultLayout = ({ app, title = false, crumbs = false, children = [] }) => slug={slug} before={[
- - - - - +
, ]} diff --git a/sites/dev/components/navigation/primary.js b/sites/dev/components/navigation/primary.js index de156dcb0d6..44c70313c5a 100644 --- a/sites/dev/components/navigation/primary.js +++ b/sites/dev/components/navigation/primary.js @@ -74,38 +74,37 @@ const SubLevel = ({ nodes = {}, active }) => ( items-center `} > - - + - - {child.__slug === active ? <>• : <>°} - - - {child.__linktitle || child.__title} - - + {child.__slug === active ? <>• : <>°} + + + {child.__linktitle || child.__title} + @@ -114,37 +113,37 @@ const SubLevel = ({ nodes = {}, active }) => ( ) : (
  • - - + - - {child.__slug === active ? <>• : <>°} - - - {child.__linktitle || child.__title} - - + {child.__slug === active ? <>• : <>°} + + + {child.__linktitle || child.__title} +
  • ) @@ -152,56 +151,6 @@ const SubLevel = ({ nodes = {}, active }) => ( ) -// Component that renders a toplevel of navigation -/* -const TopLevel = ({ icon, title, nav, current, slug, hasChildren=false, active }) => ( -
    - - {icon} - - - {title} - - - {hasChildren && } - - {hasChildren && } -
    -) - -const Navigation = ({ app, active, className='' }) => { - if (!app.navigation) return null - const output = [] - for (const page of order(app.navigation)) output.push(° - } - title={page.__title} - slug={page.__slug} - hasChildren={1} - nav={app.navigation} - current={order(app.navigation[page.__slug])} - active={active} - />) - - return
    {output}
    -} -*/ export const Icons = ({ app, active, @@ -217,11 +166,9 @@ export const Icons = ({ for (const page of order(app.navigation)) { output.push(
  • - - - {icons[page.__slug] ? icons[page.__slug]('w-14 h-14') : } - {page.__title} - + + {icons[page.__slug] ? icons[page.__slug]('w-14 h-14') : } + {page.__title}
  • ) @@ -229,16 +176,7 @@ export const Icons = ({ return
      {output}
    } -/* -const PrimaryMenu = ({ app, active, before=[], after=[] }) => ( - -) -*/ + export const MainSections = ({ app, active }) => { if (!app.navigation) return null const output = [] @@ -271,17 +209,16 @@ export const MainSections = ({ app, active }) => { {txt} ) : ( - - - {txt} - + + {txt} )} diff --git a/sites/dev/components/search.js b/sites/dev/components/search.js index 92a52d05975..7f25d7d55c7 100644 --- a/sites/dev/components/search.js +++ b/sites/dev/components/search.js @@ -67,32 +67,26 @@ const Hit = (props) => ( ${props.index === props.active ? 'bg-secondary bg-opacity-30' : 'bg-base-300 bg-opacity-10'} `} > - - - - {props.hit._highlightResult?.title ? ( - - ) : ( - props.hit.title - )} - - - {props.hit.page.split('/')[1]} - - + + + {props.hit._highlightResult?.title ? ( + + ) : ( + props.hit.title + )} + + + {props.hit.page.split('/')[1]} + {props.hit._snippetResult?.body && ( - - - - + + )} {props.hit?._highlightResult?.page && ( - - - - + + )}
    diff --git a/sites/dev/package.json b/sites/dev/package.json index 23bf6e383b3..a7f3543ebda 100644 --- a/sites/dev/package.json +++ b/sites/dev/package.json @@ -25,21 +25,22 @@ "serve": "pm2 start npm --name 'dev' -- run start" }, "dependencies": { - "@heroicons/react": "^2.0.1", - "@mdx-js/loader": "^2.0.0-rc.2", - "@mdx-js/mdx": "^2.0.0-rc.2", - "@mdx-js/react": "^2.0.0-rc.2", - "@mdx-js/runtime": "next", - "@next/bundle-analyzer": "^13.0.5", - "@tailwindcss/typography": "^0.5.0", + "@heroicons/react": "latest", + "@mdx-js/loader": "latest", + "@mdx-js/mdx": "latest", + "@mdx-js/react": "latest", + "@mdx-js/runtime": "latest", + "@next/bundle-analyzer": "^13", + "@tailwindcss/typography": "latest", "algoliasearch": "^4.11.0", "daisyui": "^2.0.6", "lodash.get": "^4.4.2", "lodash.orderby": "^4.6.0", "lodash.set": "^4.3.2", - "netlify-cli": "^12.0.4", - "next": "latest", + "next": "^13", + "react": "^18.2.0", "react-copy-to-clipboard": "^5.0.4", + "react-dom": "^18.2.0", "react-hotkeys-hook": "^3.4.4", "react-instantsearch-dom": "^6.18.0", "react-markdown": "^8.0.3", diff --git a/sites/lab/package.json b/sites/lab/package.json index f4a98975291..3f2c5fc0fb8 100644 --- a/sites/lab/package.json +++ b/sites/lab/package.json @@ -44,7 +44,6 @@ "lodash.get": "^4.4.2", "lodash.orderby": "^4.6.0", "lodash.set": "^4.3.2", - "netlify-cli": "^12.0.4", "next": "latest", "next-i18next": "^12.0.0", "react-copy-to-clipboard": "^5.0.4", diff --git a/sites/org/package.json b/sites/org/package.json index f02b8fc3abd..bc9258d4d7c 100644 --- a/sites/org/package.json +++ b/sites/org/package.json @@ -40,7 +40,6 @@ "lodash.get": "^4.4.2", "lodash.orderby": "^4.6.0", "lodash.set": "^4.3.2", - "netlify-cli": "^12.0.4", "next": "latest", "react-hotkeys-hook": "^3.4.4", "react-instantsearch-dom": "^6.18.0", diff --git a/sites/shared/components/navigation/primary.js b/sites/shared/components/navigation/primary.js index 50837c27b34..62a7566c52f 100644 --- a/sites/shared/components/navigation/primary.js +++ b/sites/shared/components/navigation/primary.js @@ -87,8 +87,7 @@ const SubLevel = ({ nodes={}, active }) => ( hover:cursor-row-resize items-center `}> - - ( { child.__linktitle || child.__title } - @@ -120,8 +118,7 @@ const SubLevel = ({ nodes={}, active }) => ( ) : (
  • - - ( {child.__linktitle || child.__title} -
  • ) @@ -165,8 +161,7 @@ const TopLevel = ({ icon, title, nav, current, slug, hasChildren=false, active } items-center `}> {icon} - - {title} - {hasChildren && } @@ -216,14 +210,12 @@ export const Icons = ({ for (const page of order(app.navigation)) { output.push(
  • - - + {icons[page.__slug] ? icons[page.__slug]('w-14 h-14') : } {page.__title} -
  • ) diff --git a/sites/shared/components/page-link.js b/sites/shared/components/page-link.js index 516886f1a26..9a41c240a7e 100644 --- a/sites/shared/components/page-link.js +++ b/sites/shared/components/page-link.js @@ -1,11 +1,9 @@ import Link from 'next/link' const PageLink = ({ href, txt, className="" }) => ( - - {txt} - + title={txt}>{txt} ) export default PageLink diff --git a/sites/shared/components/worm.js b/sites/shared/components/worm.js index 1d97703588c..8bbc6eca1df 100644 --- a/sites/shared/components/worm.js +++ b/sites/shared/components/worm.js @@ -25,7 +25,7 @@ const PreviewTile = ({ img, slug, title, href=false, fixed=false }) => ( > {href ? - : + : } ) diff --git a/sites/shared/package.json b/sites/shared/package.json index 9a5a3207e7c..5ff97582187 100644 --- a/sites/shared/package.json +++ b/sites/shared/package.json @@ -43,6 +43,8 @@ "mdast-util-toc": "^6.1.0", "pdfkit": "^0.13.0", "postcss-for": "^2.1.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react-markdown": "^8.0.0", "react-sizeme": "^3.0.2", "react-timeago": "^7.1.0", From 62b11529db567c23ab04aeba3283c0b4e6030704 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 4 Dec 2022 15:04:56 +0100 Subject: [PATCH 3/3] chore: Upgrade to nextjs 13 and react 18 --- sites/lab/components/design-picker.js | 4 +- sites/lab/components/footer.js | 11 +- sites/lab/page-templates/design-list.js | 35 +-- sites/shared/components/breadcrumbs.js | 16 +- sites/shared/components/layouts/default.js | 137 ++++++----- sites/shared/components/locale-picker.js | 8 +- sites/shared/components/mdx/prev-next.js | 8 +- sites/shared/components/mdx/read-more.js | 26 +- sites/shared/components/navigation/primary.js | 227 ++++++++++-------- sites/shared/components/page-link.js | 13 +- sites/shared/components/picker.js | 95 +++++--- sites/shared/components/wordmark.js | 13 +- sites/shared/components/wrappers/mdx.js | 23 +- sites/shared/components/wrappers/toc.js | 2 +- 14 files changed, 347 insertions(+), 271 deletions(-) diff --git a/sites/lab/components/design-picker.js b/sites/lab/components/design-picker.js index 8a3bd557e25..dc428ac7589 100644 --- a/sites/lab/components/design-picker.js +++ b/sites/lab/components/design-picker.js @@ -48,9 +48,9 @@ const PatternPicker = ({ app }) => { {sectionPatterns(section).map((pattern) => (
  • - + {pattern} - +
  • ))} diff --git a/sites/lab/components/footer.js b/sites/lab/components/footer.js index b06e203c28b..d0301d67dd9 100644 --- a/sites/lab/components/footer.js +++ b/sites/lab/components/footer.js @@ -110,10 +110,13 @@ const Footer = ({ app }) => { {/* Social icons */}
    {Object.keys(social).map((item) => ( - - - {social[item].icon} - + + {social[item].icon} ))}
    diff --git a/sites/lab/page-templates/design-list.js b/sites/lab/page-templates/design-list.js index 73279a2aa25..17fea723ea5 100644 --- a/sites/lab/page-templates/design-list.js +++ b/sites/lab/page-templates/design-list.js @@ -5,19 +5,22 @@ import { useTranslation } from 'next-i18next' import Layout from 'site/components/layouts/bare' import { PageTitle } from 'shared/components/layouts/default' -const DesignLinks = ({ list, prefix='' }) => { +const DesignLinks = ({ list, prefix = '' }) => { const { t } = useTranslation(['patterns']) return (
      - {list.map( d => ( + {list.map((d) => (
    • - - - {t(`patterns:${d}.t`)} -
      - {t(`patterns:${d}.d`)} -
      + + {t(`patterns:${d}.t`)} +
      + + {t(`patterns:${d}.d`)} +
    • ))} @@ -25,15 +28,13 @@ const DesignLinks = ({ list, prefix='' }) => { ) } -const PatternListPageTemplate = ({ section=false }) => { +const PatternListPageTemplate = ({ section = false }) => { const app = useApp() const { t } = useTranslation(['app']) - const title = section - ? app.navigation[section].__title - : t('designs') + const title = section ? app.navigation[section].__title : t('designs') - const sectionDesigns = (section=false) => { + const sectionDesigns = (section = false) => { if (!section) { const all = [] for (const section in app.designs) all.push(...app.designs[section]) @@ -47,7 +48,11 @@ const PatternListPageTemplate = ({ section=false }) => {
      - +
      @@ -56,5 +61,3 @@ const PatternListPageTemplate = ({ section=false }) => { } export default PatternListPageTemplate - - diff --git a/sites/shared/components/breadcrumbs.js b/sites/shared/components/breadcrumbs.js index ebecb704e60..f5034807a04 100644 --- a/sites/shared/components/breadcrumbs.js +++ b/sites/shared/components/breadcrumbs.js @@ -6,10 +6,8 @@ const Breadcrumbs = ({ crumbs = [], title }) => crumbs ? (
      • - - - - + +
      • {crumbs.map((crumb) => ( @@ -17,10 +15,12 @@ const Breadcrumbs = ({ crumbs = [], title }) =>
      • »
      • {crumb[1] ? ( - - - {crumb[0]} - + + {crumb[0]} ) : ( {crumb[0]} diff --git a/sites/shared/components/layouts/default.js b/sites/shared/components/layouts/default.js index 5390cd4ee03..359881d75dc 100644 --- a/sites/shared/components/layouts/default.js +++ b/sites/shared/components/layouts/default.js @@ -20,39 +20,38 @@ export const PageTitle = ({ app, slug, title }) => { return

        FIXME: This page has no title

        } -const Breadcrumbs = ({ app, slug=false, title }) => { +const Breadcrumbs = ({ app, slug = false, title }) => { if (!slug) return null const crumbs = [] const chunks = slug.split('/') for (const i in chunks) { - const j = parseInt(i)+parseInt(1) - const page = get(app.navigation, chunks.slice(0,j)) - if (page) crumbs.push([page.__linktitle, '/'+chunks.slice(0,j).join('/'), (j < chunks.length)]) + const j = parseInt(i) + parseInt(1) + const page = get(app.navigation, chunks.slice(0, j)) + if (page) crumbs.push([page.__linktitle, '/' + chunks.slice(0, j).join('/'), j < chunks.length]) } return (
        • - - - - + +
        • - {crumbs.map(crumb => ( + {crumbs.map((crumb) => (
        • »
        • - {crumb[2] - ? ( - - - {crumb[0]} - - - ) - : {crumb[0]} - } + {crumb[2] ? ( + + {crumb[0]} + + ) : ( + {crumb[0]} + )}
        • ))} @@ -78,16 +77,15 @@ const asideClasses = ` xl:w-1/4 ` - const DefaultLayout = ({ app, - title=false, - children=[], + title = false, + children = [], search, setSearch, - noSearch=false, - workbench=false, - AltMenu=null, + noSearch = false, + workbench = false, + AltMenu = null, }) => { const startNavigation = () => { app.startLoading() @@ -105,50 +103,58 @@ const DefaultLayout = ({ const [collapseAltMenu, setCollapseAltMenu] = useState(false) return ( -
          + `} + >
          - -
          -
          + ${workbench && collapsePrimaryNav ? '' : 'max-w-7xl'} + `} + >
          {title && ( <> @@ -160,28 +166,35 @@ const DefaultLayout = ({
          -
          {workbench && AltMenu && ( -
          {!noSearch && search && ( <> -
          - -
          -
          + `} + > + +
          +
          )}