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:
parent
71e1d2b42d
commit
7eff523f7e
8 changed files with 378 additions and 247 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue