isomorfeus-asset-manager 0.14.23 → 0.14.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,26 +1,10 @@
1
+ "use strict";
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
6
  var __getProtoOf = Object.getPrototypeOf;
9
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
8
  var __export = (target, all) => {
25
9
  for (var name in all)
26
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -33,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
33
17
  }
34
18
  return to;
35
19
  };
36
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
37
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
25
 
39
26
  // lib/npm/node.ts
@@ -317,9 +304,14 @@ function pushCommonFlags(flags, options, keys) {
317
304
  let jsx = getFlag(options, keys, "jsx", mustBeString);
318
305
  let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
319
306
  let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
307
+ let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString);
308
+ let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean);
320
309
  let define = getFlag(options, keys, "define", mustBeObject);
310
+ let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
311
+ let supported = getFlag(options, keys, "supported", mustBeObject);
321
312
  let pure = getFlag(options, keys, "pure", mustBeArray);
322
313
  let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
314
+ let platform = getFlag(options, keys, "platform", mustBeString);
323
315
  if (legalComments)
324
316
  flags.push(`--legal-comments=${legalComments}`);
325
317
  if (sourceRoot !== void 0)
@@ -336,6 +328,8 @@ function pushCommonFlags(flags, options, keys) {
336
328
  flags.push(`--format=${format}`);
337
329
  if (globalName)
338
330
  flags.push(`--global-name=${globalName}`);
331
+ if (platform)
332
+ flags.push(`--platform=${platform}`);
339
333
  if (minify)
340
334
  flags.push("--minify");
341
335
  if (minifySyntax)
@@ -365,6 +359,10 @@ function pushCommonFlags(flags, options, keys) {
365
359
  flags.push(`--jsx-factory=${jsxFactory}`);
366
360
  if (jsxFragment)
367
361
  flags.push(`--jsx-fragment=${jsxFragment}`);
362
+ if (jsxImportSource)
363
+ flags.push(`--jsx-import-source=${jsxImportSource}`);
364
+ if (jsxDev)
365
+ flags.push(`--jsx-dev`);
368
366
  if (define) {
369
367
  for (let key in define) {
370
368
  if (key.indexOf("=") >= 0)
@@ -372,6 +370,20 @@ function pushCommonFlags(flags, options, keys) {
372
370
  flags.push(`--define:${key}=${define[key]}`);
373
371
  }
374
372
  }
373
+ if (logOverride) {
374
+ for (let key in logOverride) {
375
+ if (key.indexOf("=") >= 0)
376
+ throw new Error(`Invalid log override: ${key}`);
377
+ flags.push(`--log-override:${key}=${logOverride[key]}`);
378
+ }
379
+ }
380
+ if (supported) {
381
+ for (let key in supported) {
382
+ if (key.indexOf("=") >= 0)
383
+ throw new Error(`Invalid supported: ${key}`);
384
+ flags.push(`--supported:${key}=${supported[key]}`);
385
+ }
386
+ }
375
387
  if (pure)
376
388
  for (let fn of pure)
377
389
  flags.push(`--pure:${fn}`);
@@ -397,7 +409,6 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
397
409
  let outfile = getFlag(options, keys, "outfile", mustBeString);
398
410
  let outdir = getFlag(options, keys, "outdir", mustBeString);
399
411
  let outbase = getFlag(options, keys, "outbase", mustBeString);
400
- let platform = getFlag(options, keys, "platform", mustBeString);
401
412
  let tsconfig = getFlag(options, keys, "tsconfig", mustBeString);
402
413
  let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray);
403
414
  let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray);
@@ -451,8 +462,6 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
451
462
  flags.push(`--outdir=${outdir}`);
452
463
  if (outbase)
453
464
  flags.push(`--outbase=${outbase}`);
454
- if (platform)
455
- flags.push(`--platform=${platform}`);
456
465
  if (tsconfig)
457
466
  flags.push(`--tsconfig=${tsconfig}`);
458
467
  if (resolveExtensions) {
@@ -540,7 +549,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
540
549
  }
541
550
  if (stdin) {
542
551
  let stdinKeys = /* @__PURE__ */ Object.create(null);
543
- let contents = getFlag(stdin, stdinKeys, "contents", mustBeString);
552
+ let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array);
544
553
  let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString);
545
554
  let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString);
546
555
  let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString);
@@ -551,7 +560,10 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
551
560
  flags.push(`--loader=${loader2}`);
552
561
  if (resolveDir)
