@jsenv/core 34.0.1 → 34.0.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.
package/README.md CHANGED
@@ -7,7 +7,7 @@ It has naturally evolved to cover the core needs of a JavaScript project: develo
7
7
  - :sparkles: Same tooling for dev, tests and build.
8
8
  - :exploding_head: Can execute tests on Chrome, Firefox, Safari and Node.js.
9
9
 
10
- [Documentation](https://github.com/jsenv/jsenv-core/wiki/A\)-Getting-started)
10
+ [Documentation](<https://github.com/jsenv/jsenv-core/wiki/A)-Getting-started>)
11
11
 
12
12
  # Installation
13
13
 
package/dist/js/ws.js CHANGED
@@ -9,6 +9,9 @@ import require$$0$1 from "zlib";
9
9
  import require$$0$2 from "buffer";
10
10
  import require$$7 from "url";
11
11
 
12
+ function getDefaultExportFromCjs(x) {
13
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
14
+ }
12
15
  const {
13
16
  Duplex
14
17
  } = require$$0;
@@ -149,14 +152,9 @@ function createWebSocketStream(ws, options) {
149
152
  return duplex;
150
153
  }
151
154
  var stream = createWebSocketStream;
152
- var bufferUtilExports = {};
155
+ var stream$1 = /*@__PURE__*/getDefaultExportFromCjs(stream);
153
156
  var bufferUtil$1 = {
154
- get exports() {
155
- return bufferUtilExports;
156
- },
157
- set exports(v) {
158
- bufferUtilExports = v;
159
- }
157
+ exports: {}
160
158
  };
161
159
  var constants = {
162
160
  BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],
@@ -276,16 +274,17 @@ bufferUtil$1.exports = {
276
274
  if (!process.env.WS_NO_BUFFER_UTIL) {
277
275
  try {
278
276
  const bufferUtil = require('bufferutil');
279
- mask = bufferUtilExports.mask = function (source, mask, output, offset, length) {
277
+ mask = bufferUtil$1.exports.mask = function (source, mask, output, offset, length) {
280
278
  if (length < 48) _mask(source, mask, output, offset, length);else bufferUtil.mask(source, mask, output, offset, length);
281
279
  };
282
- unmask$1 = bufferUtilExports.unmask = function (buffer, mask) {
280
+ unmask$1 = bufferUtil$1.exports.unmask = function (buffer, mask) {
283
281
  if (buffer.length < 32) _unmask(buffer, mask);else bufferUtil.unmask(buffer, mask);
284
282
  };
285
283
  } catch (e) {
286
284
  // Continue regardless of the error.
287
285
  }
288
286
  }
287
+ var bufferUtilExports = bufferUtil$1.exports;
289
288
  const kDone = Symbol('kDone');
290
289
  const kRun = Symbol('kRun');
291
290
 
@@ -746,14 +745,8 @@ function inflateOnError(err) {
746
745
  err[kStatusCode$2] = 1007;
747
746
  this[kCallback](err);
748
747
  }
749
- var validationExports = {};
750
748
  var validation = {
751
- get exports() {
752
- return validationExports;
753
- },
754
- set exports(v) {
755
- validationExports = v;
756
- }
749
+ exports: {}
757
750
  };
758
751
  var isValidUTF8_1;
759
752
  const {
@@ -853,19 +846,20 @@ validation.exports = {
853
846
  tokenChars: tokenChars$2
854
847
  };
855
848
  if (isUtf8) {
856
- isValidUTF8_1 = validationExports.isValidUTF8 = function (buf) {
849
+ isValidUTF8_1 = validation.exports.isValidUTF8 = function (buf) {
857
850
  return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
858
851
  };
859
852
  } /* istanbul ignore else */else if (!process.env.WS_NO_UTF_8_VALIDATE) {
860
853
  try {
861
854
  const isValidUTF8 = require('utf-8-validate');
862
- isValidUTF8_1 = validationExports.isValidUTF8 = function (buf) {
855
+ isValidUTF8_1 = validation.exports.isValidUTF8 = function (buf) {
863
856
  return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
864
857
  };
865
858
  } catch (e) {
866
859
  // Continue regardless of the error.
867
860
  }
868
861
  }
862
+ var validationExports = validation.exports;
869
863
  const {
870
864
  Writable
871
865
  } = require$$0;
@@ -1309,6 +1303,7 @@ function error(ErrorCtor, message, prefix, statusCode, errorCode) {
1309
1303
  err[kStatusCode$1] = statusCode;
1310
1304
  return err;
1311
1305
  }
1306
+ var receiver$1 = /*@__PURE__*/getDefaultExportFromCjs(receiver);
1312
1307
 
1313
1308
  /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^net|tls$" }] */
1314
1309
  const {
@@ -1725,6 +1720,7 @@ let Sender$1 = class Sender {
1725
1720
  }
1726
1721
  };
1727
1722
  var sender = Sender$1;
1723
+ var sender$1 = /*@__PURE__*/getDefaultExportFromCjs(sender);
1728
1724
  const {
1729
1725
  kForOnEventAttribute: kForOnEventAttribute$1,
1730
1726
  kListener: kListener$1
@@ -3316,6 +3312,7 @@ function socketOnError$1() {
3316
3312
  this.destroy();
3317
3313
  }
3318
3314
  }
3315
+ var WebSocket$2 = /*@__PURE__*/getDefaultExportFromCjs(websocket);
3319
3316
  const {
3320
3317
  tokenChars
3321
3318
  } = validationExports;
@@ -3801,5 +3798,6 @@ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
3801
3798
  abortHandshake(socket, code, message);
3802
3799
  }
3803
3800
  }
3801
+ var websocketServer$1 = /*@__PURE__*/getDefaultExportFromCjs(websocketServer);
3804
3802
 
3805
- export { receiver as Receiver, sender as Sender, websocket as WebSocket, websocketServer as WebSocketServer, stream as createWebSocketStream, websocket as default };
3803
+ export { receiver$1 as Receiver, sender$1 as Sender, WebSocket$2 as WebSocket, websocketServer$1 as WebSocketServer, stream$1 as createWebSocketStream, WebSocket$2 as default };
package/dist/jsenv.js CHANGED
@@ -7910,7 +7910,6 @@ const createUrlInfoTransformer = ({
7910
7910
  await context.cook(sourcemapUrlInfo, {
7911
7911
  reference: sourcemapReference
7912
7912
  });
7913
- sourcemapUrlInfo.isInline = sourcemaps === "inline";
7914
7913
  const sourcemapRaw = JSON.parse(sourcemapUrlInfo.content);
7915
7914
  const sourcemap = normalizeSourcemap(urlInfo, sourcemapRaw);
7916
7915
  urlInfo.sourcemap = sourcemap;
@@ -9003,6 +9002,7 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
9003
9002
  url: urlInfo.url
9004
9003
  },
9005
9004
  type: "sourcemap_comment",
9005
+ expectedType: "sourcemap",
9006
9006
  subtype: urlInfo.contentType === "text/javascript" ? "js" : "css",
9007
9007
  parentUrl: urlInfo.url,
9008
9008
  specifier
@@ -9026,11 +9026,15 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
9026
9026
  const [sourcemapReference, sourcemapUrlInfo] = resolveReference(createReference({
9027
9027
  trace: traceFromUrlSite(sourcemapUrlSite),
9028
9028
  type,
9029
+ expectedType: "sourcemap",
9029
9030
  parentUrl: urlInfo.url,
9030
9031
  specifier,
9031
9032
  specifierLine,
9032
9033
  specifierColumn
9033
9034
  }));
9035
+ if (sourcemapReference.isInline) {
9036
+ sourcemapUrlInfo.isInline = true;
9037
+ }
9034
9038
  sourcemapUrlInfo.type = "sourcemap";
9035
9039
  return [sourcemapReference, sourcemapUrlInfo];
9036
9040
  }
@@ -9541,6 +9545,12 @@ const adjustUrlSite = (urlInfo, {
9541
9545
  }, urlInfo);
9542
9546
  };
9543
9547
  const inferUrlInfoType = urlInfo => {
9548
+ const {
9549
+ type
9550
+ } = urlInfo;
9551
+ if (type === "sourcemap") {
9552
+ return "sourcemap";
9553
+ }
9544
9554
  const {
9545
9555
  contentType
9546
9556
  } = urlInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "34.0.1",
3
+ "version": "34.0.3",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -66,14 +66,14 @@
66
66
  "@c88/v8-coverage": "0.1.1",
67
67
  "@financial-times/polyfill-useragent-normaliser": "1.10.2",
68
68
  "@jsenv/abort": "4.2.4",
69
- "@jsenv/ast": "3.0.4",
69
+ "@jsenv/ast": "3.0.5",
70
70
  "@jsenv/babel-plugins": "1.1.5",
71
71
  "@jsenv/filesystem": "4.2.3",
72
72
  "@jsenv/importmap": "1.2.1",
73
73
  "@jsenv/integrity": "0.0.1",
74
74
  "@jsenv/log": "3.3.4",
75
75
  "@jsenv/node-esm-resolution": "1.0.1",
76
- "@jsenv/plugin-bundling": "2.1.3",
76
+ "@jsenv/plugin-bundling": "2.1.4",
77
77
  "@jsenv/server": "15.0.2",
78
78
  "@jsenv/sourcemap": "1.0.10",
79
79
  "@jsenv/uneval": "1.6.0",
@@ -100,18 +100,18 @@
100
100
  "@babel/plugin-syntax-import-assertions": "7.20.0",
101
101
  "@jsenv/assert": "./packages/assert/",
102
102
  "@jsenv/eslint-config": "./packages/eslint-config/",
103
- "@jsenv/file-size-impact": "14.0.0",
103
+ "@jsenv/file-size-impact": "14.1.0",
104
104
  "@jsenv/https-local": "3.0.6",
105
105
  "@jsenv/package-workspace": "0.5.1",
106
106
  "@jsenv/performance-impact": "4.1.0",
107
107
  "@jsenv/plugin-globals": "./packages/jsenv-plugin-globals/",
108
108
  "@jsenv/plugin-minification": "./packages/jsenv-plugin-minification/",
109
109
  "@jsenv/plugin-placeholders": "./packages/jsenv-plugin-placeholders/",
110
- "eslint": "8.36.0",
110
+ "eslint": "8.38.0",
111
111
  "eslint-plugin-html": "7.1.0",
112
112
  "eslint-plugin-import": "2.27.5",
113
113
  "eslint-plugin-react": "7.32.2",
114
- "playwright": "1.32.1",
114
+ "playwright": "1.32.3",
115
115
  "prettier": "2.8.7"
116
116
  }
117
117
  }
@@ -291,6 +291,7 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
291
291
  url: urlInfo.url,
292
292
  },
293
293
  type: "sourcemap_comment",
294
+ expectedType: "sourcemap",
294
295
  subtype: urlInfo.contentType === "text/javascript" ? "js" : "css",
295
296
  parentUrl: urlInfo.url,
296
297
  specifier,
@@ -316,12 +317,16 @@ ${ANSI.color(normalizedReturnValue, ANSI.YELLOW)}
316
317
  createReference({
317
318
  trace: traceFromUrlSite(sourcemapUrlSite),
318
319
  type,
320
+ expectedType: "sourcemap",
319
321
  parentUrl: urlInfo.url,
320
322
  specifier,
321
323
  specifierLine,
322
324
  specifierColumn,
323
325
  }),
324
326
  )
327
+ if (sourcemapReference.isInline) {
328
+ sourcemapUrlInfo.isInline = true
329
+ }
325
330
  sourcemapUrlInfo.type = "sourcemap"
326
331
  return [sourcemapReference, sourcemapUrlInfo]
327
332
  },
@@ -913,6 +918,10 @@ const adjustUrlSite = (urlInfo, { urlGraph, url, line, column }) => {
913
918
  }
914
919
 
915
920
  const inferUrlInfoType = (urlInfo) => {
921
+ const { type } = urlInfo
922
+ if (type === "sourcemap") {
923
+ return "sourcemap"
924
+ }
916
925
  const { contentType } = urlInfo
917
926
  if (contentType === "text/html") {
918
927
  return "html"
@@ -123,7 +123,6 @@ export const createUrlInfoTransformer = ({
123
123
  })
124
124
  try {
125
125
  await context.cook(sourcemapUrlInfo, { reference: sourcemapReference })
126
- sourcemapUrlInfo.isInline = sourcemaps === "inline"
127
126
  const sourcemapRaw = JSON.parse(sourcemapUrlInfo.content)
128
127
  const sourcemap = normalizeSourcemap(urlInfo, sourcemapRaw)
129
128
  urlInfo.sourcemap = sourcemap