isomorfeus-asset-manager 0.14.24 → 0.15.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.
@@ -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,10 +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);
321
310
  let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
311
+ let supported = getFlag(options, keys, "supported", mustBeObject);
322
312
  let pure = getFlag(options, keys, "pure", mustBeArray);
323
313
  let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
314
+ let platform = getFlag(options, keys, "platform", mustBeString);
324
315
  if (legalComments)
325
316
  flags.push(`--legal-comments=${legalComments}`);
326
317
  if (sourceRoot !== void 0)
@@ -337,6 +328,8 @@ function pushCommonFlags(flags, options, keys) {
337
328
  flags.push(`--format=${format}`);
338
329
  if (globalName)
339
330
  flags.push(`--global-name=${globalName}`);
331
+ if (platform)
332
+ flags.push(`--platform=${platform}`);
340
333
  if (minify)
341
334
  flags.push("--minify");
342
335
  if (minifySyntax)
@@ -366,6 +359,10 @@ function pushCommonFlags(flags, options, keys) {
366
359
  flags.push(`--jsx-factory=${jsxFactory}`);
367
360
  if (jsxFragment)
368
361
  flags.push(`--jsx-fragment=${jsxFragment}`);
362
+ if (jsxImportSource)
363
+ flags.push(`--jsx-import-source=${jsxImportSource}`);
364
+ if (jsxDev)
365
+ flags.push(`--jsx-dev`);
369
366
  if (define) {
370
367
  for (let key in define) {
371
368
  if (key.indexOf("=") >= 0)
@@ -380,6 +377,13 @@ function pushCommonFlags(flags, options, keys) {
380
377
  flags.push(`--log-override:${key}=${logOverride[key]}`);
381
378
  }
382
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
+ }
383
387
  if (pure)
384
388
  for (let fn of pure)
385
389
  flags.push(`--pure:${fn}`);
@@ -405,7 +409,6 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
405
409
  let outfile = getFlag(options, keys, "outfile", mustBeString);
406
410
  let outdir = getFlag(options, keys, "outdir", mustBeString);
407
411
  let outbase = getFlag(options, keys, "outbase", mustBeString);
408
- let platform = getFlag(options, keys, "platform", mustBeString);
409
412
  let tsconfig = getFlag(options, keys, "tsconfig", mustBeString);
410
413
  let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray);
411
414
  let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray);
@@ -459,8 +462,6 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
459
462
  flags.push(`--outdir=${outdir}`);
460
463
  if (outbase)
461
464
  flags.push(`--outbase=${outbase}`);
462
- if (platform)
463
- flags.push(`--platform=${platform}`);
464
465
  if (tsconfig)
465
466
  flags.push(`--tsconfig=${tsconfig}`);
466
467
  if (resolveExtensions) {
@@ -548,7 +549,7 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
548
549
  }
549
550
  if (stdin) {
550
551
  let stdinKeys = /* @__PURE__ */ Object.create(null);
551
- let contents = getFlag(stdin, stdinKeys, "contents", mustBeString);
552
+ let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array);
552
553
  let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString);
553
554
  let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString);
554
555
  let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString);
@@ -559,7 +560,10 @@ function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeD
559
560
  flags.push(`--loader=${loader2}`);
560
561
  if (resolveDir)
561
562
  stdinResolveDir = resolveDir + "";
562
- stdinContents = contents ? contents + "" : "";
563
+ if (typeof contents === "string")
564
+ stdinContents = encodeUTF8(contents);
565
+ else if (contents instanceof Uint8Array)
566
+ stdinContents = contents;
563
567
  }
564
568
  let nodePaths = [];
