diff --git a/CHANGELOG.md b/CHANGELOG.md index c485c76c7e2..5348e3afe2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,13 +9,14 @@ - The `@freesewing/components` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - The `@freesewing/css-theme` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `gatsby-remark-jargon` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. + - The `@freesewing/i18n` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - The `@freesewing/mui-theme` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `plugin-export-dxf` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `plugin-export-dxf` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `remark-jargon` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. Use `rehype-jargon` instead. + - The `@freesewing/pattern-info` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. + - The `@freesewing/plugin-export-dxf` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - The `@freesewing/snapseries` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - The `@freesewing/utils` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. + - The `gatsby-remark-jargon` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. + - The `remark-jargon` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. Use `rehype-jargon` instead. ### plugin-gore @@ -229,12 +230,6 @@ ## 2.21.1 (2022-06-28) -### pattern-info - -#### Fixed - - - Added Noble to the list - ## 2.21.0 (2022-06-27) @@ -730,12 +725,6 @@ ### models -#### Changed - - - Migrated from Rollup to Esbuild for all builds - -### pattern-info - #### Changed - Migrated from Rollup to Esbuild for all builds @@ -1810,15 +1799,6 @@ - Fixed bug in resolving of shared pattern options - Removed optional chaining which broke node v12 support -### pattern-info - -#### Changed - - - Added Bee pattern - - Added Lunetius pattern - - Added Tiberius pattern - - Added Walburga pattern - ## 2.18.0 (2021-09-09) @@ -2485,13 +2465,6 @@ - Added translation for new Titan options - Added translations for Charlie -### pattern-info - -#### Added - - - Added Charlie - - Info now also contains deprecated status - ## 2.14.0 (2021-03-07) @@ -2546,12 +2519,6 @@ - Fixed type in bustsidecode finder code -### pattern-info - -#### Fixed - - - Make pattern list alphabetic - ## 2.13.1 (2021-02-14) @@ -2896,12 +2863,6 @@ - Replaced a few identical files with symlinks -### pattern-info - -#### Added - - - Added teagan info - ## 2.8.1 (2020-08-16) @@ -4116,12 +4077,6 @@ ### models -#### Added - - - Initial release - -### pattern-info - #### Added - Initial release diff --git a/config/changelog.yaml b/config/changelog.yaml index a4f6da46683..fa96f40f087 100644 --- a/config/changelog.yaml +++ b/config/changelog.yaml @@ -14,24 +14,23 @@ Unreleased: While v2 versions remain available, this package is no longer supported. - The `@freesewing/css-theme` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `gatsby-remark-jargon` package is not part of FreeSewing v3. + - The `@freesewing/i18n` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - The `@freesewing/mui-theme` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `plugin-export-dxf` package is not part of FreeSewing v3. + - The `@freesewing/pattern-info` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `plugin-export-dxf` package is not part of FreeSewing v3. + - The `@freesewing/plugin-export-dxf` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - - The `@freesewing/i18n` package is not part of FreeSewing v3. - While v2 versions remain available, this package is no longer supported. - - The `remark-jargon` package is not part of FreeSewing v3. - While v2 versions remain available, this package is no longer supported. - Use `rehype-jargon` instead. - The `@freesewing/snapseries` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - The `@freesewing/utils` package is not part of FreeSewing v3. While v2 versions remain available, this package is no longer supported. - + - The `gatsby-remark-jargon` package is not part of FreeSewing v3. + While v2 versions remain available, this package is no longer supported. + - The `remark-jargon` package is not part of FreeSewing v3. + While v2 versions remain available, this package is no longer supported. + Use `rehype-jargon` instead. 2.22.0: diff --git a/config/software/packages.json b/config/software/packages.json index e8a2fd32e6e..8835d393769 100644 --- a/config/software/packages.json +++ b/config/software/packages.json @@ -4,7 +4,6 @@ "i18n": "Translations for the FreeSewing project", "models": "Body measurements data for a range of default sizes", "new-design": "Initializer package for a new FreeSewing design: npx @freesewing/new-design", - "pattern-info": "Information about available freesewing patterns", "prettier-config": "FreeSewing's shared configuration for prettier", "rehype-jargon": "A Rehype plugin for jargon terms" } diff --git a/packages/pattern-info/.gitignore b/packages/pattern-info/.gitignore deleted file mode 100644 index bb5f3defed6..00000000000 --- a/packages/pattern-info/.gitignore +++ /dev/null @@ -1 +0,0 @@ -src/prebuild/ diff --git a/packages/pattern-info/CHANGELOG.md b/packages/pattern-info/CHANGELOG.md deleted file mode 100644 index 4fdb204a47d..00000000000 --- a/packages/pattern-info/CHANGELOG.md +++ /dev/null @@ -1,55 +0,0 @@ -# Change log for: @freesewing/pattern-info - - -## 2.21.1 (2022-06-28) - -### Fixed - - - Added Noble to the list - -## 2.21.0 (2022-06-27) - -### Changed - - - Migrated from Rollup to Esbuild for all builds - -## 2.19.0 (2021-10-17) - -### Changed - - - Added Bee pattern - - Added Lunetius pattern - - Added Tiberius pattern - - Added Walburga pattern - -## 2.15.0 (2021-04-15) - -### Added - - - Added Charlie - - Info now also contains deprecated status - -## 2.13.2 (2021-02-21) - -### Fixed - - - Make pattern list alphabetic - -## 2.9.0 (2020-10-02) - -### Added - - - Added teagan info - -## 2.0.0 (2019-08-25) - -### Added - - - Initial release - - -This is the **initial release**, and the start of this change log. - -> Prior to version 2, FreeSewing was not a JavaScript project. -> As such, that history is out of scope for this change log. - diff --git a/packages/pattern-info/README.md b/packages/pattern-info/README.md deleted file mode 100644 index c4ae94949df..00000000000 --- a/packages/pattern-info/README.md +++ /dev/null @@ -1,288 +0,0 @@ -![FreeSewing](https://static.freesewing.org/banner.png) -

