@jsii/runtime 1.57.0 → 1.58.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsii/runtime",
3
- "version": "1.57.0",
3
+ "version": "1.58.0",
4
4
  "description": "jsii runtime kernel process",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -34,24 +34,24 @@
34
34
  "package": "package-js"
35
35
  },
36
36
  "dependencies": {
37
- "@jsii/kernel": "^1.57.0",
38
- "@jsii/check-node": "1.57.0",
39
- "@jsii/spec": "^1.57.0"
37
+ "@jsii/kernel": "^1.58.0",
38
+ "@jsii/check-node": "1.58.0",
39
+ "@jsii/spec": "^1.58.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@scope/jsii-calc-base": "^1.57.0",
43
- "@scope/jsii-calc-lib": "^1.57.0",
42
+ "@scope/jsii-calc-base": "^1.58.0",
43
+ "@scope/jsii-calc-lib": "^1.58.0",
44
44
  "@types/jest": "^27.4.1",
45
- "@types/node": "^12.20.47",
46
- "eslint": "^8.12.0",
45
+ "@types/node": "^12.20.48",
46
+ "eslint": "^8.13.0",
47
47
  "jest": "^27.5.1",
48
- "jsii-build-tools": "^1.57.0",
48
+ "jsii-build-tools": "^1.58.0",
49
49
  "jsii-calc": "^3.20.120",
50
50
  "prettier": "^2.6.2",
51
51
  "source-map-loader": "^3.0.1",
52
52
  "ts-jest": "^27.1.4",
53
53
  "typescript": "~3.9.10",
54
- "webpack": "^5.71.0",
54
+ "webpack": "^5.72.0",
55
55
  "webpack-cli": "^4.9.2"
56
56
  }
57
57
  }
