Skip to content

Commit cabc397

Browse files
authored
fix(generators): Fix generating of gitignore (#3514)
1 parent 410ba7d commit cabc397

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

packages/generators/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@
3737
"LICENSE",
3838
"README.md",
3939
"lib/**",
40-
"lib/app/static/.gitignore",
4140
"*.d.ts",
4241
"*.js"
4342
],
4443
"scripts": {
4544
"prepublish": "npm run compile",
46-
"compile": "shx rm -rf lib/ && tsc && shx cp -r src/. lib/",
45+
"compile": "shx rm -rf lib/ && tsc",
4746
"test": "npm run compile && mocha --config ../../.mocharc.json --require tsx --recursive test/**.test.ts test/**/*.test.ts"
4847
},
4948
"directories": {
@@ -94,4 +93,4 @@
9493
"typescript": "^5.5.3"
9594
},
9695
"gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5"
97-
}
96+
}

packages/generators/src/app/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { sep, dirname } from 'path'
22
import chalk from 'chalk'
3-
import { prompt, runGenerators, fromFile, copyFiles, toFile } from '@featherscloud/pinion'
3+
import { prompt, runGenerators } from '@featherscloud/pinion'
44
import { fileURLToPath } from 'url'
55
import {
66
FeathersBaseContext,
@@ -141,7 +141,6 @@ export const generate = (ctx: AppGeneratorArguments) =>
141141
])
142142
)
143143
.then(runGenerators(__dirname, 'templates'))
144-
.then(copyFiles(fromFile(__dirname, 'static'), toFile('.')))
145144
.then(initializeBaseContext())
146145
.then(async (ctx) => {
147146
const { dependencies } = await connectionGenerator(ctx)

packages/generators/src/app/static/.gitignore renamed to packages/generators/src/app/templates/gitignore.tpl.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Logs
1+
import { renderTemplate, toFile } from '@featherscloud/pinion'
2+
import { AppGeneratorContext } from '..'
3+
4+
const template = `# Logs
25
logs
36
*.log
47
npm-debug.log*
@@ -119,3 +122,7 @@ dist
119122
.sqlite
120123
121124
lib/
125+
`
126+
127+
export const generate = (ctx: AppGeneratorContext) =>
128+
Promise.resolve(ctx).then(renderTemplate(template, toFile('.gitignore')))

0 commit comments

Comments
 (0)