isomorfeus-asset-manager 0.14.21 → 0.14.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5cf524bb95ea6eaa13f38dc97708c888bf03b4f25471ee75daa1037bf2ae2e2
4
- data.tar.gz: 95a07004dd5d82c9cb92ea7284109c363e0917752fcb5f73454c04789260dfe6
3
+ metadata.gz: e208b674f5b5ed724db1be5c74054c92d4b2468faea3a30267f528f36c1bb9ce
4
+ data.tar.gz: 03201b0049a608178c9a7d550749556de94ad9e9382eca635f18694ed5debd51
5
5
  SHA512:
6
- metadata.gz: 01b7e6f0ca7eb49ab6bbbd2f96cf05e1e525cadcb0ea2b641a58bd98fe5a20404fd95890408e37a51e965fa6f6a2d144fedb369601bd0093898e2fb152db1998
7
- data.tar.gz: f784e2c97646fb1247220317200362043bf720f35d4b2e243c97f51f32a6828f8b53c23ab8721eb73c856c9221d50b72c92c650b6652117eaee92c704e2827b8
6
+ metadata.gz: ff78d031bde9dc60794d00abd392449f6acee64845d9ba5270749dcea6fbe89c680da79c5a46975db1ff16f6c036b525f330c1fd211fc0462f842cf29cdc102c
7
+ data.tar.gz: 2088239fe557d25847360d8e5348d0052f72176384bd22492e1222569286a9c196f53284dd895c9ce46fdc93bc13c0faf045aa9bd7d72db4637c45d0a10c66d0
@@ -78,7 +78,7 @@ module Isomorfeus
78
78
 
79
79
  self.hmr_listener = nil
80
80
  self.asset_manager_hmr_channel = :isomorfeus_asset_manager_module_updates
81
- self.asset_manager_hmr_dirs = %w[channels components data imports locales operations policies server]
81
+ self.asset_manager_hmr_dirs = %w[channels components data imports locales mail_components operations policies server]
82
82
  self.hmr_websocket_path = '/_asset_manager_hmr_websocket'
83
83
  self.assets_path = '/assets'