@freesewing/pattern-info on NPM - License: MIT - Code quality on DeepScan - Open issues tagged pkg:pattern-info - All Contributors -

Follow @freesewing_org on Twitter - Chat with us on Discord - Become a FreeSewing Patron - Follow @freesewing_org on Twitter -

- -# @freesewing/pattern-info - -Information about available freesewing patterns - -## 🚨🚨 This packages is deprecated 🚨🚨 - -This package will not be part of FreeSewing v3. - - - - -> #### Note: Version 3 is a work in progress -> -> We are working on a new major version (v3) but it is not ready for prime-time. -> For production use, please refer to our v2 packages (the `latest` on NPM) -> or [the `v2` branch in our monorepo](https://github.com/freesewing/freesewing/tree/v2). - -## What am I looking at? πŸ€” - -This repository is our *monorepo* holding all our NPM designs, plugins, other NPM packages, and (web)sites. - -This folder holds: @freesewing/pattern-info - -If you're not entirely sure what to do or how to start, type this command: - -``` -npm run tips -``` - -> If you don't want to set up a dev environment, you can run it in your browser: -> -> [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/freesewing/freesewing) -> -> We recommend that you fork our repository and then -> put `gitpod.io/# to start up a browser-based dev environment of your own. - -## About FreeSewing πŸ’€ - -Where the world of makers and developers collide, that's where you'll find FreeSewing. - -If you're a maker, checkout [freesewing.org](https://freesewing.org/) where you can generate -our sewing patterns adapted to your measurements. - -If you're a developer, our documentation is on [freesewing.dev](https://freesewing.dev/). -Our [core library](https://freesewing.dev/reference/api/) is a *batteries-included* toolbox -for parametric design of sewing patterns. But we also provide a range -of [plugins](https://freesewing.dev/reference/plugins/) that further extend the -functionality of the platform. - -If you have NodeJS installed, you can try it right now by running: - -```bash -npx create-freesewing-pattern -``` - -Or, consult our getting started guides -for [Linux](https://freesewing.dev/tutorials/getting-started-linux/), -[MacOS](https://freesewing.dev/tutorials/getting-started-mac/), -or [Windows](https://freesewing.dev/tutorials/getting-started-windows/). - -We also have a [pattern design tutorial](https://freesewing.dev/tutorials/pattern-design/) that -walks you through your first parametric design, -and [a friendly community](https://freesewing.org/community/where/) with -people who can help you when you get stuck. - -## Support FreeSewing: Become a patron πŸ₯° - -FreeSewing is an open source project run by a community, -and financially supported by our patrons. - -If you feel what we do is worthwhile, and you can spend a few coind without -hardship, then you should [join us and become a patron](https://freesewing.org/community/join). - -## Links πŸ‘©β€πŸ’» - - - πŸ’» Makers website: [freesewing.org](https://freesewing.org) - - πŸ’» Developers website: [freesewing.dev](https://freesewing.dev) - - πŸ’¬ Chat: On Discord via [discord.freesewing.org](https://discord.freesewing.org/) - - βœ… Todo list/Kanban board: On Github via [todo.freesewing.org](https://todo.freesewing.org/) - - 🐦 Twitter: [@freesewing_org](https://twitter.com/freesewing_org) - - πŸ“· Instagram: [@freesewing_org](https://instagram.com/freesewing_org) - -## License: MIT πŸ€“ - -Β© [Joost De Cock](https://github.com/joostdecock). -See [the license file](https://github.com/freesewing/freesewing/blob/develop/LICENSE) for details. - -## Where to get help 🀯 - -Our [chatrooms on Discord](https://chat.freesewing.org/) are the best place to ask questions, -share your feedback, or just hang out. - -If you want to report a problem, please [create an issue](https://github.com/freesewing/freesewing/issues/new). - - - -## Contributors ✨ - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Adam Tomkins

