@jsenv/core 38.2.1 → 38.2.3

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.
@@ -45,7 +45,8 @@ function memberDec(
45
45
  isStatic,
46
46
  isPrivate,
47
47
  value,
48
- hasPrivateBrand
48
+ hasPrivateBrand,
49
+ metadata
49
50
  ) {
50
51
  var kindStr;
51
52
 
@@ -71,6 +72,7 @@ function memberDec(
71
72
  name: isPrivate ? "#" + name : name,
72
73
  static: isStatic,
73
74
  private: isPrivate,
75
+ metadata: metadata,
74
76
  };
75
77
 
76
78
  var decoratorFinishedRef = { v: false };
@@ -211,7 +213,8 @@ function applyMemberDec(
211
213
  isStatic,
212
214
  isPrivate,
213
215
  initializers,
214
- hasPrivateBrand
216
+ hasPrivateBrand,
217
+ metadata
215
218
  ) {
216
219
  var decs = decInfo[0];
217
220
 
@@ -276,7 +279,8 @@ function applyMemberDec(
276
279
  isStatic,
277
280
  isPrivate,
278
281
  value,
279
- hasPrivateBrand
282
+ hasPrivateBrand,
283
+ metadata
280
284
  );
281
285
 
282
286
  if (newValue !== void 0) {
@@ -369,7 +373,7 @@ function applyMemberDec(
369
373
  }
370
374
  }
371
375
 
372
- function applyMemberDecs(Class, decInfos, instanceBrand) {
376
+ function applyMemberDecs(Class, decInfos, instanceBrand, metadata) {
373
377
  var ret = [];
374
378
  var protoInitializers;
375
379
  var staticInitializers;
@@ -451,7 +455,8 @@ function applyMemberDecs(Class, decInfos, instanceBrand) {
451
455
  isStatic,
452
456
  isPrivate,
453
457
  initializers,
454
- hasPrivateBrand
458
+ hasPrivateBrand,
459
+ metadata
455
460
  );
456
461
  }
457
462
 
@@ -471,7 +476,7 @@ function pushInitializers(ret, initializers) {
471
476
  }
472
477
  }
473
478
 
474
- function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
479
+ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis, metadata) {
475
480
  if (classDecs.length) {
476
481
  var initializers = [];
477
482
  var newClass = targetClass;
@@ -493,6 +498,7 @@ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
493
498
  initializers,
494
499
  decoratorFinishedRef
495
500
  ),
501
+ metadata,
496
502
  }
497
503
  );
498
504
  } finally {
@@ -506,7 +512,7 @@ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
506
512
  }
507
513
 