84
84
  self.assets = {
@@ -49,7 +49,7 @@ module Isomorfeus
49
49
  def generate_entry(asset_name)
50
50
  js = ''
51
51
  js << "#{@js_imports.map(&:to_s).join("\n")}"
52
- js << "#{@ruby_imports.map { |i| i.to_s(asset_name) }.join("\n")}"
52
+ js << "#{@ruby_imports.map { |i| i.to_s(asset_name) }.join('')}"
53
53
  end
54
54
  end
55
55
  end
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.14.21'
3
+ VERSION = '0.14.22'
4
4
  end
5
5
  end
@@ -1,18 +1,18 @@
1
- {
2
- "name": "isomorfeus-asset-manager",
3
- "lockfileVersion": 2,
4
- "requires": true,
5
- "packages": {
6
- "node_modules/esbuild-wasm": {
7
- "version": "0.14.23",
8
- "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.23.tgz",
9
- "integrity": "sha512-w1qhGLvUaPXiigGWIEGcnMmN/FxQ6VDLnHQIOpf29Qh9z6x4qe4gmsQyUbFBW6UsWsw/E8OJDE0XRtiV/0siYQ==",
10
- "bin": {
11
- "esbuild": "bin/esbuild"
12
- },
13
- "engines": {
14
- "node": ">=12"
15
- }
16
- }
17
- }
18
- }
1
+ {
2
+ "name": "isomorfeus-asset-manager",
3
+ "lockfileVersion": 2,
4
+ "requires": true,
5
+ "packages": {
6
+ "node_modules/esbuild-wasm": {
7
+ "version": "0.14.36",
8
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.36.tgz",
9
+ "integrity": "sha512-tDMs2l397fd/pwLoIKb4uYfQayM5hMfUwVvCmzbFEU+zXedj15/Z/A8iD87cWHN1VD66REdgcGMt1BO6C7RnLw==",
10
+ "bin": {
11
+ "esbuild": "bin/esbuild"
12
+ },
13
+ "engines": {
14
+ "node": ">=12"
15
+ }
16
+ }
17
+ }
18
+ }
@@ -2,17 +2,18 @@
2
2
 
3
3
  // Forward to the automatically-generated WebAssembly loader from the Go compiler
4
4
 
5
+ const module_ = require('module');
5
6
  const crypto = require('crypto');
6
7
  const path = require('path');
7
8
  const zlib = require('zlib');
8
9
  const fs = require('fs');
9
10
  const os = require('os');
10
11
 
11
- const wasm_exec = path.join(__dirname, '..', 'wasm_exec.js');
12
+ const wasm_exec_node = path.join(__dirname, '..', 'wasm_exec_node.js');
12
13
  const esbuild_wasm = path.join(__dirname, '..', 'esbuild.wasm');
13
14
 
14
- const code = fs.readFileSync(wasm_exec, 'utf8');
15
- const wrapper = new Function('require', 'module', 'process', 'WebAssembly', code);
15
+ const code = fs.readFileSync(wasm_exec_node, 'utf8');
16
+ const wrapper = new Function('require', 'WebAssembly', code);
16
17
 
17
18
  function instantiate(bytes, importObject) {
18
19
  // Using this API causes "./esbuild --version" to run around 1 second faster
@@ -80,6 +81,37 @@ fs.read = function () {
80
81
  return read.apply(this, arguments);
81
82
  };
82
83
 
84
+ // Hack around a Unicode bug in node: https://github.com/nodejs/node/issues/24550.
85
+ // See this for the matching Go issue: https://github.com/golang/go/issues/43917.
86
+ const write = fs.write;
87
+ fs.write = function (fd, buf, offset, length, position, callback) {
88
+ if (offset === 0 && length === buf.length && position === null) {
89
+ if (fd === process.stdout.fd) {
90
+ try {
91
+ process.stdout.write(buf, err => err ? callback(err, 0, null) : callback(null, length, buf));
92
+ } catch (err) {
93
+ callback(err, 0, null);
94
+ }
95
+ return;
96
+ }
97
+ if (fd === process.stderr.fd) {
98
+ try {
99
+ process.stderr.write(buf, err => err ? callback(err, 0, null) : callback(null, length, buf));
100
+ } catch (err) {
101
+ callback(err, 0, null);
102
+ }
103
+ return;
104
+ }
105
+ }
106
+ return write.apply(this, arguments);
107
+ };
108
+ const writeSync = fs.writeSync;
109
+ fs.writeSync = function (fd, buf) {
110
+ if (fd === process.stdout.fd) return process.stdout.write(buf), buf.length;
111
+ if (fd === process.stderr.fd) return process.stderr.write(buf), buf.length;
112
+ return writeSync.apply(this, arguments);
113
+ };
114
+
83
115
  // WASM code generated with Go 1.17.2+ will crash when run in a situation with
84
116
  // many environment variables: https://github.com/golang/go/issues/49011. An
85
117
  // example of this situation is running a Go-compiled WASM executable in GitHub
@@ -97,5 +129,5 @@ for (let key in process.env) {
97
129
  }
98
130
  }
99
131
 
100
- const argv = ['node', wasm_exec, esbuild_wasm].concat(process.argv.slice(2));
101
- wrapper(require, require.main, Object.assign(Object.create(process), { argv }), Object.assign(Object.create(WebAssembly), { instantiate }));
132
+ process.argv.splice(2, 0, esbuild_wasm);
133
+ wrapper(module_.createRequire(wasm_exec_node), Object.assign(Object.create(WebAssembly), { instantiate }));
Binary file
@@ -7,7 +7,7 @@ export type Drop = 'console' | 'debugger';
7
7
 
8
8
  interface CommonOptions {
9
9
  /** Documentation: https://esbuild.github.io/api/#sourcemap */
10
- sourcemap?: boolean | 'inline' | 'external' | 'both';
10
+ sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
11
11
  /** Documentation: https://esbuild.github.io/api/#legal-comments */
12
12
  legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
13
13
  /** Documentation: https://esbuild.github.io/api/#source-root */
@@ -27,6 +27,8 @@ interface CommonOptions {
27
27
  /** Documentation: https://esbuild.github.io/api/#mangle-props */
28
28
  reserveProps?: RegExp;
29
29
  /** Documentation: https://esbuild.github.io/api/#mangle-props */
30
+ mangleQuoted?: boolean;
31
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
30
32
  mangleCache?: Record<string, string | false>;
31
33
  /** Documentation: https://esbuild.github.io/api/#drop */
32
34
  drop?: Drop[];
@@ -569,6 +571,16 @@ export interface InitializeOptions {
569
571
  */
570
572
  wasmURL?: string
571
573
 
574
+ /**
575
+ * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
576
+ * is a typed array or ArrayBuffer containing the binary code of the
577
+ * "esbuild.wasm" file.
578
+ *
579
+ * You can use this as an alternative to "wasmURL" for environments where it's
580
+ * not possible to download the WebAssembly module.
581
+ */
582
+ wasmModule?: WebAssembly.Module
583
+
572
584
  /**
573
585
  * By default esbuild runs the WebAssembly-based browser API in a web worker
574
586
  * to avoid blocking the UI thread. This can be disabled by setting "worker"