πŸ“–

Alexandre Ignjatovic

πŸ’»

AlfaLyr

πŸ’» πŸ”Œ 🎨

Andrew James

πŸ“–

Anneke

πŸ“– 🌍

Annie Kao

πŸ“–

Anternative

πŸ“–

Anthony

πŸ’¬

Ari Grayzel-student

πŸ’»

BenJamesBen

πŸ’» πŸ“–

Cameron Dubas

πŸ“–

Carsten Biebricher

πŸ“–

Cathy Zoller

πŸ“–

Chantal Lapointe

🌍

Damien PIQUET

πŸ’»

Darigov Research

πŸ“– πŸ€”

Elena FdR

πŸ“– πŸ“

Emmanuel Nyachoke

πŸ’» πŸ“–

Enoch Riese

πŸ’»

EvEkSwed

🌍

Fantastik-Maman

🌍

Forrest O.

πŸ“–

FrΓ©dΓ©ric

🌍

Glenn Matthews

πŸ“–

Greg Sadetsky

πŸ“–

Igor Couto

πŸ›

Ikko Ashimine

πŸ“–

Irapeke

🌍

Jacek Sawoszczuk

πŸ“–

Jason Williams

πŸ“–

Jeremy Jackson

πŸ’»

Joe Schofield

πŸ“–

Joebidido

🌍

Joost De Cock

🚧

Josh Essman

πŸ“–

Kake

πŸ“–

Kapunahele Wong

πŸ“–

Karen

πŸ“– πŸ“‹

Katie McGinley

πŸ“–

Kieran Klaassen

πŸ’»

Kittycatou

🌍

Kris

πŸ“–

Kristin Ruben

πŸ’»

Loudepeuter

🌍

Lucian

πŸ“‹

Marcus

🌍

Martin Tribo

πŸ“–

Nadege Michel

⚠️ πŸ“–

Natalia

πŸ’» 🎨 πŸ“

Nathan Yergler

πŸ“–

Nick Dower

πŸ“– πŸ’» πŸ›

Nikhil Chelliah

πŸ“–

OysteinHoiby

πŸ’»

Patrick Forringer

πŸ”Œ

Paul

πŸ“– πŸ“ 🌍

Phillip Thelen

πŸ’»

Pixieish

πŸ“–

Prof. dr. Sorcha NΓ­ Dhubhghaill

πŸ“–

Quentin FELIX

πŸ’» 🎨

Rik Hekker

πŸ›

Sam Livingston-Gray

πŸ“–

Sanne

πŸ’» πŸ“–

Sara Latorre

🌍

SeaZeeZee

πŸ“– πŸ’»

SimonbJohnson

πŸ›

Slylele

πŸ“– 🌍

Soazillon

🌍

SoneaTheBest

🌍

Stefan Sydow

🌍 πŸ“– πŸ’»

TrΓ­ona

πŸ“–

Unmutual

πŸ“–

Wouter van Wageningen

πŸ’» 🎨 πŸ”§

amysews

πŸ“–

anna-puk

πŸ’»

beautifulsummermoon

🌍

berce

πŸ“–

biou

πŸ’»

