Skip to content
This repository was archived by the owner on Sep 10, 2019. It is now read-only.

Commit 9e3bdad

Browse files
committed
feat: use nodemon with custom gateways
1 parent 120f0b5 commit 9e3bdad

File tree

4 files changed

+2656
-483
lines changed

4 files changed

+2656
-483
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"graphql-playground-middleware-express": "^1.3.8",
4646
"mkdirp": "^0.5.1",
4747
"node-cleanup": "^2.1.2",
48+
"nodemon": "^1.19.0",
4849
"yargs": "^10.0.3"
4950
},
5051
"peerDependencies": {

src/dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const startGateway = ({
2929
: '';
3030

3131
// Start the user-specified gateway.
32-
spawn('node', [gateway], { stdio: 'inherit' });
32+
spawn('nodemon', ['-e', 'js,graphql', gateway], { stdio: 'inherit' });
3333
return;
3434
}
3535

test/dev.test.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ describe('gramps dev', () => {
8989

9090
expect(process.env.GRAMPS_MODE).toEqual('live');
9191
expect(process.env.GRAMPS_DATA_SOURCES).toEqual('');
92-
expect(crossSpawn.spawn).toBeCalledWith('node', ['./gateway.js'], {
93-
stdio: 'inherit',
94-
});
92+
expect(crossSpawn.spawn).toBeCalledWith(
93+
'nodemon',
94+
['-e', 'js,graphql', './gateway.js'],
95+
{
96+
stdio: 'inherit',
97+
},
98+
);
9599
});
96100

97101
it('starts a custom gateway in mock mode when flag is set', async () => {

0 commit comments

Comments
 (0)