Skip to content

Commit

Permalink
fix(generators): Fix generating of gitignore (#3514)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Jul 10, 2024
1 parent 410ba7d commit cabc397
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -94,4 +93,4 @@
"typescript": "^5.5.3"
},
"gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5"
}
}
3 changes: 1 addition & 2 deletions packages/generators/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Logs
import { renderTemplate, toFile } from '@featherscloud/pinion'
import { AppGeneratorContext } from '..'

const template = `# Logs
logs
*.log
npm-debug.log*
Expand Down Expand Up @@ -119,3 +122,7 @@ dist
.sqlite
lib/
`

export const generate = (ctx: AppGeneratorContext) =>
Promise.resolve(ctx).then(renderTemplate(template, toFile('.gitignore')))

0 comments on commit cabc397

Please sign in to comment.