From 8189258d409c9634cf6acd5438e1a2f5eb2bb984 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Thu, 28 Sep 2023 15:43:39 +0200 Subject: [PATCH] chore: Remove tutorial design, it is no longer used --- CHANGELOG.md | 30 --- config/software/designs.json | 4 - designs/tutorial/CHANGELOG.md | 39 ---- designs/tutorial/README.md | 305 ------------------------- designs/tutorial/build.mjs | 35 --- designs/tutorial/config/index.js | 36 --- designs/tutorial/data.mjs | 4 - designs/tutorial/i18n/de.json | 9 - designs/tutorial/i18n/en.json | 11 - designs/tutorial/i18n/es.json | 9 - designs/tutorial/i18n/fr.json | 9 - designs/tutorial/i18n/index.mjs | 8 - designs/tutorial/i18n/nl.json | 9 - designs/tutorial/i18n/uk.json | 9 - designs/tutorial/package.json | 73 ------ designs/tutorial/src/bib.mjs | 233 ------------------- designs/tutorial/src/configpart.mjs | 14 -- designs/tutorial/src/index.mjs | 31 --- designs/tutorial/src/step1-4.mjs | 138 ----------- designs/tutorial/src/step5-8.mjs | 131 ----------- designs/tutorial/src/step9-11.mjs | 117 ---------- designs/tutorial/tests/shared.test.mjs | 20 -- 22 files changed, 1274 deletions(-) delete mode 100644 designs/tutorial/CHANGELOG.md delete mode 100644 designs/tutorial/README.md delete mode 100644 designs/tutorial/build.mjs delete mode 100644 designs/tutorial/config/index.js delete mode 100644 designs/tutorial/data.mjs delete mode 100644 designs/tutorial/i18n/de.json delete mode 100644 designs/tutorial/i18n/en.json delete mode 100644 designs/tutorial/i18n/es.json delete mode 100644 designs/tutorial/i18n/fr.json delete mode 100644 designs/tutorial/i18n/index.mjs delete mode 100644 designs/tutorial/i18n/nl.json delete mode 100644 designs/tutorial/i18n/uk.json delete mode 100644 designs/tutorial/package.json delete mode 100644 designs/tutorial/src/bib.mjs delete mode 100644 designs/tutorial/src/configpart.mjs delete mode 100644 designs/tutorial/src/index.mjs delete mode 100644 designs/tutorial/src/step1-4.mjs delete mode 100644 designs/tutorial/src/step5-8.mjs delete mode 100644 designs/tutorial/src/step9-11.mjs delete mode 100644 designs/tutorial/tests/shared.test.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ba7303163..767851788c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -586,12 +586,6 @@ ### trayvon -#### Changed - - - Migrated from Rollup to Esbuild for all builds - -### tutorial - #### Changed - Migrated from Rollup to Esbuild for all builds @@ -1110,12 +1104,6 @@ ### trayvon -#### Changed - - - Switched to default import for version from package.json - -### tutorial - #### Changed - Switched to default import for version from package.json @@ -1784,12 +1772,6 @@ - The `s3collar and `s3armhole` options now allow shifting the shoulder seam (`s3` is short for *Shift Shoulder Seam*) -### tutorial - -#### Fixed - - - Set department in the config to one of the newly accepted values - ### plugin-mirror #### Changed @@ -2829,12 +2811,6 @@ - Ported trayvon to the new (names for) measurements. See [#416](https://github.com/freesewing/freesewing/issues/416) - Removed `Circumference` suffix from measurement names -### tutorial - -#### Changed - - - Removed `Circumference` suffix from measurement names - ### wahid #### Changed @@ -3446,12 +3422,6 @@ ### trayvon -#### Added - - - Initial release - -### tutorial - #### Added - Initial release diff --git a/config/software/designs.json b/config/software/designs.json index 0e55052822c..55f2580889b 100644 --- a/config/software/designs.json +++ b/config/software/designs.json @@ -384,10 +384,6 @@ "tags": ["accessories"], "techniques": ["precision", "lining"] }, - "tutorial": { - "description": "A FreeSewing pattern for a baby bib that's used in our tutorial", - "code": "Joost De Cock" - }, "uma": { "description": "A FreeSewing pattern for a basic, highly-customizable underwear pattern", "code": "Joost De Cock", diff --git a/designs/tutorial/CHANGELOG.md b/designs/tutorial/CHANGELOG.md deleted file mode 100644 index 05961d442cf..00000000000 --- a/designs/tutorial/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -# Change log for: @freesewing/tutorial - - -## 2.21.0 (2022-06-27) - -### Changed - - - Migrated from Rollup to Esbuild for all builds - -## 2.20.0 (2022-01-24) - -### Changed - - - Switched to default import for version from package.json - -## 2.17.0 (2021-07-01) - -### Fixed - - - Set department in the config to one of the newly accepted values - -## 2.7.0 (2020-07-12) - -### Changed - - - Removed `Circumference` suffix from measurement names - -## 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/designs/tutorial/README.md b/designs/tutorial/README.md deleted file mode 100644 index 018c1d72f37..00000000000 --- a/designs/tutorial/README.md +++ /dev/null @@ -1,305 +0,0 @@ -![FreeSewing](https://static.freesewing.org/banner.png) -

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

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