@@ -1812,14 +1812,16 @@ var __webpack_modules__ = {
1812
1812
  this.loose = !!options.loose;
1813
1813
  this.includePrerelease = !!options.includePrerelease;
1814
1814
  this.raw = range;
1815
- this.set = range.split(/\s*\|\|\s*/).map((range => this.parseRange(range.trim()))).filter((c => c.length));
1815
+ this.set = range.split("||").map((r => this.parseRange(r.trim()))).filter((c => c.length));
1816
1816
  if (!this.set.length) {
1817
1817
  throw new TypeError(`Invalid SemVer Range: ${range}`);
1818
1818
  }
1819
1819
  if (this.set.length > 1) {
1820
1820
  const first = this.set[0];
1821
1821
  this.set = this.set.filter((c => !isNullSet(c[0])));
1822
- if (this.set.length === 0) this.set = [ first ]; else if (this.set.length > 1) {
1822
+ if (this.set.length === 0) {
1823
+ this.set = [ first ];
1824
+ } else if (this.set.length > 1) {
1823
1825
  for (const c of this.set) {
1824
1826
  if (c.length === 1 && isAny(c[0])) {
1825
1827
  this.set = [ c ];
@@ -1842,25 +1844,37 @@ var __webpack_modules__ = {
1842
1844
  const memoOpts = Object.keys(this.options).join(",");
1843
1845
  const memoKey = `parseRange:${memoOpts}:${range}`;
1844
1846
  const cached = cache.get(memoKey);
1845
- if (cached) return cached;
1847
+ if (cached) {
1848
+ return cached;
1849
+ }
1846
1850
  const loose = this.options.loose;
1847
1851
  const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1848
1852
  range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1849
1853
  debug("hyphen replace", range);
1850
1854
  range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1851
- debug("comparator trim", range, re[t.COMPARATORTRIM]);
1855
+ debug("comparator trim", range);
1852
1856
  range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1853
1857
  range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1854
1858
  range = range.split(/\s+/).join(" ");
1855
- const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1856
- const rangeList = range.split(" ").map((comp => parseComparator(comp, this.options))).join(" ").split(/\s+/).map((comp => replaceGTE0(comp, this.options))).filter(this.options.loose ? comp => !!comp.match(compRe) : () => true).map((comp => new Comparator(comp, this.options)));
1857
- const l = rangeList.length;
1859
+ let rangeList = range.split(" ").map((comp => parseComparator(comp, this.options))).join(" ").split(/\s+/).map((comp => replaceGTE0(comp, this.options)));
1860
+ if (loose) {
1861
+ rangeList = rangeList.filter((comp => {
1862
+ debug("loose invalid filter", comp, this.options);
1863
+ return !!comp.match(re[t.COMPARATORLOOSE]);
1864
+ }));
1865
+ }
1866
+ debug("range list", rangeList);
1858
1867
  const rangeMap = new Map;
1859
- for (const comp of rangeList) {
1860
- if (isNullSet(comp)) return [ comp ];
1868
+ const comparators = rangeList.map((comp => new Comparator(comp, this.options)));
1869
+ for (const comp of comparators) {
1870
+ if (isNullSet(comp)) {
1871
+ return [ comp ];
1872
+ }
1861
1873
  rangeMap.set(comp.value, comp);
1862
1874
  }
1863
- if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
1875
+ if (rangeMap.size > 1 && rangeMap.has("")) {
1876
+ rangeMap.delete("");
1877
+ }
1864
1878
  const result = [ ...rangeMap.values() ];
1865
1879
  cache.set(memoKey, result);
1866
1880
  return result;
@@ -1925,7 +1939,7 @@ var __webpack_modules__ = {
1925
1939
  return comp;
1926
1940
  };
1927
1941
  const isX = id => !id || id.toLowerCase() === "x" || id === "*";
1928
- const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp => replaceTilde(comp, options))).join(" ");
1942
+ const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((c => replaceTilde(c, options))).join(" ");
1929
1943
  const replaceTilde = (comp, options) => {
1930
1944
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1931
1945
  return comp.replace(r, ((_, M, m, p, pr) => {
@@ -1947,7 +1961,7 @@ var __webpack_modules__ = {
1947
1961
  return ret;
1948
1962
  }));
1949
1963
  };
1950
- const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp => replaceCaret(comp, options))).join(" ");
1964
+ const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((c => replaceCaret(c, options))).join(" ");
1951
1965
  const replaceCaret = (comp, options) => {
1952
1966
  debug("caret", comp, options);
1953
1967
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
@@ -1994,7 +2008,7 @@ var __webpack_modules__ = {
1994
2008
  };
1995
2009
  const replaceXRanges = (comp, options) => {
1996
2010
  debug("replaceXRanges", comp, options);
1997
- return comp.split(/\s+/).map((comp => replaceXRange(comp, options))).join(" ");
2011
+ return comp.split(/\s+/).map((c => replaceXRange(c, options))).join(" ");
1998
2012
  };
1999
2013
  const replaceXRange = (comp, options) => {
2000
2014
  comp = comp.trim();
@@ -2038,7 +2052,9 @@ var __webpack_modules__ = {
2038
2052
  m = +m + 1;
2039
2053
  }
2040
2054
  }
2041
- if (gtlt === "<") pr = "-0";
2055
+ if (gtlt === "<") {
2056
+ pr = "-0";
2057
+ }
2042
2058
  ret = `${gtlt + M}.${m}.${p}${pr}`;
2043
2059
  } else if (xm) {
2044
2060
  ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
@@ -2316,7 +2332,7 @@ var __webpack_modules__ = {
2316
2332
  }
2317
2333
  }
2318
2334
  if (identifier) {
2319
- if (this.prerelease[0] === identifier) {
2335
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
2320
2336
  if (isNaN(this.prerelease[1])) {
2321
2337
  this.prerelease = [ identifier, 0 ];
2322
2338
  }
@@ -2354,13 +2370,21 @@ var __webpack_modules__ = {
2354
2370
  const cmp = (a, op, b, loose) => {
2355
2371
  switch (op) {
2356
2372
  case "===":
2357
- if (typeof a === "object") a = a.version;
2358
- if (typeof b === "object") b = b.version;
2373
+ if (typeof a === "object") {
2374
+ a = a.version;
2375
+ }
2376
+ if (typeof b === "object") {
2377
+ b = b.version;
2378
+ }
2359
2379
  return a === b;
2360
2380
 
2361
2381
  case "!==":
2362
- if (typeof a === "object") a = a.version;
2363
- if (typeof b === "object") b = b.version;
2382
+ if (typeof a === "object") {
2383
+ a = a.version;
2384
+ }
2385
+ if (typeof b === "object") {
2386
+ b = b.version;
2387
+ }
2364
2388
  return a !== b;
2365
2389
 
2366
2390
  case "":
@@ -2417,7 +2441,9 @@ var __webpack_modules__ = {
2417
2441
  }
2418
2442
  re[t.COERCERTL].lastIndex = -1;
2419
2443
  }
2420
- if (match === null) return null;
2444
+ if (match === null) {
2445
+ return null;
2446
+ }
2421
2447
  return parse(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options);
2422
2448
  };
2423
2449
  module.exports = coerce;
@@ -2488,7 +2514,7 @@ var __webpack_modules__ = {
2488
2514
  options = undefined;
2489
2515
  }
2490
2516
  try {
2491
- return new SemVer(version, options).inc(release, identifier).version;
2517
+ return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier).version;
2492
2518
  } catch (er) {
2493
2519
  return null;
2494
2520
  }
@@ -2682,9 +2708,9 @@ var __webpack_modules__ = {
2682
2708
  const opts = [ "includePrerelease", "loose", "rtl" ];
2683
2709
  const parseOptions = options => !options ? {} : typeof options !== "object" ? {
2684
2710
  loose: true
2685
- } : opts.filter((k => options[k])).reduce(((options, k) => {
2686
- options[k] = true;
2687
- return options;
2711
+ } : opts.filter((k => options[k])).reduce(((o, k) => {
2712
+ o[k] = true;
2713
+ return o;
2688
2714
  }), {});
2689
2715
  module.exports = parseOptions;
2690
2716
  },
@@ -2698,7 +2724,7 @@ var __webpack_modules__ = {
2698
2724
  let R = 0;
2699
2725
  const createToken = (name, value, isGlobal) => {
2700
2726
  const index = R++;
2701
- debug(index, value);
2727
+ debug(name, index, value);
2702
2728
  t[name] = index;
2703
2729
  src[index] = value;
2704
2730
  re[index] = new RegExp(value, isGlobal ? "g" : undefined);
@@ -2744,8 +2770,8 @@ var __webpack_modules__ = {
2744
2770
  createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`);
2745
2771
  createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`);
2746
2772
  createToken("STAR", "(<|>)?=?\\s*\\*");
2747
- createToken("GTE0", "^\\s*>=\\s*0.0.0\\s*$");
2748
- createToken("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$");
2773
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
2774
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
2749
2775
  },
2750
2776
  4933: (module, __unused_webpack_exports, __webpack_require__) => {
2751
2777
  const outside = __webpack_require__(939);
@@ -2858,7 +2884,9 @@ var __webpack_modules__ = {
2858
2884
  throw new Error(`Unexpected operation: ${comparator.operator}`);
2859
2885
  }
2860
2886
  }));
2861
- if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
2887
+ if (setMin && (!minver || gt(minver, setMin))) {
2888
+ minver = setMin;
2889
+ }
2862
2890
  }
2863
2891
  if (minver && range.test(minver)) {
2864
2892
  return minver;
@@ -2938,26 +2966,40 @@ var __webpack_modules__ = {
2938
2966
  const compare = __webpack_require__(2247);
2939
2967
  module.exports = (versions, range, options) => {
2940
2968
  const set = [];
2941
- let min = null;
2969
+ let first = null;
2942
2970
  let prev = null;
2943
2971
  const v = versions.sort(((a, b) => compare(a, b, options)));
2944
2972
  for (const version of v) {
2945
2973
  const included = satisfies(version, range, options);
2946
2974
  if (included) {
2947
2975
  prev = version;
2948
- if (!min) min = version;
2976
+ if (!first) {
2977
+ first = version;
2978
+ }
2949
2979
  } else {
2950
2980
  if (prev) {
2951
- set.push([ min, prev ]);
2981
+ set.push([ first, prev ]);
2952
2982
  }
2953
2983
  prev = null;
2954
- min = null;
2984
+ first = null;
2955
2985
  }
2956
2986
  }
2957
- if (min) set.push([ min, null ]);
2987
+ if (first) {
2988
+ set.push([ first, null ]);
2989
+ }
2958
2990
  const ranges = [];
2959
2991
  for (const [min, max] of set) {
2960
- if (min === max) ranges.push(min); else if (!max && min === v[0]) ranges.push("*"); else if (!max) ranges.push(`>=${min}`); else if (min === v[0]) ranges.push(`<=${max}`); else ranges.push(`${min} - ${max}`);
2992
+ if (min === max) {
2993
+ ranges.push(min);
2994
+ } else if (!max && min === v[0]) {
2995
+ ranges.push("*");
2996
+ } else if (!max) {
2997
+ ranges.push(`>=${min}`);
2998
+ } else if (min === v[0]) {
2999
+ ranges.push(`<=${max}`);
3000
+ } else {
3001
+ ranges.push(`${min} - ${max}`);
3002
+ }
2961
3003
  }
2962
3004
  const simplified = ranges.join(" || ");
2963
3005
  const original = typeof range.raw === "string" ? range.raw : String(range);
@@ -2971,7 +3013,9 @@ var __webpack_modules__ = {
2971
3013
  const satisfies = __webpack_require__(8915);
2972
3014
  const compare = __webpack_require__(2247);
2973
3015
  const subset = (sub, dom, options = {}) => {
2974
- if (sub === dom) return true;
3016
+ if (sub === dom) {
3017
+ return true;
3018
+ }
2975
3019
  sub = new Range(sub, options);
2976
3020
  dom = new Range(dom, options);
2977
3021
  let sawNonNull = false;
@@ -2979,36 +3023,70 @@ var __webpack_modules__ = {
2979
3023
  for (const simpleDom of dom.set) {
2980
3024
  const isSub = simpleSubset(simpleSub, simpleDom, options);
2981
3025
  sawNonNull = sawNonNull || isSub !== null;
2982
- if (isSub) continue OUTER;
3026
+ if (isSub) {
3027
+ continue OUTER;
3028
+ }
3029
+ }
3030
+ if (sawNonNull) {
3031
+ return false;
2983
3032
  }
2984
- if (sawNonNull) return false;
2985
3033
  }
2986
3034
  return true;
2987
3035
  };
2988
3036
  const simpleSubset = (sub, dom, options) => {
2989
- if (sub === dom) return true;
3037
+ if (sub === dom) {
3038
+ return true;
3039
+ }
2990
3040
  if (sub.length === 1 && sub[0].semver === ANY) {
2991
- if (dom.length === 1 && dom[0].semver === ANY) return true; else if (options.includePrerelease) sub = [ new Comparator(">=0.0.0-0") ]; else sub = [ new Comparator(">=0.0.0") ];
3041
+ if (dom.length === 1 && dom[0].semver === ANY) {
3042
+ return true;
3043
+ } else if (options.includePrerelease) {
3044
+ sub = [ new Comparator(">=0.0.0-0") ];
3045
+ } else {
3046
+ sub = [ new Comparator(">=0.0.0") ];
3047
+ }
2992
3048
  }
2993
3049
  if (dom.length === 1 && dom[0].semver === ANY) {
2994
- if (options.includePrerelease) return true; else dom = [ new Comparator(">=0.0.0") ];
3050
+ if (options.includePrerelease) {
3051
+ return true;
3052
+ } else {
3053
+ dom = [ new Comparator(">=0.0.0") ];
3054
+ }
2995
3055
  }
2996
3056
  const eqSet = new Set;
2997
3057
  let gt, lt;
2998
3058
  for (const c of sub) {
2999
- if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options); else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options); else eqSet.add(c.semver);
3059
+ if (c.operator === ">" || c.operator === ">=") {
3060
+ gt = higherGT(gt, c, options);
3061
+ } else if (c.operator === "<" || c.operator === "<=") {
3062
+ lt = lowerLT(lt, c, options);
3063
+ } else {
3064
+ eqSet.add(c.semver);
3065
+ }
3066
+ }
3067
+ if (eqSet.size > 1) {
3068
+ return null;
3000
3069
  }
3001
- if (eqSet.size > 1) return null;
3002
3070
  let gtltComp;
3003
3071
  if (gt && lt) {
3004
3072
  gtltComp = compare(gt.semver, lt.semver, options);
3005
- if (gtltComp > 0) return null; else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
3073
+ if (gtltComp > 0) {
3074
+ return null;
3075
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
3076
+ return null;
3077
+ }
3006
3078
  }
3007
3079
  for (const eq of eqSet) {
3008
- if (gt && !satisfies(eq, String(gt), options)) return null;
3009
- if (lt && !satisfies(eq, String(lt), options)) return null;
3080
+ if (gt && !satisfies(eq, String(gt), options)) {
3081
+ return null;
3082
+ }
3083
+ if (lt && !satisfies(eq, String(lt), options)) {
3084
+ return null;
3085
+ }
3010
3086
  for (const c of dom) {
3011
- if (!satisfies(eq, String(c), options)) return false;
3087
+ if (!satisfies(eq, String(c), options)) {
3088
+ return false;
3089
+ }
3012
3090
  }
3013
3091
  return true;
3014
3092
  }
@@ -3030,8 +3108,12 @@ var __webpack_modules__ = {
3030
3108
  }
3031
3109
  if (c.operator === ">" || c.operator === ">=") {
3032
3110
  higher = higherGT(gt, c, options);
3033
- if (higher === c && higher !== gt) return false;
3034
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
3111
+ if (higher === c && higher !== gt) {
3112
+ return false;
3113
+ }
3114
+ } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
3115
+ return false;
3116
+ }
3035
3117
  }
3036
3118
  if (lt) {
3037
3119
  if (needDomLTPre) {
@@ -3041,23 +3123,39 @@ var __webpack_modules__ = {
3041
3123
  }
3042
3124
  if (c.operator === "<" || c.operator === "<=") {
3043
3125
  lower = lowerLT(lt, c, options);
3044
- if (lower === c && lower !== lt) return false;
3045
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
3126
+ if (lower === c && lower !== lt) {
3127
+ return false;
3128
+ }
3129
+ } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
3130
+ return false;
3131
+ }
3046
3132
  }
3047
- if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
3133
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
3134
+ return false;
3135
+ }
3136
+ }
3137
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
3138
+ return false;
3139
+ }
3140
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
3141
+ return false;
3142
+ }
3143
+ if (needDomGTPre || needDomLTPre) {
3144
+ return false;
3048
3145
  }
3049
- if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
3050
- if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
3051
- if (needDomGTPre || needDomLTPre) return false;
3052
3146
  return true;
3053
3147
  };
3054
3148
  const higherGT = (a, b, options) => {
3055
- if (!a) return b;
3149
+ if (!a) {
3150
+ return b;
3151
+ }
3056
3152
  const comp = compare(a.semver, b.semver, options);
3057
3153
  return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
3058
3154
  };
3059
3155
  const lowerLT = (a, b, options) => {
3060
- if (!a) return b;
3156
+ if (!a) {
3157
+ return b;
3158
+ }
3061
3159
  const comp = compare(a.semver, b.semver, options);
3062
3160
  return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
3063
3161
  };
@@ -3552,27 +3650,76 @@ var __webpack_modules__ = {
3552
3650
  __webpack_require__(3278)(Yallist);
3553
3651
  } catch (er) {}
3554
3652
  },
3555
- 6829: (__unused_webpack_module, exports) => {
3653
+ 6829: (__unused_webpack_module, exports, __webpack_require__) => {
3556
3654
  "use strict";
3557
3655
  Object.defineProperty(exports, "__esModule", {
3558
3656
  value: true
3559
3657
  });
3560
- exports.VERSION_SUPPORT = exports.DEADLINE_EPOCH_MS = exports.DEADLINE = void 0;
3561
- exports.DEADLINE = "2021-09-01";
3562
- exports.DEADLINE_EPOCH_MS = new Date(`${exports.DEADLINE}T00:00:00.000Z`).getTime();
3563
- exports.VERSION_SUPPORT = {
3564
- "<12.0.0-0": "end-of-life",
3565
- "<12.7.0": "unsupported",
3566
- "^12.7.0": "supported",
3567
- "^13.0.0-0": "end-of-life",
3568
- "<14.5.0": "unsupported",
3569
- "^14.5.0": "supported",
3570
- "^15.0.0-0": "end-of-life",
3571
- "<16.3.0": "unsupported",
3572
- "^16.3.0": "supported",
3573
- "<17.3.0": "unsupported",
3574
- "^17.3.0": "supported"
3575
- };
3658
+ exports.NodeRelease = void 0;
3659
+ const process = __webpack_require__(7282);
3660
+ const semver_1 = __webpack_require__(6027);
3661
+ const ONE_DAY_IN_MILLISECONDS = 864e5;
3662
+ class NodeRelease {
3663
+ constructor(majorVersion, opts) {
3664
+ var _a, _b;
3665
+ this.majorVersion = majorVersion;
3666
+ this.endOfLifeDate = opts.endOfLife === true ? undefined : opts.endOfLife;
3667
+ this.untested = (_a = opts.untested) !== null && _a !== void 0 ? _a : false;
3668
+ this.supportedRange = new semver_1.Range((_b = opts.supportedRange) !== null && _b !== void 0 ? _b : `^${majorVersion}.0.0`);
3669
+ this.endOfLife = opts.endOfLife === true || opts.endOfLife.getTime() <= Date.now();
3670
+ this.deprecated = !this.endOfLife && opts.endOfLife !== true && opts.endOfLife.getTime() - NodeRelease.DEPRECATION_WINDOW_MS <= Date.now();
3671
+ this.supported = !this.untested && !this.endOfLife;
3672
+ }
3673
+ static forThisRuntime() {
3674
+ const semver = new semver_1.SemVer(process.version);
3675
+ const majorVersion = semver.major;
3676
+ for (const nodeRelease of this.ALL_RELEASES) {
3677
+ if (nodeRelease.majorVersion === majorVersion) {
3678
+ return {
3679
+ nodeRelease,
3680
+ knownBroken: !nodeRelease.supportedRange.test(semver)
3681
+ };
3682
+ }
3683
+ }
3684
+ return {
3685
+ nodeRelease: undefined,
3686
+ knownBroken: false
3687
+ };
3688
+ }
3689
+ toString() {
3690
+ const eolInfo = this.endOfLifeDate ? ` (Planned end-of-life: ${this.endOfLifeDate.toISOString().slice(0, 10)})` : "";
3691
+ return `${this.supportedRange.raw}${eolInfo}`;
3692
+ }
3693
+ }
3694
+ exports.NodeRelease = NodeRelease;
3695
+ NodeRelease.DEPRECATION_WINDOW_MS = 30 * ONE_DAY_IN_MILLISECONDS;
3696
+ NodeRelease.ALL_RELEASES = [ ...[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ].map((majorVersion => new NodeRelease(majorVersion, {
3697
+ endOfLife: true
3698
+ }))), new NodeRelease(13, {
3699
+ endOfLife: new Date("2020-06-01")
3700
+ }), new NodeRelease(15, {
3701
+ endOfLife: new Date("2021-06-01")
3702
+ }), new NodeRelease(12, {
3703
+ endOfLife: new Date("2022-04-30"),
3704
+ supportedRange: "^12.7.0"
3705
+ }), new NodeRelease(14, {
3706
+ endOfLife: new Date("2023-04-30"),
3707
+ supportedRange: "^14.5.0"
3708
+ }), new NodeRelease(16, {
3709
+ endOfLife: new Date("2024-04-30"),
3710
+ supportedRange: "^16.3.0"
3711
+ }), new NodeRelease(17, {
3712
+ endOfLife: new Date("2022-06-01"),
3713
+ supportedRange: "^17.3.0"
3714
+ }), new NodeRelease(18, {
3715
+ endOfLife: new Date("2025-04-30")
3716
+ }), new NodeRelease(19, {
3717
+ endOfLife: new Date("2023-06-01"),
3718
+ untested: true
3719
+ }), new NodeRelease(20, {
3720
+ endOfLife: new Date("2026-04-30"),
3721
+ untested: true
3722
+ }) ];
3576
3723
  },
3577
3724
  7962: (__unused_webpack_module, exports, __webpack_require__) => {
3578
3725
  "use strict";
@@ -3583,41 +3730,25 @@ var __webpack_modules__ = {
3583
3730
  const chalk_1 = __webpack_require__(1201);
3584
3731
  const console_1 = __webpack_require__(6206);
3585
3732
  const process_1 = __webpack_require__(7282);
3586
- const semver_1 = __webpack_require__(6027);
3587
3733
  const constants_1 = __webpack_require__(6829);
3588
3734
  function checkNode() {
3589
- const runtimeVersion = new semver_1.SemVer(process_1.version);
3590
- let versionSupportLevel = "untested";
3591
- for (const [rangeExpr, supportLevel] of Object.entries(constants_1.VERSION_SUPPORT)) {
3592
- const range = new semver_1.Range(rangeExpr);
3593
- if (range.test(runtimeVersion)) {
3594
- versionSupportLevel = supportLevel;
3595
- break;
3596
- }
3597
- }
3598
- switch (versionSupportLevel) {
3599
- case "deprecated":
3600
- const deadlinePast = Date.now() > constants_1.DEADLINE_EPOCH_MS;
3601
- veryVisibleMessage(deadlinePast ? chalk_1.bgRed.white.bold : chalk_1.bgYellowBright.black, `Node ${process_1.version} has reached end-of-life and will no longer be supported in new releases after ${constants_1.DEADLINE}.`, `Please upgrade to a supported node version as soon as possible.`);
3602
- break;
3603
-
3604
- case "end-of-life":
3605
- veryVisibleMessage(chalk_1.bgRed.white.bold, `Node ${process_1.version} has reached end-of-life and is not supported.`);
3606
- break;
3607
-
3608
- case "unsupported":
3609
- veryVisibleMessage(chalk_1.bgRed.white.bold, `Node ${process_1.version} is not supported. Early releases a node major often lack essential features of that line.`);
3610
- break;
3611
-
3612
- case "supported":
3613
- break;
3614
-
3615
- case "untested":
3735
+ const {nodeRelease, knownBroken} = constants_1.NodeRelease.forThisRuntime();
3736
+ if (nodeRelease === null || nodeRelease === void 0 ? void 0 : nodeRelease.endOfLife) {
3737
+ const qualifier = nodeRelease.endOfLifeDate ? ` on ${nodeRelease.endOfLifeDate.toISOString().slice(0, 10)}` : "";
3738
+ veryVisibleMessage(chalk_1.bgRed.white.bold, `Node ${nodeRelease.majorVersion} has reached end-of-life${qualifier} and is not supported.`, `Please upgrade to a supported node version as soon as possible.`);
3739
+ } else if (knownBroken) {
3740
+ veryVisibleMessage(chalk_1.bgRed.white.bold, `Node ${process_1.version} is unsupported and has known compatibility issues with this software.`);
3741
+ } else if (!nodeRelease || nodeRelease.untested) {
3616
3742
  veryVisibleMessage(chalk_1.bgYellow.black, `This software has not been tested with node ${process_1.version}.`);
3617
- break;
3743
+ } else if (nodeRelease === null || nodeRelease === void 0 ? void 0 : nodeRelease.deprecated) {
3744
+ const deadline = nodeRelease.endOfLifeDate.toISOString().slice(0, 10);
3745
+ veryVisibleMessage(chalk_1.bgYellowBright.black, `Node ${nodeRelease.majorVersion} is approaching end-of-life and will no longer be supported in new releases after ${deadline}.`, `Please upgrade to a supported node version as soon as possible.`);
3618
3746
  }
3619
3747
  function veryVisibleMessage(chalk, message, callToAction = "You may to encounter runtime issues, and should switch to a supported release.") {
3620
- const lines = [ message, callToAction, "", "As of the current release, supported versions of node are:", ...Object.entries(constants_1.VERSION_SUPPORT).filter((([, supportLevel]) => supportLevel === "supported")).map((([rangeExpr]) => `- ${rangeExpr}`)) ];
3748
+ const lines = [ message, callToAction, "", `This software is currently running on node ${process_1.version}.`, "As of the current release of this software, supported node releases are:", ...constants_1.NodeRelease.ALL_RELEASES.filter((release => release.supported)).sort(((l, r) => {
3749
+ var _a, _b, _c, _d;
3750
+ return ((_b = (_a = r.endOfLifeDate) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0) - ((_d = (_c = l.endOfLifeDate) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : 0);
3751
+ })).map((release => `- ${release.toString()}${release.deprecated ? " [DEPRECATED]" : ""}`)) ];
3621
3752
  const len = Math.max(...lines.map((l => l.length)));
3622
3753
  const border = chalk("!".repeat(len + 8));
3623
3754
  const spacer = chalk(`!! ${" ".repeat(len)} !!`);