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

@ -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
log.write(chalk.green(' All done\n'))
process.exit()