isomorfeus-asset-manager 0.12.7 → 0.13.2

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: 6f2bba888a2b50846a6384f6b5a04036b3e5e7e9e367f867b4cb23996ceb8ba1
4
- data.tar.gz: 2ef547ce6fb466c561b1c4964d561c2c5612a2a641179b1dfdb33f555142f6b0
3
+ metadata.gz: 4a112cc640b13b364433d04260428447dbea74a176c1c8af02bacaf65a623cf2
4
+ data.tar.gz: 2bc572ba13866a0abb7f88e5b7fb081446ff0310b62cc2f3d320951d4c09fece
5
5
  SHA512:
6
- metadata.gz: 5b65f19ea35eb669fc45e946afe44b7da36b75910d28b69c4f9fdd9657f23c446c0f22e5fb505bf78755537428f91dcddd391edd4d818f9cabc8b2b3ca115e68
7
- data.tar.gz: 7acea3a93903a46f1d59ae45f83617c619812836015c58bbbab9b7ebf1e24c21708b013021eb1898ab9cfcdafaf991ae0f821db6dddbd256097a170118a0a133
6
+ metadata.gz: 2d57a280d6477851e3c728b0e43213ffeb8505676fc2ecc6aaeedf54787508bfe4638b2fde8b1a7b6fe117e8e48e9c9fdc234f3ebd7c133139a553cac6d08450
7
+ data.tar.gz: 489af5d09fbada0e1e6eca982c70638ede9054e67a9b0ee745d8aab6bb80bd1877edab1e94940cdf89724d0d685bc1c88a8457ae7a1d42842f8ce6f1d5242726
@@ -7,7 +7,6 @@ module Isomorfeus
7
7
  attr_reader :asset_manager
8
8
 
9
9
  def initialize(app)
10
- STDERR.puts "asset manager"
11
10
  @app = app
12
11
  @asset_manager = Isomorfeus::AssetManager.new
13
12
  @compressible_types = %w[application/javascript text/javascript]
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.12.7'
3
+ VERSION = '0.13.2'
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.12.27",
8
- "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.12.27.tgz",
9
- "integrity": "sha512-vuzLng5lSXouUX+QXV+24U6Htn6Kh3azGYyBAMj44oRbCPEt0SquZQX4LAJCnVItP9/Axa9q7B3/9vTLBIcOoQ==",
7
+ "version": "0.13.12",
8
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.13.12.tgz",
9
+ "integrity": "sha512-eGdiSewbnJffEvyA0qQmr+w3HurBMVp4QhOfICzeeoL9naC8qC3PFaw6hZaqSgks5DXnQONtUGUFLsX3eXpq8A==",
10
10
  "bin": {
11
11
  "esbuild": "bin/esbuild"
12
12
  },
@@ -80,5 +80,22 @@ fs.read = function () {
80
80
  return read.apply(this, arguments);
81
81
  };
82
82
 
83
+ // WASM code generated with Go 1.17.2+ will crash when run in a situation with
84
+ // many environment variables: https://github.com/golang/go/issues/49011. An
85
+ // example of this situation is running a Go-compiled WASM executable in GitHub
86
+ // Actions. Work around this by filtering node's copy of environment variables
87
+ // down to only include the environment variables that esbuild currently uses.
88
+ const esbuildUsedEnvVars = [
89
+ 'NO_COLOR',
90
+ 'NODE_PATH',
91
+ 'npm_config_user_agent',
92
+ 'WT_SESSION',
93
+ ]
94
+ for (let key in process.env) {
95
+ if (esbuildUsedEnvVars.indexOf(key) < 0) {
96
+ delete process.env[key]
97
+ }
98
+ }
99
+
83
100
  const argv = ['node', wasm_exec, esbuild_wasm].concat(process.argv.slice(2));
84
101
  wrapper(require, require.main, Object.assign(Object.create(process), { argv }), Object.assign(Object.create(WebAssembly), { instantiate }));
Binary file
@@ -3,69 +3,123 @@ export type Format = 'iife' | 'cjs' | 'esm';
3
3
  export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
4
4
  export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
