diff --git a/packages/new-design/lib/config.mjs b/packages/new-design/lib/config.mjs index 717984c3966..4a9f454c14a 100644 --- a/packages/new-design/lib/config.mjs +++ b/packages/new-design/lib/config.mjs @@ -1,8 +1,12 @@ export const config = { - node: 14, // Minimum node version + // Minimum node version + node: 16, + // Site to download from fileUri: 'https://raw.githubusercontent.com', - repo: process.env.FS_REPO || 'freesewing/freesewing', // Repository to download from - branch: process.env.FS_BRANCH || 'main', // Branch to download from + // Repository to download from + repo: process.env.FS_REPO || 'freesewing/freesewing', + // Branch to download from + branch: process.env.FS_BRANCH || 'develop', i18n: [ 'account', 'common', @@ -24,223 +28,6 @@ export const config = { 'settings', 'welcome', ], - fetch: { - sites: [ - "shared/utils.mjs", - "shared/config/freesewing.mjs", - "shared/config/i18n.config.mjs", - "shared/config/next.mjs", - "shared/config/postcss.config.js", - "shared/config/tailwind.config.js", - "shared/prebuild/contributors.mjs", - "shared/hooks/useGist.js", - "shared/hooks/useLocalStorage.js", - "shared/hooks/useTheme.js", - "shared/styles/code.css", - "shared/styles/globals.css", - "shared/styles/svg-freesewing-draft.css", - "shared/themes/dark.js", - "shared/themes/hax0r.js", - "shared/themes/index.js", - "shared/themes/lgbtq.js", - "shared/themes/light.js", - "shared/themes/runtime.js", - "shared/themes/trans.js", - "shared/components/copy-to-clipboard.js", - "shared/components/json.js", - "shared/components/lightbox.js", - "shared/components/locale-picker.js", - "shared/components/modal.js", - "shared/components/page-link.js", - "shared/components/pinked-ribbon.js", - "shared/components/popout.js", - "shared/components/raw-span.js", - "shared/components/theme-picker.js", - "shared/components/web-link.js", - "shared/components/yaml.js", - "shared/components/layouts/default.js", - "shared/components/icons/box.js", - "shared/components/icons/camera.js", - "shared/components/icons/clear.js", - "shared/components/icons/close.js", - "shared/components/icons/cog.js", - "shared/components/icons/community.js", - "shared/components/icons/copy.js", - "shared/components/icons/design.js", - "shared/components/icons/discord.js", - "shared/components/icons/docs.js", - "shared/components/icons/down.js", - "shared/components/icons/edit.js", - "shared/components/icons/export.js", - "shared/components/icons/facebook.js", - "shared/components/icons/filter.js", - "shared/components/icons/flip.js", - "shared/components/icons/freesewing.js", - "shared/components/icons/github.js", - "shared/components/icons/google.js", - "shared/components/icons/guide.js", - "shared/components/icons/heart.js", - "shared/components/icons/help.js", - "shared/components/icons/i18n.js", - "shared/components/icons/instagram.js", - "shared/components/icons/left.js", - "shared/components/icons/menu.js", - "shared/components/icons/note.js", - "shared/components/icons/options.js", - "shared/components/icons/page.js", - "shared/components/icons/page-size.js", - "shared/components/icons/print.js", - "shared/components/icons/reddit.js", - "shared/components/icons/right.js", - "shared/components/icons/rotate.js", - "shared/components/icons/rss.js", - "shared/components/icons/search.js", - "shared/components/icons/settings.js", - "shared/components/icons/sheet.js", - "shared/components/icons/theme.js", - "shared/components/icons/tip.js", - "shared/components/icons/tutorial.js", - "shared/components/icons/twitter.js", - "shared/components/icons/user.js", - "shared/components/icons/versions.js", - "shared/components/icons/with-breasts.js", - "shared/components/icons/without-breasts.js", - "shared/components/icons/xray.js", - "shared/components/logos/cc-by.js", - "shared/components/logos/cc.js", - "shared/components/logos/freesewing.js", - "shared/components/logos/osi.js", - "shared/components/navigation/aside.js", - "shared/components/navigation/primary.js", - "shared/components/picker.js", - "shared/components/robot/index.js", - "shared/components/robot/poses.js", - "shared/components/wrappers/img.js", - "shared/components/wrappers/mdx.js", - "shared/components/wrappers/page.js", - "shared/components/wrappers/toc.js", - "shared/components/wrappers/workbench.js", - "shared/components/mdx/index.js", - "shared/components/mdx/tabs.js", - "shared/components/workbench/default-settings.js", - "shared/components/workbench/draft/circle/index.js", - "shared/components/workbench/draft/defs/index.js", - "shared/components/workbench/draft/error.js", - "shared/components/workbench/draft/index.js", - "shared/components/workbench/draft/part/index.js", - "shared/components/workbench/draft/path/index.js", - "shared/components/workbench/draft/point/index.js", - "shared/components/workbench/draft/snippet/index.js", - "shared/components/workbench/draft/svg/index.js", - "shared/components/workbench/draft/svg-wrapper.js", - "shared/components/workbench/draft/text/index.js", - "shared/components/workbench/draft/text-on-path/index.js", - "shared/components/workbench/draft/utils.js", - "shared/components/workbench/events.js", - "shared/components/workbench/exporting/index.js", - "shared/components/workbench/exporting/pdfExporter.js", - "shared/components/workbench/inputs/design-option-count.js", - "shared/components/workbench/inputs/design-option-list.js", - "shared/components/workbench/inputs/design-option-pct-deg.js", - "shared/components/workbench/inputs/measurement.js", - "shared/components/workbench/json.js", - "shared/components/workbench/layout/cut/index.js", - "shared/components/workbench/layout/cut/settings.js", - "shared/components/workbench/layout/draft/buttons.js", - "shared/components/workbench/layout/draft/index.js", - "shared/components/workbench/layout/draft/part.js", - "shared/components/workbench/layout/print/index.js", - "shared/components/workbench/layout/print/orientation-picker.js", - "shared/components/workbench/layout/print/pagesize-picker.js", - "shared/components/workbench/layout/print/plugin.js", - "shared/components/workbench/layout/print/settings.js", - "shared/components/workbench/measurements/index.js", - "shared/components/workbench/measurements/non-human.js", - "shared/components/workbench/menu/core-settings/core-setting-bool.js", - "shared/components/workbench/menu/core-settings/core-setting-list.js", - "shared/components/workbench/menu/core-settings/core-setting-mm.js", - "shared/components/workbench/menu/core-settings/core-setting-nr.js", - "shared/components/workbench/menu/core-settings/core-setting-only.js", - "shared/components/workbench/menu/core-settings/core-setting-sa-bool.js", - "shared/components/workbench/menu/core-settings/core-setting-sa-mm.js", - "shared/components/workbench/menu/core-settings/index.js", - "shared/components/workbench/menu/core-settings/setting.js", - "shared/components/workbench/menu/design-options/index.js", - "shared/components/workbench/menu/design-options/option-group.js", - "shared/components/workbench/menu/design-options/option-input.js", - "shared/components/workbench/menu/design-options/option.js", - "shared/components/workbench/menu/design-options/option-value.js", - "shared/components/workbench/menu/index.js", - "shared/components/workbench/menu/test-design-options/index.js", - "shared/components/workbench/menu/test-design-options/option-group.js", - "shared/components/workbench/menu/test-design-options/option.js", - "shared/components/workbench/menu/test-design-options/option-sub-group.js", - "shared/components/workbench/menu/view.js", - "shared/components/workbench/menu/xray/attributes.js", - "shared/components/workbench/menu/xray/disable.js", - "shared/components/workbench/menu/xray/index.js", - "shared/components/workbench/menu/xray/list.js", - "shared/components/workbench/menu/xray/log.js", - "shared/components/workbench/menu/xray/path.js", - "shared/components/workbench/menu/xray/path-ops.js", - "shared/components/workbench/menu/xray/point.js", - "shared/components/workbench/menu/xray/reset.js", - "shared/components/workbench/preload.js", - "shared/components/workbench/sample.js", - "shared/components/workbench/yaml.js", - "shared/components/error/error-boundary.js", - "shared/components/error/error-boundary.js", - "shared/components/error/reset-buttons.js", - "shared/components/error/view.js", - "shared/components/workbench/layout/draft/index.js", - "shared/components/workbench/layout/draft/part.js", - "shared/components/workbench/layout/cut/index.js", - "shared/components/workbench/layout/cut/settings.js", - "shared/components/workbench/layout/print/index.js", - "shared/components/workbench/layout/print/orientation-picker.js", - "shared/components/workbench/layout/print/pagesize-picker.js", - "shared/components/workbench/layout/print/plugin.js", - "shared/components/workbench/layout/print/settings.js", - "shared/components/workbench/menu/index.js", - "shared/components/workbench/menu/view.js", - "shared/components/workbench/menu/core-settings/core-setting-bool.js", - "shared/components/workbench/menu/core-settings/core-setting-list.js", - "shared/components/workbench/menu/core-settings/core-setting-mm.js", - "shared/components/workbench/menu/core-settings/core-setting-nr.js", - "shared/components/workbench/menu/core-settings/core-setting-only.js", - "shared/components/workbench/menu/core-settings/core-setting-sa-bool.js", - "shared/components/workbench/menu/core-settings/core-setting-sa-mm.js", - "shared/components/workbench/menu/core-settings/index.js", - "shared/components/workbench/menu/core-settings/setting.js", - "shared/components/workbench/menu/design-options/index.js", - "shared/components/workbench/menu/design-options/option-group.js", - "shared/components/workbench/menu/design-options/option-input.js", - "shared/components/workbench/menu/design-options/option-value.js", - "shared/components/workbench/menu/design-options/option.js", - "shared/components/workbench/menu/test-design-options/index.js", - "shared/components/workbench/menu/test-design-options/option-group.js", - "shared/components/workbench/menu/test-design-options/option-sub-group.js", - "shared/components/workbench/menu/test-design-options/option.js", - "shared/components/workbench/menu/xray/attributes.js", - "shared/components/workbench/menu/xray/disable.js", - "shared/components/workbench/menu/xray/index.js", - "shared/components/workbench/menu/xray/list.js", - "shared/components/workbench/menu/xray/log.js", - "shared/components/workbench/menu/xray/path-ops.js", - "shared/components/workbench/menu/xray/path.js", - "shared/components/workbench/menu/xray/point.js", - "shared/components/workbench/menu/xray/reset.js", - "lab/components/footer.js", - "lab/components/wrappers/layout.js", - "lab/components/wrappers/page.js" - ], - config: [ - { - from: 'measurements.mjs', - to: 'shared/config/measurements.mjs' - } - ], - }, gitignore: ` # See https://help.github.com/ignore-files/ for more about ignoring files. @@ -263,5 +50,216 @@ npm-debug.log* yarn-debug.log* yarn-error.log* `, + fetch: { + config: [ + { + from: 'measurements.mjs', + to: 'shared/config/measurements.mjs', + }, + ], + sites: [ + 'shared/utils.mjs', + 'shared/designs/index.js', + 'shared/hooks/useGist.js', + 'shared/hooks/useLocalStorage.js', + 'shared/hooks/useTheme.js', + 'shared/mdx/compiler.js', + 'shared/mdx/loader.js', + 'shared/mdx/mdx-plugin-toc.mjs', + 'shared/mdx/remark-intro-plugin.mjs', + 'shared/config/freesewing.mjs', + 'shared/config/i18n.config.mjs', + 'shared/config/next.mjs', + 'shared/config/postcss.config.js', + 'shared/config/tailwind-force.html', + 'shared/config/tailwind.config.js', + 'shared/prebuild/contributors.mjs', + 'shared/prebuild/feed.mjs', + 'shared/prebuild/i18n-only.mjs', + 'shared/prebuild/i18n.mjs', + 'shared/prebuild/index.mjs', + 'shared/prebuild/lab.mjs', + 'shared/prebuild/mdx.mjs', + 'shared/prebuild/navigation.mjs', + 'shared/prebuild/patrons.mjs', + 'shared/prebuild/strapi.mjs', + 'shared/strapi/loader.js', + 'shared/strapi/qa.mjs', + 'shared/themes/dark.js', + 'shared/themes/hax0r.js', + 'shared/themes/index.js', + 'shared/themes/lgbtq.js', + 'shared/themes/light.js', + 'shared/themes/runtime.js', + 'shared/styles/code.css', + 'shared/styles/globals.css', + 'shared/styles/svg-freesewing-draft.css', + 'shared/components/breadcrumbs.js', + 'shared/components/code.js', + 'shared/components/copy-to-clipboard.js', + 'shared/components/docs-link.js', + 'shared/components/json-highlight.js', + 'shared/components/lightbox.js', + 'shared/components/locale-picker.js', + 'shared/components/modal.js', + 'shared/components/page-link.js', + 'shared/components/picker.js', + 'shared/components/popout.js', + 'shared/components/raw-span.js', + 'shared/components/ribbon.js', + 'shared/components/theme-picker.js', + 'shared/components/web-link.js', + 'shared/components/wordmark.js', + 'shared/components/worm.js', + 'shared/components/yaml.js', + 'shared/components/error/error-boundary.js', + 'shared/components/error/reset-buttons.js', + 'shared/components/error/view.js', + 'shared/components/layouts/default.js', + 'shared/components/logos/cc-by.js', + 'shared/components/logos/cc.js', + 'shared/components/logos/freesewing.js', + 'shared/components/logos/osi.js', + 'shared/components/mdx/example.js', + 'shared/components/mdx/examples.js', + 'shared/components/mdx/figure.js', + 'shared/components/mdx/highlight.js', + 'shared/components/mdx/index.js', + 'shared/components/mdx/prev-next.js', + 'shared/components/mdx/read-more.js', + 'shared/components/mdx/tabs.js', + 'shared/components/mdx/youtube.js', + 'shared/components/navigation/aside.js', + 'shared/components/navigation/primary.js', + 'shared/components/icons/box.js', + 'shared/components/icons/camera.js', + 'shared/components/icons/clear.js', + 'shared/components/icons/close.js', + 'shared/components/icons/cog.js', + 'shared/components/icons/community.js', + 'shared/components/icons/copy.js', + 'shared/components/icons/design.js', + 'shared/components/icons/discord.js', + 'shared/components/icons/docs.js', + 'shared/components/icons/down.js', + 'shared/components/icons/edit.js', + 'shared/components/icons/export.js', + 'shared/components/icons/facebook.js', + 'shared/components/icons/filter.js', + 'shared/components/icons/flip.js', + 'shared/components/icons/freesewing.js', + 'shared/components/icons/github.js', + 'shared/components/icons/google.js', + 'shared/components/icons/guide.js', + 'shared/components/icons/heart.js', + 'shared/components/icons/help.js', + 'shared/components/icons/i18n.js', + 'shared/components/icons/instagram.js', + 'shared/components/icons/left.js', + 'shared/components/icons/menswear.js', + 'shared/components/icons/menu.js', + 'shared/components/icons/note.js', + 'shared/components/icons/options.js', + 'shared/components/icons/page-size.js', + 'shared/components/icons/page.js', + 'shared/components/icons/print.js', + 'shared/components/icons/reddit.js', + 'shared/components/icons/right.js', + 'shared/components/icons/rotate.js', + 'shared/components/icons/rss.js', + 'shared/components/icons/search.js', + 'shared/components/icons/settings.js', + 'shared/components/icons/sheet.js', + 'shared/components/icons/swipeleft.js', + 'shared/components/icons/swiperight.js', + 'shared/components/icons/theme.js', + 'shared/components/icons/tip.js', + 'shared/components/icons/tutorial.js', + 'shared/components/icons/twitter.js', + 'shared/components/icons/user.js', + 'shared/components/icons/versions.js', + 'shared/components/icons/womenswear.js', + 'shared/components/icons/xray.js', + 'shared/components/robot/index.js', + 'shared/components/robot/poses.js', + 'shared/components/wrappers/img.js', + 'shared/components/wrappers/mdx.js', + 'shared/components/wrappers/page.js', + 'shared/components/wrappers/toc.js', + 'shared/components/wrappers/workbench.js', + 'shared/components/workbench/default-settings.js', + 'shared/components/workbench/gist-as-json.js', + 'shared/components/workbench/logs.js', + 'shared/components/workbench/preload.js', + 'shared/components/workbench/sample.js', + 'shared/components/workbench/yaml.js', + 'shared/components/workbench/inputs/design-option-count.js', + 'shared/components/workbench/inputs/design-option-list.js', + 'shared/components/workbench/inputs/design-option-pct-deg.js', + 'shared/components/workbench/inputs/measurement.js', + 'shared/components/workbench/exporting/export-handler.js', + 'shared/components/workbench/exporting/export-worker.js', + 'shared/components/workbench/exporting/index.js', + 'shared/components/workbench/exporting/pdf-maker.js', + 'shared/components/workbench/measurements/index.js', + 'shared/components/workbench/measurements/non-human.js', + 'shared/components/workbench/draft/error.js', + 'shared/components/workbench/draft/index.js', + 'shared/components/workbench/draft/stack.js', + 'shared/components/workbench/draft/svg-wrapper.js', + 'shared/components/workbench/draft/utils.js', + 'shared/components/workbench/draft/circle/index.js', + 'shared/components/workbench/draft/defs/index.js', + 'shared/components/workbench/draft/part/index.js', + 'shared/components/workbench/draft/path/index.js', + 'shared/components/workbench/draft/point/index.js', + 'shared/components/workbench/draft/snippet/index.js', + 'shared/components/workbench/draft/svg/index.js', + 'shared/components/workbench/draft/text/index.js', + 'shared/components/workbench/draft/text-on-path/index.js', + 'shared/components/workbench/layout/cut/index.js', + 'shared/components/workbench/layout/cut/settings.js', + 'shared/components/workbench/layout/draft/buttons.js', + 'shared/components/workbench/layout/draft/index.js', + 'shared/components/workbench/layout/draft/part.js', + 'shared/components/workbench/layout/print/index.js', + 'shared/components/workbench/layout/print/orientation-picker.js', + 'shared/components/workbench/layout/print/pagesize-picker.js', + 'shared/components/workbench/layout/print/plugin.js', + 'shared/components/workbench/layout/print/settings.js', + 'shared/components/workbench/menu/index.js', + 'shared/components/workbench/menu/view.js', + 'shared/components/workbench/menu/core-settings/core-setting-bool.js', + 'shared/components/workbench/menu/core-settings/core-setting-list.js', + 'shared/components/workbench/menu/core-settings/core-setting-mm.js', + 'shared/components/workbench/menu/core-settings/core-setting-nr.js', + 'shared/components/workbench/menu/core-settings/core-setting-only.js', + 'shared/components/workbench/menu/core-settings/core-setting-sa-bool.js', + 'shared/components/workbench/menu/core-settings/core-setting-sa-mm.js', + 'shared/components/workbench/menu/core-settings/index.js', + 'shared/components/workbench/menu/core-settings/setting.js', + 'shared/components/workbench/menu/design-options/index.js', + 'shared/components/workbench/menu/design-options/option-group.js', + 'shared/components/workbench/menu/design-options/option-input.js', + 'shared/components/workbench/menu/design-options/option-value.js', + 'shared/components/workbench/menu/design-options/option.js', + 'shared/components/workbench/menu/test-design-options/index.js', + 'shared/components/workbench/menu/test-design-options/option.js', + 'shared/components/workbench/menu/xray/attributes.js', + 'shared/components/workbench/menu/xray/disable.js', + 'shared/components/workbench/menu/xray/index.js', + 'shared/components/workbench/menu/xray/list.js', + 'shared/components/workbench/menu/xray/log.js', + 'shared/components/workbench/menu/xray/path-ops.js', + 'shared/components/workbench/menu/xray/path.js', + 'shared/components/workbench/menu/xray/point.js', + 'shared/components/workbench/menu/xray/reset.js', + 'lab/components/about.js', + 'lab/components/design-picker.js', + 'lab/components/layouts/bare.js', + 'lab/components/layouts/lab.js', + 'lab/components/wrappers/layout.js', + 'lab/components/wrappers/page.js', + ], + }, } - diff --git a/packages/new-design/lib/utils.mjs b/packages/new-design/lib/utils.mjs index 24a0deb1df0..c3458d22c48 100644 --- a/packages/new-design/lib/utils.mjs +++ b/packages/new-design/lib/utils.mjs @@ -22,7 +22,7 @@ const nl = '\n' const tab = ' ' const nlt = nl + tab -// Checks for node 14 or higher +// Checks for node 16 or higher export const checkNodeVersion = () => { const node_version = process.version.slice(1).split('.')[0] if (parseInt(node_version) < config.node) { @@ -134,25 +134,12 @@ const copyTemplate = async (config, choices) => { // Template files for (const from of config.files.template) { - /* - * We can't include a package.json file in the templates - * because doing so will prevent NPM from including those folders - * in our package. So we use _package.json, and if we see that we - * rename it here to package.json - */ let to = join(config.dest, from.slice(config.source.template.length - 7)) - if (to.slice(-13) === '_package.json') { - to = to.slice(0, -13) + 'package.json' - } + if (to.slice(-9) === '.mustache') to = to.slice(0, -9) if (!dirs[to]) await ensureDir(to) - if (['config.js', 'kage.json'].indexOf(from.slice(-9)) !== -1) { - // Template out file rather than coy it - const src = await readFile(from, 'utf-8') - promises.push(writeFile(to, mustache.render(src, { name: choices.name }))) - } else { - // Just copy the file - promises.push(copyFile(from, to)) - } + // Template out file + const src = await readFile(from, 'utf-8') + promises.push(writeFile(to, mustache.render(src, { name: choices.name }))) } await Promise.all(promises) diff --git a/packages/new-design/scripts/filelist.mjs b/packages/new-design/scripts/filelist.mjs new file mode 100644 index 00000000000..75880d0c724 --- /dev/null +++ b/packages/new-design/scripts/filelist.mjs @@ -0,0 +1,36 @@ +import rdir from 'recursive-readdir' +import path from 'path' + +const ignore = [ + 'package.json', + 'node_modules', + '.eslint', + '.gitignore', + '.md', + 'lab/components/header.js', + 'lab/components/help-us.js', + 'lab/components/search.js', + 'lab/components/footer.js', + 'shared/config/measurements.js', +] + +const getFiles = async (dir) => { + const all = await rdir(path.resolve(dir)) + return all + .filter((file) => { + for (const skip of ignore) { + if (file.includes(skip)) return false + } + return true + }) + .map((file) => file.split('/sites/').pop()) +} + +const doIt = async () => { + let files = [] + const shared = await getFiles('../../sites/shared') + const lab = await getFiles('../../sites/lab/components') + console.log(JSON.stringify([...shared, ...lab], null, 2)) +} + +doIt() diff --git a/packages/new-design/shared/lab/components/footer.js b/packages/new-design/shared/lab/components/footer.js new file mode 100644 index 00000000000..0b7838532a4 --- /dev/null +++ b/packages/new-design/shared/lab/components/footer.js @@ -0,0 +1,119 @@ +import Logo from 'shared/components/logos/freesewing.js' +import OsiLogo from 'shared/components/logos/osi.js' +import CreativeCommonsLogo from 'shared/components/logos/cc.js' +import CcByLogo from 'shared/components/logos/cc-by.js' +import { useTranslation } from 'next-i18next' +import Ribbon from 'shared/components/ribbon.js' +import Link from 'next/link' +import { WordMark } from 'shared/components/wordmark.js' + +import DiscordIcon from 'shared/components/icons/discord.js' +import FacebookIcon from 'shared/components/icons/facebook.js' +import GithubIcon from 'shared/components/icons/github.js' +import InstagramIcon from 'shared/components/icons/instagram.js' +import RedditIcon from 'shared/components/icons/reddit.js' +import TwitterIcon from 'shared/components/icons/twitter.js' + +// Classes +const link = 'text-secondary font-bold hover:pointer hover:underline px-1' +const accent = 'text-accent font-bold text-lg px-1 block sm:inline' +const freesewing = 'px-1 text-lg font-bold block sm:inline' + +// Keep these translations in the component because they're only used here +const translations = { + cc: ( + + Content on FreeSewing.org is available under{' '} + + a Creative Commons license + + + ), + mit: ( + + The FreeSewing source code is{' '} + + available on Github + {' '} + under{' '} + + the MIT license + + + ), + sponsors: ( + <> + FreeSewing is sponsored by these{' '} + awesome companies + + ), +} + +const icon = { className: 'w-8 lg:w-12 h-8 lg:h-12' } +const social = { + Discord: { + icon: , + href: 'https://discord.freesewing.org/', + }, + Instagram: { + icon: , + href: 'https://instagram.com/freesewing_org', + }, + Facebook: { + icon: , + href: 'https://www.facebook.com/groups/627769821272714/', + }, + Github: { + icon: , + href: 'https://github.com/freesewing', + }, + Reddit: { + icon: , + href: 'https://www.reddit.com/r/freesewing/', + }, + Twitter: { + icon: , + href: 'https://twitter.com/freesewing_org', + }, +} + +const Footer = ({ app }) => { + const { t } = useTranslation(['common', 'patrons']) + + return ( +
+ +
+ {/* Logo & Slogan */} +
+
+ +
+ +
+

+ {t('sloganCome')} +
+ {t('sloganStay')} +

+
+
+ {/* Second col - Social */} +
+ {/* Social icons */} +
+ {Object.keys(social).map((item) => ( + + + {social[item].icon} + + + ))} +
+
+
+
+ ) +} + +export default Footer diff --git a/packages/new-design/shared/lab/components/header.js b/packages/new-design/shared/lab/components/header.js index f69f304ff6f..40d689bfde7 100644 --- a/packages/new-design/shared/lab/components/header.js +++ b/packages/new-design/shared/lab/components/header.js @@ -2,21 +2,18 @@ import { useState, useEffect } from 'react' import Link from 'next/link' import ThemePicker from 'shared/components/theme-picker.js' import LocalePicker from 'shared/components/locale-picker.js' +import DesignPicker from 'site/components/design-picker.js' import CloseIcon from 'shared/components/icons/close.js' import MenuIcon from 'shared/components/icons/menu.js' +import HelpIcon from 'shared/components/icons/help.js' +import Ribbon from 'shared/components/ribbon.js' +import { WordMark } from 'shared/components/wordmark.js' import DocsIcon from 'shared/components/icons/docs.js' import { useTranslation } from 'next-i18next' -const Right = props => ( - - - -) -const Left = props => ( - - - -) +const btnClasses = + 'btn btn-ghost text-base font-medium btn-sm text-neutral-content ' + + ' capitalize hover:bg-transparent hover:text-secondary-focus' const Header = ({ app }) => { const { t } = useTranslation(['common']) @@ -27,11 +24,10 @@ const Header = ({ app }) => { useEffect(() => { if (typeof window !== 'undefined') { const handleScroll = () => { - const curScrollPos = (typeof window !== 'undefined') ? window.pageYOffset : 0 + const curScrollPos = typeof window !== 'undefined' ? window.pageYOffset : 0 if (curScrollPos >= prevScrollPos) { if (show && curScrollPos > 20) setShow(false) - } - else setShow(true) + } else setShow(true) setPrevScrollPos(curScrollPos) } window.addEventListener('scroll', handleScroll) @@ -39,59 +35,53 @@ const Header = ({ app }) => { } }, [prevScrollPos, show]) - return ( -
-
-
+ ${show ? '' : 'fixed top-0 left-0 -translate-y-20'} + `} + > +
+
+
+ - -
- - -
+
+
+ +
-
+ + + ) } diff --git a/packages/new-design/shared/lab/hooks/useApp.js b/packages/new-design/shared/lab/hooks/useApp.js index 64be9796987..3576bb4f693 100644 --- a/packages/new-design/shared/lab/hooks/useApp.js +++ b/packages/new-design/shared/lab/hooks/useApp.js @@ -6,13 +6,12 @@ import { useRouter } from 'next/router' import useTheme from 'shared/hooks/useTheme' function useApp(full = true) { - // Load translation method const locale = useRouter().locale // Persistent state const [account, setAccount] = useLocalStorage('account', { username: false }) - const [theme, setTheme] = useTheme(); + const [theme, setTheme] = useTheme() // React State const [primaryMenu, setPrimaryMenu] = useState(false) @@ -43,13 +42,18 @@ function useApp(full = true) { setPrimaryMenu, setSlug, setTheme, - startLoading: () => { setLoading(true); setPrimaryMenu(false) }, // Always close menu when navigating + startLoading: () => { + setLoading(true) + setPrimaryMenu(false) + }, // Always close menu when navigating stopLoading: () => setLoading(false), // State handlers togglePrimaryMenu, + + // Standalone is for the development environment + standalone: true, } } export default useApp - diff --git a/packages/new-design/shared/next.config.mjs b/packages/new-design/shared/next.config.mjs index 6ca07c84cb4..cb732264d4b 100644 --- a/packages/new-design/shared/next.config.mjs +++ b/packages/new-design/shared/next.config.mjs @@ -2,25 +2,15 @@ import path from 'path' import i18nConfig from './next-i18next.config.js' const config = { - experimental: { - externalDir: true, - }, i18n: i18nConfig.i18n, - pageExtensions: [ 'js', 'mjs' ], + pageExtensions: ['mjs'], webpack: (config, options) => { - - // Suppress warnings about importing version from package.json - // We'll deal with it in v3 of FreeSewing - config.ignoreWarnings = [ - /only default export is available soon/ - ] - // Aliases config.resolve.alias.shared = path.resolve('./shared/') config.resolve.alias.site = path.resolve('./lab/') config.resolve.alias.design = path.resolve('./design/') return config - } + }, } export default config diff --git a/packages/new-design/shared/pages/_app.js b/packages/new-design/shared/pages/_app.mjs similarity index 100% rename from packages/new-design/shared/pages/_app.js rename to packages/new-design/shared/pages/_app.mjs diff --git a/packages/new-design/shared/pages/design.js b/packages/new-design/shared/pages/design.mjs similarity index 76% rename from packages/new-design/shared/pages/design.js rename to packages/new-design/shared/pages/design.mjs index df9b518bd28..efa2889a4f8 100644 --- a/packages/new-design/shared/pages/design.js +++ b/packages/new-design/shared/pages/design.mjs @@ -1,4 +1,4 @@ -import design from 'design/src/index.js' +import { Pattern } from 'design/src/index.mjs' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' import Page from 'site/components/wrappers/page.js' @@ -6,12 +6,12 @@ import useApp from 'site/hooks/useApp.js' import WorkbenchWrapper from 'shared/components/wrappers/workbench.js' import Layout from 'site/components/layouts/lab' -const WorkbenchPage = props => { +const WorkbenchPage = (props) => { const app = useApp() return ( - + ) } @@ -22,6 +22,6 @@ export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale)), - } + }, } } diff --git a/packages/new-design/shared/pages/index.js b/packages/new-design/shared/pages/index.mjs similarity index 68% rename from packages/new-design/shared/pages/index.js rename to packages/new-design/shared/pages/index.mjs index c3d809ff2ce..29528193942 100644 --- a/packages/new-design/shared/pages/index.js +++ b/packages/new-design/shared/pages/index.mjs @@ -19,8 +19,17 @@ const translations = { nl: `Naar jouw ontwerp`, }, tips: { - en: Edit the files in the design folder, and we'll auto-update your design, - nl: Bewerk de bestanden in de design map, en we passen je ontwerp automatisch aan, + en: ( + + Edit the files in the design folder, and we'll auto-update your design + + ), + nl: ( + + Bewerk de bestanden in de design map, en we passen je ontwerp automatisch + aan + + ), }, } @@ -37,39 +46,38 @@ const HomePage = (props) => {

{translations.sade[app.locale]}

- 👉 + + 👉 + {translations.load[app.locale]} - 👈 + + 👈 + {translations.tips[app.locale]}
- {router.locales.map(locale => ( + {router.locales.map((locale) => ( - - {t(`locales:${locale}`)} - + {t(`locales:${locale}`)} ))}
- {Object.keys(themes).map(theme => ( - - ))} + {Object.keys(themes).map((theme) => ( + + ))}
-

{t('patrons:supportFreesewing')}

@@ -78,9 +86,13 @@ const HomePage = (props) => {

{t('patrons:patronPitch')}

- 🥰 + + 🥰 + {t('patrons:becomeAPatron')} - 🙏🏻 + + 🙏🏻 +
@@ -96,9 +108,6 @@ export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale)), - } + }, } } - - - diff --git a/packages/new-design/shared/pages/support.js b/packages/new-design/shared/pages/support.mjs similarity index 77% rename from packages/new-design/shared/pages/support.js rename to packages/new-design/shared/pages/support.mjs index 45a0d2ca68c..778a174c09a 100644 --- a/packages/new-design/shared/pages/support.js +++ b/packages/new-design/shared/pages/support.mjs @@ -32,7 +32,7 @@ const translations = { ongoing issues, future plans, and news big and small about FreeSewing and its community.`, nl: `Elke twee weken is er de FreeSewing contributor call (Engelstalig), waar de FreeSewing vrijwilligers de lopende zaken bespreken. Ook de plannen voor de toekomst en groot en klein - nieuws over FreeSewing en de gemeenschap komen aan bod.` + nieuws over FreeSewing en de gemeenschap komen aan bod.`, }, docs: { en: `Our documentation for developers hosted on ${fsd}. You can find guides and how-to's @@ -52,67 +52,70 @@ const SupportPage = (props) => { const { t } = useTranslation(['common', 'patrons']) return ( - -

Discord

+

Discord

-

Github

+

Github

-

{t('docs')}

+

{t('docs')}

-

Contributor Calls

+

Contributor Calls

-
-

{t('patrons:supportFreesewing')}

+

{t('patrons:supportFreesewing')}

{t('patrons:patronLead')}

{t('patrons:patronPitch')}

- + {t('patrons:becomeAPatron')}
-
) } @@ -123,9 +126,6 @@ export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale)), - } + }, } } - - - diff --git a/packages/new-design/templates/from-brian/design/config.js b/packages/new-design/templates/from-brian/design/config.js deleted file mode 100644 index 2185f7800f5..00000000000 --- a/packages/new-design/templates/from-brian/design/config.js +++ /dev/null @@ -1,27 +0,0 @@ -import pkg from '../package.json' assert { type: 'json' } -import { config as brianConfig } from '@freesewing/brian' - -export default { - name: '{{name}}', - version: pkg.version, - optionGroups: { - ...brianConfig.optionGroups, - }, - measurements: [...brianConfig.measurements], - dependencies: { - brianSleevecap: 'brianFront', - }, - inject: { - brianBack: 'brianBase', - brianFront: 'brianBack', - brianSleeve: 'brianSleevecap', - back: 'brianBack', - front: 'brianFront', - sleeve: 'brianSleeve', - }, - hide: ['brianBase', 'brianFront', 'brianBack', 'brianSleevecap', 'brianSleeve', 'sleevecap'], - parts: [], - options: { - ...brianConfig.options, - }, -} diff --git a/packages/new-design/templates/from-brian/design/src/back.js b/packages/new-design/templates/from-brian/design/src/back.js deleted file mode 100644 index 2112dad247c..00000000000 --- a/packages/new-design/templates/from-brian/design/src/back.js +++ /dev/null @@ -1,5 +0,0 @@ -export default (part) => { - // Do to this part what you wish, before returning it - - return part -} diff --git a/packages/new-design/templates/from-brian/design/src/back.mjs.mustache b/packages/new-design/templates/from-brian/design/src/back.mjs.mustache new file mode 100644 index 00000000000..463041ca123 --- /dev/null +++ b/packages/new-design/templates/from-brian/design/src/back.mjs.mustache @@ -0,0 +1,155 @@ +import { back as brianBack } from '@freesewing/brian' + +function draftBack({ + // Uncomment below to destructure what you need + /* + * Content constructors + */ + //Path, // A Path constructor to create new paths + //Point, // A Point constructor to create new points + //Snippet, // A Snippet constructor to create new snippets + /* + * Content constainers + */ + //paths, // Add a Path to your part by adding it to this object + //points, // Add a Points to your part by adding it to this object + //snippets, // Add a Snippet to your part by adding it to this object + /* + * Access to settings + */ + //absoluteOptions, // Access to settings.absoluteOptions + //complete, // Access to settings.complete + //measurements, // Access to settings.measurements + //options, // Access to settings.options + //paperless, // Access to settings.paperless + //sa, // Access to settings.sa + //scale, // Access to settings.scale + /* + * Access to utilities + */ + //getId, //See the getId documentation + //hide, //See the hide documentation + //log, //See the logging documentation + //macro, //See the macros documentation + //setHidden, //See the setHidden documentation + //store, //See the store documentation + //unhide, //See the unhide documentation + //units, //See the units documentation + //utils, //See the utils documentation + /* + * Return value + */ + part, // Your draft method must return this +}) { + + // Work your magic here + + return part +} + +export const back = { + /* + * name: Holds the name of this part. + * + * We STRONGLY recommend naming your parts in the format of + * design.part to avoid naming conflicts when people re-use + * parts across designs. + */ + name: '{{ name }}.back', + /* + * draft: Holds the draft method for this part + * + * This should be a function that drafts and returns the part + * + * Documentation: https://freesewing.dev/reference/api/part/draft + */ + draft: draftBack, + after: [ + /* + * after: Holds a list of parts that should be drafted prior to this part. + * + * You'll need to import these parts, just as with the from key above. + * + * If you don't have any parts to draft prior to this part, + * you can remove this options key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/dependencies + */ + ], + /* + * from: Holds the part you want to extend. + * + * Since you opted to extend brian, and this is the back part, + * we're extending brian's back part here. + * It was imported at the top of this file from @freesewing/brian + * + * Documentation: https://freesewing.dev/reference/api/part/config/dependencies + */ + from: brianBack, + /* + * hide: Set this to true to hide a part. + * + * We've set this to false here to clarify its use. + * I you don't want to hide this part, + * you can remove the hide key entirely. + */ + hide: false, + /* + * hideDependecies: Set this to true to hide a part's dependencies. + * + * We've set this to true here since you're extending Brian's back part. + * I you don't want to hide this part's dependencies, + * you can remove the hideDependencies key entirely. + */ + hideDependencies: true, + /* + * hideAll: Set this to true to hide both the part and its dependencies. + * + * This is a combination of the hide and hideDependencies keys in case + * you want to both hide this part and its dependencies. + * We've included it here with a value of false to its use. + * I you don't want to hide this a part and its dependencies, + * you can remove the hideAll key entirely. + */ + hideAll: false, + options: { + /* + * options: Holds (the configuration of) options for this part + * + * Declare options used in this part here. + * You only need to add additional options. + * All options coming from Brian's back part are already loaded. + * + * If you don't have any options to add, + * you can remove this options key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/options + */ + }, + measurements: [ + /* + * measurements: Holds a list of measurements required by this part. + * + * Declare measurements required by this part here. + * You only need to add additional measurements. + * All measurements coming from Brian's back part are already loaded. + * + * If you don't have any required measurements to add, + * you can remove this measurements key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/measurements + */ + ], + optionalMeasurements: [ + /* + * optionalMeasurements: Holds a list of measurements optional in this part. + * + * Declare measurements that are optional for this part here. + * + * If you don't have any optional measurements to add, + * you can remove this optionalMeasurements key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/measurements + */ + ], +} diff --git a/packages/new-design/templates/from-brian/design/src/front.js b/packages/new-design/templates/from-brian/design/src/front.js deleted file mode 100644 index 2112dad247c..00000000000 --- a/packages/new-design/templates/from-brian/design/src/front.js +++ /dev/null @@ -1,5 +0,0 @@ -export default (part) => { - // Do to this part what you wish, before returning it - - return part -} diff --git a/packages/new-design/templates/from-brian/design/src/front.mjs.mustache b/packages/new-design/templates/from-brian/design/src/front.mjs.mustache new file mode 100644 index 00000000000..c5a076482c6 --- /dev/null +++ b/packages/new-design/templates/from-brian/design/src/front.mjs.mustache @@ -0,0 +1,155 @@ +import { front as brianFront } from '@freesewing/brian' + +function draftFront({ + // Uncomment below to destructure what you need + /* + * Content constructors + */ + //Path, // A Path constructor to create new paths + //Point, // A Point constructor to create new points + //Snippet, // A Snippet constructor to create new snippets + /* + * Content constainers + */ + //paths, // Add a Path to your part by adding it to this object + //points, // Add a Points to your part by adding it to this object + //snippets, // Add a Snippet to your part by adding it to this object + /* + * Access to settings + */ + //absoluteOptions, // Access to settings.absoluteOptions + //complete, // Access to settings.complete + //measurements, // Access to settings.measurements + //options, // Access to settings.options + //paperless, // Access to settings.paperless + //sa, // Access to settings.sa + //scale, // Access to settings.scale + /* + * Access to utilities + */ + //getId, //See the getId documentation + //hide, //See the hide documentation + //log, //See the logging documentation + //macro, //See the macros documentation + //setHidden, //See the setHidden documentation + //store, //See the store documentation + //unhide, //See the unhide documentation + //units, //See the units documentation + //utils, //See the utils documentation + /* + * Return value + */ + part, // Your draft method must return this +}) { + + // Work your magic here + + return part +} + +export const front = { + /* + * name: Holds the name of this part. + * + * We STRONGLY recommend naming your parts in the format of + * design.part to avoid naming conflicts when people re-use + * parts across designs. + */ + name: '{{ name }}.front', + /* + * draft: Holds the draft method for this part + * + * This should be a function that drafts and returns the part + * + * Documentation: https://freesewing.dev/reference/api/part/draft + */ + draft: draftFront, + after: [ + /* + * after: Holds a list of parts that should be drafted prior to this part. + * + * You'll need to import these parts, just as with the from key above. + * + * If you don't have any parts to draft prior to this part, + * you can remove this options key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/dependencies + */ + ], + /* + * from: Holds the part you want to extend. + * + * Since you opted to extend brian, and this is the front part, + * we're extending brian's front part here. + * It was imported at the top of this file from @freesewing/brian + * + * Documentation: https://freesewing.dev/reference/api/part/config/dependencies + */ + from: brianFront, + /* + * hide: Set this to true to hide a part. + * + * We've set this to false here to clarify its use. + * I you don't want to hide this part, + * you can remove the hide key entirely. + */ + hide: false, + /* + * hideDependecies: Set this to true to hide a part's dependencies. + * + * We've set this to true here since you're extending Brian's front part. + * I you don't want to hide this part's dependencies, + * you can remove the hideDependencies key entirely. + */ + hideDependencies: true, + /* + * hideAll: Set this to true to hide both the part and its dependencies. + * + * This is a combination of the hide and hideDependencies keys in case + * you want to both hide this part and its dependencies. + * We've included it here with a value of false to its use. + * I you don't want to hide this a part and its dependencies, + * you can remove the hideAll key entirely. + */ + hideAll: false, + options: { + /* + * options: Holds (the configuration of) options for this part + * + * Declare options used in this part here. + * You only need to add additional options. + * All options coming from Brian's front part are already loaded. + * + * If you don't have any options to add, + * you can remove this options key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/options + */ + }, + measurements: [ + /* + * measurements: Holds a list of measurements required by this part. + * + * Declare measurements required by this part here. + * You only need to add additional measurements. + * All measurements coming from Brian's front part are already loaded. + * + * If you don't have any required measurements to add, + * you can remove this measurements key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/measurements + */ + ], + optionalMeasurements: [ + /* + * optionalMeasurements: Holds a list of measurements optional in this part. + * + * Declare measurements that are optional for this part here. + * + * If you don't have any optional measurements to add, + * you can remove this optionalMeasurements key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/measurements + */ + ], +} diff --git a/packages/new-design/templates/from-brian/design/src/index.js b/packages/new-design/templates/from-brian/design/src/index.js deleted file mode 100644 index d900df8a231..00000000000 --- a/packages/new-design/templates/from-brian/design/src/index.js +++ /dev/null @@ -1,29 +0,0 @@ -// Import dependencies -import freesewing from '@freesewing/core' -import plugins from '@freesewing/plugin-bundle' -// Import Brian so we can extend it -import Brian from '@freesewing/brian' -// Import configuration -import config from '../config' -// Import parts -import draftFront from './front' -import draftBack from './back' -import draftSleeve from './sleeve' - -// Create the new design -const Design = new freesewing.Design(config, plugins) - -// Attach Brian's draft methods to the prototype -for (const m of ['Base', 'Front', 'Back', 'Sleevecap', 'Sleeve']) { - Design.prototype[`draftBrian${m}`] = function (part) { - return new Brian(this.settings)[`draft${m}`](part) - } -} - -// Attach the draft methods to the prototype -Design.prototype.draftBack = draftBack -Design.prototype.draftFront = draftFront -Design.prototype.draftSleeve = draftSleeve - -// Export the new Design -export default Design diff --git a/packages/new-design/templates/from-brian/design/src/index.mjs.mustache b/packages/new-design/templates/from-brian/design/src/index.mjs.mustache new file mode 100644 index 00000000000..2c8d60eb066 --- /dev/null +++ b/packages/new-design/templates/from-brian/design/src/index.mjs.mustache @@ -0,0 +1,31 @@ +// Import Design constructor +import { Design } from '@freesewing/core' +// Import parts +import { back } from './back' +import { front } from './front' +import { sleeve } from './sleeve' + +// Create the new design +const Pattern = new freesewing.Design({ + data: { + /* + * If you like, you can add any data you want to your design. + * We'll add the name here as an example. + * + * If you don't use this, + * you can remove this data key enterely. + */ + name: "{{ name }}", + }, + // A list of parts is all that is required. + parts: [ back, front, sleeve ], +}) + +/* + * Named exports + * + * We export the design itself as well as each part individually. + * This allows us to re-use these parts in other designs. + */ +export { back, front, sleeve, Pattern } + diff --git a/packages/new-design/templates/from-brian/design/src/sleeve.js b/packages/new-design/templates/from-brian/design/src/sleeve.js deleted file mode 100644 index 2112dad247c..00000000000 --- a/packages/new-design/templates/from-brian/design/src/sleeve.js +++ /dev/null @@ -1,5 +0,0 @@ -export default (part) => { - // Do to this part what you wish, before returning it - - return part -} diff --git a/packages/new-design/templates/from-brian/design/src/sleeve.mjs.mustache b/packages/new-design/templates/from-brian/design/src/sleeve.mjs.mustache new file mode 100644 index 00000000000..c7da096bf05 --- /dev/null +++ b/packages/new-design/templates/from-brian/design/src/sleeve.mjs.mustache @@ -0,0 +1,155 @@ +import { sleeve as brianSleeve } from '@freesewing/brian' + +function draftSleeve({ + // Uncomment below to destructure what you need + /* + * Content constructors + */ + //Path, // A Path constructor to create new paths + //Point, // A Point constructor to create new points + //Snippet, // A Snippet constructor to create new snippets + /* + * Content constainers + */ + //paths, // Add a Path to your part by adding it to this object + //points, // Add a Points to your part by adding it to this object + //snippets, // Add a Snippet to your part by adding it to this object + /* + * Access to settings + */ + //absoluteOptions, // Access to settings.absoluteOptions + //complete, // Access to settings.complete + //measurements, // Access to settings.measurements + //options, // Access to settings.options + //paperless, // Access to settings.paperless + //sa, // Access to settings.sa + //scale, // Access to settings.scale + /* + * Access to utilities + */ + //getId, //See the getId documentation + //hide, //See the hide documentation + //log, //See the logging documentation + //macro, //See the macros documentation + //setHidden, //See the setHidden documentation + //store, //See the store documentation + //unhide, //See the unhide documentation + //units, //See the units documentation + //utils, //See the utils documentation + /* + * Return value + */ + part, // Your draft method must return this +}) { + + // Work your magic here + + return part +} + +export const sleeve = { + /* + * name: Holds the name of this part. + * + * We STRONGLY recommend naming your parts in the format of + * design.part to avoid naming conflicts when people re-use + * parts across designs. + */ + name: '{{ name }}.sleeve', + /* + * draft: Holds the draft method for this part + * + * This should be a function that drafts and returns the part + * + * Documentation: https://freesewing.dev/reference/api/part/draft + */ + draft: draftSleeve, + after: [ + /* + * after: Holds a list of parts that should be drafted prior to this part. + * + * You'll need to import these parts, just as with the from key above. + * + * If you don't have any parts to draft prior to this part, + * you can remove this options key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/dependencies + */ + ], + /* + * from: Holds the part you want to extend. + * + * Since you opted to extend brian, and this is the sleeve part, + * we're extending brian's sleeve part here. + * It was imported at the top of this file from @freesewing/brian + * + * Documentation: https://freesewing.dev/reference/api/part/config/dependencies + */ + from: brianSleeve, + /* + * hide: Set this to true to hide a part. + * + * We've set this to false here to clarify its use. + * I you don't want to hide this part, + * you can remove the hide key entirely. + */ + hide: false, + /* + * hideDependecies: Set this to true to hide a part's dependencies. + * + * We've set this to true here since you're extending Brian's sleeve part. + * I you don't want to hide this part's dependencies, + * you can remove the hideDependencies key entirely. + */ + hideDependencies: true, + /* + * hideAll: Set this to true to hide both the part and its dependencies. + * + * This is a combination of the hide and hideDependencies keys in case + * you want to both hide this part and its dependencies. + * We've included it here with a value of false to its use. + * I you don't want to hide this a part and its dependencies, + * you can remove the hideAll key entirely. + */ + hideAll: false, + options: { + /* + * options: Holds (the configuration of) options for this part + * + * Declare options used in this part here. + * You only need to add additional options. + * All options coming from Brian's sleeve part are already loaded. + * + * If you don't have any options to add, + * you can remove this options key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/options + */ + }, + measurements: [ + /* + * measurements: Holds a list of measurements required by this part. + * + * Declare measurements required by this part here. + * You only need to add additional measurements. + * All measurements coming from Brian's sleeve part are already loaded. + * + * If you don't have any required measurements to add, + * you can remove this measurements key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/measurements + */ + ], + optionalMeasurements: [ + /* + * optionalMeasurements: Holds a list of measurements optional in this part. + * + * Declare measurements that are optional for this part here. + * + * If you don't have any optional measurements to add, + * you can remove this optionalMeasurements key entirely. + * + * Documentation: https://freesewing.dev/reference/api/part/config/measurements + */ + ], +} diff --git a/packages/new-design/templates/from-brian/design/src/sleevecap.js b/packages/new-design/templates/from-brian/design/src/sleevecap.js deleted file mode 100644 index 2112dad247c..00000000000 --- a/packages/new-design/templates/from-brian/design/src/sleevecap.js +++ /dev/null @@ -1,5 +0,0 @@ -export default (part) => { - // Do to this part what you wish, before returning it - - return part -} diff --git a/packages/new-design/templates/from-brian/_package.json b/packages/new-design/templates/from-brian/package.json.mustache similarity index 94% rename from packages/new-design/templates/from-brian/_package.json rename to packages/new-design/templates/from-brian/package.json.mustache index 8a0467225f2..985a4c01a65 100644 --- a/packages/new-design/templates/from-brian/_package.json +++ b/packages/new-design/templates/from-brian/package.json.mustache @@ -42,6 +42,7 @@ "@freesewing/plugin-svgattr": "latest", "@freesewing/plugin-theme": "latest", "@freesewing/plugin-i18n": "latest", + "@freesewing/plugin-bust": "latest", "@freesewing/utils": "latest", "@freesewing/models": "latest", "@headlessui/react": "^1.6.5", @@ -53,7 +54,6 @@ "react-sizeme": "^3.0.2", "react-zoom-pan-pinch": "^2.1.3", "react-markdown": "^8.0.3", - "roughjs": "^4.5.2", "@tailwindcss/typography": "^0.5.2", "d3-dispatch": "^3.0.1", "d3-drag": "^3.0.0", @@ -78,9 +78,11 @@ "js-yaml": "^4.1.0", "pdfkit": "^0.13.0", "svg-to-pdfkit": "^0.1.8", + "postcss-for": "^2.1.1", "postcss": "^8.4.14", "tailwindcss": "^3.1.3", - "tailwindcss-open-variant": "^1.0.0" + "tailwindcss-open-variant": "^1.0.0", + "web-worker": "^1.2.0" }, "files": [ "dist/*", @@ -92,7 +94,7 @@ "tag": "next" }, "engines": { - "node": ">=14.0.0", + "node": ">=16.0.0", "npm": ">=6" } }