@jsii/runtime 1.84.0 → 1.86.0

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.
@@ -8,9 +8,14 @@ const path_1 = require("path");
8
8
  // Spawn another node process, with the following file descriptor setup:
9
9
  // - No STDIN will be provided
10
10
  // - STDOUT and STDERR will be intercepted, contents wrapped & forward to STDERR
11
- // - FD#3 is the communication pipe to read jsii API messages
12
- // - FD#4 is the communication pipe to write jsii API responses
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'] });
11
+ // - FD#3 is the communication pipe to read & write jsii API messages
12
+ const child = (0, child_process_1.spawn)(process.execPath, [
13
+ ...process.execArgv,
14
+ // Instruct the module loader to NOT resolve symbolic links, so we don't
15
+ // have to copy modules around all the time (which is expensive to do).
16
+ '--preserve-symlinks',
17
+ (0, path_1.resolve)(__dirname, '..', 'lib', 'program.js'),
18
+ ], { stdio: ['ignore', 'pipe', 'pipe', 'pipe'] });
14
19
  //#region Exit, error and signal forwarders
15
20
  child.once('end', (code, signal) => {
16
21
  var _a;
package/lib/host.d.ts CHANGED
@@ -8,6 +8,7 @@ export declare class KernelHost {
8
8
  debug?: boolean;
9
9
  debugTiming?: boolean;
10
10
  noStack?: boolean;
11
+ validateAssemblies?: boolean;
11
12
  });
12
13
  run(): void;
13
14
  once(event: 'exit', listener: (code: number) => void): void;
package/lib/host.js CHANGED
@@ -5,13 +5,14 @@ const kernel_1 = require("@jsii/kernel");
5
5
  const events_1 = require("events");
6
6
  class KernelHost {
7
7
  constructor(inout, opts = {}) {
8
- var _a, _b;
8
+ var _a, _b, _c;
9
9
  this.inout = inout;
10
10
  this.opts = opts;
11
11
  this.kernel = new kernel_1.Kernel(this.callbackHandler.bind(this));
12
12
  this.eventEmitter = new events_1.EventEmitter();
13
13
  this.kernel.traceEnabled = (_a = opts.debug) !== null && _a !== void 0 ? _a : false;
14
14
  this.kernel.debugTimingEnabled = (_b = opts.debugTiming) !== null && _b !== void 0 ? _b : false;
15
+ this.kernel.validateAssemblies = (_c = opts.validateAssemblies) !== null && _c !== void 0 ? _c : false;
15
16
  }
16
17
  run() {
17
18
  var _a;
@@ -31,7 +32,7 @@ class KernelHost {
31
32
  }
32
33
  callbackHandler(callback) {
33
34
  // write a "callback" response, which is a special response that tells
34
- // the client that there's synchonous callback it needs to invoke and
35
+ // the client that there's synchronous callback it needs to invoke and
35
36
  // bring back the result via a "complete" request.
36
37
  this.inout.write({ callback });
37
38
  return completeCallback.call(this);
package/lib/program.js CHANGED
@@ -10,6 +10,7 @@ const version = packageInfo.version;
10
10
  const noStack = !!process.env.JSII_NOSTACK;
11
11
  const debug = !!process.env.JSII_DEBUG;
12
12
  const debugTiming = !!process.env.JSII_DEBUG_TIMING;
13
+ const validateAssemblies = !!process.env.JSII_VALIDATE_ASSEMBLIES;
13
14
  // This assumes FD#3 is opened for reading and writing. This is normally
14
15
  // performed by`bin/jsii-runtime.js`, and we will not be verifying this once
15
16
  // again...Meaning that failure to have set this up correctly results in
@@ -24,7 +25,12 @@ const stdio = new sync_stdio_1.SyncStdio({
24
25
  writeFD: 3,
25
26
  });
26
27
  const inout = new in_out_1.InputOutput(stdio);
27
- const host = new host_1.KernelHost(inout, { debug, noStack, debugTiming });
28
+ const host = new host_1.KernelHost(inout, {
29
+ debug,
30
+ noStack,
31
+ debugTiming,
32
+ validateAssemblies,
33
+ });
28
34
  host.once('exit', process.exit.bind(process));
29
35
  // say hello
30
36
  inout.write({ hello: `${name}@${version}` });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsii/runtime",
3
- "version": "1.84.0",
3
+ "version": "1.86.0",
4
4
  "description": "jsii runtime kernel process",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -34,17 +34,17 @@
34
34
  "package": "package-js"
35
35
  },
36
36
  "dependencies": {
37
- "@jsii/kernel": "^1.84.0",
38
- "@jsii/check-node": "1.84.0",
39
- "@jsii/spec": "^1.84.0"
37
+ "@jsii/kernel": "^1.86.0",
38
+ "@jsii/check-node": "1.86.0",
39
+ "@jsii/spec": "^1.86.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@scope/jsii-calc-base": "^1.84.0",
43
- "@scope/jsii-calc-lib": "^1.84.0",
44
- "jsii-build-tools": "^1.84.0",
42
+ "@scope/jsii-calc-base": "^1.86.0",
43
+ "@scope/jsii-calc-lib": "^1.86.0",
44
+ "jsii-build-tools": "^1.86.0",
45
45
  "jsii-calc": "^3.20.120",
46
46
  "source-map-loader": "^4.0.1",
47
- "webpack": "^5.86.0",
47
+ "webpack": "^5.88.2",
48
48
  "webpack-cli": "^5.1.4"
49
49
  }
50
50
  }
@@ -1463,6 +1463,7 @@ var __webpack_modules__ = {
1463
1463
  comp = comp.value;
1464
1464
  }
1465
1465
  }
1466
+ comp = comp.trim().split(/\s+/).join(" ");
1466
1467
  debug("comparator", comp, options);
1467
1468
  this.options = options;
1468
1469
  this.loose = !!options.loose;
@@ -1549,7 +1550,7 @@ var __webpack_modules__ = {
1549
1550
  }
1550
1551
  module.exports = Comparator;
1551
1552
  const parseOptions = __webpack_require__(3867);
1552
- const {re, t} = __webpack_require__(9541);
1553
+ const {safeRe: re, t} = __webpack_require__(9541);
1553
1554
  const cmp = __webpack_require__(1918);
1554
1555
  const debug = __webpack_require__(5432);
1555
1556
  const SemVer = __webpack_require__(3013);
@@ -1575,10 +1576,10 @@ var __webpack_modules__ = {
1575
1576
  this.options = options;
1576
1577
  this.loose = !!options.loose;
1577
1578
  this.includePrerelease = !!options.includePrerelease;
1578
- this.raw = range;
1579
- this.set = range.split("||").map((r => this.parseRange(r.trim()))).filter((c => c.length));
1579
+ this.raw = range.trim().split(/\s+/).join(" ");
1580
+ this.set = this.raw.split("||").map((r => this.parseRange(r.trim()))).filter((c => c.length));
1580
1581
  if (!this.set.length) {
1581
- throw new TypeError(`Invalid SemVer Range: ${range}`);
1582
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
1582
1583
  }
1583
1584
  if (this.set.length > 1) {
1584
1585
  const first = this.set[0];
@@ -1604,7 +1605,6 @@ var __webpack_modules__ = {
1604
1605
  return this.range;
1605
1606
  }
1606
1607
  parseRange(range) {
1607
- range = range.trim();
1608
1608
  const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
1609
1609
  const memoKey = memoOpts + ":" + range;
1610
1610
  const cached = cache.get(memoKey);
@@ -1618,8 +1618,9 @@ var __webpack_modules__ = {
1618
1618
  range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1619
1619
  debug("comparator trim", range);
1620
1620
  range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1621
+ debug("tilde trim", range);
1621
1622
  range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1622
- range = range.split(/\s+/).join(" ");
1623
+ debug("caret trim", range);
1623
1624
  let rangeList = range.split(" ").map((comp => parseComparator(comp, this.options))).join(" ").split(/\s+/).map((comp => replaceGTE0(comp, this.options)));
1624
1625
  if (loose) {
1625
1626
  rangeList = rangeList.filter((comp => {
@@ -1677,7 +1678,7 @@ var __webpack_modules__ = {
1677
1678
  const Comparator = __webpack_require__(7706);
1678
1679
  const debug = __webpack_require__(5432);
1679
1680
  const SemVer = __webpack_require__(3013);
1680
- const {re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace} = __webpack_require__(9541);
1681
+ const {safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace} = __webpack_require__(9541);
1681
1682
  const {FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE} = __webpack_require__(9041);
1682
1683
  const isNullSet = c => c.value === "<0.0.0-0";
1683
1684
  const isAny = c => c.value === "";
@@ -1892,7 +1893,7 @@ var __webpack_modules__ = {
1892
1893
  3013: (module, __unused_webpack_exports, __webpack_require__) => {
1893
1894
  const debug = __webpack_require__(5432);
1894
1895
  const {MAX_LENGTH, MAX_SAFE_INTEGER} = __webpack_require__(9041);
1895
- const {re, t} = __webpack_require__(9541);
1896
+ const {safeRe: re, t} = __webpack_require__(9541);
1896
1897
  const parseOptions = __webpack_require__(3867);
1897
1898
  const {compareIdentifiers} = __webpack_require__(3650);
1898
1899
  class SemVer {
@@ -2123,8 +2124,10 @@ var __webpack_modules__ = {
2123
2124
  default:
2124
2125
  throw new Error(`invalid increment argument: ${release}`);
2125
2126
  }
2126
- this.format();
2127
- this.raw = this.version;
2127
+ this.raw = this.format();
2128
+ if (this.build.length) {
2129
+ this.raw += `+${this.build.join(".")}`;
2130
+ }
2128
2131
  return this;
2129
2132
  }
2130
2133
  }
@@ -2194,7 +2197,7 @@ var __webpack_modules__ = {
2194
2197
  4115: (module, __unused_webpack_exports, __webpack_require__) => {
2195
2198
  const SemVer = __webpack_require__(3013);
2196
2199
  const parse = __webpack_require__(7507);
2197
- const {re, t} = __webpack_require__(9541);
2200
+ const {safeRe: re, t} = __webpack_require__(9541);
2198
2201
  const coerce = (version, options) => {
2199
2202
  if (version instanceof SemVer) {
2200
2203
  return version;
@@ -2258,6 +2261,19 @@ var __webpack_modules__ = {
2258
2261
  const highVersion = v1Higher ? v1 : v2;
2259
2262
  const lowVersion = v1Higher ? v2 : v1;
2260
2263
  const highHasPre = !!highVersion.prerelease.length;
2264
+ const lowHasPre = !!lowVersion.prerelease.length;
2265
+ if (lowHasPre && !highHasPre) {
2266
+ if (!lowVersion.patch && !lowVersion.minor) {
2267
+ return "major";
2268
+ }
2269
+ if (highVersion.patch) {
2270
+ return "patch";
2271
+ }
2272
+ if (highVersion.minor) {
2273
+ return "minor";
2274
+ }
2275
+ return "major";
2276
+ }
2261
2277
  const prefix = highHasPre ? "pre" : "";
2262
2278
  if (v1.major !== v2.major) {
2263
2279
  return prefix + "major";
@@ -2268,16 +2284,7 @@ var __webpack_modules__ = {
2268
2284
  if (v1.patch !== v2.patch) {
2269
2285
  return prefix + "patch";
2270
2286
  }
2271
- if (highHasPre) {
2272
- return "prerelease";
2273
- }
2274
- if (lowVersion.patch) {
2275
- return "patch";
2276
- }
2277
- if (lowVersion.minor) {
2278
- return "minor";
2279
- }
2280
- return "major";
2287
+ return "prerelease";
2281
2288
  };
2282
2289
  module.exports = diff;
2283
2290
  },
@@ -2497,10 +2504,12 @@ var __webpack_modules__ = {
2497
2504
  const MAX_LENGTH = 256;
2498
2505
  const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
2499
2506
  const MAX_SAFE_COMPONENT_LENGTH = 16;
2507
+ const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
2500
2508
  const RELEASE_TYPES = [ "major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease" ];
2501
2509
  module.exports = {
2502
2510
  MAX_LENGTH,
2503
2511
  MAX_SAFE_COMPONENT_LENGTH,
2512
+ MAX_SAFE_BUILD_LENGTH,
2504
2513
  MAX_SAFE_INTEGER,
2505
2514
  RELEASE_TYPES,
2506
2515
  SEMVER_SPEC_VERSION,
@@ -2546,30 +2555,41 @@ var __webpack_modules__ = {
2546
2555
  module.exports = parseOptions;
2547
2556
  },
2548
2557
  9541: (module, exports, __webpack_require__) => {
2549
- const {MAX_SAFE_COMPONENT_LENGTH} = __webpack_require__(9041);
2558
+ const {MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH} = __webpack_require__(9041);
2550
2559
  const debug = __webpack_require__(5432);
2551
2560
  exports = module.exports = {};
2552
2561
  const re = exports.re = [];
2562
+ const safeRe = exports.safeRe = [];
2553
2563
  const src = exports.src = [];
2554
2564
  const t = exports.t = {};
2555
2565
  let R = 0;
2566
+ const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
2567
+ const safeRegexReplacements = [ [ "\\s", 1 ], [ "\\d", MAX_LENGTH ], [ LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH ] ];
2568
+ const makeSafeRegex = value => {
2569
+ for (const [token, max] of safeRegexReplacements) {
2570
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
2571
+ }
2572
+ return value;
2573
+ };
2556
2574
  const createToken = (name, value, isGlobal) => {
2575
+ const safe = makeSafeRegex(value);
2557
2576
  const index = R++;
2558
2577
  debug(name, index, value);
2559
2578
  t[name] = index;
2560
2579
  src[index] = value;
2561
2580
  re[index] = new RegExp(value, isGlobal ? "g" : undefined);
2581
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : undefined);
2562
2582
  };
2563
2583
  createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
2564
- createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+");
2565
- createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*");
2584
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
2585
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
2566
2586
  createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`);
2567
2587
  createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
2568
2588
  createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
2569
2589
  createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
2570
2590
  createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
2571
2591
  createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
2572
- createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+");
2592
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
2573
2593
  createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
2574
2594
  createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
2575
2595
  createToken("FULL", `^${src[t.FULLPLAIN]}$`);
@@ -3928,7 +3948,7 @@ var __webpack_exports__ = {};
3928
3948
  const console_1 = __webpack_require__(6206);
3929
3949
  const os_1 = __webpack_require__(2037);
3930
3950
  const path_1 = __webpack_require__(4822);
3931
- const child = (0, child_process_1.spawn)(process.execPath, [ ...process.execArgv, (0,
3951
+ const child = (0, child_process_1.spawn)(process.execPath, [ ...process.execArgv, "--preserve-symlinks", (0,
3932
3952
  path_1.resolve)(__dirname, "..", "lib", "program.js") ], {
3933
3953
  stdio: [ "ignore", "pipe", "pipe", "pipe" ]
3934
3954
  });