- -# @freesewing/tutorial - -A FreeSewing pattern for a baby bib that's used in our tutorial - - - - -> #### 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). -> -> We the `main` branch and `next` packages on NPM holds v3 code. But it's alpha for now. - -## 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/tutorial - -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
Adam Tomkins

πŸ“–
Alexandre Ignjatovic
Alexandre Ignjatovic

πŸ’»
AlfaLyr
AlfaLyr

πŸ’» πŸ”Œ 🎨
Andrew James
Andrew James

πŸ“–
Anneke
Anneke

πŸ“– 🌍
Annie Kao
Annie Kao

πŸ“–
Anternative
Anternative

πŸ“–
Anthony
Anthony

πŸ’¬
Ari Grayzel-student
Ari Grayzel-student

πŸ’»
Bart
Bart

πŸ“–
BenJamesBen
BenJamesBen

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

πŸ“–
Carsten Biebricher
Carsten Biebricher

πŸ“–
Cathy Zoller
Cathy Zoller

πŸ“–
Chantal Lapointe
Chantal Lapointe

🌍
Damien PIQUET
Damien PIQUET

πŸ’»
Darigov Research
Darigov Research

πŸ“– πŸ€”
David Clegg
David Clegg

🎨 πŸ’»
Elena FdR
Elena FdR

πŸ“– πŸ“
Emmanuel Nyachoke
Emmanuel Nyachoke

πŸ’» πŸ“–
Enoch Riese
Enoch Riese

πŸ’»
EvEkSwed
EvEkSwed

🌍
Fantastik-Maman
Fantastik-Maman

🌍
Forrest O.
Forrest O.

πŸ“–
FrΓ©dΓ©ric
FrΓ©dΓ©ric

🌍
Glenn Matthews
Glenn Matthews

πŸ“–
Greg Sadetsky
Greg Sadetsky

πŸ“–
Igor Couto
Igor Couto

πŸ›
Ikko Ashimine
Ikko Ashimine

πŸ“–
Irapeke
Irapeke

🌍
Ivo Bek
Ivo Bek

πŸ“–
Jacek Sawoszczuk
Jacek Sawoszczuk

πŸ“–
Jason Williams
Jason Williams

πŸ“–
Jeremy Jackson
Jeremy Jackson

πŸ’»
Jeroen Hoek
Jeroen Hoek

πŸ“–
Joe Schofield
Joe Schofield

πŸ“–
Joebidido
Joebidido

🌍
Joost De Cock
Joost De Cock

🚧
Josh Essman
Josh Essman

πŸ“–
Kake
Kake

πŸ“–
Kapunahele Wong
Kapunahele Wong

πŸ“–
Karen
Karen

πŸ“– πŸ“‹
Katie McGinley
Katie McGinley

πŸ“–
Kieran Klaassen
Kieran Klaassen

πŸ’»
Kittycatou
Kittycatou

🌍
Kris
Kris

πŸ“–
Kristin Ruben
Kristin Ruben

πŸ’»
Lin
Lin

πŸ’»
Loudepeuter
Loudepeuter

🌍
Lucian
Lucian

πŸ“‹
Luiz Saggioro
Luiz Saggioro

πŸ’»
MA-TATAS
MA-TATAS

πŸ“–
Marcus
Marcus

🌍
Martin Tribo
Martin Tribo

πŸ“–
Nadege Michel
Nadege Michel

⚠️ πŸ“–
Natalia
Natalia

πŸ’» 🎨 πŸ“
Nathan Yergler
Nathan Yergler

πŸ“–
Nick Dower
Nick Dower

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

πŸ“–
OysteinHoiby
OysteinHoiby

πŸ’»
Patrick Forringer
Patrick Forringer

πŸ”Œ
Paul
Paul

πŸ“– πŸ“ 🌍
Phillip Thelen
Phillip Thelen

πŸ’»
Pixieish
Pixieish

πŸ“–
Prof. dr. Sorcha NΓ­ Dhubhghaill
Prof. dr. Sorcha NΓ­ Dhubhghaill

πŸ“–
Quentin FELIX
Quentin FELIX

πŸ’» 🎨
Rik Hekker
Rik Hekker

πŸ›
Sam Livingston-Gray
Sam Livingston-Gray

πŸ“–
Sanne
Sanne

πŸ’» πŸ“–
Sara Latorre
Sara Latorre

🌍
SeaZeeZee
SeaZeeZee

πŸ“– πŸ’»
SimonbJohnson
SimonbJohnson

πŸ›
SirCharlotte
SirCharlotte

🌍
Slylele
Slylele

πŸ“– 🌍
Soazillon
Soazillon

🌍
SoneaTheBest
SoneaTheBest

🌍
Stefan Sydow
Stefan Sydow

🌍 πŸ“– πŸ’»
Trent Trama
Trent Trama

πŸ’»
TrΓ­ona
TrΓ­ona

πŸ“–
Unmutual
Unmutual

πŸ“–
Wouter van Wageningen
Wouter van Wageningen

πŸ’» 🎨 πŸ”§
amysews
amysews

πŸ“–
anna-puk
anna-puk

πŸ’»
beautifulsummermoon
beautifulsummermoon

🌍
berce
berce

πŸ“–
biou
biou