508
514
  return [
509
- newClass,
515
+ defineMetadata(newClass, metadata),
510
516
  function () {
511
517
  for (var i = 0; i < initializers.length; i++) {
512
518
  initializers[i].call(newClass);
@@ -518,6 +524,14 @@ function applyClassDecs(targetClass, classDecs, decoratorsHaveThis) {
518
524
  // so we don't have to return an empty array here.
519
525
  }
520
526
 
527
+ function defineMetadata(Class, metadata) {
528
+ return Object.defineProperty(
529
+ Class,
530
+ Symbol.metadata || Symbol.for("Symbol.metadata"),
531
+ { configurable: true, enumerable: true, value: metadata }
532
+ );
533
+ }
534
+
521
535
  /**
522
536
  Basic usage:
523
537
 
@@ -669,13 +683,28 @@ export default function applyDecs2305(
669
683
  memberDecs,
670
684
  classDecs,
671
685
  classDecsHaveThis,
672
- instanceBrand
686
+ instanceBrand,
687
+ parentClass
673
688
  ) {
689
+ if (arguments.length >= 6) {
690
+ var parentMetadata =
691
+ parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
692
+ }
693
+ var metadata = Object.create(
694
+ parentMetadata === void 0 ? null : parentMetadata
695
+ );
696
+ var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);
697
+ if (!classDecs.length) defineMetadata(targetClass, metadata);
674
698
  return {
675
- e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
699
+ e: e,
676
700
  // Lazily apply class decorations so that member init locals can be properly bound.
677
701
  get c() {
678
- return applyClassDecs(targetClass, classDecs, classDecsHaveThis);
702
+ return applyClassDecs(
703
+ targetClass,
704
+ classDecs,
705
+ classDecsHaveThis,
706
+ metadata
707
+ );
679
708
  },
680
709
  };
681
710
  }
@@ -0,0 +1,31 @@
1
+ /* @minVersion 7.23.0 */
2
+ export default function _importDeferProxy(init) {
3
+ var ns = null;
4
+ var constValue = function (v) {
5
+ return function () {
6
+ return v;
7
+ };
8
+ };
9
+ var proxy = function (run) {
10
+ return function (arg1, arg2, arg3) {
11
+ if (ns === null) ns = init();
12
+ return run(ns, arg2, arg3);
13
+ };
14
+ };
15
+ return new Proxy(
16
+ {},
17
+ {
18
+ defineProperty: constValue(false),
19
+ deleteProperty: constValue(false),
20
+ get: proxy(Reflect.get),
21
+ getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor),
22
+ getPrototypeOf: constValue(null),
23
+ isExtensible: constValue(false),
24
+ has: proxy(Reflect.has),
25
+ ownKeys: proxy(Reflect.ownKeys),
26
+ preventExtensions: constValue(true),
27
+ set: constValue(false),
28
+ setPrototypeOf: constValue(false),
29
+ }
30
+ );
31
+ }
@@ -0,0 +1,3 @@
1
+ export function _nullishReceiverError() {
2
+ throw new TypeError("Cannot set property of null or undefined.");
3
+ }
package/dist/js/ws.js CHANGED
@@ -878,6 +878,12 @@ const { isValidStatusCode: isValidStatusCode$1, isValidUTF8 } = validationExport
878
878
  const FastBuffer = Buffer[Symbol.species];
879
879
  const promise = Promise.resolve();
880
880
 
881
+ //
882
+ // `queueMicrotask()` is not available in Node.js < 11.
883
+ //
884
+ const queueTask =
885
+ typeof queueMicrotask === 'function' ? queueMicrotask : queueMicrotaskShim;
886
+
881
887
  const GET_INFO = 0;
882
888
  const GET_PAYLOAD_LENGTH_16 = 1;
883
889
  const GET_PAYLOAD_LENGTH_64 = 2;
@@ -1032,11 +1038,7 @@ let Receiver$1 = class Receiver extends Writable {
1032
1038
  //
1033
1039
  this._loop = false;
1034
1040
 
1035
- //
1036
- // `queueMicrotask()` is not available in Node.js < 11 and is no
1037
- // better anyway.
1038
- //
1039
- promise.then(() => {
1041
+ queueTask(() => {
1040
1042
  this._state = GET_INFO;
1041
1043
  this.startLoop(cb);
1042
1044
  });
@@ -1510,6 +1512,35 @@ function error(ErrorCtor, message, prefix, statusCode, errorCode) {
1510
1512
  return err;
1511
1513
  }
1512
1514
 
1515
+ /**
1516
+ * A shim for `queueMicrotask()`.
1517
+ *
1518
+ * @param {Function} cb Callback
1519
+ */
1520
+ function queueMicrotaskShim(cb) {
1521
+ promise.then(cb).catch(throwErrorNextTick);
1522
+ }
1523
+
1524
+ /**
1525
+ * Throws an error.
1526
+ *
1527
+ * @param {Error} err The error to throw
1528
+ * @private
1529
+ */
1530
+ function throwError(err) {
1531
+ throw err;
1532
+ }
1533
+
1534
+ /**
1535
+ * Throws an error in the next tick.
1536
+ *
1537
+ * @param {Error} err The error to throw
1538
+ * @private
1539
+ */
1540
+ function throwErrorNextTick(err) {
1541
+ process.nextTick(throwError, err);
1542
+ }
1543
+
1513
1544
  /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex" }] */
1514
1545
  const { randomFillSync } = require$$1;
1515
1546
 
@@ -2543,9 +2543,7 @@ callback: ${callback}`);
2543
2543
  return { registerCleanupCallback, cleanup };
2544
2544
  };
2545
2545
 
2546
- const isLinux = process.platform === "linux";
2547
- // linux does not support recursive option
2548
- const fsWatchSupportsRecursive = !isLinux;
2546
+ const fsWatchSupportsRecursive = true;
2549
2547
 
2550
2548
  const registerDirectoryLifecycle = (
2551
2549
  source,
@@ -2781,25 +2779,6 @@ const registerDirectoryLifecycle = (
2781
2779
  handleEntryFound(childEntryInfo, { notify });
2782
2780
  }
2783
2781
  });
2784
- // we must watch manually every directory we find
2785
- if (!fsWatchSupportsRecursive) {
2786
- const watcher = createWatcher(urlToFileSystemPath(entryInfo.url), {
2787
- persistent: keepProcessAlive,
2788
- });
2789
- tracker.registerCleanupCallback(() => {
2790
- watcher.close();
2791
- });
2792
- watcher.on("change", (eventType, filename) => {
2793
- handleDirectoryEvent({
2794
- directoryRelativeUrl: entryInfo.relativeUrl,
2795
- filename: filename
2796
- ? // replace back slashes with slashes
2797
- filename.replace(/\\/g, "/")
2798
- : "",
2799
- eventType,
2800
- });
2801
- });
2802
- }
2803
2782
  }
2804
2783
  if (added && entryInfo.patternValue && notify) {
2805
2784
  added({
@@ -7751,9 +7730,10 @@ const getCompressedResponse = async ({ sourceUrl, headers }) => {
7751
7730
  }
7752
7731
 
7753
7732
  const fileReadableStream = fileUrlToReadableStream(sourceUrl);
7754
- const body = await availableCompressionFormats[acceptedCompressionFormat](
7755
- fileReadableStream,
7756
- );
7733
+ const body =
7734
+ await availableCompressionFormats[acceptedCompressionFormat](
7735
+ fileReadableStream,
7736
+ );
7757
7737
 
7758
7738
  return {
7759
7739
  status: 200,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "38.2.1",
3
+ "version": "38.2.3",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -13,7 +13,7 @@
13
13
  "url": "https://github.com/jsenv/core"
14
14
  },
15
15
  "engines": {
16
- "node": ">=18.5.0"
16
+ "node": ">=20.8.0"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"
@@ -61,20 +61,20 @@
61
61
  "dependencies": {
62
62
  "@financial-times/polyfill-useragent-normaliser": "1.10.2",
63
63
  "@jsenv/abort": "4.2.4",
64
- "@jsenv/ast": "5.1.3",
65
- "@jsenv/filesystem": "4.2.6",
64
+ "@jsenv/ast": "5.1.4",
65
+ "@jsenv/filesystem": "4.3.0",
66
66
  "@jsenv/importmap": "1.2.1",
67
67
  "@jsenv/integrity": "0.0.1",
68
68
  "@jsenv/log": "3.4.0",
69
69
  "@jsenv/node-esm-resolution": "1.0.1",
70
- "@jsenv/js-module-fallback": "1.3.4",
70
+ "@jsenv/js-module-fallback": "1.3.5",
71
71
  "@jsenv/runtime-compat": "1.2.0",
72
- "@jsenv/server": "15.1.1",
73
- "@jsenv/sourcemap": "1.2.2",
74
- "@jsenv/plugin-bundling": "2.5.3",
75
- "@jsenv/plugin-minification": "1.5.1",
76
- "@jsenv/plugin-transpilation": "1.3.3",
77
- "@jsenv/plugin-supervisor": "1.3.3",
72
+ "@jsenv/server": "15.1.2",
73
+ "@jsenv/sourcemap": "1.2.3",
74
+ "@jsenv/plugin-bundling": "2.5.4",
75
+ "@jsenv/plugin-minification": "1.5.2",
76
+ "@jsenv/plugin-transpilation": "1.3.4",
77
+ "@jsenv/plugin-supervisor": "1.3.4",
78
78
  "@jsenv/url-meta": "8.1.0",
79
79
  "@jsenv/urls": "2.2.1",
80
80
  "@jsenv/utils": "2.0.1"
@@ -92,12 +92,12 @@
92
92
  "@jsenv/performance-impact": "4.1.1",
93
93
  "@jsenv/plugin-as-js-classic": "./packages/related/plugin-as-js-classic/",
94
94
  "@jsenv/test": "./packages/related/test/",
95
- "eslint": "8.49.0",
95
+ "eslint": "8.50.0",
96
96
  "eslint-plugin-html": "7.1.0",
97
97
  "eslint-plugin-import": "2.28.1",
98
98
  "eslint-plugin-react": "7.33.2",
99
99
  "open": "9.1.0",
100
- "playwright": "1.37.1",
100
+ "playwright": "1.38.1",
101
101
  "prettier": "3.0.3"
102
102
  }
103
103
  }