Skip to content

Commit

Permalink
fix(cli): update affected example projects
Browse files Browse the repository at this point in the history
Add rebuild npm script in example projects & call it within pretest & prestart scripts

fix loopbackio#3259

Signed-off-by: Mattia Primavera <[email protected]>
  • Loading branch information
MattiaPrimavera committed Oct 19, 2020
1 parent eefffc3 commit 3e60be1
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 43 deletions.
5 changes: 3 additions & 2 deletions examples/access-control-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js",
"verify": "npm pack && tar xf loopback-access-control-migration*.tgz && tree package && npm run clean",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/binding-resolution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
"scripts": {
"build": "lb-tsc",
"build:watch": "lb-tsc --watch",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha --allow-console-logs \"dist/__tests__\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node -r source-map-support/register .",
"clean": "lb-clean dist *.tsbuildinfo .eslintcache"
},
Expand Down
5 changes: 3 additions & 2 deletions examples/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/express-composition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/file-transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/greeter-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node .",
"verify": "npm pack && tar xf *example-greeter-extension*.tgz && tree package && npm run clean"
},
Expand Down
5 changes: 3 additions & 2 deletions examples/greeting-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node .",
"verify": "npm pack && tar xf *example-greeting-app*.tgz && tree package && npm run clean"
},
Expand Down
5 changes: 3 additions & 2 deletions examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha --allow-console-logs \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/lb3-application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\" \"lb3app/test/*.js\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"verify": "npm pack && tar xf loopback-lb3-application*.tgz && tree package && npm run clean",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion examples/log-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"rebuild": "npm run clean && npm run build",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
Expand Down
5 changes: 3 additions & 2 deletions examples/metrics-prometheus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node .",
"demo": "./bin/demo.sh"
},
Expand Down
5 changes: 3 additions & 2 deletions examples/multi-tenancy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha --allow-console-logs \"dist/__tests__\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js",
"docker:build": "docker build -t @loopback/example-multi-tenancy .",
Expand All @@ -31,7 +31,8 @@
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node -r source-map-support/register .",
"clean": "lb-clean dist *.tsbuildinfo .eslintcache"
},
Expand Down
5 changes: 3 additions & 2 deletions examples/passport-login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/rest-crud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"verify": "npm pack && tar xf loopback-rest-crud*.tgz && tree package && npm run clean",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/rpc-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/soap-calculator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/todo-jwt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"verify": "npm pack && tar xf loopback-todo*.tgz && tree package && npm run clean",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"dependencies": {
Expand Down
5 changes: 3 additions & 2 deletions examples/todo-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"verify": "npm pack && tar xf loopback-todo-list*.tgz && tree package && npm run clean",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
"verify": "npm pack && tar xf loopback-todo*.tgz && tree package && npm run clean",
"premigrate": "npm run build ",
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/validation-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"prettier:fix": "npm run prettier:cli -- --write",
"eslint": "lb-eslint --report-unused-disable-directives .",
"eslint:fix": "npm run eslint -- --fix",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha --allow-console-logs \"dist/__tests__\"",
"posttest": "npm run lint",
"test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest",
Expand All @@ -34,7 +34,8 @@
"migrate": "node ./dist/migrate",
"preopenapi-spec": "npm run build",
"openapi-spec": "node ./dist/openapi-spec",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node -r source-map-support/register ."
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions examples/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
"prepack": "npm run build:webpack-web",
"clean": "lb-clean *example-webpack*.tgz dist *.tsbuildinfo package",
"verify": "npm pack && tar xf *example-webpack*.tgz && tree package && npm run clean",
"pretest": "npm run clean && npm run build",
"pretest": "npm run rebuild",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"prestart": "npm run build",
"rebuild": "npm run clean && npm run build",
"prestart": "npm run rebuild",
"start": "node ."
},
"repository": {
Expand Down

0 comments on commit 3e60be1

Please sign in to comment.