@jsii/runtime 1.61.0 → 1.63.1

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.
@@ -13,10 +13,11 @@ const path_1 = require("path");
13
13
  const child = (0, child_process_1.spawn)(process.execPath, [...process.execArgv, (0, path_1.resolve)(__dirname, '..', 'lib', 'program.js')], { stdio: ['ignore', 'pipe', 'pipe', 'pipe'] });
14
14
  //#region Exit, error and signal forwarders
15
15
  child.once('end', (code, signal) => {
16
+ var _a;
16
17
  if (signal != null) {
17
18
  // Child was killed by signal, this is usually reflected by exiting with
18
19
  // 128 + <signal code>
19
- process.exit(128 + (os_1.constants.signals[signal] ?? 0));
20
+ process.exit(128 + ((_a = os_1.constants.signals[signal]) !== null && _a !== void 0 ? _a : 0));
20
21
  }
21
22
  // Child exited, so we reflect it's exit code to our creator
22
23
  process.exit(code);
@@ -0,0 +1,13 @@
1
+ import { overriddenConfig } from '../../../jest.config.mjs';
2
+
3
+ export default overriddenConfig({
4
+ coveragePathIgnorePatterns: [
5
+ // This cannot be tested in a way that enables collection of coverage
6
+ '<rootDir>/lib/sync-stdio.ts',
7
+ ],
8
+ coverageThreshold: {
9
+ global: {
10
+ branches: 48,
11
+ },
12
+ },
13
+ });
package/lib/host.js CHANGED
@@ -12,9 +12,10 @@ class KernelHost {
12
12
  this.kernel.traceEnabled = opts.debug ? true : false;
13
13
  }
14
14
  run() {
15
+ var _a;
15
16
  const req = this.inout.read();
16
17
  if (!req || 'exit' in req) {
17
- this.eventEmitter.emit('exit', req?.exit ?? 0);
18
+ this.eventEmitter.emit('exit', (_a = req === null || req === void 0 ? void 0 : req.exit) !== null && _a !== void 0 ? _a : 0);
18
19
  return; // done
19
20
  }
20
21
  this.processRequest(req, () => {
@@ -149,7 +150,7 @@ class KernelHost {
149
150
  * Returns true if the value is a promise.
150
151
  */
151
152
  isPromise(v) {
152
- return typeof v?.then === 'function';
153
+ return typeof (v === null || v === void 0 ? void 0 : v.then) === 'function';
153
154
  }
154
155
  /**
155
156
  * Given a kernel api name, returns the function to invoke.
package/lib/program.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ var _a;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  const packageInfo = require("../package.json");
4
5
  const host_1 = require("./host");
@@ -17,7 +18,7 @@ const stdio = new sync_stdio_1.SyncStdio({
17
18
  // absent in certain circumstances (for example, in `worker_threads` workers).
18
19
  // We'll fall-back to `2` - its expected value - in this case; but this is not
19
20
  // supposed to be happening here (we don't use `worker_threads`).
20
- errorFD: process.stderr.fd ?? 2,
21
+ errorFD: (_a = process.stderr.fd) !== null && _a !== void 0 ? _a : 2,
21
22
  readFD: 3,
22
23
  writeFD: 3,
23
24
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsii/runtime",
3
- "version": "1.61.0",
3
+ "version": "1.63.1",
4
4
  "description": "jsii runtime kernel process",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -34,14 +34,14 @@
34
34
  "package": "package-js"
35
35
  },
36
36
  "dependencies": {
37
- "@jsii/kernel": "^1.61.0",
38
- "@jsii/check-node": "1.61.0",
39
- "@jsii/spec": "^1.61.0"
37
+ "@jsii/kernel": "^1.63.1",
38
+ "@jsii/check-node": "1.63.1",
39
+ "@jsii/spec": "^1.63.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@scope/jsii-calc-base": "^1.61.0",
43
- "@scope/jsii-calc-lib": "^1.61.0",
44
- "jsii-build-tools": "^1.61.0",
42
+ "@scope/jsii-calc-base": "^1.63.1",
43
+ "@scope/jsii-calc-lib": "^1.63.1",
44
+ "jsii-build-tools": "^1.63.1",
45
45
  "jsii-calc": "^3.20.120",
46
46
  "source-map-loader": "^4.0.0",
47
47
  "webpack": "^5.73.0",
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const kernel_1 = require("@jsii/kernel");
4
+ const spec_1 = require("@jsii/spec");
4
5
  const child = require("child_process");
5
6
  const fs = require("fs");
6
7
  const path = require("path");
@@ -70,8 +71,7 @@ function loadRequest(library) {
70
71
  tarball,
71
72
  };
72
73
  function loadAssembly() {
73
- const assemblyFile = path.resolve(require.resolve(`${library}/package.json`), '..', '.jsii');
74
- return JSON.parse(fs.readFileSync(assemblyFile, { encoding: 'utf-8' }));
74
+ return (0, spec_1.loadAssemblyFromPath)(path.resolve(require.resolve(`${library}/package.json`), '..'));
75
75
  }
76
76
  function packageLibrary(target) {
77
77
  const targetDir = path.dirname(target);
@@ -3706,7 +3706,7 @@ var __webpack_modules__ = {
3706
3706
  endOfLife: new Date("2023-04-30"),
3707
3707
  supportedRange: "^14.6.0"
3708
3708
  }), new NodeRelease(16, {
3709
- endOfLife: new Date("2024-04-30"),
3709
+ endOfLife: new Date("2023-09-11"),
3710
3710
  supportedRange: "^16.3.0"
3711
3711
  }), new NodeRelease(17, {
3712
3712
  endOfLife: new Date("2022-06-01"),
@@ -3839,8 +3839,9 @@ var __webpack_exports__ = {};
3839
3839
  stdio: [ "ignore", "pipe", "pipe", "pipe" ]
3840
3840
  });
3841
3841
  child.once("end", ((code, signal) => {
3842
+ var _a;
3842
3843
  if (signal != null) {
3843
- process.exit(128 + (os_1.constants.signals[signal] ?? 0));
3844
+ process.exit(128 + ((_a = os_1.constants.signals[signal]) !== null && _a !== void 0 ? _a : 0));
3844
3845
  }
3845
3846
  process.exit(code);
3846
3847
  }));