@pm2/agent
Advanced tools
Comparing version 2.0.4 to 2.1.0
@@ -64,2 +64,3 @@ /** | ||
IS_BUN : typeof Bun !== 'undefined', | ||
PM2_HOME: PM2_HOME, | ||
@@ -66,0 +67,0 @@ DAEMON_RPC_PORT: path.resolve(PM2_HOME, 'rpc.sock'), |
{ | ||
"name": "@pm2/agent", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"description": "PM2.io Agent Daemon", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "test" | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/keymetrics/pm2-io-agent.git" | ||
}, | ||
@@ -26,6 +27,5 @@ "scripts": { | ||
"fclone": "~1.0.11", | ||
"nssocket": "0.6.0", | ||
"pm2-axon": "~4.0.1", | ||
"pm2-axon-rpc": "~0.7.0", | ||
"proxy-agent": "~6.3.0", | ||
"proxy-agent": "~6.4.0", | ||
"semver": "~7.5.0", | ||
@@ -36,3 +36,3 @@ "ws": "~7.5.10" | ||
"clone": "^2.1.1", | ||
"mocha": "^7.1", | ||
"mocha": "^10.8.0", | ||
"nock": "^13.0.11", | ||
@@ -39,0 +39,0 @@ "simple-socks": "^2.0.2" |
@@ -7,6 +7,2 @@ # pm2-io-agent | ||
Two transporters are available now, AxonTransporter and WebsocketTransporter. | ||
AxonTransporter is using [axon pub-emitter](https://github.com/tj/axon) to send data (PushInteractor) to interaction server and [nssocket](https://github.com/foreverjs/nssocket) to receive data from reverse interaction server. | ||
WebsocketTransporter is using [websocket](https://github.com/websockets/ws) to send and receive data from websocket server. | ||
@@ -50,7 +46,7 @@ | ||
To configure this agent you can use `config.json`. | ||
To configure this agent you can use `config.json`. | ||
### Default | ||
By default `AxonTransporter` is enabled and using `push` and `reverse` bucket's endpoint. | ||
By default `AxonTransporter` is enabled and using `push` and `reverse` bucket's endpoint. | ||
You can override this endpoints with `AGENT_PUSH_ENDPOINT` and `AGENT_REVERSE_ENDPOINT` environements' vars | ||
@@ -62,37 +58,8 @@ | ||
Into this configuration you can put `transporter name` as key and for values, two keys are available `enabled` and `endpoints`. | ||
Into this configuration you can put `transporter name` as key and for values, two keys are available `enabled` and `endpoints`. | ||
The `enabled` key is using to disable or enable transporter. | ||
The `endpoints` key can be a string or an object. It depends on what the connect method of the transporter needs. | ||
The `endpoints` key can be a string or an object. It depends on what the connect method of the transporter needs. | ||
If you set a string, the connect method will be called with endpoint's value or raw value if no endpoint is matched. | ||
For objects, the connect method will be called with this object, and value of the keys will be replaced by endpoint's value or raw value if no endpoint is matched. | ||
## Release | ||
To release a new version, first install [gren](https://github.com/github-tools/github-release-notes) : | ||
```bash | ||
yarn global add github-release-notes | ||
``` | ||
Push a commit in github with the new version you want to release : | ||
``` | ||
git commit -am "version: major|minor|patch bump to X.X.X" | ||
``` | ||
Care for the **versionning**, we use the [semver versioning](https://semver.org/) currently. Please be careful about the version when pushing a new package. | ||
Then tag a version with git : | ||
```bash | ||
git tag -s vX.X.X | ||
``` | ||
Push the tag into github (this will trigger the publish to npm) : | ||
``` | ||
git push origin vX.X.X | ||
``` | ||
To finish update the changelog of the release on github with `gren` (be sure that gren has selected the right tags): | ||
``` | ||
gren release -o -D commits -u keymetrics -r pm2-io-agent | ||
``` |
@@ -182,8 +182,9 @@ 'use strict' | ||
let binary = process.execPath | ||
if (binary.indexOf('node') === -1) { | ||
if (cst.IS_BUN === true) | ||
binary = process.execPath | ||
else if (binary.indexOf('node') === -1) | ||
binary = 'node' | ||
} | ||
if (process.env.NODEJS_EXECUTABLE) { | ||
if (process.env.NODEJS_EXECUTABLE) | ||
binary = process.env.NODEJS_EXECUTABLE | ||
} | ||
@@ -205,3 +206,4 @@ const child = childProcess.spawn(binary, [InteractorJS], { | ||
}, process.env), | ||
stdio: ['ipc', out, err] | ||
stdio: [null, out, err, 'ipc'], // Redirect stdout, stderr, and enable IPC | ||
//stdio: ['ipc', out, err] | ||
}) | ||
@@ -227,2 +229,3 @@ | ||
} | ||
return cb() | ||
@@ -241,3 +244,4 @@ }) | ||
child.removeAllListeners() | ||
child.disconnect() | ||
if (child.disconnect) | ||
child.disconnect() | ||
return cb(null, {}, child) | ||
@@ -255,2 +259,4 @@ }, 7000) | ||
child.removeAllListeners('error') | ||
if (cst.IS_BUN === true) | ||
child.removeAllListeners('close') | ||
child.disconnect() | ||
@@ -257,0 +263,0 @@ |
@@ -40,3 +40,4 @@ 'use strict' | ||
this._internalDebugger() | ||
if (cst.IS_BUN === false) | ||
this._internalDebugger() | ||
} | ||
@@ -43,0 +44,0 @@ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
240189
12
86
25
3392
63
+ Addedproxy-agent@6.4.0(transitive)
- Removednssocket@0.6.0
- Removedeventemitter2@0.4.14(transitive)
- Removedlazy@1.0.11(transitive)
- Removednssocket@0.6.0(transitive)
- Removedproxy-agent@6.3.1(transitive)
Updatedproxy-agent@~6.4.0