@golar/plugin 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import worker_threads from "node:worker_threads";
5
5
 
6
6
  //#region src/index.ts
7
7
  const HEADER_SIZE = 5;
8
+ const PROTOCOL_VERSION = 1;
8
9
  const MSG_KIND = {
9
10
  CREATE_SERVICE_CODE: 0,
10
11
  CREATE_SERVICE_CODE_RESPONSE: 1
@@ -43,11 +44,15 @@ function createPlugin(opts) {
43
44
  }
44
45
  }
45
46
  {
46
- const initialization = JSON.stringify({ extraExtensions: opts.extraExtensions ?? [] });
47
+ const initialization = JSON.stringify({
48
+ protocolVersion: PROTOCOL_VERSION,
49
+ extraExtensions: opts.extraExtensions ?? []
50
+ });
47
51
  recvBuffer.writeUint32LE(Buffer.byteLength(initialization));
48
52
  process.stdout.write(recvBuffer.subarray(0, 4));
49
53
  process.stdout.write(initialization);
50
54
  }
55
+ process.stdin.on("end", () => process.exit(0));
51
56
  process.stdin.on("data", (data) => {
52
57
  assert.ok(data instanceof Buffer, "Data is expected to be buffer");
53
58
  ensureRecvBuffer(recvBufferLen + data.byteLength);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golar/plugin",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"