Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(generators): Fix generating of gitignore #3514

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')))
Loading