Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 413d7c9

Browse files
committed
Update npm modules; a small fix in scripts/start.js
1 parent 0ca7ced commit 413d7c9

File tree

4 files changed

+140
-130
lines changed

4 files changed

+140
-130
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ git clone -o graphql-starter-kit -b master --single-branch \
4949
https://github.com/kriasoft/graphql-starter-kit.git api.example.com
5050
cd api.example.com
5151
yarn install # Install project dependencies. Alternatively, npm install
52-
npm run db:create # Create a new database (see .env/DATABASE_URL)
53-
npm run db:migrate # Migrate database schema to the latest version
54-
npm run start # Launch the app. Alternatively, node scripts/start.js
52+
yarn run db:create # Create a new database (see .env/DATABASE_URL)
53+
yarn run db:migrate # Migrate database schema to the latest version
54+
yarn start # Launch the app. Alternatively, node scripts/start.js
5555
```
5656

5757
The GraphQL server should become available at [http://localhost:5000/](http://localhost:5000/)
@@ -60,8 +60,8 @@ The GraphQL server should become available at [http://localhost:5000/](http://lo
6060
If you just need to build the project without launching a dev server, run one of these two commands:
6161

6262
```bash
63-
npm run build # Compiles the app into the /build folder
64-
npm run build:watch # Compiles the app and starts watching for changes
63+
yarn run build # Compiles the app into the /build folder
64+
yarn run build:watch # Compiles the app and starts watching for changes
6565
```
6666

6767

@@ -73,34 +73,34 @@ the way how to get to the new state and how to revert the changes in order to ge
7373
state.
7474

7575
```bash
76-
npm run db:create # Create a new database
77-
npm run db:drop # Drop the database
78-
npm run db:version # Print database schema version
79-
npm run db:migrate # Migrate database schema to the latest version
80-
npm run db:migrate:undo # Rollback the latest migration
81-
npm run db:migration <name> # Create a new migration from the template (see /migrations folder)
82-
npm run db:seed # Import reference data
76+
yarn run db:create # Create a new database
77+
yarn run db:drop # Drop the database
78+
yarn run db:version # Print database schema version
79+
yarn run db:migrate # Migrate database schema to the latest version
80+
yarn run db:migrate:undo # Rollback the latest migration
81+
yarn run db:migration <name> # Create a new migration from the template (see /migrations folder)
82+
yarn run db:seed # Import reference data
8383
```
8484

8585

8686
## Testing
8787

8888
```bash
89-
npm run lint # Find problematic patterns in code
90-
npm run check # Check source code for type errors
91-
npm run test # Run unit tests once
92-
npm run test:watch # Run unit tests in watch mode
89+
yarn run lint # Find problematic patterns in code
90+
yarn run check # Check source code for type errors
91+
yarn run test # Run unit tests once
92+
yarn run test:watch # Run unit tests in watch mode
9393
```
9494

9595

9696
## Debugging
9797

9898
```bash
9999
# Option 1:
100-
npm run build && node build/server.js --debug --nolazy
100+
yarn run build && node build/server.js --debug --nolazy
101101

102102
# Option 2:
103-
npm run start -- --debug --nolazy
103+
yarn run start -- --debug --nolazy
104104
```
105105

106106
After launching the app in a debug mode [attach your debugger](https://code.visualstudio.com/Docs/editor/debugging)

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,36 @@
1414
"express-graphql": "^0.6.1",
1515
"express-jwt": "^5.1.0",
1616
"graphql": "^0.8.2",
17-
"jsonwebtoken": "^7.1.9",
17+
"jsonwebtoken": "^7.2.1",
1818
"knex": "^0.12.6",
1919
"passport": "^0.3.2",
2020
"passport-facebook": "^2.1.1",
2121
"passport-google-oauth": "^1.0.0",
2222
"passport-twitter": "^1.0.4",
23-
"pg": "^6.1.0",
24-
"pg-pool": "^1.5.0",
23+
"pg": "^6.1.1",
24+
"pg-pool": "^1.6.0",
2525
"pretty-error": "^2.0.2",
2626
"source-map-support": "^0.4.6"
2727
},
2828
"devDependencies": {
2929
"babel-cli": "^6.18.0",
30-
"babel-core": "^6.18.2",
30+
"babel-core": "^6.20.0",
3131
"babel-eslint": "^7.1.1",
3232
"babel-plugin-syntax-async-functions": "^6.13.0",
33-
"babel-plugin-syntax-trailing-function-commas": "^6.13.0",
33+
"babel-plugin-syntax-trailing-function-commas": "^6.20.0",
3434
"babel-plugin-transform-async-to-module-method": "^6.16.0",
3535
"babel-plugin-transform-class-properties": "^6.19.0",
3636
"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0",
3737
"babel-plugin-transform-export-extensions": "^6.8.0",
3838
"babel-plugin-transform-flow-strip-types": "^6.18.0",
39-
"babel-plugin-transform-object-rest-spread": "^6.19.0",
39+
"babel-plugin-transform-object-rest-spread": "^6.20.2",
4040
"babel-plugin-transform-runtime": "^6.15.0",
4141
"babel-register": "^6.18.0",
4242
"chai": "^3.5.0",
4343
"chai-http": "^3.0.0",
4444
"cp-file": "^4.1.1",
45-
"eslint": "^3.11.0",
46-
"eslint-config-airbnb-base": "^10.0.1",
45+
"eslint": "^3.12.0",
46+
"eslint-config-airbnb-base": "^11.0.0",
4747
"eslint-plugin-flowtype": "^2.29.1",
4848
"eslint-plugin-import": "^2.2.0",
4949
"flow-bin": "^0.36.0",

scripts/start.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,29 @@ const nodemon = require('nodemon');
1212
const setup = require('./setup');
1313
const task = require('../src/utils/task');
1414

15-
module.exports = task('start', () => setup().then(() => new Promise(resolve => {
16-
process.on('SIGINT', () => {
17-
nodemon.emit('exit');
18-
process.exit();
19-
});
20-
process.stdout.write('\033c');
21-
nodemon({
15+
module.exports = task('start', () => setup().then(() => new Promise((resolve) => {
16+
let start;
17+
18+
const nm = nodemon({
2219
watch: [path.join(__dirname, '../src')],
2320
ignore: [],
2421
stdin: false,
2522
script: 'src/server.js',
2623
nodeArgs: ['--require', 'babel-register', ...process.argv.filter(x => x.startsWith('-'))],
2724
stdout: false,
2825
})
29-
.on('stdout', data => {
26+
.on('stdout', (data) => {
3027
if (data.toString().includes(' is listening on ')) {
31-
process.stdout.write('\033c');
28+
console.log(`Finished 'build' after ${new Date().getTime() - start.getTime()}ms`);
3229
}
3330
process.stdout.write(data);
3431
})
3532
.on('stderr', data => process.stderr.write(data))
36-
.on('start', () => process.stdout.write('\033cBuilding...'));
33+
.on('start', () => {
34+
start = new Date();
35+
console.log('Starting \'build\'...');
36+
});
37+
38+
process.on('exit', () => nm.emit.bind(nm, 'exit'));
39+
process.once('SIGINT', process.exit.bind(process, 0));
3740
})));

0 commit comments

Comments
 (0)