1
0
Fork 0

chore: Move meta-info from design config to repo config

This commit is contained in:
Joost De Cock 2022-08-27 13:25:42 +02:00
parent 5adca6da4f
commit 25bbca5fb2
3 changed files with 357 additions and 60 deletions

View file

@ -1,68 +1,359 @@
{ {
"accessories": { "accessories": {
"benjamin": "A FreeSewing pattern for a bow tie", "albert": {
"bob": "A FreeSewing pattern for a bib", "description": "A FreeSewing pattern for an apron",
"florence": "A FreeSewing pattern for a face mask", "code": "Wouter Van Wageningen",
"florent": "A FreeSewing pattern for a flat cap", "design": "Wouter Van Wageningen",
"hi": "A FreeSewing pattern for a shark plush toy", "difficulty": 2,
"holmes": "A FreeSewing pattern for a Sherlock Holmes hat", "tags": [ "accessories" ]
"hortensia": "A FreeSewing pattern for a handbag", },
"octoplushy": "A FreeSewing pattern for an octopus plushy toy", "benjamin": {
"trayvon": "A FreeSewing pattern for a tie" "description": "A FreeSewing pattern for a bow tie",
"code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen",
"difficulty": 3,
"tags": [ "accessories" ]
},
"bob": {
"description": "A FreeSewing pattern for a bib",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "accessories", "infants" ]
},
"florence": {
"description": "A FreeSewing pattern for a face mask",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 1,
"tags": [ "accessories" ]
},
"florent": {
"description": "A FreeSewing pattern for a flat cap",
"code": [ "Quentin Felix", "Joost De Cock" ],
"design": "Quentin Felix",
"difficulty": 3,
"tags": [ "accessories", "hats" ]
},
"hi": {
"description": "A FreeSewing pattern for a shark plush toy",
"code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen",
"difficulty": 4,
"tags": [ "accessories", "toys" ]
},
"holmes": {
"description": "A FreeSewing pattern for a Sherlock Holmes hat",
"code": [ "Erica Alcusa Sáez", "bobgeorgethe3rd" ],
"design": "Erica Alcusa Sáez",
"difficulty": 3,
"tags": [ "accessories", "hats" ]
},
"hortensia": {
"description": "A FreeSewing pattern for a handbag",
"code": "Wouter Van Wageningen",
"design": [ "Stoffsuchti", "Wouter Van Wageningen" ],
"difficulty": 3,
"tags": [ "accessories", "bags" ]
},
"lucy": {
"description": "A FreeSewing pattern for a historical tie-on pocket",
"code": "SeaZeeZee",
"design": "SeaZeeZee",
"difficulty": 2,
"tags": [ "accessories", "historical", "bags" ]
},
"octoplushy": {
"description": "A FreeSewing pattern for an octopus plushy toy",
"code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen",
"difficulty": 4,
"tags": [ "accessories", "toys" ]
},
"trayvon": {
"description": "A FreeSewing pattern for a tie",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 2,
"tags": [ "accessories" ]
}
}, },
"blocks": { "blocks": {
"bella": "A FreeSewing pattern for a womenswear bodice block", "bella": {
"bent": "A FreeSewing pattern for a menswear body block with a two-part sleeve", "description": "A FreeSewing pattern for a womenswear bodice block",
"breanna": "A FreeSewing pattern for a basic body block for womenswear",
"brian": {
"about": "A FreeSewing pattern for a basic body block for menswear",
"design": "Joost De Cock",
"code": "Joost De Cock", "code": "Joost De Cock",
"department": "tops", "design": [ "Bella Incognito", "Joost De Cock" ],
"difficulty": 3 "difficulty": 3,
"tags": [ "tops" ]
}, },
"noble": "A FreeSewing pattern for a princess seam bodice block", "bent": {
"titan": "A FreeSewing pattern for a unisex trouser block" "description": "A FreeSewing pattern for a menswear body block with a two-part sleeve",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "tops" ]
},
"breanna": {
"description": "A FreeSewing pattern for a basic body block for womenswear",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "tops" ]
},
"brian": {
"description": "A FreeSewing pattern for a basic body block for menswear",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "tops" ]
},
"noble": {
"description": "A FreeSewing pattern for a princess seam bodice block",
"code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen",
"difficulty": 3,
"tags": [ "tops" ]
},
"titan": {
"description": "A FreeSewing pattern for a unisex trouser block",
"code": "Joost De Cock",
"design": [ "Debra Bean", "Joost De Cock" ],
"difficulty": 3,
"tags": [ "bottoms" ]
}
}, },
"garments": { "garments": {
"aaron": "A FreeSewing pattern for a A-shirt or tank top", "aaron": {
"albert": "A FreeSewing pattern for an apron", "description": "A FreeSewing pattern for a A-shirt or tank top",
"bee": "A FreeSewing pattern for a bikini top", "code": "Joost De Cock",
"bruce": "A FreeSewing pattern for boxer briefs", "design": "Joost De Cock",
"carlita": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat", "difficulty": 2,
"carlton": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat", "tags": [ "tops", "underwear" ]
"cathrin": "A FreeSewing pattern for a underbust corset / waist trainer", },
"charlie": "A FreeSewing pattern for chino trousers", "bee": {
"cornelius": "A FreeSewing pattern for cycling breeches, based on the Keystone drafting system", "description": "A FreeSewing pattern for a bikini top",
"diana": "A FreeSewing pattern for a top with a draped neck", "code": "bobgeorgethe3rd",
"huey": "A FreeSewing pattern for a zip-up hoodie", "design": "PrudenceRabbit",
"hugo": "A FreeSewing pattern for a hooded jumper with raglan sleeves", "difficulty": 3,
"jaeger": "A FreeSewing pattern for a sport coat style jacket", "tags": [ "tops", "swimwear" ]
"lucy": "A FreeSewing pattern for a historical tie-on pocket", },
"lunetius": "A FreeSewing pattern for a lacerna, a historical Roman cloak", "bruce": {
"paco": "A FreeSewing pattern for summer pants", "description": "A FreeSewing pattern for boxer briefs",
"penelope": "A FreeSewing pattern for a pencil skirt", "code": "Joost De Cock",
"sandy": "A FreeSewing pattern for a circle skirt", "design": "Joost De Cock",
"shin": "A FreeSewing pattern for swim trunks", "difficulty": 3,
"simon": "A FreeSewing pattern for a button down shirt", "tags": [ "tops", "underwear" ]
"simone": "A FreeSewing pattern for a button down shirt (Simone = Simon for people with breasts)", },
"sven": "A FreeSewing pattern for a straightforward sweater", "carlita": {
"tamiko": "A FreeSewing pattern for a zero-waste top", "description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat",
"teagan": "A FreeSewing pattern for a T-shirt", "code": "Joost De Cock",
"theo": "A FreeSewing pattern for classic trousers", "design": [ "Anneke Caramin", "Joost De Cock" ],
"tiberius": "A FreeSewing pattern for a tunica, a historical Roman tunic", "difficulty": 5,
"unice": "A FreeSewing pattern for a basic, highly-customizable underwear pattern", "tags": [ "tops", "coats" ]
"ursula": "A FreeSewing pattern for a basic, highly-customizable underwear pattern", },
"wahid": "A FreeSewing pattern for a classic fitted waistcoat", "carlton": {
"walburga": "A FreeSewing pattern for a wappenrock (tabard/surcoat), a historical European/medieval (ish) garment", "description": "A FreeSewing pattern for Sherlock Holmes cosplay; Or just a nice long coat",
"waralee": "A FreeSewing pattern for wrap pants", "code": "Joost De Cock",
"yuri": "A FreeSewing pattern for a fancy zipless sweater based on the Huey hoodie" "design": [ "Anneke Caramin", "Joost De Cock" ],
"difficulty": 5,
"tags": [ "tops", "coats" ]
},
"cathrin": {
"description": "A FreeSewing pattern for a underbust corset / waist trainer",
"code": "Joost De Cock",
"design": [ "Cathrin Åhlén", "Joost De Cock" ],
"difficulty": 4,
"tags": [ "tops", "underwear" ]
},
"charlie": {
"description": "A FreeSewing pattern for chino trousers",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "bottoms", "trousers" ]
},
"cornelius": {
"description": "A FreeSewing pattern for cycling breeches, based on the Keystone drafting system",
"code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen",
"difficulty": 3,
"tags": [ "bottoms", "trousers" ]
},
"diana": {
"description": "A FreeSewing pattern for a top with a draped neck",
"code": "Erica Alcusa Sáez",
"design": "Erica Alcusa Sáez",
"difficulty": 2,
"tags": [ "tops" ]
},
"huey": {
"description": "A FreeSewing pattern for a zip-up hoodie",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "tops" ]
},
"hugo": {
"description": "A FreeSewing pattern for a hooded jumper with raglan sleeves",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "tops" ]
},
"jaeger": {
"description": "A FreeSewing pattern for a sport coat style jacket",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 5,
"tags": [ "tops", "coats" ]
},
"lunetius": {
"description": "A FreeSewing pattern for a lacerna, a historical Roman cloak",
"code": "Rika Tamaike",
"design": "Rika Tamaike",
"difficulty": 1,
"tags": [ "tops", "coats", "historical" ]
},
"paco": {
"description": "A FreeSewing pattern for summer pants",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "bottoms", "trousers" ]
},
"penelope": {
"description": "A FreeSewing pattern for a pencil skirt",
"code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen",
"difficulty": 3,
"tags": [ "bottoms", "skirts" ]
},
"sandy": {
"description": "A FreeSewing pattern for a circle skirt",
"code": [ "Erica Alcusa Sáez", "Joost De Cock" ],
"design": "Erica Alcusa Sáez",
"difficulty": 3,
"tags": [ "bottoms", "skirts" ]
},
"shin": {
"description": "A FreeSewing pattern for swim trunks",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 2,
"tags": [ "bottoms", "swimwear" ]
},
"simon": {
"description": "A FreeSewing pattern for a button down shirt",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 4,
"tags": [ "tops" ]
},
"simone": {
"description": "A FreeSewing pattern for a button down shirt (Simone = Simon for people with breasts)",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 4,
"tags": [ "tops" ]
},
"sven": {
"description": "A FreeSewing pattern for a straightforward sweater",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 3,
"tags": [ "tops" ]
},
"tamiko": {
"description": "A FreeSewing pattern for a zero-waste top",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 1,
"tags": [ "tops" ]
},
"teagan": {
"description": "A FreeSewing pattern for a T-shirt",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 2,
"tags": [ "tops" ]
},
"theo": {
"description": "A FreeSewing pattern for classic trousers",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 4,
"tags": [ "bottoms", "trousers" ]
},
"tiberius": {
"description": "A FreeSewing pattern for a tunica, a historical Roman tunic",
"code": "Rika Tamaike",
"design": "Rika Tamaike",
"difficulty": 1,
"tags": [ "tops", "historic" ]
},
"unice": {
"description": "A FreeSewing pattern for a basic, highly-customizable underwear pattern",
"code": [ "Anna Puk", "Natalia Sayang" ],
"design": [ "Anna Puk", "Natalia Sayang" ],
"difficulty": 1,
"tags": [ "bottoms", "underwear" ]
},
"ursula": {
"description": "A FreeSewing pattern for a basic, highly-customizable underwear pattern",
"code": "Natalia Sayang",
"design": "Natalia Sayang",
"difficulty": 1,
"tags": [ "bottoms", "underwear" ]
},
"wahid": {
"description": "A FreeSewing pattern for a classic fitted waistcoat",
"code": "Joost De Cock",
"design": "Joost De Cock",
"difficulty": 4,
"tags": [ "tops" ]
},
"walburga": {
"description": "A FreeSewing pattern for a wappenrock (tabard/surcoat), a historical European/medieval (ish) garment",
"code": "Rika Tamaike",
"design": "Rika Tamaike",
"difficulty": 1,
"tags": [ "bottoms", "historic" ]
},
"waralee": {
"description": "A FreeSewing pattern for wrap pants",
"code": "Wouter Van Wageningen",
"design": "Wouter Van Wageningen",
"difficulty": 2,
"tags": [ "bottoms", "trousers" ]
},
"yuri": {
"description": "A FreeSewing pattern for a fancy zipless sweater based on the Huey hoodie",
"code": "Hellgy",
"design": "Biou",
"difficulty": 3,
"tags": [ "tops" ]
}
}, },
"utilities": { "utilities": {
"examples": "A FreeSewing pattern holding examples for our documentation", "examples": {
"legend": "A FreeSewing pattern to document pattern notation", "description": "A FreeSewing pattern holding examples for our documentation",
"plugintest": "A FreeSewing pattern to test (y)our plugins", "code": "Joost De Cock"
"rendertest": "A FreeSewing pattern to test (y)our render engine our CSS", },
"tutorial": "A FreeSewing pattern for a baby bib that's used in our tutorial" "legend": {
"description": "A FreeSewing pattern to document pattern notation",
"code": "Joost De Cock"
},
"plugintest": {
"description": "A FreeSewing pattern to test (y)our plugins",
"code": "Joost De Cock"
},
"rendertest": {
"description": "A FreeSewing pattern to test (y)our render engine our CSS",
"code": "Joost De Cock"
},
"tutorial": {
"description": "A FreeSewing pattern for a baby bib that's used in our tutorial",
"code": "Joost De Cock"
}
} }
} }

