fix: package gen script (#10352)

* fix: package gen script

* fix: files without extensions didn't have handlebars stripped

* chore: requested change
This commit is contained in:
DD
2024-06-18 12:55:02 +03:00
committed by Vlad Frangu
parent e7cc754fd3
commit 5c023bd64b
9 changed files with 4 additions and 3 deletions

View File

@@ -41,14 +41,15 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
{
type: 'addMany',
destination: `${plop.getDestBasePath()}/../{{name}}`,
templateFiles: ['templates/**'],
// plop doesn't like our cliff.toml file since it tries to parse it. we add it manually later
templateFiles: ['templates/**', '!templates/default/cliff.toml'],
globOptions: { dot: true },
base: 'templates/default/',
stripExtensions: ['hbs'],
},
{
type: 'modify',
path: `${plop.getDestBasePath()}/turbo/generators/templates/cliff.toml`,
path: `${plop.getDestBasePath()}/turbo/generators/templates/default/cliff.toml`,
async transform(content, answers) {
const cliffTOML = content.replace('{{name}}', answers.name);
await writeFile(`${plop.getDestBasePath()}/../${answers.name}/cliff.toml`, cliffTOML);