isomorfeus-asset-manager 0.14.21 → 0.14.24

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: f586e23dc01984bc63ef61bf778358cd86c29aca7e267dba653980ff375d060d
4
+ data.tar.gz: 1f94c309bc6afa788e21f49d98112bc0b112c8d8f98f15d1a9d4f09c9ed898c0
5
5
  SHA512:
6
- metadata.gz: 01b7e6f0ca7eb49ab6bbbd2f96cf05e1e525cadcb0ea2b641a58bd98fe5a20404fd95890408e37a51e965fa6f6a2d144fedb369601bd0093898e2fb152db1998
7
- data.tar.gz: f784e2c97646fb1247220317200362043bf720f35d4b2e243c97f51f32a6828f8b53c23ab8721eb73c856c9221d50b72c92c650b6652117eaee92c704e2827b8
6
+ metadata.gz: 7e71f723e77390090e380c4bbab129383e370e85062eac29522fd70847ea04365bf98171d61a0b4ea1cb2e58687eddcc70cbff40e81abbd0a524918770fa05b4
7
+ data.tar.gz: b08b9e83032b7cd606161adf451e4a914817b982382913ec43033baeb1e0f5968a8e8078f1dce5cb928c734e4d33a35148d21119e5de4a661f0e97d29926d219
@@ -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.24'
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.42",
8
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.42.tgz",
9
+ "integrity": "sha512-gaR16gg58YxDyIXjS/8zVKxnC0IqbPAqMCVv4Yu6PmrJFoFzhverHINiM24MXuhnngHYCTIn4p3t3JjkfkMPdg==",
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[];
@@ -65,6 +67,8 @@ interface CommonOptions {
65
67
  logLevel?: LogLevel;
66
68
  /** Documentation: https://esbuild.github.io/api/#log-limit */
67
69
  logLimit?: number;
70
+ /** Documentation: https://esbuild.github.io/api/#log-override */
71
+ logOverride?: Record<string, LogLevel>;
68
72
  }
69
73
 
70
74
  export interface BuildOptions extends CommonOptions {
@@ -569,6 +573,16 @@ export interface InitializeOptions {
569
573
  */
570
574
  wasmURL?: string
571
575
 
576
+ /**
577
+ * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
578
+ * is a typed array or ArrayBuffer containing the binary code of the
579
+ * "esbuild.wasm" file.
580
+ *
581
+ * You can use this as an alternative to "wasmURL" for environments where it's
582
+ * not possible to download the WebAssembly module.
583
+ */
584
+ wasmModule?: WebAssembly.Module
585
+
572
586
  /**
573
587
  * By default esbuild runs the WebAssembly-based browser API in a web worker
574
588
  * to avoid blocking the UI thread. This can be disabled by setting "worker"