View file

@ -5,7 +5,12 @@ import sites from './sites.json' assert { type: 'json' }
// Helper method to construct summary objects // Helper method to construct summary objects
const unpack = (obj, folder) => Object.fromEntries( const unpack = (obj, folder) => Object.fromEntries(
Object.keys(obj).map(name => [name, { name, folder, description: obj[name], type: folder.slice(0, -1) } ]) Object.keys(obj).map(name => [name, { name, folder, type: folder.slice(0, -1), description: obj[name] } ])
)
// Helper method to construct summary objects for designs
const unpackDesigns = (obj, folder) => Object.fromEntries(
Object.keys(obj).map(name => [name, { name, folder, type: folder.slice(0, -1), ...obj[name] } ])
) )
const designs = { const designs = {
@ -20,7 +25,7 @@ export { designs, designsByType, packages, plugins, sites }
// All software // All software
export const software = { export const software = {
...unpack(designs, 'designs'), ...unpackDesigns(designs, 'designs'),
...unpack(plugins, 'plugins'), ...unpack(plugins, 'plugins'),
...unpack(packages, 'packages'), ...unpack(packages, 'packages'),
...unpack(sites, 'sites'), ...unpack(sites, 'sites'),
@ -28,7 +33,7 @@ export const software = {
// All software published on NPM // All software published on NPM
export const publishedSoftware = { export const publishedSoftware = {
...unpack(designs, 'designs'), ...unpackDesigns(designs, 'designs'),
...unpack(plugins, 'plugins'), ...unpack(plugins, 'plugins'),
...unpack(packages, 'packages'), ...unpack(packages, 'packages'),
} }

View file

@ -14,6 +14,7 @@ import {
} from '../config/software/index.mjs' } from '../config/software/index.mjs'
import { buildOrder } from '../config/build-order.mjs' import { buildOrder } from '../config/build-order.mjs'
import rootPackageJson from '../package.json' assert { type: 'json' } import rootPackageJson from '../package.json' assert { type: 'json' }
import { capitalize } from '../sites/shared/utils.mjs'
// Working directory // Working directory
const cwd = process.cwd() const cwd = process.cwd()
@ -111,7 +112,7 @@ log.write(chalk.green(" Done\n"))
for (const design in designs) { for (const design in designs) {
fs.writeFileSync( fs.writeFileSync(
path.join(repo.path, 'designs', design, 'tests', 'shared.test.mjs'), path.join(repo.path, 'designs', design, 'tests', 'shared.test.mjs'),
mustache.render(repo.templates.designTests, { name: design }) mustache.render(repo.templates.designTests, { name: design, Name: capitalize(design) })
) )
} }
for (const plugin in plugins) { for (const plugin in plugins) {