πŸ’»
bobgeorgethe3rd
bobgeorgethe3rd

πŸ’» πŸ“– 🎨
brmlyklr
brmlyklr

πŸ“–
chri5b
chri5b

πŸ’» ⚠️
dingcycle
dingcycle

🌍
drowned-in-books
drowned-in-books

πŸ’¬
econo202
econo202

πŸ“–
ericamattos
ericamattos

🌍
evilrobotfromouterspace
evilrobotfromouterspace

πŸ›
fightingrabbit
fightingrabbit

πŸ’»
gaylyndie
gaylyndie

πŸ“–
grimlokason
grimlokason

πŸ’»
hellgy
hellgy

🎨
jackseye
jackseye

πŸ“–
marckiesel
marckiesel

🌍
marpants
marpants

πŸ’»
mergerg
mergerg

πŸ“–
mesil
mesil

πŸ›
starfetch
starfetch

πŸ’» πŸ“– 🌍 🎨
timorl
timorl

πŸ’»
ttimearl
ttimearl

πŸ–‹
tuesgloomsday
tuesgloomsday

πŸ“–
valadaptive
valadaptive

πŸ’»
viocky
viocky

🌍
woolishboy
woolishboy

πŸ’»
yc
yc

🌍
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! - diff --git a/designs/tutorial/build.mjs b/designs/tutorial/build.mjs deleted file mode 100644 index 99ace216bc8..00000000000 --- a/designs/tutorial/build.mjs +++ /dev/null @@ -1,35 +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.mjs'], - 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 -const build = async () => { - const result = await esbuild.build(options).catch(() => process.exit(1)) - - if (process.env.VERBOSE) { - const info = await esbuild.analyzeMetafile(result.metafile) - console.log(info) - } -} -build() diff --git a/designs/tutorial/config/index.js b/designs/tutorial/config/index.js deleted file mode 100644 index 9c525970e1b..00000000000 --- a/designs/tutorial/config/index.js +++ /dev/null @@ -1,36 +0,0 @@ -import pkg from '../package.json' assert { type: 'json' } - -const { version } = pkg - -export default { - version, - name: 'tutorial', - design: 'joostdecock', - code: 'joostdecock', - department: 'accessorties', - type: 'pattern', - difficulty: 1, - tags: ['example'], - optionGroups: { - fit: ['neckRatio', 'widthRatio', 'lengthRatio'], - box: ['size'], - }, - measurements: ['head'], - inject: { - step4: 'step3', - step5: 'step4', - step6: 'step5', - step7: 'step6', - step8: 'step7', - step9: 'step8', - step10: 'step9', - step11: 'step10', - }, - parts: ['step1', 'step2', 'bib'], - options: { - size: { pct: 50, min: 10, max: 100 }, - neckRatio: { pct: 80, min: 70, max: 90 }, - widthRatio: { pct: 45, min: 35, max: 55 }, - lengthRatio: { pct: 75, min: 55, max: 85 }, - }, -} diff --git a/designs/tutorial/data.mjs b/designs/tutorial/data.mjs deleted file mode 100644 index 26dab3b5c4f..00000000000 --- a/designs/tutorial/data.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// This file is auto-generated | All changes you make will be overwritten. -export const name = '@freesewing/tutorial' -export const version = '3.0.0-alpha.10' -export const data = { name, version } diff --git a/designs/tutorial/i18n/de.json b/designs/tutorial/i18n/de.json deleted file mode 100644 index 056f70802a5..00000000000 --- a/designs/tutorial/i18n/de.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "t": "Tutorial", - "d": "A FreeSewing pattern used in our pattern design tutorial", - "p": { - "bib": "Bib" - }, - "s": {}, - "o": {} -} diff --git a/designs/tutorial/i18n/en.json b/designs/tutorial/i18n/en.json deleted file mode 100644 index a354b54c7ef..00000000000 --- a/designs/tutorial/i18n/en.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "t": "Tutorial", - "d": "A FreeSewing pattern used in our pattern design tutorial", - "p": { - "bib": "Bib" - }, - "s": { - "finishWithBiasTape": "Finish with bias tape" - }, - "o": {} -} diff --git a/designs/tutorial/i18n/es.json b/designs/tutorial/i18n/es.json deleted file mode 100644 index 056f70802a5..00000000000 --- a/designs/tutorial/i18n/es.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "t": "Tutorial", - "d": "A FreeSewing pattern used in our pattern design tutorial", - "p": { - "bib": "Bib" - }, - "s": {}, - "o": {} -} diff --git a/designs/tutorial/i18n/fr.json b/designs/tutorial/i18n/fr.json deleted file mode 100644 index 056f70802a5..00000000000 --- a/designs/tutorial/i18n/fr.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "t": "Tutorial", - "d": "A FreeSewing pattern used in our pattern design tutorial", - "p": { - "bib": "Bib" - }, - "s": {}, - "o": {} -} diff --git a/designs/tutorial/i18n/index.mjs b/designs/tutorial/i18n/index.mjs deleted file mode 100644 index 36aac928b67..00000000000 --- a/designs/tutorial/i18n/index.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import en from './en.json' assert { type: 'json' } -import de from './de.json' assert { type: 'json' } -import es from './es.json' assert { type: 'json' } -import fr from './fr.json' assert { type: 'json' } -import nl from './nl.json' assert { type: 'json' } -import uk from './uk.json' assert { type: 'json' } - -export const i18n = { en, de, es, fr, nl, uk } diff --git a/designs/tutorial/i18n/nl.json b/designs/tutorial/i18n/nl.json deleted file mode 100644 index 056f70802a5..00000000000 --- a/designs/tutorial/i18n/nl.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "t": "Tutorial", - "d": "A FreeSewing pattern used in our pattern design tutorial", - "p": { - "bib": "Bib" - }, - "s": {}, - "o": {} -} diff --git a/designs/tutorial/i18n/uk.json b/designs/tutorial/i18n/uk.json deleted file mode 100644 index 056f70802a5..00000000000 --- a/designs/tutorial/i18n/uk.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "t": "Tutorial", - "d": "A FreeSewing pattern used in our pattern design tutorial", - "p": { - "bib": "Bib" - }, - "s": {}, - "o": {} -} diff --git a/designs/tutorial/package.json b/designs/tutorial/package.json deleted file mode 100644 index 15f8ac71cbc..00000000000 --- a/designs/tutorial/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "@freesewing/tutorial", - "version": "3.0.0-alpha.10", - "description": "A FreeSewing pattern for a baby bib that's used in our tutorial", - "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", - "design", - "diy", - "fashion", - "made to measure", - "parametric design", - "pattern", - "sewing", - "sewing pattern" - ], - "type": "module", - "module": "dist/index.mjs", - "exports": { - ".": { - "internal": "./src/index.mjs", - "default": "./dist/index.mjs" - } - }, - "scripts": { - "build": "node build.mjs", - "build:all": "yarn build", - "clean": "rimraf dist", - "mbuild": "NO_MINIFY=1 node build.mjs", - "symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -", - "test": "npx mocha tests/*.test.mjs", - "vbuild": "VERBOSE=1 node build.mjs", - "lab": "cd ../../sites/lab && yarn start", - "tips": "node ../../scripts/help.mjs", - "lint": "npx eslint 'src/**' 'tests/*.mjs'", - "prettier": "npx prettier --write 'src/*.mjs' 'tests/*.mjs'", - "testci": "NODE_OPTIONS=\"--conditions=internal\" npx mocha tests/*.test.mjs --reporter ../../tests/reporters/terse.js", - "wbuild": "node build.mjs", - "wbuild:all": "yarn wbuild" - }, - "peerDependencies": { - "@freesewing/core": "3.0.0-alpha.10" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "10.2.0", - "chai": "4.3.9", - "@freesewing/models": "3.0.0-alpha.10", - "@freesewing/plugin-timing": "3.0.0-alpha.10" - }, - "files": [ - "dist/*", - "README.md" - ], - "publishConfig": { - "access": "public", - "tag": "next" - }, - "engines": { - "node": "18", - "npm": "9" - } -} diff --git a/designs/tutorial/src/bib.mjs b/designs/tutorial/src/bib.mjs deleted file mode 100644 index f869cc6bcc4..00000000000 --- a/designs/tutorial/src/bib.mjs +++ /dev/null @@ -1,233 +0,0 @@ -import { configpart } from './configpart.mjs' - -export const bib = { - name: 'tutorial.bib', - after: configpart, - draft: ({ - Point, - points, - Path, - paths, - measurements, - options, - macro, - complete, - snippets, - Snippet, - paperless, - part, - }) => { - // Construct the neck opening - let tweak = 1 - let target = (measurements.head * options.neckRatio) / 4 - let delta - do { - points.right = new Point((tweak * measurements.head) / 10, 0) - points.bottom = new Point(0, (tweak * measurements.head) / 12) - - points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) - points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) - - paths.neck = new Path() - .move(points.right) - .curve(points.rightCp1, points.bottomCp2, points.bottom) - - delta = paths.neck.length() - target - if (delta > 0) tweak = tweak * 0.99 - else tweak = tweak * 1.02 - } while (Math.abs(delta) > 1) - - points.rightCp2 = points.rightCp1.flipY() - points.bottomCp1 = points.bottomCp2.flipX() - - points.left = points.right.flipX() - points.leftCp1 = points.rightCp2.flipX() - points.leftCp2 = points.rightCp1.flipX() - - points.top = points.bottom.flipY() - points.topCp1 = points.bottomCp2.flipY() - points.topCp2 = points.bottomCp1.flipY() - - // Construct the outline - let width = measurements.head * options.widthRatio - let length = measurements.head * options.lengthRatio - - points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x)) - points.topRight = points.topLeft.shift(0, width) - points.bottomLeft = points.topLeft.shift(-90, length) - points.bottomRight = points.topRight.shift(-90, length) - - points.edgeLeft = new Point(points.topLeft.x, points.left.y) - points.edgeRight = new Point(points.topRight.x, points.right.y) - points.edgeTop = new Point(0, points.topLeft.y) - - points.edgeLeftCp = points.edgeLeft.shiftFractionTowards(points.topLeft, 0.5) - points.edgeRightCp = points.edgeLeftCp.flipX() - points.edgeTopLeftCp = points.edgeTop.shiftFractionTowards(points.topLeft, 0.5) - points.edgeTopRightCp = points.edgeTopLeftCp.flipX() - - // Round the end of the straps - let strap = points.edgeTop.dy(points.top) - - points.tipRight = points.edgeTop.translate(strap / 2, strap / 2) - points.tipRightTop = new Point(points.tipRight.x, points.edgeTop.y) - points.tipRightBottom = new Point(points.tipRight.x, points.top.y) - - macro('round', { - from: points.edgeTop, - to: points.tipRight, - via: points.tipRightTop, - prefix: 'tipRightTop', - }) - macro('round', { - from: points.tipRight, - to: points.top, - via: points.tipRightBottom, - prefix: 'tipRightBottom', - }) - - // Rotate straps so they don't overlap - let rotateThese = [ - 'edgeTopLeftCp', - 'edgeTop', - 'tipRight', - 'tipRightTop', - 'tipRightTopStart', - 'tipRightTopCp1', - 'tipRightTopCp2', - 'tipRightTopEnd', - 'tipRightBottomStart', - 'tipRightBottomCp1', - 'tipRightBottomCp2', - 'tipRightBottomEnd', - 'tipRightBottom', - 'top', - 'topCp2', - ] - - while (points.tipRightBottomStart.x > -1) { - for (let p of rotateThese) points[p] = points[p].rotate(1, points.edgeLeft) - } - - // Add points to anchor snaps on - points.snapLeft = points.top.shiftFractionTowards(points.edgeTop, 0.5) - - // Mirror points to the other side - points.edgeTopRightCp = points.edgeTopLeftCp.flipX() - points.topCp1 = points.topCp2.flipX() - points.tipLeftTopStart = points.tipRightTopStart.flipX() - points.tipLeftTopCp1 = points.tipRightTopCp1.flipX() - points.tipLeftTopCp2 = points.tipRightTopCp2.flipX() - points.tipLeftTopEnd = points.tipRightTopEnd.flipX() - points.tipLeftBottomStart = points.tipRightBottomStart.flipX() - points.tipLeftBottomCp1 = points.tipRightBottomCp1.flipX() - points.tipLeftBottomCp2 = points.tipRightBottomCp2.flipX() - points.tipLeftBottomEnd = points.tipRightBottomEnd.flipX() - points.snapRight = points.snapLeft.flipX() - - // Round the bottom of the bib - // Radius is fixed, but you could use an option for it) - macro('round', { - from: points.topLeft, - to: points.bottomRight, - via: points.bottomLeft, - radius: points.bottomRight.x / 4, - prefix: 'bottomLeft', - }) - macro('round', { - from: points.bottomLeft, - to: points.topRight, - via: points.bottomRight, - radius: points.bottomRight.x / 4, - prefix: 'bottomRight', - }) - - // Construct the path - paths.seam = new Path() - .move(points.edgeLeft) - .line(points.bottomLeftStart) - .curve(points.bottomLeftCp1, points.bottomLeftCp2, points.bottomLeftEnd) - .line(points.bottomRightStart) - .curve(points.bottomRightCp1, points.bottomRightCp2, points.bottomRightEnd) - .line(points.edgeRight) - .curve(points.edgeRightCp, points.edgeTopRightCp, points.tipLeftTopStart) - .curve(points.tipLeftTopCp1, points.tipLeftTopCp2, points.tipLeftTopEnd) - .curve(points.tipLeftBottomCp1, points.tipLeftBottomCp2, points.tipLeftBottomEnd) - .curve(points.topCp1, points.rightCp2, points.right) - .curve(points.rightCp1, points.bottomCp2, points.bottom) - .curve(points.bottomCp1, points.leftCp2, points.left) - .curve(points.leftCp1, points.topCp2, points.tipRightBottomEnd) - .curve(points.tipRightBottomCp2, points.tipRightBottomCp1, points.tipRightBottomStart) - .curve(points.tipRightTopCp2, points.tipRightTopCp1, points.tipRightTopStart) - .curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft) - .close() - .attr('class', 'fabric') - - // Complete? - if (complete) { - // Add the snaps - snippets.snapStud = new Snippet('snap-stud', points.snapLeft) - snippets.snapSocket = new Snippet('snap-socket', points.snapRight).attr('opacity', 0.5) - - // Add the bias tape - paths.bias = paths.seam - .offset(-5) - .attr('class', 'various dashed') - .attr('data-text', 'tutorial:finishWithBiasTape') - .attr('data-text-class', 'center fill-various') - - // Add the title - points.title = points.bottom.shift(-90, 45) - macro('title', { - at: points.title, - nr: 1, - title: 'bib', - }) - - // Add the scalebox - points.scalebox = points.title.shift(-90, 55) - macro('scalebox', { at: points.scalebox }) - - // Add the logo - points.logo = new Point(0, 0) - snippets.logo = new Snippet('logo', points.logo) - - // Paperless? - if (paperless) { - // Add dimensions - macro('hd', { - from: points.bottomLeftStart, - to: points.bottomRightEnd, - y: points.bottomLeft.y + 15, - }) - macro('vd', { - from: points.bottomRightStart, - to: points.bottom, - x: points.bottomRight.x + 15, - }) - macro('vd', { - from: points.bottomRightStart, - to: points.right, - x: points.bottomRight.x + 30, - }) - macro('vd', { - from: points.bottomRightStart, - to: points.tipLeftTopStart, - x: points.bottomRight.x + 45, - }) - macro('hd', { - from: points.left, - to: points.right, - y: points.left.y + 25, - }) - macro('ld', { - from: points.tipLeftBottomEnd, - to: points.tipLeftTopStart, - d: -15, - }) - } - } - - return part - }, -} diff --git a/designs/tutorial/src/configpart.mjs b/designs/tutorial/src/configpart.mjs deleted file mode 100644 index 3c42ac541a3..00000000000 --- a/designs/tutorial/src/configpart.mjs +++ /dev/null @@ -1,14 +0,0 @@ -// This tutorial design is kinda weird, so we've -// setup this part to hold options & measurements config -export const configpart = { - name: 'tutorial.configpart', - measurements: ['head'], - options: { - size: { pct: 50, min: 10, max: 100 }, - neckRatio: { pct: 80, min: 70, max: 90 }, - widthRatio: { pct: 45, min: 35, max: 55 }, - lengthRatio: { pct: 75, min: 55, max: 85 }, - }, - hide: { self: true }, - draft: ({ part }) => part, -} diff --git a/designs/tutorial/src/index.mjs b/designs/tutorial/src/index.mjs deleted file mode 100644 index 7ae289e822c..00000000000 --- a/designs/tutorial/src/index.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import { Design } from '@freesewing/core' -import { data } from '../data.mjs' -import { i18n } from '../i18n/index.mjs' -import { step1, step2, step3, step4 } from './step1-4.mjs' -import { step5, step6, step7, step8 } from './step5-8.mjs' -import { step9, step10, step11 } from './step9-11.mjs' -import { bib } from './bib.mjs' - -// Setup our new design -const Tutorial = new Design({ - data, - parts: [step1, step2, step3, step4, step5, step6, step7, step8, step9, step10, step11, bib], -}) - -// Named exports -export { - step1, - step2, - step3, - step4, - step5, - step6, - step7, - step8, - step9, - step10, - step11, - bib, - Tutorial, - i18n, -} diff --git a/designs/tutorial/src/step1-4.mjs b/designs/tutorial/src/step1-4.mjs deleted file mode 100644 index 99e7d46b027..00000000000 --- a/designs/tutorial/src/step1-4.mjs +++ /dev/null @@ -1,138 +0,0 @@ -import { configpart } from './configpart.mjs' - -export const step1 = { - name: 'tutorial.step1', - after: configpart, - draft: ({ - options, - Point, - Path, - points, - paths, - Snippet, - snippets, - complete, - sa, - store, - paperless, - macro, - part, - }) => { - const w = 500 * options.size - points.topLeft = new Point(0, 0) - points.topRight = new Point(w, 0) - points.bottomLeft = new Point(0, w / 2) - points.bottomRight = new Point(w, w / 2) - - paths.seam = new Path() - .move(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.topRight) - .line(points.topLeft) - .close() - .attr('class', 'fabric') - - if (sa) paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa') - /* - * Annotations - */ - - // Cutlist - store.cutlist.setCut({ cut: 1, from: 'fabric' }) - - // Logo & Hello - points.logo = points.topLeft.shiftFractionTowards(points.bottomRight, 0.5) - snippets.logo = new Snippet('logo', points.logo) - - if (complete) points.text = points.logo.shift(-90, w / 8).addText('hello', 'center') - - //Dimensions - macro('hd', { - id: 'width', - from: points.bottomLeft, - to: points.bottomRight, - y: points.bottomLeft.y + sa + 15, - }) - macro('vd', { - id: 'height', - from: points.bottomRight, - to: points.topRight, - x: points.topRight.x + sa + 15, - }) - - return part - }, -} - -export const step2 = { - name: 'tutorial.step2', - after: configpart, - draft: ({ Point, points, Path, paths, measurements, part }) => { - points.right = new Point(measurements.head / 10, 0) - points.bottom = new Point(0, measurements.head / 12) - - points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) - points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) - - paths.neck = new Path() - .move(points.right) - .curve(points.rightCp1, points.bottomCp2, points.bottom) - - return part - }, -} - -export const step3 = { - name: 'tutorial.step3', - after: configpart, - draft: ({ Point, points, Path, paths, measurements, options, part }) => { - let tweak = 1 - let target = (measurements.head * options.neckRatio) / 4 - let delta - do { - points.right = new Point((tweak * measurements.head) / 10, 0) - points.bottom = new Point(0, (tweak * measurements.head) / 12) - - points.rightCp1 = points.right.shift(90, points.bottom.dy(points.right) / 2) - points.bottomCp2 = points.bottom.shift(0, points.bottom.dx(points.right) / 2) - - paths.neck = new Path() - .move(points.right) - .curve(points.rightCp1, points.bottomCp2, points.bottom) - - delta = paths.neck.length() - target - if (delta > 0) tweak = tweak * 0.99 - else tweak = tweak * 1.02 - } while (Math.abs(delta) > 1) - - return part - }, -} - -export const step4 = { - name: 'tutorial.step4', - from: step3, - draft: ({ points, Path, paths, part }) => { - points.rightCp2 = points.rightCp1.flipY() - points.bottomCp1 = points.bottomCp2.flipX() - - points.left = points.right.flipX() - points.leftCp1 = points.rightCp2.flipX() - points.leftCp2 = points.rightCp1.flipX() - - points.top = points.bottom.flipY() - points.topCp1 = points.bottomCp2.flipY() - points.topCp2 = points.bottomCp1.flipY() - - paths.neck = new Path() - .move(points.top) - .curve(points.topCp2, points.leftCp1, points.left) - .curve(points.leftCp2, points.bottomCp1, points.bottom) - .curve(points.bottomCp2, points.rightCp1, points.right) - .curve(points.rightCp2, points.topCp1, points.top) - .close() - - return part - }, -} diff --git a/designs/tutorial/src/step5-8.mjs b/designs/tutorial/src/step5-8.mjs deleted file mode 100644 index f0c36771a97..00000000000 --- a/designs/tutorial/src/step5-8.mjs +++ /dev/null @@ -1,131 +0,0 @@ -import { step4 } from './step1-4.mjs' - -export const step5 = { - name: 'tutorial.step5', - from: step4, - draft: ({ Point, points, Path, paths, measurements, options, part }) => { - const width = measurements.head * options.widthRatio - const length = measurements.head * options.lengthRatio - - points.topLeft = new Point(width / -2, points.top.y - (width / 2 - points.right.x)) - points.topRight = points.topLeft.shift(0, width) - points.bottomLeft = points.topLeft.shift(-90, length) - points.bottomRight = points.topRight.shift(-90, length) - - paths.rect = new Path() - .move(points.topLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.topRight) - .line(points.topLeft) - .close() - - return part - }, -} - -export const step6 = { - name: 'tutorial.step6', - from: step5, - draft: ({ Point, points, Path, paths, part }) => { - points.edgeLeft = new Point(points.topLeft.x, points.left.y) - points.edgeRight = new Point(points.topRight.x, points.right.y) - points.edgeTop = new Point(0, points.topLeft.y) - - points.edgeLeftCp = points.edgeLeft.shiftFractionTowards(points.topLeft, 0.5) - points.edgeRightCp = points.edgeLeftCp.flipX() - points.edgeTopLeftCp = points.edgeTop.shiftFractionTowards(points.topLeft, 0.5) - points.edgeTopRightCp = points.edgeTopLeftCp.flipX() - - paths.rect = new Path() - .move(points.edgeTop) - .curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.edgeRight) - .curve(points.edgeRightCp, points.edgeTopRightCp, points.edgeTop) - .close() - - return part - }, -} - -export const step7 = { - name: 'tutorial.step7', - from: step6, - draft: ({ Point, points, macro, part }) => { - const strap = points.edgeTop.dy(points.top) - - points.tipRight = points.edgeTop.translate(strap / 2, strap / 2) - points.tipRightTop = new Point(points.tipRight.x, points.edgeTop.y) - points.tipRightBottom = new Point(points.tipRight.x, points.top.y) - - macro('round', { - from: points.edgeTop, - to: points.tipRight, - via: points.tipRightTop, - prefix: 'tipRightTop', - }) - macro('round', { - from: points.tipRight, - to: points.top, - via: points.tipRightBottom, - prefix: 'tipRightBottom', - }) - - return part - }, -} - -export const step8 = { - name: 'tutorial.step8', - from: step7, - draft: ({ points, Path, paths, macro, part }) => { - const rotateThese = [ - 'edgeTopLeftCp', - 'edgeTop', - 'tipRight', - 'tipRightTop', - 'tipRightTopStart', - 'tipRightTopCp1', - 'tipRightTopCp2', - 'tipRightTopEnd', - 'tipRightBottomStart', - 'tipRightBottomCp1', - 'tipRightBottomCp2', - 'tipRightBottomEnd', - 'tipRightBottom', - 'top', - 'topCp2', - ] - while (points.tipRightBottomStart.x > -1) { - for (let p of rotateThese) points[p] = points[p].rotate(1, points.edgeLeft) - } - - points.snapLeft = points.top.shiftFractionTowards(points.edgeTop, 0.5) - - macro('round', { - from: points.edgeTop, - to: points.tipRight, - via: points.tipRightTop, - prefix: 'tipRightTop', - }) - macro('round', { - from: points.tipRight, - to: points.top, - via: points.tipRightBottom, - prefix: 'tipRightBottom', - }) - - paths.rect = new Path() - .move(points.edgeTop) - .curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.edgeRight) - .curve(points.edgeRightCp, points.edgeTopRightCp, points.edgeTop) - .close() - - return part - }, -} diff --git a/designs/tutorial/src/step9-11.mjs b/designs/tutorial/src/step9-11.mjs deleted file mode 100644 index d3d504a65e9..00000000000 --- a/designs/tutorial/src/step9-11.mjs +++ /dev/null @@ -1,117 +0,0 @@ -import { step8 } from './step5-8.mjs' - -export const step9 = { - name: 'tutorial.step9', - from: step8, - draft: ({ points, Path, paths, part }) => { - points.edgeTopRightCp = points.edgeTopLeftCp.flipX() - points.topCp1 = points.topCp2.flipX() - points.tipLeftTopStart = points.tipRightTopStart.flipX() - points.tipLeftTopCp1 = points.tipRightTopCp1.flipX() - points.tipLeftTopCp2 = points.tipRightTopCp2.flipX() - points.tipLeftTopEnd = points.tipRightTopEnd.flipX() - points.tipLeftBottomStart = points.tipRightBottomStart.flipX() - points.tipLeftBottomCp1 = points.tipRightBottomCp1.flipX() - points.tipLeftBottomCp2 = points.tipRightBottomCp2.flipX() - points.tipLeftBottomEnd = points.tipRightBottomEnd.flipX() - points.snapRight = points.snapLeft.flipX() - - paths.seam = new Path() - .move(points.edgeLeft) - .line(points.bottomLeft) - .line(points.bottomRight) - .line(points.edgeRight) - .curve(points.edgeRightCp, points.edgeTopRightCp, points.tipLeftTopStart) - .curve(points.tipLeftTopCp1, points.tipLeftTopCp2, points.tipLeftTopEnd) - .curve(points.tipLeftBottomCp1, points.tipLeftBottomCp2, points.tipLeftBottomEnd) - .curve(points.topCp1, points.rightCp2, points.right) - .curve(points.rightCp1, points.bottomCp2, points.bottom) - .curve(points.bottomCp1, points.leftCp2, points.left) - .curve(points.leftCp1, points.topCp2, points.tipRightBottomEnd) - .curve(points.tipRightBottomCp2, points.tipRightBottomCp1, points.tipRightBottomStart) - .curve(points.tipRightTopCp2, points.tipRightTopCp1, points.tipRightTopStart) - .curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft) - .close() - .attr('class', 'fabric') - - delete paths.neck - delete paths.rect - - return part - }, -} - -export const step10 = { - name: 'tutorial.step10', - from: step9, - draft: ({ points, Path, paths, macro, part }) => { - macro('round', { - from: points.topLeft, - to: points.bottomRight, - via: points.bottomLeft, - radius: points.bottomRight.x / 4, - prefix: 'bottomLeft', - }) - macro('round', { - from: points.bottomLeft, - to: points.topRight, - via: points.bottomRight, - radius: points.bottomRight.x / 4, - prefix: 'bottomRight', - }) - - paths.seam = new Path() - .move(points.edgeLeft) - .line(points.bottomLeftStart) - .curve(points.bottomLeftCp1, points.bottomLeftCp2, points.bottomLeftEnd) - .line(points.bottomRightStart) - .curve(points.bottomRightCp1, points.bottomRightCp2, points.bottomRightEnd) - .line(points.edgeRight) - .curve(points.edgeRightCp, points.edgeTopRightCp, points.tipLeftTopStart) - .curve(points.tipLeftTopCp1, points.tipLeftTopCp2, points.tipLeftTopEnd) - .curve(points.tipLeftBottomCp1, points.tipLeftBottomCp2, points.tipLeftBottomEnd) - .curve(points.topCp1, points.rightCp2, points.right) - .curve(points.rightCp1, points.bottomCp2, points.bottom) - .curve(points.bottomCp1, points.leftCp2, points.left) - .curve(points.leftCp1, points.topCp2, points.tipRightBottomEnd) - .curve(points.tipRightBottomCp2, points.tipRightBottomCp1, points.tipRightBottomStart) - .curve(points.tipRightTopCp2, points.tipRightTopCp1, points.tipRightTopStart) - .curve(points.edgeTopLeftCp, points.edgeLeftCp, points.edgeLeft) - .close() - - return part - }, -} - -export const step11 = { - name: 'tutorial.step11', - from: step10, - draft: ({ Point, points, paths, macro, complete, snippets, Snippet, part }) => { - // Complete? - if (complete) { - snippets.snapStud = new Snippet('snap-stud', points.snapLeft) - snippets.snapSocket = new Snippet('snap-socket', points.snapRight).attr('opacity', 0.5) - - paths.bias = paths.seam - .offset(-5) - .attr('class', 'various dashed') - .attr('data-text', 'finishWithBiasTape') - .attr('data-text-class', 'center fill-various') - - points.title = points.bottom.shift(-90, 45) - macro('title', { - at: points.title, - nr: 1, - title: 'bib', - }) - - points.scalebox = points.title.shift(-90, 55) - macro('scalebox', { at: points.scalebox }) - - points.logo = new Point(0, 0) - snippets.logo = new Snippet('logo', points.logo) - } - - return part - }, -} diff --git a/designs/tutorial/tests/shared.test.mjs b/designs/tutorial/tests/shared.test.mjs deleted file mode 100644 index 9a484bf8612..00000000000 --- a/designs/tutorial/tests/shared.test.mjs +++ /dev/null @@ -1,20 +0,0 @@ -// This file is auto-generated | Any changes you make will be overwritten. -import { Tutorial, i18n } from '../src/index.mjs' - -// Shared tests -import { testPatternConfig } from '../../../tests/designs/config.mjs' -import { testPatternI18n } from '../../../tests/designs/i18n.mjs' -import { testPatternDrafting } from '../../../tests/designs/drafting.mjs' -import { testPatternSampling } from '../../../tests/designs/sampling.mjs' - -// Test config -testPatternConfig(Tutorial) - -// Test translation -testPatternI18n(Tutorial, i18n) - -// Test drafting - Change the second parameter to `true` to log errors -testPatternDrafting(Tutorial, false) - -// Test sampling - Change the second parameter to `true` to log errors -testPatternSampling(Tutorial, false)