diff --git a/packages/generators/package.json b/packages/generators/package.json index 25a6b36042..973262fa4e 100644 --- a/packages/generators/package.json +++ b/packages/generators/package.json @@ -37,13 +37,12 @@ "LICENSE", "README.md", "lib/**", - "lib/app/static/.gitignore", "*.d.ts", "*.js" ], "scripts": { "prepublish": "npm run compile", - "compile": "shx rm -rf lib/ && tsc && shx cp -r src/. lib/", + "compile": "shx rm -rf lib/ && tsc", "test": "npm run compile && mocha --config ../../.mocharc.json --require tsx --recursive test/**.test.ts test/**/*.test.ts" }, "directories": { @@ -94,4 +93,4 @@ "typescript": "^5.5.3" }, "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} +} \ No newline at end of file diff --git a/packages/generators/src/app/index.ts b/packages/generators/src/app/index.ts index 2aabc1beb6..64f9597c15 100644 --- a/packages/generators/src/app/index.ts +++ b/packages/generators/src/app/index.ts @@ -1,6 +1,6 @@ import { sep, dirname } from 'path' import chalk from 'chalk' -import { prompt, runGenerators, fromFile, copyFiles, toFile } from '@featherscloud/pinion' +import { prompt, runGenerators } from '@featherscloud/pinion' import { fileURLToPath } from 'url' import { FeathersBaseContext, @@ -141,7 +141,6 @@ export const generate = (ctx: AppGeneratorArguments) => ]) ) .then(runGenerators(__dirname, 'templates')) - .then(copyFiles(fromFile(__dirname, 'static'), toFile('.'))) .then(initializeBaseContext()) .then(async (ctx) => { const { dependencies } = await connectionGenerator(ctx) diff --git a/packages/generators/src/app/static/.gitignore b/packages/generators/src/app/templates/gitignore.tpl.ts similarity index 87% rename from packages/generators/src/app/static/.gitignore rename to packages/generators/src/app/templates/gitignore.tpl.ts index 82cf9aa04b..03aed1b74c 100644 --- a/packages/generators/src/app/static/.gitignore +++ b/packages/generators/src/app/templates/gitignore.tpl.ts @@ -1,4 +1,7 @@ -# Logs +import { renderTemplate, toFile } from '@featherscloud/pinion' +import { AppGeneratorContext } from '..' + +const template = `# Logs logs *.log npm-debug.log* @@ -119,3 +122,7 @@ dist .sqlite lib/ +` + +export const generate = (ctx: AppGeneratorContext) => + Promise.resolve(ctx).then(renderTemplate(template, toFile('.gitignore')))