565
569
  if (nodePathsInput) {
@@ -754,8 +758,8 @@ function createChannel(streamIn) {
754
758
  if (isFirstPacket) {
755
759
  isFirstPacket = false;
756
760
  let binaryVersion = String.fromCharCode(...bytes);
757
- if (binaryVersion !== "0.14.42") {
758
- throw new Error(`Cannot start service: Host version "${"0.14.42"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
761
+ if (binaryVersion !== "0.15.0") {
762
+ throw new Error(`Cannot start service: Host version "${"0.15.0"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
759
763
  }
760
764
  return;
761
765
  }
@@ -1142,34 +1146,39 @@ function createChannel(streamIn) {
1142
1146
  if (plugins && plugins.length > 0) {
1143
1147
  if (streamIn.isSync)
1144
1148
  return handleError(new Error("Cannot use plugins in synchronous API calls"), "");
1145
- handlePlugins(options, plugins, key, details, refs).then((result) => {
1146
- if (!result.ok) {
1147
- handleError(result.error, result.pluginName);
1148
- } else {
1149
- try {
1150
- buildOrServeContinue(__spreadProps(__spreadValues({}, args), {
1151
- key,
1152
- details,
1153
- logPluginError,
1154
- requestPlugins: result.requestPlugins,
1155
- runOnEndCallbacks: result.runOnEndCallbacks,
1156
- pluginRefs: result.pluginRefs
1157
- }));
1158
- } catch (e) {
1159
- 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
+ }
1160
1167
  }
1161
- }
1162
- }, (e) => handleError(e, ""));
1168
+ },
1169
+ (e) => handleError(e, "")
1170
+ );
1163
1171
  } else {
1164
1172
  try {
1165
- buildOrServeContinue(__spreadProps(__spreadValues({}, args), {
1173
+ buildOrServeContinue({
1174
+ ...args,
1166
1175
  key,
1167
1176
  details,
1168
1177
  logPluginError,
1169
1178
  requestPlugins: null,
1170
1179
  runOnEndCallbacks: (result, logPluginError2, done) => done(),
1171
1180
  pluginRefs: null
1172
- }));
1181
+ });
1173
1182
  } catch (e) {
1174
1183
  handleError(e, "");
1175
1184
  }
@@ -1204,7 +1213,7 @@ function createChannel(streamIn) {
1204
1213
  callerRefs.unref();
1205
1214
  }
1206
1215
  };
1207
- let writeDefault = !streamIn.isBrowser;
1216
+ let writeDefault = !streamIn.isWriteUnavailable;
1208
1217
  let {
1209
1218
  entries,
1210
1219
  flags,
@@ -1262,18 +1271,22 @@ function createChannel(streamIn) {
1262
1271
  rebuild = () => new Promise((resolve, reject) => {
1263
1272
  if (isDisposed || closeData)
1264
1273
  throw new Error("Cannot rebuild");
1265
- sendRequest(refs, { command: "rebuild", key }, (error2, response2) => {
1266
- if (error2) {
1267
- const message = { pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
1268
- 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
+ });
1269
1288
  }
1270
- buildResponseToResult(response2, (error3, result3) => {
1271
- if (error3)
1272
- reject(error3);
1273
- else
1274
- resolve(result3);
1275
- });
1276
- });
1289
+ );
1277
1290
  });
1278
1291
  refs.ref();
1279
1292
  rebuild.dispose = () => {
@@ -1332,8 +1345,8 @@ function createChannel(streamIn) {
1332
1345
  callback2(null, result);
1333
1346
  });
1334
1347
  };