553
562
  stdinResolveDir = resolveDir + "";
554
- stdinContents = contents ? contents + "" : "";
563
+ if (typeof contents === "string")
564
+ stdinContents = encodeUTF8(contents);
565
+ else if (contents instanceof Uint8Array)
566
+ stdinContents = contents;
555
567
  }
556
568
  let nodePaths = [];
557
569
  if (nodePathsInput) {
@@ -746,8 +758,8 @@ function createChannel(streamIn) {
746
758
  if (isFirstPacket) {
747
759
  isFirstPacket = false;
748
760
  let binaryVersion = String.fromCharCode(...bytes);
749
- if (binaryVersion !== "0.14.39") {
750
- throw new Error(`Cannot start service: Host version "${"0.14.39"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
761
+ if (binaryVersion !== "0.14.53") {
762
+ throw new Error(`Cannot start service: Host version "${"0.14.53"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
751
763
  }
752
764
  return;
753
765
  }
@@ -1134,34 +1146,39 @@ function createChannel(streamIn) {
1134
1146
  if (plugins && plugins.length > 0) {
1135
1147
  if (streamIn.isSync)
1136
1148
  return handleError(new Error("Cannot use plugins in synchronous API calls"), "");
1137
- handlePlugins(options, plugins, key, details, refs).then((result) => {
1138
- if (!result.ok) {
1139
- handleError(result.error, result.pluginName);
1140
- } else {
1141
- try {
1142
- buildOrServeContinue(__spreadProps(__spreadValues({}, args), {
1143
- key,
1144
- details,
1145
- logPluginError,
1146
- requestPlugins: result.requestPlugins,
1147
- runOnEndCallbacks: result.runOnEndCallbacks,
1148
- pluginRefs: result.pluginRefs
1149
- }));
1150
- } catch (e) {
1151
- handleError(e, "");
1149
+ handlePlugins(options, plugins, key, details, refs).then(
1150
+ (result) => {
1151
+ if (!result.ok) {
1152
+ handleError(result.error, result.pluginName);
1153
+ } else {
1154
+ try {
1155
+ buildOrServeContinue({
1156
+ ...args,
1157
+ key,
1158
+ details,
1159
+ logPluginError,
1160
+ requestPlugins: result.requestPlugins,
1161
+ runOnEndCallbacks: result.runOnEndCallbacks,
1162
+ pluginRefs: result.pluginRefs
1163
+ });
1164
+ } catch (e) {
1165
+ handleError(e, "");
1166
+ }
1152
1167
  }
1153
- }
1154
- }, (e) => handleError(e, ""));
1168
+ },
1169
+ (e) => handleError(e, "")
1170
+ );
1155
1171
  } else {
1156
1172
  try {
1157
- buildOrServeContinue(__spreadProps(__spreadValues({}, args), {
1173
+ buildOrServeContinue({
1174
+ ...args,
1158
1175
  key,
1159
1176
  details,
1160
1177
  logPluginError,
1161
1178
  requestPlugins: null,
1162
1179
  runOnEndCallbacks: (result, logPluginError2, done) => done(),
1163
1180
  pluginRefs: null
1164
- }));
1181
+ });
1165
1182
  } catch (e) {
1166
1183
  handleError(e, "");
1167
1184
  }
@@ -1196,7 +1213,7 @@ function createChannel(streamIn) {
1196
1213
  callerRefs.unref();
1197
1214
  }
1198
1215
  };
1199
- let writeDefault = !streamIn.isBrowser;
1216
+ let writeDefault = !streamIn.isWriteUnavailable;
1200
1217
  let {
1201
1218
  entries,
1202
1219
  flags,
@@ -1254,18 +1271,22 @@ function createChannel(streamIn) {
1254
1271
  rebuild = () => new Promise((resolve, reject) => {
1255
1272
  if (isDisposed || closeData)
1256
1273
  throw new Error("Cannot rebuild");
1257
- sendRequest(refs, { command: "rebuild", key }, (error2, response2) => {
1258
- if (error2) {
1259
- const message = { pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
1260
- return callback2(failureErrorWithLog("Build failed", [message], []), null);
1274
+ sendRequest(
1275
+ refs,
1276
+ { command: "rebuild", key },
1277
+ (error2, response2) => {
1278
+ if (error2) {
1279
+ const message = { id: "", pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
1280
+ return callback2(failureErrorWithLog("Build failed", [message], []), null);
1281
+ }
1282
+ buildResponseToResult(response2, (error3, result3) => {
1283
+ if (error3)
1284
+ reject(error3);
1285
+ else
1286
+ resolve(result3);
1287
+ });
1261
1288
  }
1262
- buildResponseToResult(response2, (error3, result3) => {
1263
- if (error3)
1264
- reject(error3);
1265
- else
1266
- resolve(result3);
1267
- });
1268
- });
1289
+ );
1269
1290
  });
1270
1291
  refs.ref();
1271
1292
  rebuild.dispose = () => {
@@ -1324,8 +1345,8 @@ function createChannel(streamIn) {
1324
1345
  callback2(null, result);
1325
1346
  });
1326
1347
  };
1327
- if (write && streamIn.isBrowser)
1328
- throw new Error(`Cannot enable "write" in the browser`);
1348
+ if (write && streamIn.isWriteUnavailable)
1349
+ throw new Error(`The "write" option is unavailable in this environment`);
1329
1350
  if (incremental && streamIn.isSync)
1330
1351
  throw new Error(`Cannot use "incremental" with a synchronous build`);
1331
1352
  if (watch && streamIn.isSync)
@@ -1360,8 +1381,8 @@ function createChannel(streamIn) {
1360
1381
  const details = createObjectStash();
1361
1382
  let start = (inputPath) => {
1362
1383
  try {
1363
- if (typeof input !== "string")
1364
- throw new Error('The input to "transform" must be a string');
1384
+ if (typeof input !== "string" && !(input instanceof Uint8Array))
1385
+ throw new Error('The input to "transform" must be a string or a Uint8Array');
1365
1386
  let {
1366
1387
  flags,
1367
1388
  mangleCache
@@ -1370,7 +1391,7 @@ function createChannel(streamIn) {
1370
1391
  command: "transform",
1371
1392
  flags,
1372
1393
  inputFS: inputPath !== null,
1373
- input: inputPath !== null ? inputPath : input
1394
+ input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input
1374
1395
  };
1375
1396
  if (mangleCache)
1376
1397
  request.mangleCache = mangleCache;
@@ -1427,7 +1448,7 @@ function createChannel(streamIn) {
1427
1448
  });
1428
1449
  }
1429
1450
  };
1430
- if (typeof input === "string" && input.length > 1024 * 1024) {
1451
+ if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) {
1431
1452
  let next = start;
1432
1453
  start = () => fs3.writeFile(input, next);
1433
1454
  }
@@ -1539,7 +1560,7 @@ function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
1539
1560
  location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
1540
1561
  } catch {
1541
1562
  }
1542
- return { pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
1563
+ return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
1543
1564
  }
1544
1565
  function parseStackLinesV8(streamIn, lines, ident) {
1545
1566
  let at = " at ";
@@ -1638,6 +1659,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
1638
1659
  let index = 0;
1639
1660
  for (const message of messages) {
1640
1661
  let keys = {};
1662
+ let id = getFlag(message, keys, "id", mustBeString);
1641
1663
  let pluginName = getFlag(message, keys, "pluginName", mustBeString);
1642
1664
  let text = getFlag(message, keys, "text", mustBeString);
1643
1665
  let location = getFlag(message, keys, "location", mustBeObjectOrNull);
@@ -1659,6 +1681,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
1659
1681
  }
1660
1682
  }
1661
1683
  messagesClone.push({
1684
+ id: id || "",
1662
1685
  pluginName: pluginName || fallbackPluginName,
1663
1686
  text: text || "",
1664
1687
  location: sanitizeLocation(location, where),
@@ -1684,8 +1707,11 @@ function convertOutputFiles({ path: path3, contents }) {
1684
1707
  path: path3,
1685
1708
  contents,
1686
1709
  get text() {
1687
- if (text === null)
1688
- text = decodeUTF8(contents);
1710
+ const binary = this.contents;
1711
+ if (text === null || binary !== contents) {
1712
+ contents = binary;
1713
+ text = decodeUTF8(binary);
1714
+ }
1689
1715
  return text;
1690
1716
  }
1691
1717
  };
@@ -1715,6 +1741,7 @@ var knownUnixlikePackages = {
1715
1741
  "linux riscv64 LE": "esbuild-linux-riscv64",
1716
1742
  "linux s390x BE": "esbuild-linux-s390x",
1717
1743
  "linux x64 LE": "esbuild-linux-64",
1744
+ "linux loong64 LE": "@esbuild/linux-loong64",
1718
1745
  "netbsd x64 LE": "esbuild-netbsd-64",
1719
1746
  "openbsd x64 LE": "esbuild-openbsd-64",
1720
1747
  "sunos x64 LE": "esbuild-sunos-64"
@@ -1859,12 +1886,14 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1859
1886
  }
1860
1887
  }
1861
1888
  var _a;
1862
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.39";
1889
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.53";
1863
1890
  var esbuildCommandAndArgs = () => {
1864
1891
  if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1865
- throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
1892
+ throw new Error(
1893
+ `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
1866
1894
 
1867
- More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);
1895
+ More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`
1896
+ );
1868
1897
  }
1869
1898
  if (true) {
1870
1899
  return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]];
@@ -1923,7 +1952,7 @@ var fsAsync = {
1923
1952
  }
1924
1953
  }
1925
1954
  };
1926
- var version = "0.14.39";
1955
+ var version = "0.14.53";
1927
1956
  var build = (options) => ensureServiceIsRunning().build(options);
1928
1957
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1929
1958
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2018,6 +2047,8 @@ var initialize = (options) => {
2018
2047
  options = validateInitializeOptions(options || {});
2019
2048
  if (options.wasmURL)
2020
2049
  throw new Error(`The "wasmURL" option only works in the browser`);
2050
+ if (options.wasmModule)
2051
+ throw new Error(`The "wasmModule" option only works in the browser`);
2021
2052
  if (options.worker)
2022
2053
  throw new Error(`The "worker" option only works in the browser`);
2023
2054
  if (initializeWasCalled)
@@ -2032,7 +2063,7 @@ var ensureServiceIsRunning = () => {
2032
2063
  if (longLivedService)
2033
2064
  return longLivedService;
2034
2065
  let [command, args] = esbuildCommandAndArgs();
2035
- let child = child_process.spawn(command, args.concat(`--service=${"0.14.39"}`, "--ping"), {
2066
+ let child = child_process.spawn(command, args.concat(`--service=${"0.14.53"}`, "--ping"), {
2036
2067
  windowsHide: true,
2037
2068
  stdio: ["pipe", "pipe", "inherit"],
2038
2069
  cwd: defaultWD
@@ -2046,7 +2077,7 @@ var ensureServiceIsRunning = () => {
2046
2077
  },
2047
2078
  readFileSync: fs2.readFileSync,
2048
2079
  isSync: false,
2049
- isBrowser: false,
2080
+ isWriteUnavailable: false,
2050
2081
  esbuild: node_exports
2051
2082
  });
2052
2083
  child.stdin.on("error", afterClose);
@@ -2142,11 +2173,11 @@ var runServiceSync = (callback) => {
2142
2173
  stdin = bytes;
2143
2174
  },
2144
2175
  isSync: true,
2145
- isBrowser: false,
2176
+ isWriteUnavailable: false,
2146
2177
  esbuild: node_exports
2147
2178
  });
2148
2179
  callback(service);
2149
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.39"}`), {
2180
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.53"}`), {
2150
2181
  cwd: defaultWD,
2151
2182
  windowsHide: true,
2152
2183
  input: stdin,
@@ -2162,16 +2193,15 @@ var workerThreadService = null;
2162
2193
  var startWorkerThreadService = (worker_threads2) => {
2163
2194
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2164
2195
  let worker = new worker_threads2.Worker(__filename, {
2165
- workerData: { workerPort, defaultWD, esbuildVersion: "0.14.39" },
2196
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.14.53" },
2166
2197
  transferList: [workerPort],
2167
2198
  execArgv: []
2168
2199
  });
2169
2200
  let nextID = 0;
2170
- let wasStopped = false;
2171
2201
  let fakeBuildError = (text) => {
2172
2202
  let error = new Error(`Build failed with 1 error:
2173
2203
  error: ${text}`);
2174
- let errors = [{ pluginName: "", text, location: null, notes: [], detail: void 0 }];
2204
+ let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
2175
2205
  error.errors = errors;
2176
2206
  error.warnings = [];
2177
2207
  return error;
@@ -2195,8 +2225,6 @@ error: ${text}`);
2195
2225
  }
2196
2226
  };
2197
2227
  let runCallSync = (command, args) => {
2198
- if (wasStopped)
2199
- throw new Error("The service was stopped");
2200
2228
  let id = nextID++;
2201
2229
  let sharedBuffer = new SharedArrayBuffer(8);
2202
2230
  let sharedBufferView = new Int32Array(sharedBuffer);
@@ -2234,8 +2262,6 @@ error: ${text}`);
2234
2262
  var startSyncServiceWorker = () => {
2235
2263
  let workerPort = worker_threads.workerData.workerPort;
2236
2264
  let parentPort = worker_threads.parentPort;
2237
- let service = ensureServiceIsRunning();
2238
- defaultWD = worker_threads.workerData.defaultWD;
2239
2265
  let extractProperties = (object) => {
2240
2266
  let properties = {};
2241
2267
  if (object && typeof object === "object") {
@@ -2245,34 +2271,46 @@ var startSyncServiceWorker = () => {
2245
2271
  }
2246
2272
  return properties;
2247
2273
  };
2248
- parentPort.on("message", (msg) => {
2249
- (async () => {
2250
- let { sharedBuffer, id, command, args } = msg;
2251
- let sharedBufferView = new Int32Array(sharedBuffer);
2252
- try {
2253
- switch (command) {
2254
- case "build":
2255
- workerPort.postMessage({ id, resolve: await service.build(args[0]) });
2256
- break;
2257
- case "transform":
2258
- workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) });
2259
- break;
2260
- case "formatMessages":
2261
- workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) });
2262
- break;
2263
- case "analyzeMetafile":
2264
- workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) });
2265
- break;
2266
- default:
2267
- throw new Error(`Invalid command: ${command}`);
2274
+ try {
2275
+ let service = ensureServiceIsRunning();
2276
+ defaultWD = worker_threads.workerData.defaultWD;
2277
+ parentPort.on("message", (msg) => {
2278
+ (async () => {
2279
+ let { sharedBuffer, id, command, args } = msg;
2280
+ let sharedBufferView = new Int32Array(sharedBuffer);
2281
+ try {
2282
+ switch (command) {
2283
+ case "build":
2284
+ workerPort.postMessage({ id, resolve: await service.build(args[0]) });
2285
+ break;
2286
+ case "transform":
2287
+ workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) });
2288
+ break;
2289
+ case "formatMessages":
2290
+ workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) });
2291
+ break;
2292
+ case "analyzeMetafile":
2293
+ workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) });
2294
+ break;
2295
+ default:
2296
+ throw new Error(`Invalid command: ${command}`);
2297
+ }
2298
+ } catch (reject) {
2299
+ workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2268
2300
  }
2269
- } catch (reject) {
2270
- workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2271
- }
2301
+ Atomics.add(sharedBufferView, 0, 1);
2302
+ Atomics.notify(sharedBufferView, 0, Infinity);
2303
+ })();
2304
+ });
2305
+ } catch (reject) {
2306
+ parentPort.on("message", (msg) => {
2307
+ let { sharedBuffer, id } = msg;
2308
+ let sharedBufferView = new Int32Array(sharedBuffer);
2309
+ workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2272
2310
  Atomics.add(sharedBufferView, 0, 1);
2273
2311
  Atomics.notify(sharedBufferView, 0, Infinity);
2274
- })();
2275
- });
2312
+ });
2313
+ }
2276
2314
  };
