Skip to content

Commit

Permalink
fix(cli): make sure tsbuildinfo is removed by the clean script
Browse files Browse the repository at this point in the history
Fixes #3197
  • Loading branch information
raymondfeng committed Jun 21, 2019
1 parent f14b5e5 commit 3fdc0b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cli/generators/project/templates/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "lb-tsc",
"build:watch": "lb-tsc --watch",
"clean": "lb-clean dist tsconfig.build.tsbuildinfo",
"clean": "lb-clean dist *.tsbuildinfo",
<% if (project.prettier && project.eslint) { -%>
"lint": "npm run prettier:check && npm run eslint",
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "tsc",
"build:watch": "tsc --watch",
"clean": "rimraf dist",
"clean": "rimraf dist *.tsbuildinfo",
<% if (project.prettier && project.eslint) { -%>
"lint": "npm run prettier:check && npm run eslint",
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/test/integration/generators/app.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ describe('app-generator specific files', () => {
assert.fileContent('package.json', /"docker:run": "docker run/);
});

it('creates npm script "clean"', () => {
assert.fileContent(
'package.json',
'"clean": "lb-clean dist *.tsbuildinfo"',
);
});

it('creates npm script "migrate-db"', async () => {
const pkg = JSON.parse(await readFile('package.json'));
expect(pkg.scripts).to.have.property('migrate', 'node ./dist/migrate');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/integration/lib/project-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ module.exports = function(projGenerator, props, projectType) {
['tsconfig.json', '@loopback/build'],
]);
assert.fileContent([
['package.json', '"clean": "rimraf dist"'],
['package.json', '"clean": "rimraf dist *.tsbuildinfo"'],
['package.json', '"typescript"'],
['package.json', '"eslint"'],
['package.json', 'eslint-config-prettier'],
Expand Down

0 comments on commit 3fdc0b1

Please sign in to comment.