1335
- if (write && streamIn.isBrowser)
1336
- 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`);
1337
1350
  if (incremental && streamIn.isSync)
1338
1351
  throw new Error(`Cannot use "incremental" with a synchronous build`);
1339
1352
  if (watch && streamIn.isSync)
@@ -1368,8 +1381,8 @@ function createChannel(streamIn) {
1368
1381
  const details = createObjectStash();
1369
1382
  let start = (inputPath) => {
1370
1383
  try {
1371
- if (typeof input !== "string")
1372
- 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');
1373
1386
  let {
1374
1387
  flags,
1375
1388
  mangleCache
@@ -1378,7 +1391,7 @@ function createChannel(streamIn) {
1378
1391
  command: "transform",
1379
1392
  flags,
1380
1393
  inputFS: inputPath !== null,
1381
- input: inputPath !== null ? inputPath : input
1394
+ input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input
1382
1395
  };
1383
1396
  if (mangleCache)
1384
1397
  request.mangleCache = mangleCache;
@@ -1435,7 +1448,7 @@ function createChannel(streamIn) {
1435
1448
  });
1436
1449
  }
1437
1450
  };
1438
- if (typeof input === "string" && input.length > 1024 * 1024) {
1451
+ if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) {
1439
1452
  let next = start;
1440
1453
  start = () => fs3.writeFile(input, next);
1441
1454
  }
@@ -1547,7 +1560,7 @@ function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
1547
1560
  location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
1548
1561
  } catch {
1549
1562
  }
1550
- 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 };
1551
1564
  }
1552
1565
  function parseStackLinesV8(streamIn, lines, ident) {
1553
1566
  let at = " at ";
@@ -1646,6 +1659,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
1646
1659
  let index = 0;
1647
1660
  for (const message of messages) {
1648
1661
  let keys = {};
1662
+ let id = getFlag(message, keys, "id", mustBeString);
1649
1663
  let pluginName = getFlag(message, keys, "pluginName", mustBeString);
1650
1664
  let text = getFlag(message, keys, "text", mustBeString);
1651
1665
  let location = getFlag(message, keys, "location", mustBeObjectOrNull);
@@ -1667,6 +1681,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
1667
1681
  }
1668
1682
  }
1669
1683
  messagesClone.push({
1684
+ id: id || "",
1670
1685
  pluginName: pluginName || fallbackPluginName,
1671
1686
  text: text || "",
1672
1687
  location: sanitizeLocation(location, where),
@@ -1692,8 +1707,11 @@ function convertOutputFiles({ path: path3, contents }) {
1692
1707
  path: path3,
1693
1708
  contents,
1694
1709
  get text() {
1695
- if (text === null)
1696
- text = decodeUTF8(contents);
1710
+ const binary = this.contents;
1711
+ if (text === null || binary !== contents) {
1712
+ contents = binary;
1713
+ text = decodeUTF8(binary);
1714
+ }
1697
1715
  return text;
1698
1716
  }
1699
1717
  };
@@ -1723,6 +1741,7 @@ var knownUnixlikePackages = {
1723
1741
  "linux riscv64 LE": "esbuild-linux-riscv64",
1724
1742
  "linux s390x BE": "esbuild-linux-s390x",
1725
1743
  "linux x64 LE": "esbuild-linux-64",
1744
+ "linux loong64 LE": "@esbuild/linux-loong64",
1726
1745
  "netbsd x64 LE": "esbuild-netbsd-64",
1727
1746
  "openbsd x64 LE": "esbuild-openbsd-64",
1728
1747
  "sunos x64 LE": "esbuild-sunos-64"
@@ -1867,12 +1886,14 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1867
1886
  }
1868
1887
  }
1869
1888
  var _a;
1870
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.42";
1889
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.15.0";
1871
1890
  var esbuildCommandAndArgs = () => {
1872
1891
  if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1873
- 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.
1874
1894
 
1875
- 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
+ );
1876
1897
  }
1877
1898
  if (true) {
1878
1899
  return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]];
@@ -1931,7 +1952,7 @@ var fsAsync = {
1931
1952
  }
1932
1953
  }
1933
1954
  };
1934
- var version = "0.14.42";
1955
+ var version = "0.15.0";
1935
1956
  var build = (options) => ensureServiceIsRunning().build(options);
1936
1957
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1937
1958
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2026,6 +2047,8 @@ var initialize = (options) => {
2026
2047
  options = validateInitializeOptions(options || {});
2027
2048
  if (options.wasmURL)
2028
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`);
2029
2052
  if (options.worker)
2030
2053
  throw new Error(`The "worker" option only works in the browser`);
2031
2054
  if (initializeWasCalled)