bobgeorgethe3rd

πŸ’» πŸ“– 🎨

brmlyklr

πŸ“–

chri5b

πŸ’» ⚠️

dingcycle

🌍

drowned-in-books

πŸ’¬

econo202

πŸ“–

ericamattos

🌍

fightingrabbit

πŸ’»

gaylyndie

πŸ“–

grimlokason

πŸ’»

hellgy

🎨

jackseye

πŸ“–

marckiesel

🌍

mesil

πŸ›

starfetch

πŸ’» πŸ“– 🌍 🎨

ttimearl

πŸ–‹

tuesgloomsday

πŸ“–

valadaptive

πŸ’»

viocky

🌍

woolishboy

πŸ’»

yc

🌍
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! - diff --git a/packages/pattern-info/build.mjs b/packages/pattern-info/build.mjs deleted file mode 100644 index 9d1da1994da..00000000000 --- a/packages/pattern-info/build.mjs +++ /dev/null @@ -1,49 +0,0 @@ -/* This script will build the package with esbuild */ -import esbuild from 'esbuild' -import pkg from './package.json' assert { type: 'json' } - -// Create banner based on package info -const banner = `/** - * ${pkg.name} | v${pkg.version} - * ${pkg.description} - * (c) ${new Date().getFullYear()} ${pkg.author} - * @license ${pkg.license} - */` - -// Shared esbuild options -const options = { - banner: { js: banner }, - bundle: true, - entryPoints: ['src/index.js'], - format: 'esm', - outfile: 'dist/index.mjs', - external: ["@freesewing"], - metafile: process.env.VERBOSE ? true : false, - minify: process.env.NO_MINIFY ? false : true, - sourcemap: true, -} - -// Let esbuild generate the build -let result -(async () => { - result = await esbuild.build(options).catch(() => process.exit(1)) - - if (process.env.VERBOSE) { - const info = await esbuild.analyzeMetafile(result.metafile) - console.log(info) - } - - // Also build a version that has all dependencies bundled - // This makes it easy to run tests - await esbuild - .build({ - ...options, - minify: false, - sourcemap: false, - outfile: 'tests/dist/index.mjs', - format: 'esm', - external: [], - }) - .catch(() => process.exit(1)) - -})() diff --git a/packages/pattern-info/info.md b/packages/pattern-info/info.md deleted file mode 100644 index 2201ea27009..00000000000 --- a/packages/pattern-info/info.md +++ /dev/null @@ -1,4 +0,0 @@ -## 🚨🚨 This packages is deprecated 🚨🚨 - -This package will not be part of FreeSewing v3. - diff --git a/packages/pattern-info/package.json b/packages/pattern-info/package.json deleted file mode 100644 index bf95dd01046..00000000000 --- a/packages/pattern-info/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "@freesewing/pattern-info", - "version": "3.0.0-alpha.0", - "description": "Information about available freesewing patterns", - "author": "Joost De Cock (https://github.com/joostdecock)", - "homepage": "https://freesewing.org/", - "repository": "github:freesewing/freesewing", - "license": "MIT", - "bugs": { - "url": "https://github.com/freesewing/freesewing/issues" - }, - "funding": { - "type": "individual", - "url": "https://freesewing.org/patrons/join" - }, - "keywords": [ - "freesewing", - "freesewing" - ], - "type": "module", - "module": "dist/index.mjs", - "exports": { - ".": "./dist/index.mjs" - }, - "scripts": { - "build": "node --experimental-json-modules build.mjs", - "clean": "rimraf dist", - "mbuild": "NO_MINIFY=1 node --experimental-json-modules build.mjs", - "symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -", - "test": "echo \"pattern-info: No tests configured. Perhaps you'd like to do this?\" && exit 0", - "vbuild": "VERBOSE=1 node --experimental-json-modules build.mjs", - "lab": "cd ../../sites/lab && yarn start", - "tips": "node ../../scripts/help.mjs", - "prebuild": "node --experimental-json-modules src/prebuild.js", - "precibuild_step6": "node --experimental-json-modules src/prebuild.js", - "cibuild_step6": "node --experimental-json-modules build.mjs" - }, - "peerDependencies": {}, - "dependencies": {}, - "devDependencies": {}, - "files": [ - "dist/*", - "README.md" - ], - "publishConfig": { - "access": "public", - "tag": "next" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=8" - } -} diff --git a/packages/pattern-info/src/index.js b/packages/pattern-info/src/index.js deleted file mode 100644 index 4692303bf6a..00000000000 --- a/packages/pattern-info/src/index.js +++ /dev/null @@ -1,101 +0,0 @@ -export { default as options } from './prebuild/options' -export { default as optionGroups } from './prebuild/option-groups' -export { default as parts } from './prebuild/parts' -export { default as measurements } from './prebuild/measurements' -export { default as optionalMeasurements } from './prebuild/optional-measurements' -export { default as versions } from './prebuild/versions' -export { default as info } from './prebuild/info' - -export const list = [ - 'aaron', - 'albert', - 'bee', - 'bella', - 'benjamin', - 'bent', - 'bob', - 'breanna', - 'brian', - 'bruce', - 'carlita', - 'carlton', - 'cathrin', - 'charlie', - 'cornelius', - 'diana', - 'florent', - 'florence', - 'hi', - 'holmes', - 'hortensia', - 'huey', - 'hugo', - 'jaeger', - 'lucy', - 'lunetius', - 'noble', - 'octoplushy', - 'paco', - 'penelope', - 'sandy', - 'shin', - 'simon', - 'simone', - 'sven', - 'tamiko', - 'teagan', - 'theo', - 'tiberius', - 'titan', - 'unice', - 'ursula', - 'trayvon', - 'wahid', - 'walburga', - 'waralee', - 'yuri', -] - -export const withoutBreasts = [ - 'aaron', - 'albert', - 'benjamin', - 'bent', - 'bob', - 'brian', - 'bruce', - 'carlton', - 'charlie', - 'cornelius', - 'florent', - 'florence', - 'hi', - 'holmes', - 'hortensia', - 'huey', - 'hugo', - 'jaeger', - 'lucy', - 'lunetius', - 'octoplushy', - 'paco', - 'penelope', - 'sandy', - 'shin', - 'simon', - 'sven', - 'tamiko', - 'teagan', - 'theo', - 'tiberius', - 'titan', - 'trayvon', - 'unice', - 'ursula', - 'wahid', - 'walburga', - 'waralee', - 'yuri', -] - -export const withBreasts = ['bee', 'bella', 'breanna', 'cathrin', 'carlita', 'diana', 'noble', 'simone'] diff --git a/packages/pattern-info/src/prebuild.js b/packages/pattern-info/src/prebuild.js deleted file mode 100644 index b015715483d..00000000000 --- a/packages/pattern-info/src/prebuild.js +++ /dev/null @@ -1,199 +0,0 @@ -const path = require('path') -const fse = require('fs-extra') -const aaron = require('@freesewing/aaron').config -const albert = require('@freesewing/albert').config -const bee = require('@freesewing/bee').config -const bella = require('@freesewing/bella').config -const benjamin = require('@freesewing/benjamin').config -const bent = require('@freesewing/bent').config -const bob = require('@freesewing/bob').config -const brian = require('@freesewing/brian').config -const breanna = require('@freesewing/breanna').config -const diana = require('@freesewing/diana').config -const bruce = require('@freesewing/bruce').config -const carlita = require('@freesewing/carlita').config -const carlton = require('@freesewing/carlton').config -const cathrin = require('@freesewing/cathrin').config -const charlie = require('@freesewing/charlie').config -const cornelius = require('@freesewing/cornelius').config -const florent = require('@freesewing/florent').config -const florence = require('@freesewing/florence').config -const hi = require('@freesewing/hi').config -const holmes = require('@freesewing/holmes').config -const hortensia = require('@freesewing/hortensia').config -const huey = require('@freesewing/huey').config -const hugo = require('@freesewing/hugo').config -const jaeger = require('@freesewing/jaeger').config -const lucy = require('@freesewing/lucy').config -const lunetius = require('@freesewing/lunetius').config -const noble = require('@freesewing/noble').config -const octoplushy = require('@freesewing/octoplushy').config -const paco = require('@freesewing/paco').config -const penelope = require('@freesewing/penelope').config -const sandy = require('@freesewing/sandy').config -const shin = require('@freesewing/shin').config -const simon = require('@freesewing/simon').config -const simone = require('@freesewing/simone').config -const sven = require('@freesewing/sven').config -const tamiko = require('@freesewing/tamiko').config -const teagan = require('@freesewing/teagan').config -const theo = require('@freesewing/theo').config -const tiberius = require('@freesewing/tiberius').config -const titan = require('@freesewing/titan').config -const trayvon = require('@freesewing/trayvon').config -const unice = require('@freesewing/unice').config -const ursula = require('@freesewing/ursula').config -const wahid = require('@freesewing/wahid').config -const walburga = require('@freesewing/walburga').config -const waralee = require('@freesewing/waralee').config -const yuri = require('@freesewing/yuri').config - -const patterns = { - aaron, - albert, - bee, - bella, - benjamin, - bent, - bob, - brian, - breanna, - diana, - bruce, - carlita, - carlton, - cathrin, - charlie, - cornelius, - florent, - florence, - hi, - holmes, - hortensia, - huey, - hugo, - jaeger, - lucy, - lunetius, - noble, - octoplushy, - paco, - penelope, - sandy, - shin, - simon, - simone, - sven, - tamiko, - teagan, - theo, - tiberius, - titan, - trayvon, - unice, - ursula, - wahid, - walburga, - waralee, - yuri, -} -const patternOptions = (config) => { - let all = [] - let groups = config.optionGroups - for (let group of Object.keys(groups)) { - for (let option of groups[group]) { - if (typeof option === 'string') all.push(option) - else { - for (let subgroup of Object.keys(option)) { - for (let suboption of option[subgroup]) all.push(suboption) - } - } - } - } - - return all -} - -const patternParts = (config) => { - let parts = {} - if (config.parts) { - for (let p of config.parts) parts[p] = p - } - if (config.dependencies) { - for (let p of Object.keys(config.dependencies)) { - parts[p] = p - if (typeof config.dependencies[p] === 'string') { - parts[config.dependencies[p]] = config.dependencies[p] - } else { - for (let d of config.dependencies[p]) parts[d] = d - } - } - } - if (config.inject) { - for (let p of Object.keys(config.inject)) { - parts[p] = p - parts[config.inject[p]] = config.inject[p] - } - } - if (config.hide) { - for (let p of config.hide) delete parts[p] - } - - return Object.keys(parts) -} - -const options = {} -const optionGroups = {} -const parts = {} -const measurements = {} -const optionalMeasurements = {} -const versions = {} -const info = {} -for (let pattern of Object.keys(patterns)) { - if (typeof patterns[pattern] === 'undefined') console.log({pattern}) - options[pattern] = patternOptions(patterns[pattern]) - optionGroups[pattern] = patterns[pattern].optionGroups - parts[pattern] = patternParts(patterns[pattern]) - measurements[pattern] = patterns[pattern].measurements - optionalMeasurements[pattern] = patterns[pattern].optionalMeasurements || [] - versions[pattern] = patterns[pattern].version - info[pattern] = { - design: patterns[pattern].design, - code: patterns[pattern].code, - department: patterns[pattern].department, - type: patterns[pattern].type, - difficulty: patterns[pattern].difficulty, - tags: patterns[pattern].tags, - deprecated: patterns[pattern].deprecated || false, - } -} - -fse.mkdirSync(path.join('.', 'src', 'prebuild'), { recursive: true }) -fse.writeFileSync( - path.join('.', 'src', 'prebuild', 'options.js'), - 'module.exports = ' + JSON.stringify(options) + '\n' -) -fse.writeFileSync( - path.join('.', 'src', 'prebuild', 'option-groups.js'), - 'module.exports = ' + JSON.stringify(optionGroups) + '\n' -) -fse.writeFileSync( - path.join('.', 'src', 'prebuild', 'parts.js'), - 'module.exports = ' + JSON.stringify(parts) + '\n' -) -fse.writeFileSync( - path.join('.', 'src', 'prebuild', 'measurements.js'), - 'module.exports = ' + JSON.stringify(measurements) + '\n' -) -fse.writeFileSync( - path.join('.', 'src', 'prebuild', 'optional-measurements.js'), - 'module.exports = ' + JSON.stringify(optionalMeasurements) + '\n' -) -fse.writeFileSync( - path.join('.', 'src', 'prebuild', 'versions.js'), - 'module.exports = ' + JSON.stringify(versions) + '\n' -) -fse.writeFileSync( - path.join('.', 'src', 'prebuild', 'info.js'), - 'module.exports = ' + JSON.stringify(info) + '\n' -)