2277
2315
  if (isInternalWorkerThread) {
2278
2316
  startSyncServiceWorker();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild-wasm",
3
- "version": "0.14.39",
3
+ "version": "0.14.53",
4
4
  "description": "The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "license": "MIT",
data/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/isomorfeus/isomorfeus-asset-manager",
6
6
  "dependencies": {
7
- "esbuild-wasm": "0.14.39"
7
+ "esbuild-wasm": "0.14.53"
8
8
  }
9
9
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-asset-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.23
4
+ version: 0.14.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-20 00:00:00.000000000 Z
11
+ date: 2022-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.7.49
33
+ version: 0.7.50
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.7.49
40
+ version: 0.7.50
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: isomorfeus-speednode
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 3.13.11
75
+ version: 3.13.13
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.13.11
82
+ version: 3.13.13
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: opal
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -170,6 +170,7 @@ files:
170
170
  - node_modules/.bin/esbuild.cmd
171
171
  - node_modules/.bin/esbuild.ps1
172
172
  - node_modules/.package-lock.json
173
+ - node_modules/esbuild-wasm/LICENSE.md
173
174
  - node_modules/esbuild-wasm/README.md
174
175
  - node_modules/esbuild-wasm/bin/esbuild
175
176
  - node_modules/esbuild-wasm/esbuild.wasm