@@ -2040,7 +2063,7 @@ var ensureServiceIsRunning = () => {
2040
2063
  if (longLivedService)
2041
2064
  return longLivedService;
2042
2065
  let [command, args] = esbuildCommandAndArgs();
2043
- let child = child_process.spawn(command, args.concat(`--service=${"0.14.42"}`, "--ping"), {
2066
+ let child = child_process.spawn(command, args.concat(`--service=${"0.15.0"}`, "--ping"), {
2044
2067
  windowsHide: true,
2045
2068
  stdio: ["pipe", "pipe", "inherit"],
2046
2069
  cwd: defaultWD
@@ -2054,7 +2077,7 @@ var ensureServiceIsRunning = () => {
2054
2077
  },
2055
2078
  readFileSync: fs2.readFileSync,
2056
2079
  isSync: false,
2057
- isBrowser: false,
2080
+ isWriteUnavailable: false,
2058
2081
  esbuild: node_exports
2059
2082
  });
2060
2083
  child.stdin.on("error", afterClose);
@@ -2150,11 +2173,11 @@ var runServiceSync = (callback) => {
2150
2173
  stdin = bytes;
2151
2174
  },
2152
2175
  isSync: true,
2153
- isBrowser: false,
2176
+ isWriteUnavailable: false,
2154
2177
  esbuild: node_exports
2155
2178
  });
2156
2179
  callback(service);
2157
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.42"}`), {
2180
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.15.0"}`), {
2158
2181
  cwd: defaultWD,
2159
2182
  windowsHide: true,
2160
2183
  input: stdin,
@@ -2170,16 +2193,15 @@ var workerThreadService = null;
2170
2193
  var startWorkerThreadService = (worker_threads2) => {
2171
2194
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2172
2195
  let worker = new worker_threads2.Worker(__filename, {
2173
- workerData: { workerPort, defaultWD, esbuildVersion: "0.14.42" },
2196
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.15.0" },
2174
2197
  transferList: [workerPort],
2175
2198
  execArgv: []
2176
2199
  });
2177
2200
  let nextID = 0;
2178
- let wasStopped = false;
2179
2201
  let fakeBuildError = (text) => {
2180
2202
  let error = new Error(`Build failed with 1 error:
2181
2203
  error: ${text}`);
2182
- let errors = [{ pluginName: "", text, location: null, notes: [], detail: void 0 }];
2204
+ let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
2183
2205
  error.errors = errors;
2184
2206
  error.warnings = [];
2185
2207
  return error;
@@ -2203,8 +2225,6 @@ error: ${text}`);
2203
2225
  }
2204
2226
  };
2205
2227
  let runCallSync = (command, args) => {
2206
- if (wasStopped)
2207
- throw new Error("The service was stopped");
2208
2228
  let id = nextID++;
2209
2229
  let sharedBuffer = new SharedArrayBuffer(8);
2210
2230
  let sharedBufferView = new Int32Array(sharedBuffer);
@@ -2242,8 +2262,6 @@ error: ${text}`);
2242
2262
  var startSyncServiceWorker = () => {
2243
2263
  let workerPort = worker_threads.workerData.workerPort;
2244
2264
  let parentPort = worker_threads.parentPort;
2245
- let service = ensureServiceIsRunning();
2246
- defaultWD = worker_threads.workerData.defaultWD;
2247
2265
  let extractProperties = (object) => {
2248
2266
  let properties = {};
2249
2267
  if (object && typeof object === "object") {
@@ -2253,34 +2271,46 @@ var startSyncServiceWorker = () => {
2253
2271
  }
2254
2272
  return properties;
2255
2273
  };
2256
- parentPort.on("message", (msg) => {
2257
- (async () => {
2258
- let { sharedBuffer, id, command, args } = msg;
2259
- let sharedBufferView = new Int32Array(sharedBuffer);
2260
- try {
2261
- switch (command) {
2262
- case "build":
2263
- workerPort.postMessage({ id, resolve: await service.build(args[0]) });
2264
- break;
2265
- case "transform":
2266
- workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) });
2267
- break;
2268
- case "formatMessages":
2269
- workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) });
2270
- break;
2271
- case "analyzeMetafile":
2272
- workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) });
2273
- break;
2274
- default:
2275
- 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) });
2276
2300
  }
2277
- } catch (reject) {
2278
- workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2279
- }
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) });
2280
2310
  Atomics.add(sharedBufferView, 0, 1);
2281
2311
  Atomics.notify(sharedBufferView, 0, Infinity);
2282
- })();
2283
- });
2312
+ });
2313
+ }
2284
2314
  };
2285
2315
  if (isInternalWorkerThread) {
2286
2316
  startSyncServiceWorker();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild-wasm",
3
- "version": "0.14.42",
3
+ "version": "0.15.0",
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.42"
7
+ "esbuild-wasm": "0.15.0"
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.24
4
+ version: 0.15.0
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-30 00:00:00.000000000 Z
11
+ date: 2022-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli
@@ -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