@delight-rpc/child-process 0.4.1 → 0.4.4

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.
package/README.md CHANGED
@@ -94,7 +94,8 @@ function createServer<IAPI extends object>(
94
94
  , options?: {
95
95
  parameterValidators?: DelightRPC.ParameterValidators<IAPI>
96
96
  version?: `${number}.${number}.${number}`
97
- channel?: string
97
+ channel?: string | RegExp | AnyChannel
98
+ ownPropsOnly?: boolean
98
99
  }
99
100
  ): () => void
100
101
  ```
package/lib/client.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import * as DelightRPC from 'delight-rpc';
3
4
  import { ChildProcess } from 'child_process';
4
5
  import { CustomError } from '@blackglory/errors';
package/lib/server.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import * as DelightRPC from 'delight-rpc';
3
4
  import { ChildProcess } from 'child_process';
4
- export declare function createServer<IAPI extends object>(api: DelightRPC.ImplementationOf<IAPI>, process: ChildProcess | NodeJS.Process, { parameterValidators, version, channel }?: {
5
+ export declare function createServer<IAPI extends object>(api: DelightRPC.ImplementationOf<IAPI>, process: ChildProcess | NodeJS.Process, { parameterValidators, version, channel, ownPropsOnly }?: {
5
6
  parameterValidators?: DelightRPC.ParameterValidators<IAPI>;
6
7
  version?: `${number}.${number}.${number}`;
7
- channel?: string;
8
+ channel?: string | RegExp | typeof DelightRPC.AnyChannel;
9
+ ownPropsOnly?: boolean;
8
10
  }): () => void;
package/lib/server.js CHANGED
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.createServer = void 0;
27
27
  const DelightRPC = __importStar(require("delight-rpc"));
28
28
  const prelude_1 = require("@blackglory/prelude");
29
- function createServer(api, process, { parameterValidators, version, channel } = {}) {
29
+ function createServer(api, process, { parameterValidators, version, channel, ownPropsOnly } = {}) {
30
30
  process.on('message', handler);
31
31
  return () => process.off('message', handler);
32
32
  async function handler(req) {
@@ -34,7 +34,8 @@ function createServer(api, process, { parameterValidators, version, channel } =
34
34
  const result = await DelightRPC.createResponse(api, req, {
35
35
  parameterValidators,
36
36
  version,
37
- channel
37
+ channel,
38
+ ownPropsOnly
38
39
  });
39
40
  if ((0, prelude_1.isntNull)(result)) {
40
41
  process.send(result);
package/lib/server.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyC;AAEzC,iDAA8C;AAE9C,SAAgB,YAAY,CAC1B,GAAsC,EACtC,OAAsC,EACtC,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,KAInC,EAAE;IAEN,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC9B,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAE5C,KAAK,UAAU,OAAO,CAAC,GAAQ;QAC7B,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC/D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,cAAc,CAC5C,GAAG,EACH,GAAG,EACH;gBACE,mBAAmB;gBACnB,OAAO;gBACP,OAAO;aACR,CACF,CAAA;YAED,IAAI,IAAA,kBAAQ,EAAC,MAAM,CAAC,EAAE;gBACpB,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAA;aACtB;SACF;IACH,CAAC;AACH,CAAC;AA7BD,oCA6BC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAyC;AAEzC,iDAA8C;AAE9C,SAAgB,YAAY,CAC1B,GAAsC,EACtC,OAAsC,EACtC,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,KAKjD,EAAE;IAEN,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC9B,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAE5C,KAAK,UAAU,OAAO,CAAC,GAAQ;QAC7B,IAAI,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC/D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,cAAc,CAC5C,GAAG,EACH,GAAG,EACH;gBACE,mBAAmB;gBACnB,OAAO;gBACP,OAAO;gBACP,YAAY;aACb,CACF,CAAA;YAED,IAAI,IAAA,kBAAQ,EAAC,MAAM,CAAC,EAAE;gBACpB,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAA;aACtB;SACF;IACH,CAAC;AACH,CAAC;AA/BD,oCA+BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delight-rpc/child-process",
3
- "version": "0.4.1",
3
+ "version": "0.4.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "files": [
@@ -11,6 +11,7 @@
11
11
  "repository": "git@github.com:delight-rpc/child-process.git",
12
12
  "author": "BlackGlory <woshenmedoubuzhidao@blackglory.me>",
13
13
  "license": "MIT",
14
+ "sideEffects": false,
14
15
  "scripts": {
15
16
  "prepare": "ts-patch install -s",
16
17
  "lint": "eslint --ext .js,.jsx,.ts,.tsx --quiet src",
@@ -30,34 +31,34 @@
30
31
  },
31
32
  "devDependencies": {
32
33
  "@blackglory/jest-matchers": "^0.3.1",
33
- "@commitlint/cli": "^16.2.4",
34
- "@commitlint/config-conventional": "^16.2.4",
35
- "@types/jest": "^27.5.0",
34
+ "@commitlint/cli": "^17.0.2",
35
+ "@commitlint/config-conventional": "^17.0.2",
36
+ "@types/jest": "^27.5.1",
36
37
  "@types/node": "14",
37
- "@typescript-eslint/eslint-plugin": "^5.22.0",
38
- "@typescript-eslint/parser": "^5.22.0",
38
+ "@typescript-eslint/eslint-plugin": "^5.29.0",
39
+ "@typescript-eslint/parser": "^5.29.0",
39
40
  "cross-env": "^7.0.3",
40
- "delight-rpc": "^4.0.0",
41
- "eslint": "8.15.0",
41
+ "delight-rpc": "^4.2.1",
42
+ "eslint": "8.18.0",
42
43
  "husky": "4",
43
44
  "jest": "^27.5.1",
44
45
  "npm-run-all": "^4.1.5",
45
46
  "return-style": "^1.0.0",
46
47
  "rimraf": "^3.0.2",
47
- "standard-version": "^9.3.2",
48
+ "standard-version": "^9.5.0",
48
49
  "ts-jest": "^27.1.4",
49
- "ts-node": "^10.7.0",
50
+ "ts-node": "^10.8.1",
50
51
  "ts-patch": "^2.0.1",
51
- "typescript": "^4.6.4",
52
+ "typescript": "^4.7.4",
52
53
  "typescript-transform-paths": "^3.3.1"
53
54
  },
54
55
  "dependencies": {
55
56
  "@blackglory/errors": "^2.2.1",
56
- "@blackglory/prelude": "^0.1.1",
57
+ "@blackglory/prelude": "^0.1.2",
57
58
  "@delight-rpc/protocol": "^2.2.0",
58
- "extra-promise": "^1.0.2"
59
+ "extra-promise": "^2.2.0"
59
60
  },
60
61
  "peerDependencies": {
61
- "delight-rpc": "^4.0.0"
62
+ "delight-rpc": "^4.2.1"
62
63
  }
63
64
  }