5
5
  export type Charset = 'ascii' | 'utf8';
6
- export type TreeShaking = true | 'ignore-annotations';
7
6
 
8
7
  interface CommonOptions {
8
+ /** Documentation: https://esbuild.github.io/api/#sourcemap */
9
9
  sourcemap?: boolean | 'inline' | 'external' | 'both';
10
+ /** Documentation: https://esbuild.github.io/api/#legal-comments */
10
11
  legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
12
+ /** Documentation: https://esbuild.github.io/api/#source-root */
11
13
  sourceRoot?: string;
14
+ /** Documentation: https://esbuild.github.io/api/#sources-content */
12
15
  sourcesContent?: boolean;
13
16
 
17
+ /** Documentation: https://esbuild.github.io/api/#format */
14
18
  format?: Format;
19
+ /** Documentation: https://esbuild.github.io/api/#globalName */
15
20
  globalName?: string;
21
+ /** Documentation: https://esbuild.github.io/api/#target */
16
22
  target?: string | string[];
17
23
 
24
+ /** Documentation: https://esbuild.github.io/api/#minify */
18
25
  minify?: boolean;
26
+ /** Documentation: https://esbuild.github.io/api/#minify */
19
27
  minifyWhitespace?: boolean;
28
+ /** Documentation: https://esbuild.github.io/api/#minify */
20
29
  minifyIdentifiers?: boolean;
30
+ /** Documentation: https://esbuild.github.io/api/#minify */
21
31
  minifySyntax?: boolean;
32
+ /** Documentation: https://esbuild.github.io/api/#charset */
22
33
  charset?: Charset;
23
- treeShaking?: TreeShaking;
34
+ /** Documentation: https://esbuild.github.io/api/#tree-shaking */
35
+ treeShaking?: boolean;
36
+ /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
37
+ ignoreAnnotations?: boolean;
24
38
 
39
+ /** Documentation: https://esbuild.github.io/api/#jsx */
25
40
  jsx?: 'transform' | 'preserve';
41
+ /** Documentation: https://esbuild.github.io/api/#jsx-factory */
26
42
  jsxFactory?: string;
43
+ /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
27
44
  jsxFragment?: string;
28
45
 
46
+ /** Documentation: https://esbuild.github.io/api/#define */
29
47
  define?: { [key: string]: string };
48
+ /** Documentation: https://esbuild.github.io/api/#pure */
30
49
  pure?: string[];
50
+ /** Documentation: https://esbuild.github.io/api/#keep-names */
31
51
  keepNames?: boolean;
32
52
 
53
+ /** Documentation: https://esbuild.github.io/api/#color */
33
54
  color?: boolean;
55
+ /** Documentation: https://esbuild.github.io/api/#log-level */
34
56
  logLevel?: LogLevel;
57
+ /** Documentation: https://esbuild.github.io/api/#log-limit */
35
58
  logLimit?: number;
36
59
  }
37
60
 
