isomorfeus-asset-manager 0.15.10 → 0.16.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f32c968ef6c3f285621ea0a376b3a4665c7d11341e8fdd7c9840651d9a70b0a9
4
- data.tar.gz: 56f139301a94bf1e18499d9027e78ad977611253f74113395cf1c1c8e3ce4f1c
3
+ metadata.gz: 259297a0a8596e22a40abe444ebdde38a92640fbee24efc41f5eea1a1eaa9d95
4
+ data.tar.gz: b3b2f288e4839ce833cda73758e0b61e99b236a64b8b1cd23b944bfaa1b1f8f0
5
5
  SHA512:
6
- metadata.gz: baad2ff89fe5c403263f85b2cb5c2742306c144ee28db4c593638143463fc8d0576cb3916092dd73cbced416580df25a315bfc8bbd753655412c405e48ecb504
7
- data.tar.gz: cd859e3adc60a8af3bd1f27d3fc88b7450f3e9b3d739c062451ce8e6c4f55ac2ed8b5ef2672bb2c9707a7b2bbda04b98a06eb08cb78947d1f1cf4c9b87e66cdb
6
+ metadata.gz: c6c39718827df12f4c6fe92740be749699534a0766a27295bc15bec759fd5789bc635e4c7c970d6b5e2ffc96bb8ae9dc6f26118cfde9601cb87ea325749bf4c5
7
+ data.tar.gz: 3753cc6666a0732f0bbcc38ca47902b9013c22094bfd5a23cbcd12444b425ed81d3e2607c82e926d08c20d3616510511ec48647e06f930dd089a73c4da4f4ff2
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.15.10'
3
+ VERSION = '0.16.0'
4
4
  end
5
5
  end
@@ -4,9 +4,9 @@
4
4
  "requires": true,
5
5
  "packages": {
6
6
  "node_modules/esbuild-wasm": {
7
- "version": "0.15.15",
8
- "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.15.15.tgz",
9
- "integrity": "sha512-B8OfZ0cm/zvbznYXbHnLRRp31hBObFiDAKnbTeUMHOZkyAbEClHETxSgZ/0fjm4XdkZGcBI/ZTpCa5JSTZVA7A==",
7
+ "version": "0.16.1",
8
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.16.1.tgz",
9
+ "integrity": "sha512-Sf1IJNwserrnFLO7SEdo83BIq3QAml6omLxKl5tP1tB1KgHLRaDdEyr+JxKGCmymSTVU7e5msbR9OrrrZkTENQ==",
10
10
  "bin": {
11
11
  "esbuild": "bin/esbuild"
12
12
  },
@@ -3,11 +3,8 @@
3
3
  // Forward to the automatically-generated WebAssembly loader from the Go compiler
4
4
 
5
5
  const module_ = require('module');
6
- const crypto = require('crypto');
7
6
  const path = require('path');
8
- const zlib = require('zlib');
9
7
  const fs = require('fs');
10
- const os = require('os');
11
8
 
12
9
  const wasm_exec_node = path.join(__dirname, '..', 'wasm_exec_node.js');
13
10
  const esbuild_wasm = path.join(__dirname, '..', 'esbuild.wasm');
@@ -23,45 +20,6 @@ function instantiate(bytes, importObject) {
23
20
  return Promise.resolve({ instance, module });
24
21
  }
25
22
 
26
- // Node has an unfortunate bug where the node process is unnecessarily kept open while a
27
- // WebAssembly module is being optimized: https://github.com/nodejs/node/issues/36616.
28
- // This means cases where running "esbuild" should take a few milliseconds can end up
29
- // taking many seconds instead. To work around this bug, it is possible to force node to
30
- // exit by calling the operating system's exit function. That's what this code does.
31
- process.on('exit', code => {
32
- // If it's a non-zero exit code, we can just kill our own process to stop. This will
33
- // preserve the fact that there is a non-zero exit code although the exit code will
34
- // be different. We cannot use this if the exit code is supposed to be zero.
35
- if (code !== 0) {
36
- try {
37
- process.kill(process.pid, 'SIGINT');
38
- } catch (e) {
39
- }
40
- return;
41
- }
42
-
43
- // Otherwise if the exit code is zero, try to fall back to a binary N-API module that
44
- // calls the operating system's "exit(0)" function.
45
- const nativeModule = `${process.platform}-${os.arch()}-${os.endianness()}.node`;
46
- const base64 = require('../exit0')[nativeModule];
47
- if (base64) {
48
- try {
49
- const data = zlib.inflateRawSync(Buffer.from(base64, 'base64'));
50
- const hash = crypto.createHash('sha256').update(base64).digest().toString('hex').slice(0, 16);
51
- const tempFile = path.join(os.tmpdir(), `${hash}-${nativeModule}`);
52
- try {
53
- if (fs.readFileSync(tempFile).equals(data)) {
54
- require(tempFile);
55
- }
56
- } finally {
57
- fs.writeFileSync(tempFile, data);
58
- require(tempFile);
59
- }
60
- } catch (e) {
61
- }
62
- }
63
- });
64
-
65
23
  // Node has another bug where using "fs.read" to read from stdin reads
66
24
  // everything successfully and then throws an error, but only on Windows. Go's
67
25
  // WebAssembly support uses "fs.read" so it hits this problem. This is a patch
Binary file
@@ -98,6 +98,8 @@ export interface BuildOptions extends CommonOptions {
98
98
  outbase?: string;
99
99
  /** Documentation: https://esbuild.github.io/api/#external */
100
100
  external?: string[];
101
+ /** Documentation: https://esbuild.github.io/api/#alias */
102
+ alias?: Record<string, string>;
101
103
  /** Documentation: https://esbuild.github.io/api/#loader */
102
104
  loader?: { [ext: string]: Loader };
103
105
  /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
@@ -191,8 +193,8 @@ export interface OutputFile {
191
193
  path: string;
192
194
  /** "text" as bytes */
193
195
  contents: Uint8Array;
194
- /** "contents" as text */
195
- text: string;
196
+ /** "contents" as text (changes automatically with "contents") */
197
+ get text(): string;
196
198
  }
197
199
 
198
200
  export interface BuildInvalidate {
@@ -586,7 +588,7 @@ export interface InitializeOptions {
586
588
  * The URL of the "esbuild.wasm" file. This must be provided when running
587
589
  * esbuild in the browser.
588
590
  */
589
- wasmURL?: string
591
+ wasmURL?: string | URL
590
592
 
591
593
  /**
592
594
  * The result of calling "new WebAssembly.Module(buffer)" where "buffer"