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 GitHub
parent b0e57126dc
commit 9c8784fe51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);

View file

@ -1,2 +1,2 @@
# Packages node_modules # Log files logs *.log npm-debug.log* # Runtime data pids *.pid *.seed # Env .env # Dist dist
dist-docs # Docs docs/**/* !docs/README.md # Miscellaneous .turbo .tmp coverage
dist-docs # Docs docs/**/* !docs/README.md # Miscellaneous .turbo .tmp coverage