38
61
  export interface BuildOptions extends CommonOptions {
62
+ /** Documentation: https://esbuild.github.io/api/#bundle */
39
63
  bundle?: boolean;
64
+ /** Documentation: https://esbuild.github.io/api/#splitting */
40
65
  splitting?: boolean;
66
+ /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
41
67
  preserveSymlinks?: boolean;
68
+ /** Documentation: https://esbuild.github.io/api/#outfile */
42
69
  outfile?: string;
70
+ /** Documentation: https://esbuild.github.io/api/#metafile */
43
71
  metafile?: boolean;
72
+ /** Documentation: https://esbuild.github.io/api/#outdir */
44
73
  outdir?: string;
74
+ /** Documentation: https://esbuild.github.io/api/#outbase */
45
75
  outbase?: string;
76
+ /** Documentation: https://esbuild.github.io/api/#platform */
46
77
  platform?: Platform;
78
+ /** Documentation: https://esbuild.github.io/api/#external */
47
79
  external?: string[];
80
+ /** Documentation: https://esbuild.github.io/api/#loader */
48
81
  loader?: { [ext: string]: Loader };
82
+ /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
49
83
  resolveExtensions?: string[];
84
+ /** Documentation: https://esbuild.github.io/api/#mainFields */
50
85
  mainFields?: string[];
86
+ /** Documentation: https://esbuild.github.io/api/#conditions */
51
87
  conditions?: string[];
88
+ /** Documentation: https://esbuild.github.io/api/#write */
52
89
  write?: boolean;
90
+ /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
53
91
  allowOverwrite?: boolean;
92
+ /** Documentation: https://esbuild.github.io/api/#tsconfig */
54
93
  tsconfig?: string;
94
+ /** Documentation: https://esbuild.github.io/api/#out-extension */
55
95
  outExtension?: { [ext: string]: string };
96
+ /** Documentation: https://esbuild.github.io/api/#public-path */
56
97
  publicPath?: string;
98
+ /** Documentation: https://esbuild.github.io/api/#entry-names */
57
99
  entryNames?: string;
100
+ /** Documentation: https://esbuild.github.io/api/#chunk-names */
58
101
  chunkNames?: string;
102
+ /** Documentation: https://esbuild.github.io/api/#asset-names */
59
103
  assetNames?: string;
104
+ /** Documentation: https://esbuild.github.io/api/#inject */
60
105
  inject?: string[];
106
+ /** Documentation: https://esbuild.github.io/api/#banner */
61
107
  banner?: { [type: string]: string };
108
+ /** Documentation: https://esbuild.github.io/api/#footer */
62
109
  footer?: { [type: string]: string };
110
+ /** Documentation: https://esbuild.github.io/api/#incremental */
63
111
  incremental?: boolean;
112
+ /** Documentation: https://esbuild.github.io/api/#entry-points */
64
113
  entryPoints?: string[] | Record<string, string>;
114
+ /** Documentation: https://esbuild.github.io/api/#stdin */
65
115
  stdin?: StdinOptions;
116
+ /** Documentation: https://esbuild.github.io/plugins/ */
66
117
  plugins?: Plugin[];
118
+ /** Documentation: https://esbuild.github.io/api/#working-directory */
67
119
  absWorkingDir?: string;
120
+ /** Documentation: https://esbuild.github.io/api/#node-paths */
68
121
  nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
122
+ /** Documentation: https://esbuild.github.io/api/#watch */
69
123
  watch?: boolean | WatchMode;
70
124
  }
71
125
 
@@ -86,8 +140,10 @@ export interface Message {
86
140
  location: Location | null;
87
141
  notes: Note[];
88
142
 
89
- // Optional user-specified data that is passed through unmodified. You can
90
- // use this to stash the original error, for example.
143
+ /**
144
+ * Optional user-specified data that is passed through unmodified. You can
145
+ * use this to stash the original error, for example.
146
+ */
91
147
  detail: any;
92
148
  }
93
149
 
