1
0
Fork 0

fix: Make yarn new design work again

Also makes the reconfigure script responsible for the generation of the
use-design hook.
This commit is contained in:
Joost De Cock 2023-10-04 09:14:18 +02:00
parent 71e1d2b42d
commit 7eff523f7e
8 changed files with 378 additions and 247 deletions

View file

@ -1,6 +1,8 @@
{ {
"aaron": { "aaron": {
"description": "A FreeSewing pattern for a A-shirt or tank top", "description": "A FreeSewing pattern for a A-shirt or tank top",
"lab": true,
"org": true,
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
"difficulty": 2, "difficulty": 2,
@ -8,6 +10,8 @@
"techniques": ["hem", "stretch", "knitBinding", "curvedSeam"] "techniques": ["hem", "stretch", "knitBinding", "curvedSeam"]
}, },
"albert": { "albert": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for an apron", "description": "A FreeSewing pattern for an apron",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -16,6 +20,8 @@
"techniques": ["hem", "knitBinding", "curvedSeam", "pocket"] "techniques": ["hem", "knitBinding", "curvedSeam", "pocket"]
}, },
"bee": { "bee": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a bikini top", "description": "A FreeSewing pattern for a bikini top",
"code": "bobgeorgethe3rd", "code": "bobgeorgethe3rd",
"design": "PrudenceRabbit", "design": "PrudenceRabbit",
@ -24,6 +30,8 @@
"techniques": ["hem", "stretch", "curvedSeam", "precision"] "techniques": ["hem", "stretch", "curvedSeam", "precision"]
}, },
"bella": { "bella": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a womenswear bodice block", "description": "A FreeSewing pattern for a womenswear bodice block",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": ["Bella Incognito", "Joost De Cock"], "design": ["Bella Incognito", "Joost De Cock"],
@ -32,6 +40,8 @@
"techniques": ["dart", "block"] "techniques": ["dart", "block"]
}, },
"benjamin": { "benjamin": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a bow tie", "description": "A FreeSewing pattern for a bow tie",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -40,6 +50,8 @@
"techniques": ["precision", "interfacing"] "techniques": ["precision", "interfacing"]
}, },
"bent": { "bent": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a menswear body block with a two-part sleeve", "description": "A FreeSewing pattern for a menswear body block with a two-part sleeve",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -48,6 +60,8 @@
"techniques": ["hem", "curvedSeam", "setSleeve"] "techniques": ["hem", "curvedSeam", "setSleeve"]
}, },
"bob": { "bob": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a bib", "description": "A FreeSewing pattern for a bib",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -56,6 +70,8 @@
"techniques": ["biasTape", "curvedSeam", "snap"] "techniques": ["biasTape", "curvedSeam", "snap"]
}, },
"breanna": { "breanna": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a basic body block for womenswear", "description": "A FreeSewing pattern for a basic body block for womenswear",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -64,6 +80,8 @@
"techniques": ["block", "dart"] "techniques": ["block", "dart"]
}, },
"brian": { "brian": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a basic body block for menswear", "description": "A FreeSewing pattern for a basic body block for menswear",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -72,6 +90,8 @@
"techniques": ["block", "flatSleeve"] "techniques": ["block", "flatSleeve"]
}, },
"bruce": { "bruce": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for boxer briefs", "description": "A FreeSewing pattern for boxer briefs",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -80,6 +100,8 @@
"techniques": ["stretch", "hem", "curvedSeam", "elastic"] "techniques": ["stretch", "hem", "curvedSeam", "elastic"]
}, },
"carlita": { "carlita": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat", "description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": ["Anneke Caramin", "Joost De Cock"], "design": ["Anneke Caramin", "Joost De Cock"],
@ -99,6 +121,8 @@
] ]
}, },
"carlton": { "carlton": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat", "description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": ["Anneke Caramin", "Joost De Cock"], "design": ["Anneke Caramin", "Joost De Cock"],
@ -117,6 +141,8 @@
] ]
}, },
"cathrin": { "cathrin": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a underbust corset / waist trainer", "description": "A FreeSewing pattern for a underbust corset / waist trainer",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": ["Cathrin Åhlén", "Joost De Cock"], "design": ["Cathrin Åhlén", "Joost De Cock"],
@ -125,6 +151,8 @@
"techniques": ["boning", "precision", "curvedSeam", "interfacing"] "techniques": ["boning", "precision", "curvedSeam", "interfacing"]
}, },
"charlie": { "charlie": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for chino trousers", "description": "A FreeSewing pattern for chino trousers",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -143,6 +171,8 @@
] ]
}, },
"cornelius": { "cornelius": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for cycling breeches, based on the Keystone drafting system", "description": "A FreeSewing pattern for cycling breeches, based on the Keystone drafting system",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -151,6 +181,8 @@
"techniques": [] "techniques": []
}, },
"diana": { "diana": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a top with a draped neck", "description": "A FreeSewing pattern for a top with a draped neck",
"code": "Erica Alcusa Sáez", "code": "Erica Alcusa Sáez",
"design": "Erica Alcusa Sáez", "design": "Erica Alcusa Sáez",
@ -159,10 +191,14 @@
"techniques": ["curvedSeam", "flatSleeve", "hem"] "techniques": ["curvedSeam", "flatSleeve", "hem"]
}, },
"examples": { "examples": {
"lab": false,
"org": false,
"description": "A FreeSewing pattern holding examples for our documentation", "description": "A FreeSewing pattern holding examples for our documentation",
"code": "Joost De Cock" "code": "Joost De Cock"
}, },
"florence": { "florence": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a face mask", "description": "A FreeSewing pattern for a face mask",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -171,6 +207,8 @@
"techniques": ["curvedSeam"] "techniques": ["curvedSeam"]
}, },
"florent": { "florent": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a flat cap", "description": "A FreeSewing pattern for a flat cap",
"code": ["Quentin Felix", "Joost De Cock"], "code": ["Quentin Felix", "Joost De Cock"],
"design": "Quentin Felix", "design": "Quentin Felix",
@ -179,6 +217,8 @@
"techniques": ["curvedSeam"] "techniques": ["curvedSeam"]
}, },
"hi": { "hi": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a shark plush toy", "description": "A FreeSewing pattern for a shark plush toy",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -187,6 +227,8 @@
"techniques": ["curvedSeam", "dart"] "techniques": ["curvedSeam", "dart"]
}, },
"holmes": { "holmes": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a Sherlock Holmes hat", "description": "A FreeSewing pattern for a Sherlock Holmes hat",
"code": ["Erica Alcusa Sáez", "bobgeorgethe3rd"], "code": ["Erica Alcusa Sáez", "bobgeorgethe3rd"],
"design": "Erica Alcusa Sáez", "design": "Erica Alcusa Sáez",
@ -195,6 +237,8 @@
"techniques": ["curvedSeam", "lining"] "techniques": ["curvedSeam", "lining"]
}, },
"hortensia": { "hortensia": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a handbag", "description": "A FreeSewing pattern for a handbag",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": ["Stoffsuchti", "Wouter Van Wageningen"], "design": ["Stoffsuchti", "Wouter Van Wageningen"],
@ -203,6 +247,8 @@
"techniques": ["curvedSeam", "precision", "lining", "zipper"] "techniques": ["curvedSeam", "precision", "lining", "zipper"]
}, },
"huey": { "huey": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a zip-up hoodie", "description": "A FreeSewing pattern for a zip-up hoodie",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -211,6 +257,8 @@
"techniques": ["curvedSeam", "pocket", "zipper", "ribbing", "flatSleeve"] "techniques": ["curvedSeam", "pocket", "zipper", "ribbing", "flatSleeve"]
}, },
"hugo": { "hugo": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a hooded jumper with raglan sleeves", "description": "A FreeSewing pattern for a hooded jumper with raglan sleeves",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -219,6 +267,8 @@
"techniques": ["curvedSeam", "pocket", "ribbing", "raglanSleeve"] "techniques": ["curvedSeam", "pocket", "ribbing", "raglanSleeve"]
}, },
"jaeger": { "jaeger": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a sport coat style jacket", "description": "A FreeSewing pattern for a sport coat style jacket",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -237,10 +287,14 @@
] ]
}, },
"legend": { "legend": {
"lab": false,
"org": false,
"description": "A FreeSewing pattern to document pattern notation", "description": "A FreeSewing pattern to document pattern notation",
"code": "Joost De Cock" "code": "Joost De Cock"
}, },
"lucy": { "lucy": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a historical tie-on pocket", "description": "A FreeSewing pattern for a historical tie-on pocket",
"code": "SeaZeeZee", "code": "SeaZeeZee",
"design": "SeaZeeZee", "design": "SeaZeeZee",
@ -249,6 +303,8 @@
"techniques": ["curvedSeam"] "techniques": ["curvedSeam"]
}, },
"lunetius": { "lunetius": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a lacerna, a historical Roman cloak", "description": "A FreeSewing pattern for a lacerna, a historical Roman cloak",
"code": "Rika Tamaike", "code": "Rika Tamaike",
"design": "Rika Tamaike", "design": "Rika Tamaike",
@ -257,6 +313,8 @@
"techniques": ["hem"] "techniques": ["hem"]
}, },
"magde": { "magde": {
"lab": true,
"org": false,
"description": "A FreeSewing pattern for a bike messenger bag", "description": "A FreeSewing pattern for a bike messenger bag",
"code": "clegganator259", "code": "clegganator259",
"design": "clegganator259", "design": "clegganator259",
@ -265,6 +323,8 @@
"techniques": [] "techniques": []
}, },
"noble": { "noble": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a princess seam bodice block", "description": "A FreeSewing pattern for a princess seam bodice block",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -273,6 +333,8 @@
"techniques": ["curvedSeam", "precision", "princessSeam"] "techniques": ["curvedSeam", "precision", "princessSeam"]
}, },
"octoplushy": { "octoplushy": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for an octopus plushy toy", "description": "A FreeSewing pattern for an octopus plushy toy",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -281,6 +343,8 @@
"techniques": ["curvedSeam", "precision"] "techniques": ["curvedSeam", "precision"]
}, },
"paco": { "paco": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for summer pants", "description": "A FreeSewing pattern for summer pants",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -289,6 +353,8 @@
"techniques": ["elastic", "curvedSeam", "pocket", "weltPocket", "hem"] "techniques": ["elastic", "curvedSeam", "pocket", "weltPocket", "hem"]
}, },
"penelope": { "penelope": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a pencil skirt", "description": "A FreeSewing pattern for a pencil skirt",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -297,14 +363,20 @@
"techniques": ["hem", "curvedSeam", "precision", "zipper"] "techniques": ["hem", "curvedSeam", "precision", "zipper"]
}, },
"plugintest": { "plugintest": {
"lab": false,
"org": false,
"description": "A FreeSewing pattern to test (y)our plugins", "description": "A FreeSewing pattern to test (y)our plugins",
"code": "Joost De Cock" "code": "Joost De Cock"
}, },
"rendertest": { "rendertest": {
"lab": false,
"org": false,
"description": "A FreeSewing pattern to test (y)our render engine our CSS", "description": "A FreeSewing pattern to test (y)our render engine our CSS",
"code": "Joost De Cock" "code": "Joost De Cock"
}, },
"sandy": { "sandy": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a circle skirt", "description": "A FreeSewing pattern for a circle skirt",
"code": ["Erica Alcusa Sáez", "Joost De Cock"], "code": ["Erica Alcusa Sáez", "Joost De Cock"],
"design": "Erica Alcusa Sáez", "design": "Erica Alcusa Sáez",
@ -313,6 +385,8 @@
"techniques": ["curvedSeam", "button", "hem"] "techniques": ["curvedSeam", "button", "hem"]
}, },
"shin": { "shin": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for swim trunks", "description": "A FreeSewing pattern for swim trunks",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -321,6 +395,8 @@
"techniques": ["hem", "stretch", "curvedSeam", "elastic"] "techniques": ["hem", "stretch", "curvedSeam", "elastic"]
}, },
"simon": { "simon": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a button down shirt", "description": "A FreeSewing pattern for a button down shirt",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -329,6 +405,8 @@
"techniques": ["hem", "button", "interfacing", "curvedSeam", "flatFelledSeam", "flatSleeve"] "techniques": ["hem", "button", "interfacing", "curvedSeam", "flatFelledSeam", "flatSleeve"]
}, },
"simone": { "simone": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a button down shirt (Simone = Simon for people with breasts)", "description": "A FreeSewing pattern for a button down shirt (Simone = Simon for people with breasts)",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -337,6 +415,8 @@
"techniques": ["hem", "button", "interfacing", "curvedSeam", "flatFelledSeam", "flatSleeve"] "techniques": ["hem", "button", "interfacing", "curvedSeam", "flatFelledSeam", "flatSleeve"]
}, },
"sven": { "sven": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a straightforward sweater", "description": "A FreeSewing pattern for a straightforward sweater",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -345,6 +425,8 @@
"techniques": ["curvedSeam", "flatSleeve", "ribbing"] "techniques": ["curvedSeam", "flatSleeve", "ribbing"]
}, },
"tamiko": { "tamiko": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a zero-waste top", "description": "A FreeSewing pattern for a zero-waste top",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -353,6 +435,8 @@
"techniques": ["curvedSeam"] "techniques": ["curvedSeam"]
}, },
"teagan": { "teagan": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a T-shirt", "description": "A FreeSewing pattern for a T-shirt",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -361,6 +445,8 @@
"techniques": ["curvedSeam", "hem", "flatSleeve", "knitBand"] "techniques": ["curvedSeam", "hem", "flatSleeve", "knitBand"]
}, },
"tiberius": { "tiberius": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a tunica, a historical Roman tunic", "description": "A FreeSewing pattern for a tunica, a historical Roman tunic",
"code": "Rika Tamaike", "code": "Rika Tamaike",
"design": "Rika Tamaike", "design": "Rika Tamaike",
@ -369,6 +455,8 @@
"techniques": [] "techniques": []
}, },
"titan": { "titan": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a unisex trouser block", "description": "A FreeSewing pattern for a unisex trouser block",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": ["Debra Bean", "Joost De Cock"], "design": ["Debra Bean", "Joost De Cock"],
@ -377,6 +465,8 @@
"techniques": [] "techniques": []
}, },
"trayvon": { "trayvon": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a tie", "description": "A FreeSewing pattern for a tie",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -385,6 +475,8 @@
"techniques": ["precision", "lining"] "techniques": ["precision", "lining"]
}, },
"uma": { "uma": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a basic, highly-customizable underwear pattern", "description": "A FreeSewing pattern for a basic, highly-customizable underwear pattern",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -393,6 +485,8 @@
"techniques": ["elastic", "curvedSeam"] "techniques": ["elastic", "curvedSeam"]
}, },
"wahid": { "wahid": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a classic fitted waistcoat", "description": "A FreeSewing pattern for a classic fitted waistcoat",
"code": "Joost De Cock", "code": "Joost De Cock",
"design": "Joost De Cock", "design": "Joost De Cock",
@ -401,6 +495,8 @@
"techniques": ["curvedSeam", "hem", "interfacing", "lining", "weltPocket", "button"] "techniques": ["curvedSeam", "hem", "interfacing", "lining", "weltPocket", "button"]
}, },
"walburga": { "walburga": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a wappenrock (tabard/surcoat), a historical European/medieval (ish) garment", "description": "A FreeSewing pattern for a wappenrock (tabard/surcoat), a historical European/medieval (ish) garment",
"code": "Rika Tamaike", "code": "Rika Tamaike",
"design": "Rika Tamaike", "design": "Rika Tamaike",
@ -409,6 +505,8 @@
"techniques": ["hem"] "techniques": ["hem"]
}, },
"waralee": { "waralee": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for wrap pants", "description": "A FreeSewing pattern for wrap pants",
"code": "Wouter Van Wageningen", "code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen", "design": "Wouter Van Wageningen",
@ -417,6 +515,8 @@
"techniques": [] "techniques": []
}, },
"yuri": { "yuri": {
"lab": true,
"org": true,
"description": "A FreeSewing pattern for a fancy zipless sweater based on the Huey hoodie", "description": "A FreeSewing pattern for a fancy zipless sweater based on the Huey hoodie",
"code": "Hellgy", "code": "Hellgy",
"design": "Biou", "design": "Biou",

View file

@ -0,0 +1,7 @@
{
"t": "{{ title }}",
"d": "{{ description }}",
"p": { },
"s": { },
"o": { }
}

View file

@ -0,0 +1,8 @@
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 }

View file

@ -0,0 +1,17 @@
/*
* This file is auto-generated.
* Any manual changes will be overwritten.
*/
{{#designs}}
import { {{ Name }} as {{ name }} } from '@freesewing/{{ name }}'
{{/designs}}
const designs = {
{{#designs}}
{{ name }},
{{/designs}}
}
export const useDesign = (design) => (designs[design] ? designs[design] : false)
export const collection = Object.keys(designs)

View file

@ -5,10 +5,13 @@ import chalk from 'chalk'
import { banner } from './banner.mjs' import { banner } from './banner.mjs'
import mustache from 'mustache' import mustache from 'mustache'
import { execSync } from 'child_process' import { execSync } from 'child_process'
import languages from '../config/languages.json' assert { type: 'json' }
// Software // Software
import designs from '../config/software/designs.json' assert { type: 'json' } import designs from '../config/software/designs.json' assert { type: 'json' }
import plugins from '../config/software/plugins.json' assert { type: 'json' } import plugins from '../config/software/plugins.json' assert { type: 'json' }
console.log({ languages })
const type = process.argv[2] const type = process.argv[2]
// Add new design // Add new design
@ -39,42 +42,13 @@ async function addDesign() {
${chalk.gray('≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡')} ${chalk.gray('≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡')}
We're going to add a new design to this repository. That's awesome 🎉 We're going to add a new design to this repository. That's awesome 🎉
Let's start by picking the category for this design 🏷 Let's start by picking a name. Naming things is hard 😬
`)
const { type } = await prompts({
type: 'select',
name: 'type',
message: 'In what category should we add the design?',
choices: [
{
title: 'Accessories',
value: 'accessories',
description: 'Hats, bags, plushies, and so on',
},
{ title: 'Blocks', value: 'blocks', description: 'Blocks/Slopers to base other designs on' },
{
title: 'Garments',
value: 'garments',
description: 'For clothes. The most common category',
},
{
title: 'Utilities',
value: 'utilities',
description: 'For utility designs such as our rendertest or legend',
},
],
initial: 2,
})
console.log(`
Cool cool cool.
Now a name. Naming things is hard 😬
We'd appreciate if you pick: We'd appreciate if you pick:
- a firstname like ${chalk.green('alex')}, ${chalk.green('jordan')}, ${chalk.green( - a firstname like ${chalk.green('alex')}, ${chalk.green('jordan')}, ${chalk.green(
'ezra' 'ezra'
)}, or ${chalk.green('logan')} )}, or ${chalk.green('logan')}
- that is an aliteration with the kind of design, like ${chalk.green( - that is an aliteration with the kind of design, like ${chalk.green(
'wahid' 'wahid'
)} for a ${chalk.green('w')}aistcoat )} for a ${chalk.green('w')}aistcoat
@ -89,9 +63,9 @@ async function addDesign() {
validate: validateDesignName, validate: validateDesignName,
}) })
if (name && type) { if (name) {
console.log('\n' + ` Alright, let's add ${chalk.green(name)} under ${chalk.green(type)} 🪄`) console.log('\n' + ` Alright, let's add ${chalk.green(name)} 🪄`)
createDesign(name, type) createDesign(name)
execSync('npm run reconfigure') execSync('npm run reconfigure')
console.log(` All done 🎉`) console.log(` All done 🎉`)
@ -112,16 +86,16 @@ async function addDesign() {
Hhere's a few other things you can configure: Hhere's a few other things you can configure:
👉 ${chalk.yellow('Author')}: Credit where credit is due; Add yourself as author in ${chalk.green( 👉 ${chalk.yellow('Author')}: Credit where credit is due; Add yourself as author in ${chalk.green(
'config/exceptions.yaml' 'config/exceptions.yaml'
)} )}
👉 ${chalk.yellow('Description')}: We used a placeholder description; Update it in ${chalk.green( 👉 ${chalk.yellow('Description')}: We used placeholder metadata; Update it in ${chalk.green(
'config/software/designs.json' 'config/software/designs.json'
)} )}
👉 ${chalk.yellow( 👉 ${chalk.yellow(
'Dependencies' 'Dependencies'
)}: If you need additional plugins or patterns to extend, update ${chalk.green( )}: If you need additional plugins or patterns to extend, update ${chalk.green(
'config/dependencies.yaml' 'config/dependencies.yaml'
)} )}
If you change any of these, run ${chalk.blue('yarn reconfigure')} to update the package(s). If you change any of these, run ${chalk.blue('yarn reconfigure')} to update the package(s).
@ -184,16 +158,16 @@ async function addPlugin() {
Hhere's a few other things you can configure: Hhere's a few other things you can configure:
👉 ${chalk.yellow('Author')}: Credit where credit is due; Add yourself as author in ${chalk.green( 👉 ${chalk.yellow('Author')}: Credit where credit is due; Add yourself as author in ${chalk.green(
'config/exceptions.yaml' 'config/exceptions.yaml'
)} )}
👉 ${chalk.yellow('Description')}: We used a placeholder description; Update it in ${chalk.green( 👉 ${chalk.yellow('Description')}: We used a placeholder description; Update it in ${chalk.green(
'config/software/plugins.json' 'config/software/plugins.json'
)} )}
👉 ${chalk.yellow( 👉 ${chalk.yellow(
'Dependencies' 'Dependencies'
)}: If you need additional plugins or patterns to extend, update ${chalk.green( )}: If you need additional plugins or patterns to extend, update ${chalk.green(
'config/dependencies.yaml' 'config/dependencies.yaml'
)} )}
If you change any of these, run ${chalk.blue('yarn reconfigure')} to update the package(s). If you change any of these, run ${chalk.blue('yarn reconfigure')} to update the package(s).
@ -213,14 +187,7 @@ async function addPlugin() {
} }
function validateDesignName(name) { function validateDesignName(name) {
if ( if (Object.keys(designs).indexOf(name) !== -1)
[
...Object.keys(designs.accessories),
...Object.keys(designs.blocks),
...Object.keys(designs.garments),
...Object.keys(designs.utilities),
].indexOf(name) !== -1
)
return `Sorry but ${name} is already taken so you'll need to pick something else` return `Sorry but ${name} is already taken so you'll need to pick something else`
if (/^([a-z][a-z0-9_]*)$/.test(name)) return true if (/^([a-z][a-z0-9_]*)$/.test(name)) return true
@ -237,24 +204,26 @@ function validatePluginName(name) {
else return ' 🙈 Please use only [a-z], no spaces, no capitals, no nothing 🤷' else return ' 🙈 Please use only [a-z], no spaces, no capitals, no nothing 🤷'
} }
function createDesign(name, type) { function createDesign(name) {
const template = ['config', 'templates', 'design'] const template = ['config', 'templates', 'design']
const design = ['designs', name] const design = ['designs', name]
const description = 'A FreeSewing pattern that needs a description' const description = 'A FreeSewing pattern that needs a description'
const capitalized_name = name.charAt(0).toUpperCase() + name.slice(1) const capitalized_name = name.charAt(0).toUpperCase() + name.slice(1)
// Add to designs config file // Add to designs config file
designs[type][name] = { designs[name] = {
description: description, description: description,
code: 'Coder name', code: 'Coder name',
design: 'Designer name', design: 'Designer name',
difficulty: 1, difficulty: 1,
tags: ['tagname'], tags: ['tagname'],
techniques: ['techname'],
} }
write(['config', 'software', 'designs.json'], JSON.stringify(orderDesigns(designs), null, 2)) write(['config', 'software', 'designs.json'], JSON.stringify(orderDesigns(designs), null, 2))
// Create folders // Create folders
mkdir([...design, 'src']) mkdir([...design, 'src'])
mkdir([...design, 'i18n'])
mkdir([...design, 'tests']) mkdir([...design, 'tests'])
// Create package.json // Create package.json
@ -263,11 +232,21 @@ function createDesign(name, type) {
description, description,
}) })
// Create index.mjs // Create src/index.mjs
templateOut([...template, 'src', 'index.mjs.mustache'], [...design, 'src', 'index.mjs'], { templateOut([...template, 'src', 'index.mjs.mustache'], [...design, 'src', 'index.mjs'], {
capitalized_name, capitalized_name,
}) })
// Copy i18n/index.mjs
cp([...template, 'i18n', 'index.mjs'], [...design, 'i18n', 'index.mjs'])
// Create i18n translation files
for (const language of languages)
templateOut([...template, 'i18n', 'en.json'], [...design, 'i18n', `${language}.json`], {
title: capitalized_name,
description,
})
// Create tests file // Create tests file
cp([...template, 'tests', 'shared.test.mjs'], [...design, 'tests', 'shared.test.mjs']) cp([...template, 'tests', 'shared.test.mjs'], [...design, 'tests', 'shared.test.mjs'])

View file

@ -150,6 +150,24 @@ export const designs = {
` `
) )
// Step 7: Create use-design hooks for lab & org
for (const site of ['lab', 'org']) {
fs.writeFileSync(
path.join(repo.path, 'sites', site, 'hooks', 'use-design.mjs'),
mustache.render(
fs.readFileSync(
path.join(repo.path, 'config', 'templates', 'use-design.mjs.mustache'),
'utf-8'
),
{
designs: Object.keys(designs)
.filter((name) => designs[name][site])
.map((name) => ({ name, Name: capitalize(name) })),
}
)
)
}
// All done // All done
log.write(chalk.green(' All done\n')) log.write(chalk.green(' All done\n'))
process.exit() process.exit()

View file

@ -1,103 +1,101 @@
import { Aaron } from '@freesewing/aaron' /*
import { Albert } from '@freesewing/albert' * This file is auto-generated.
import { Bee } from '@freesewing/bee' * Any manual changes will be overwritten.
import { Bella } from '@freesewing/bella' */
import { Benjamin } from '@freesewing/benjamin' import { Aaron as aaron } from '@freesewing/aaron'
import { Bent } from '@freesewing/bent' import { Albert as albert } from '@freesewing/albert'
import { Bob } from '@freesewing/bob' import { Bee as bee } from '@freesewing/bee'
import { Breanna } from '@freesewing/breanna' import { Bella as bella } from '@freesewing/bella'
import { Brian } from '@freesewing/brian' import { Benjamin as benjamin } from '@freesewing/benjamin'
import { Bruce } from '@freesewing/bruce' import { Bent as bent } from '@freesewing/bent'
import { Carlita } from '@freesewing/carlita' import { Bob as bob } from '@freesewing/bob'
import { Carlton } from '@freesewing/carlton' import { Breanna as breanna } from '@freesewing/breanna'
import { Cathrin } from '@freesewing/cathrin' import { Brian as brian } from '@freesewing/brian'
import { Charlie } from '@freesewing/charlie' import { Bruce as bruce } from '@freesewing/bruce'
import { Cornelius } from '@freesewing/cornelius' import { Carlita as carlita } from '@freesewing/carlita'
import { Diana } from '@freesewing/diana' import { Carlton as carlton } from '@freesewing/carlton'
import { Florence } from '@freesewing/florence' import { Cathrin as cathrin } from '@freesewing/cathrin'
import { Florent } from '@freesewing/florent' import { Charlie as charlie } from '@freesewing/charlie'
import { Hi } from '@freesewing/hi' import { Cornelius as cornelius } from '@freesewing/cornelius'
import { Holmes } from '@freesewing/holmes' import { Diana as diana } from '@freesewing/diana'
import { Hortensia } from '@freesewing/hortensia' import { Florence as florence } from '@freesewing/florence'
import { Huey } from '@freesewing/huey' import { Florent as florent } from '@freesewing/florent'
import { Hugo } from '@freesewing/hugo' import { Hi as hi } from '@freesewing/hi'
import { Jaeger } from '@freesewing/jaeger' import { Holmes as holmes } from '@freesewing/holmes'
import { Legend } from '@freesewing/legend' import { Hortensia as hortensia } from '@freesewing/hortensia'
import { Lucy } from '@freesewing/lucy' import { Huey as huey } from '@freesewing/huey'
import { Lunetius } from '@freesewing/lunetius' import { Hugo as hugo } from '@freesewing/hugo'
import { Magde } from '@freesewing/magde' import { Jaeger as jaeger } from '@freesewing/jaeger'
import { Noble } from '@freesewing/noble' import { Lucy as lucy } from '@freesewing/lucy'
import { Octoplushy } from '@freesewing/octoplushy' import { Lunetius as lunetius } from '@freesewing/lunetius'
import { Paco } from '@freesewing/paco' import { Magde as magde } from '@freesewing/magde'
import { Penelope } from '@freesewing/penelope' import { Noble as noble } from '@freesewing/noble'
import { Plugintest } from '@freesewing/plugintest' import { Octoplushy as octoplushy } from '@freesewing/octoplushy'
import { Rendertest } from '@freesewing/rendertest' import { Paco as paco } from '@freesewing/paco'
import { Sandy } from '@freesewing/sandy' import { Penelope as penelope } from '@freesewing/penelope'
import { Shin } from '@freesewing/shin' import { Sandy as sandy } from '@freesewing/sandy'
import { Simon } from '@freesewing/simon' import { Shin as shin } from '@freesewing/shin'
import { Simone } from '@freesewing/simone' import { Simon as simon } from '@freesewing/simon'
import { Sven } from '@freesewing/sven' import { Simone as simone } from '@freesewing/simone'
import { Tamiko } from '@freesewing/tamiko' import { Sven as sven } from '@freesewing/sven'
import { Teagan } from '@freesewing/teagan' import { Tamiko as tamiko } from '@freesewing/tamiko'
import { Tiberius } from '@freesewing/tiberius' import { Teagan as teagan } from '@freesewing/teagan'
import { Titan } from '@freesewing/titan' import { Tiberius as tiberius } from '@freesewing/tiberius'
import { Trayvon } from '@freesewing/trayvon' import { Titan as titan } from '@freesewing/titan'
import { Uma } from '@freesewing/uma' import { Trayvon as trayvon } from '@freesewing/trayvon'
import { Wahid } from '@freesewing/wahid' import { Uma as uma } from '@freesewing/uma'
import { Walburga } from '@freesewing/walburga' import { Wahid as wahid } from '@freesewing/wahid'
import { Waralee } from '@freesewing/waralee' import { Walburga as walburga } from '@freesewing/walburga'
import { Yuri } from '@freesewing/yuri' import { Waralee as waralee } from '@freesewing/waralee'
import { Yuri as yuri } from '@freesewing/yuri'
const designs = { const designs = {
aaron: Aaron, aaron,
albert: Albert, albert,
bee: Bee, bee,
bella: Bella, bella,
benjamin: Benjamin, benjamin,
bent: Bent, bent,
bob: Bob, bob,
breanna: Breanna, breanna,
brian: Brian, brian,
bruce: Bruce, bruce,
carlita: Carlita, carlita,
carlton: Carlton, carlton,
cathrin: Cathrin, cathrin,
charlie: Charlie, charlie,
cornelius: Cornelius, cornelius,
diana: Diana, diana,
florence: Florence, florence,
florent: Florent, florent,
hi: Hi, hi,
holmes: Holmes, holmes,
hortensia: Hortensia, hortensia,
huey: Huey, huey,
hugo: Hugo, hugo,
jaeger: Jaeger, jaeger,
legend: Legend, lucy,
lucy: Lucy, lunetius,
lunetius: Lunetius, magde,
magde: Magde, noble,
noble: Noble, octoplushy,
octoplushy: Octoplushy, paco,
paco: Paco, penelope,
penelope: Penelope, sandy,
plugintest: Plugintest, shin,
rendertest: Rendertest, simon,
sandy: Sandy, simone,
shin: Shin, sven,
simon: Simon, tamiko,
simone: Simone, teagan,
sven: Sven, tiberius,
tamiko: Tamiko, titan,
teagan: Teagan, trayvon,
tiberius: Tiberius, uma,
titan: Titan, wahid,
trayvon: Trayvon, walburga,
uma: Uma, waralee,
wahid: Wahid, yuri,
walburga: Walburga,
waralee: Waralee,
yuri: Yuri,
} }
export const useDesign = (design) => (designs[design] ? designs[design] : false) export const useDesign = (design) => (designs[design] ? designs[design] : false)

View file

@ -1,95 +1,99 @@
import { Aaron } from '@freesewing/aaron' /*
import { Albert } from '@freesewing/albert' * This file is auto-generated.
import { Bee } from '@freesewing/bee' * Any manual changes will be overwritten.
import { Bella } from '@freesewing/bella' */
import { Benjamin } from '@freesewing/benjamin' import { Aaron as aaron } from '@freesewing/aaron'
import { Bent } from '@freesewing/bent' import { Albert as albert } from '@freesewing/albert'
import { Bob } from '@freesewing/bob' import { Bee as bee } from '@freesewing/bee'
import { Breanna } from '@freesewing/breanna' import { Bella as bella } from '@freesewing/bella'
import { Brian } from '@freesewing/brian' import { Benjamin as benjamin } from '@freesewing/benjamin'
import { Bruce } from '@freesewing/bruce' import { Bent as bent } from '@freesewing/bent'
import { Carlita } from '@freesewing/carlita' import { Bob as bob } from '@freesewing/bob'
import { Carlton } from '@freesewing/carlton' import { Breanna as breanna } from '@freesewing/breanna'
import { Cathrin } from '@freesewing/cathrin' import { Brian as brian } from '@freesewing/brian'
import { Charlie } from '@freesewing/charlie' import { Bruce as bruce } from '@freesewing/bruce'
import { Cornelius } from '@freesewing/cornelius' import { Carlita as carlita } from '@freesewing/carlita'
import { Diana } from '@freesewing/diana' import { Carlton as carlton } from '@freesewing/carlton'
import { Florence } from '@freesewing/florence' import { Cathrin as cathrin } from '@freesewing/cathrin'
import { Florent } from '@freesewing/florent' import { Charlie as charlie } from '@freesewing/charlie'
import { Hi } from '@freesewing/hi' import { Cornelius as cornelius } from '@freesewing/cornelius'
import { Holmes } from '@freesewing/holmes' import { Diana as diana } from '@freesewing/diana'
import { Hortensia } from '@freesewing/hortensia' import { Florence as florence } from '@freesewing/florence'
import { Huey } from '@freesewing/huey' import { Florent as florent } from '@freesewing/florent'
import { Hugo } from '@freesewing/hugo' import { Hi as hi } from '@freesewing/hi'
import { Jaeger } from '@freesewing/jaeger' import { Holmes as holmes } from '@freesewing/holmes'
import { Lucy } from '@freesewing/lucy' import { Hortensia as hortensia } from '@freesewing/hortensia'
import { Lunetius } from '@freesewing/lunetius' import { Huey as huey } from '@freesewing/huey'
import { Noble } from '@freesewing/noble' import { Hugo as hugo } from '@freesewing/hugo'
import { Octoplushy } from '@freesewing/octoplushy' import { Jaeger as jaeger } from '@freesewing/jaeger'
import { Paco } from '@freesewing/paco' import { Lucy as lucy } from '@freesewing/lucy'
import { Penelope } from '@freesewing/penelope' import { Lunetius as lunetius } from '@freesewing/lunetius'
import { Sandy } from '@freesewing/sandy' import { Noble as noble } from '@freesewing/noble'
import { Shin } from '@freesewing/shin' import { Octoplushy as octoplushy } from '@freesewing/octoplushy'
import { Simon } from '@freesewing/simon' import { Paco as paco } from '@freesewing/paco'
import { Simone } from '@freesewing/simone' import { Penelope as penelope } from '@freesewing/penelope'
import { Sven } from '@freesewing/sven' import { Sandy as sandy } from '@freesewing/sandy'
import { Tamiko } from '@freesewing/tamiko' import { Shin as shin } from '@freesewing/shin'
import { Teagan } from '@freesewing/teagan' import { Simon as simon } from '@freesewing/simon'
import { Tiberius } from '@freesewing/tiberius' import { Simone as simone } from '@freesewing/simone'
import { Titan } from '@freesewing/titan' import { Sven as sven } from '@freesewing/sven'
import { Trayvon } from '@freesewing/trayvon' import { Tamiko as tamiko } from '@freesewing/tamiko'
import { Uma } from '@freesewing/uma' import { Teagan as teagan } from '@freesewing/teagan'
import { Wahid } from '@freesewing/wahid' import { Tiberius as tiberius } from '@freesewing/tiberius'
import { Walburga } from '@freesewing/walburga' import { Titan as titan } from '@freesewing/titan'
import { Waralee } from '@freesewing/waralee' import { Trayvon as trayvon } from '@freesewing/trayvon'
import { Yuri } from '@freesewing/yuri' import { Uma as uma } from '@freesewing/uma'
import { Wahid as wahid } from '@freesewing/wahid'
import { Walburga as walburga } from '@freesewing/walburga'
import { Waralee as waralee } from '@freesewing/waralee'
import { Yuri as yuri } from '@freesewing/yuri'
const designs = { const designs = {
aaron: Aaron, aaron,
albert: Albert, albert,
bee: Bee, bee,
bella: Bella, bella,
benjamin: Benjamin, benjamin,
bent: Bent, bent,
bob: Bob, bob,
breanna: Breanna, breanna,
brian: Brian, brian,
bruce: Bruce, bruce,
carlita: Carlita, carlita,
carlton: Carlton, carlton,
cathrin: Cathrin, cathrin,
charlie: Charlie, charlie,
cornelius: Cornelius, cornelius,
diana: Diana, diana,
florence: Florence, florence,
florent: Florent, florent,
hi: Hi, hi,
holmes: Holmes, holmes,
hortensia: Hortensia, hortensia,
huey: Huey, huey,
hugo: Hugo, hugo,
jaeger: Jaeger, jaeger,
lucy: Lucy, lucy,
lunetius: Lunetius, lunetius,
noble: Noble, noble,
octoplushy: Octoplushy, octoplushy,
paco: Paco, paco,
penelope: Penelope, penelope,
sandy: Sandy, sandy,
shin: Shin, shin,
simon: Simon, simon,
simone: Simone, simone,
sven: Sven, sven,
tamiko: Tamiko, tamiko,
teagan: Teagan, teagan,
tiberius: Tiberius, tiberius,
titan: Titan, titan,
trayvon: Trayvon, trayvon,
uma: Uma, uma,
wahid: Wahid, wahid,
walburga: Walburga, walburga,
waralee: Waralee, waralee,
yuri: Yuri, yuri,
} }
export const useDesign = (design) => (designs[design] ? designs[design] : false) export const useDesign = (design) => (designs[design] ? designs[design] : false)