Skip to content

Commit 09ac92d

Browse files
committed
feat: added npm run start and npm run dev
These 2 commands launch the Polykey Agent. The difference is that `npm run dev` uses `nodemon`. This monitors the `src`, `package.json`, `package-lock.json` and `tsconfig.json` and will auto-reload the Polykey agent by sending `SIGTERM` to it. Note that auto-reloading is best used with defined environment variables in the `.env`, in particular `PK_PASSWORD` and `PK_NODE_PATH`. During development, you can define other env variables which will ensure a repeatable agent server that uses the same host and port. The `nodemon` is controlled by `nodemon.json`. It automatically uses `ts-node` to run the TS code. It is possible to force a restart by running `rs` too.
1 parent 6d60c30 commit 09ac92d

File tree

4 files changed

+374
-1
lines changed

4 files changed

+374
-1
lines changed

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/tsconfig.build.json
66
/babel.config.js
77
/jest.config.js
8+
/nodemon.json
89
/scripts
910
/src
1011
/tests

nodemon.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"restartable": "rs",
3+
"verbose": true,
4+
"watch": [
5+
"./src/**",
6+
"./package.json",
7+
"./package-lock.json",
8+
"./tsconfig.json"
9+
],
10+
"ext": "ts,js,json",
11+
"signal": "SIGTERM"
12+
}

0 commit comments

Comments
 (0)