@@ -99,17 +155,22 @@ export interface Note {
99
155
  export interface Location {
100
156
  file: string;
101
157
  namespace: string;
102
- line: number; // 1-based
103
- column: number; // 0-based, in bytes
104
- length: number; // in bytes
158
+ /** 1-based */
159
+ line: number;
160
+ /** 0-based, in bytes */
161
+ column: number;
162
+ /** in bytes */
163
+ length: number;
105
164
  lineText: string;
106
165
  suggestion: string;
107
166
  }
108
167
 
109
168
  export interface OutputFile {
110
169
  path: string;
111
- contents: Uint8Array; // "text" as bytes
112
- text: string; // "contents" as text
170
+ /** "text" as bytes */
171
+ contents: Uint8Array;
172
+ /** "contents" as text */
173
+ text: string;
113
174
  }
114
175
 
115
176
  export interface BuildInvalidate {
@@ -124,10 +185,14 @@ export interface BuildIncremental extends BuildResult {
124
185
  export interface BuildResult {
125
186
  errors: Message[];
126
187
  warnings: Message[];
127
- outputFiles?: OutputFile[]; // Only when "write: false"
128
- rebuild?: BuildInvalidate; // Only when "incremental: true"
129
- stop?: () => void; // Only when "watch: true"
130
- metafile?: Metafile; // Only when "metafile: true"
188
+ /** Only when "write: false" */
189
+ outputFiles?: OutputFile[];
190
+ /** Only when "incremental: true" */
191
+ rebuild?: BuildInvalidate;
192
+ /** Only when "watch: true" */
193
+ stop?: () => void;
194
+ /** Only when "metafile: true" */
195
+ metafile?: Metafile;
131
196
  }
132
197
 
133
198
  export interface BuildFailure extends Error {
@@ -135,6 +200,7 @@ export interface BuildFailure extends Error {
135
200
  warnings: Message[];
136
201
  }
137
202
 
203
+ /** Documentation: https://esbuild.github.io/api/#serve-arguments */
138
204
  export interface ServeOptions {
139
205
  port?: number;
140
206
  host?: string;
@@ -147,9 +213,11 @@ export interface ServeOnRequestArgs {
147
213
  method: string;
148
214
  path: string;
149
215
  status: number;
150
- timeInMS: number; // The time to generate the response, not to send it
216
+ /** The time to generate the response, not to send it */
217
+ timeInMS: number;
151
218
  }
152
219
 
220
+ /** Documentation: https://esbuild.github.io/api/#serve-return-values */
153
221
  export interface ServeResult {
154
222
  port: number;
155
223
  host: string;
@@ -327,89 +395,129 @@ export interface AnalyzeMetafileOptions {
327
395
  verbose?: boolean;
328
396
  }
329
397
 
330
- // This function invokes the "esbuild" command-line tool for you. It returns a
331
- // promise that either resolves with a "BuildResult" object or rejects with a
332
- // "BuildFailure" object.
333
- //
334
- // Works in node: yes
335
- // Works in browser: yes
398
+ /**
399
+ * This function invokes the "esbuild" command-line tool for you. It returns a
400
+ * promise that either resolves with a "BuildResult" object or rejects with a
401
+ * "BuildFailure" object.
402
+ *
403
+ * - Works in node: yes
404
+ * - Works in browser: yes
405
+ *
406
+ * Documentation: https://esbuild.github.io/api/#build-api
407
+ */
336
408
  export declare function build(options: BuildOptions & { write: false }): Promise<BuildResult & { outputFiles: OutputFile[] }>;
337
409
  export declare function build(options: BuildOptions & { incremental: true }): Promise<BuildIncremental>;
338
410
  export declare function build(options: BuildOptions): Promise<BuildResult>;
339
411
 
340
- // This function is similar to "build" but it serves the resulting files over
341
- // HTTP on a localhost address with the specified port.
342
- //
343
- // Works in node: yes
344
- // Works in browser: no
412
+ /**
413
+ * This function is similar to "build" but it serves the resulting files over
414
+ * HTTP on a localhost address with the specified port.
415
+ *
416
+ * - Works in node: yes
417
+ * - Works in browser: no
418
+ *
419
+ * Documentation: https://esbuild.github.io/api/#serve
420
+ */
345
421
  export declare function serve(serveOptions: ServeOptions, buildOptions: BuildOptions): Promise<ServeResult>;
346
422
 
347
- // This function transforms a single JavaScript file. It can be used to minify
348
- // JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
349
- // to older JavaScript. It returns a promise that is either resolved with a
350
- // "TransformResult" object or rejected with a "TransformFailure" object.
351
- //
352
- // Works in node: yes
353
- // Works in browser: yes
423
+ /**
424
+ * This function transforms a single JavaScript file. It can be used to minify
425
+ * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
426
+ * to older JavaScript. It returns a promise that is either resolved with a
427
+ * "TransformResult" object or rejected with a "TransformFailure" object.
428
+ *
429
+ * - Works in node: yes
430
+ * - Works in browser: yes
431
+ *
432
+ * Documentation: https://esbuild.github.io/api/#transform-api
433
+ */
354
434
  export declare function transform(input: string, options?: TransformOptions): Promise<TransformResult>;
355
435
 
356
- // Converts log messages to formatted message strings suitable for printing in
357
- // the terminal. This allows you to reuse the built-in behavior of esbuild's
358
- // log message formatter. This is a batch-oriented API for efficiency.
359
- //
360
- // Works in node: yes
361
- // Works in browser: yes
436
+ /**
437
+ * Converts log messages to formatted message strings suitable for printing in
438
+ * the terminal. This allows you to reuse the built-in behavior of esbuild's
439
+ * log message formatter. This is a batch-oriented API for efficiency.
440
+ *
441
+ * - Works in node: yes
442
+ * - Works in browser: yes
443
+ */
362
444
  export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>;
363
445
 
364
- // Pretty-prints an analysis of the metafile JSON to a string. This is just for
365
- // convenience to be able to match esbuild's pretty-printing exactly. If you want
366
- // to customize it, you can just inspect the data in the metafile yourself.
367
- //
368
- // Works in node: yes
369
- // Works in browser: yes
446
+ /**
447
+ * Pretty-prints an analysis of the metafile JSON to a string. This is just for
448
+ * convenience to be able to match esbuild's pretty-printing exactly. If you want
449
+ * to customize it, you can just inspect the data in the metafile yourself.
450
+ *
451
+ * - Works in node: yes
452
+ * - Works in browser: yes
453
+ *
454
+ * Documentation: https://esbuild.github.io/api/#analyze
455
+ */
370
456
  export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>;
371
457
 
372
- // A synchronous version of "build".
373
- //
374
- // Works in node: yes
375
- // Works in browser: no
458
+ /**
459
+ * A synchronous version of "build".
460
+ *
461
+ * - Works in node: yes
462
+ * - Works in browser: no
463
+ *
464
+ * Documentation: https://esbuild.github.io/api/#build-api
465
+ */
376
466
  export declare function buildSync(options: BuildOptions & { write: false }): BuildResult & { outputFiles: OutputFile[] };
377
467
  export declare function buildSync(options: BuildOptions): BuildResult;
378
468
 
379
- // A synchronous version of "transform".
380
- //
381
- // Works in node: yes
382
- // Works in browser: no
469
+ /**
470
+ * A synchronous version of "transform".
471
+ *
472
+ * - Works in node: yes
473
+ * - Works in browser: no
474
+ *
475
+ * Documentation: https://esbuild.github.io/api/#transform-api
476
+ */
383
477
  export declare function transformSync(input: string, options?: TransformOptions): TransformResult;
384
478
 
385
- // A synchronous version of "formatMessages".
386
- //
387
- // Works in node: yes
388
- // Works in browser: no
479
+ /**
480
+ * A synchronous version of "formatMessages".
481
+ *
482
+ * - Works in node: yes
483
+ * - Works in browser: no
484
+ */
389
485
  export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
390
486
 
391
- // A synchronous version of "analyzeMetafile".
392
- //
393
- // Works in node: yes
394
- // Works in browser: no
487
+ /**
488
+ * A synchronous version of "analyzeMetafile".
489
+ *
490
+ * - Works in node: yes
491
+ * - Works in browser: no
492
+ *
493
+ * Documentation: https://esbuild.github.io/api/#analyze
494
+ */
395
495
  export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string;
396
496
 
397
- // This configures the browser-based version of esbuild. It is necessary to
398
- // call this first and wait for the returned promise to be resolved before
399
- // making other API calls when using esbuild in the browser.
400
- //
401
- // Works in node: yes
402
- // Works in browser: yes ("options" is required)
497
+ /**
498
+ * This configures the browser-based version of esbuild. It is necessary to
499
+ * call this first and wait for the returned promise to be resolved before
500
+ * making other API calls when using esbuild in the browser.
501
+ *
502
+ * - Works in node: yes
503
+ * - Works in browser: yes ("options" is required)
504
+ *
505
+ * Documentation: https://esbuild.github.io/api/#running-in-the-browser
506
+ */
403
507
  export declare function initialize(options: InitializeOptions): Promise<void>;
404
508
 
405
509
  export interface InitializeOptions {
406
- // The URL of the "esbuild.wasm" file. This must be provided when running
407
- // esbuild in the browser.
510
+ /**
511
+ * The URL of the "esbuild.wasm" file. This must be provided when running
512
+ * esbuild in the browser.
513
+ */
408
514
  wasmURL?: string
409
515
 
410
- // By default esbuild runs the WebAssembly-based browser API in a web worker
411
- // to avoid blocking the UI thread. This can be disabled by setting "worker"
412
- // to false.
516
+ /**
517
+ * By default esbuild runs the WebAssembly-based browser API in a web worker
518
+ * to avoid blocking the UI thread. This can be disabled by setting "worker"
519
+ * to false.
520
+ */
413
521
  worker?: boolean
414
522
  }
415
523
 
@@ -17,9 +17,6 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __require = typeof require !== "undefined" ? require : (x) => {
21
- throw new Error('Dynamic require of "' + x + '" is not supported');
22
- };
23
20
 
24
21
  // lib/shared/stdio_protocol.ts
25
22
  function encodePacket(packet) {
@@ -257,7 +254,8 @@ function pushCommonFlags(flags, options, keys) {
257
254
  let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
258
255
  let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean);
259
256
  let charset = getFlag(options, keys, "charset", mustBeString);
260
- let treeShaking = getFlag(options, keys, "treeShaking", mustBeStringOrBoolean);
257
+ let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean);
258
+ let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean);
261
259
  let jsx = getFlag(options, keys, "jsx", mustBeString);
262
260
  let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
263
261
  let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
@@ -290,8 +288,10 @@ function pushCommonFlags(flags, options, keys) {
290
288
  flags.push("--minify-identifiers");
291
289
  if (charset)
292
290
  flags.push(`--charset=${charset}`);
293
- if (treeShaking !== void 0 && treeShaking !== true)
291
+ if (treeShaking !== void 0)
294
292
  flags.push(`--tree-shaking=${treeShaking}`);
293
+ if (ignoreAnnotations)
294
+ flags.push(`--ignore-annotations`);
295
295
  if (jsx)
296
296
  flags.push(`--jsx=${jsx}`);
297
297
  if (jsxFactory)
@@ -673,8 +673,8 @@ function createChannel(streamIn) {
673
673
  if (isFirstPacket) {
674
674
  isFirstPacket = false;
675
675
  let binaryVersion = String.fromCharCode(...bytes);
676
- if (binaryVersion !== "0.12.27") {
677
- throw new Error(`Cannot start service: Host version "${"0.12.27"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
676
+ if (binaryVersion !== "0.13.12") {
677
+ throw new Error(`Cannot start service: Host version "${"0.13.12"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
678
678
  }
679
679
  return;
680
680
  }
@@ -1546,7 +1546,7 @@ function convertOutputFiles({ path, contents }) {
1546
1546
  }
1547
1547
 
1548
1548
  // lib/npm/browser.ts
1549
- var version = "0.12.27";
1549
+ var version = "0.13.12";
1550
1550
  var build = (options) => ensureServiceIsRunning().build(options);
1551
1551
  var serve = () => {
1552
1552
  throw new Error(`The "serve" API only works in node`);
@@ -2189,6 +2189,13 @@ var startRunningService = async (wasmURL, useWorker) => {
2189
2189
  offset += 8;
2190
2190
  });
2191
2191
 
2192
+ // The linker guarantees global data starts from at least wasmMinDataAddr.
2193
+ // Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
2194
+ const wasmMinDataAddr = 4096 + 4096;
2195
+ if (offset >= wasmMinDataAddr) {
2196
+ throw new Error("command line too long");
2197
+ }
2198
+
2192
2199
  this._inst.exports.run(argc, argv);
2193
2200
  if (this.exited) {
2194
2201
  this._resolveExitPromise();
@@ -2296,7 +2303,7 @@ onmessage = ({ data: wasm }) => {
2296
2303
  callback(null, count);
2297
2304
  };
2298
2305
  let go = new global.Go();
2299
- go.argv = ["", \`--service=\${"0.12.27"}\`];
2306
+ go.argv = ["", \`--service=\${"0.13.12"}\`];
2300
2307
  WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));
2301
2308
  };}`;
2302
2309
  let worker;