isomorfeus-asset-manager 0.18.1 → 0.19.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,6 +1,6 @@
1
1
  export type Platform = 'browser' | 'node' | 'neutral'
2
2
  export type Format = 'iife' | 'cjs' | 'esm'
3
- export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'text' | 'ts' | 'tsx'
3
+ export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx'
4
4
  export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent'
5
5
  export type Charset = 'ascii' | 'utf8'
6
6
  export type Drop = 'console' | 'debugger'
@@ -36,6 +36,8 @@ interface CommonOptions {
36
36
  mangleCache?: Record<string, string | false>
37
37
  /** Documentation: https://esbuild.github.io/api/#drop */
38
38
  drop?: Drop[]
39
+ /** Documentation: https://esbuild.github.io/api/#drop-labels */
40
+ dropLabels?: string[]
39
41
  /** Documentation: https://esbuild.github.io/api/#minify */
40
42
  minify?: boolean
41
43
  /** Documentation: https://esbuild.github.io/api/#minify */
@@ -44,6 +46,8 @@ interface CommonOptions {
44
46
  minifyIdentifiers?: boolean
45
47
  /** Documentation: https://esbuild.github.io/api/#minify */
46
48
  minifySyntax?: boolean
49
+ /** Documentation: https://esbuild.github.io/api/#line-limit */
50
+ lineLimit?: number
47
51
  /** Documentation: https://esbuild.github.io/api/#charset */
48
52
  charset?: Charset
49
53
  /** Documentation: https://esbuild.github.io/api/#tree-shaking */
@@ -81,23 +85,25 @@ interface CommonOptions {
81
85
  logOverride?: Record<string, LogLevel>
82
86
 
83
87
  /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */
84
- tsconfigRaw?: string | {
85
- compilerOptions?: {
86
- alwaysStrict?: boolean
87
- baseUrl?: boolean
88
- experimentalDecorators?: boolean
89
- importsNotUsedAsValues?: 'remove' | 'preserve' | 'error'
90
- jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev'
91
- jsxFactory?: string
92
- jsxFragmentFactory?: string
93
- jsxImportSource?: string
94
- paths?: Record<string, string[]>
95
- preserveValueImports?: boolean
96
- strict?: boolean
97
- target?: string
98
- useDefineForClassFields?: boolean
99
- verbatimModuleSyntax?: boolean
100
- }
88
+ tsconfigRaw?: string | TsconfigRaw
89
+ }
90
+
91
+ export interface TsconfigRaw {
92
+ compilerOptions?: {
93
+ alwaysStrict?: boolean
94
+ baseUrl?: string
95
+ experimentalDecorators?: boolean
96
+ importsNotUsedAsValues?: 'remove' | 'preserve' | 'error'
97
+ jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev'
98
+ jsxFactory?: string
99
+ jsxFragmentFactory?: string
100
+ jsxImportSource?: string
101
+ paths?: Record<string, string[]>
102
+ preserveValueImports?: boolean
103
+ strict?: boolean
104
+ target?: string
105
+ useDefineForClassFields?: boolean
106
+ verbatimModuleSyntax?: boolean
101
107
  }
102
108
  }
103
109
 
@@ -205,8 +211,8 @@ export interface Location {
205
211
 
206
212
  export interface OutputFile {
207
213
  path: string
208
- /** "text" as bytes */
209
214
  contents: Uint8Array
215
+ hash: string
210
216
  /** "contents" as text (changes automatically with "contents") */
211
217
  readonly text: string
212
218
  }
@@ -234,6 +240,7 @@ export interface ServeOptions {
234
240
  servedir?: string
235
241
  keyfile?: string
236
242
  certfile?: string
243
+ fallback?: string
237
244
  onRequest?: (args: ServeOnRequestArgs) => void
238
245
  }
239
246
 
@@ -385,6 +392,7 @@ export type ImportKind =
385
392
 
386
393
  // CSS
387
394
  | 'import-rule'
395
+ | 'composes-from'
388
396
  | 'url-token'
389
397
 
390
398
  /** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
@@ -304,7 +304,9 @@ function pushCommonFlags(flags, options, keys) {
304
304
  let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean);
305
305
  let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
306
306
  let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean);
307
+ let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger);
307
308
  let drop = getFlag(options, keys, "drop", mustBeArray);
309
+ let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray);
308
310
  let charset = getFlag(options, keys, "charset", mustBeString);
309
311
  let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean);
310
312
  let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean);
@@ -349,6 +351,8 @@ function pushCommonFlags(flags, options, keys) {
349
351
  flags.push("--minify-whitespace");
350
352
  if (minifyIdentifiers)
351
353
  flags.push("--minify-identifiers");
354
+ if (lineLimit)
355
+ flags.push(`--line-limit=${lineLimit}`);
352
356
  if (charset)
353
357
  flags.push(`--charset=${charset}`);
354
358
  if (treeShaking !== void 0)
@@ -358,6 +362,8 @@ function pushCommonFlags(flags, options, keys) {
358
362
  if (drop)
359
363
  for (let what of drop)
360
364
  flags.push(`--drop:${validateStringValue(what, "drop")}`);
365
+ if (dropLabels)
366
+ flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`);
361
367
  if (mangleProps)
362
368
  flags.push(`--mangle-props=${mangleProps.source}`);
363
369
  if (reserveProps)
@@ -717,7 +723,11 @@ function createChannel(streamIn) {
717
723
  }
718
724
  throw new Error(`Invalid command: ` + request.command);
719
725
  } catch (e) {
720
- sendResponse(id, { errors: [extractErrorMessageV8(e, streamIn, null, void 0, "")] });
726
+ const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")];
727
+ try {
728
+ sendResponse(id, { errors });
729
+ } catch {
730
+ }
721
731
  }
722
732
  };
723
733
  let isFirstPacket = true;
@@ -725,8 +735,8 @@ function createChannel(streamIn) {
725
735
  if (isFirstPacket) {
726
736
  isFirstPacket = false;
727
737
  let binaryVersion = String.fromCharCode(...bytes);
728
- if (binaryVersion !== "0.18.4") {
729
- throw new Error(`Cannot start service: Host version "${"0.18.4"}" does not match binary version ${quote(binaryVersion)}`);
738
+ if (binaryVersion !== "0.19.2") {
739
+ throw new Error(`Cannot start service: Host version "${"0.19.2"}" does not match binary version ${quote(binaryVersion)}`);
730
740
  }
731
741
  return;
732
742
  }
@@ -1124,6 +1134,7 @@ function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs,
1124
1134
  const servedir = getFlag(options2, keys, "servedir", mustBeString);
1125
1135
  const keyfile = getFlag(options2, keys, "keyfile", mustBeString);
1126
1136
  const certfile = getFlag(options2, keys, "certfile", mustBeString);
1137
+ const fallback = getFlag(options2, keys, "fallback", mustBeString);
1127
1138
  const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction);
1128
1139
  checkForInvalidFlags(options2, keys, `in serve() call`);
1129
1140
  const request2 = {
@@ -1141,6 +1152,8 @@ function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs,
1141
1152
  request2.keyfile = keyfile;
1142
1153
  if (certfile !== void 0)
1143
1154
  request2.certfile = certfile;
1155
+ if (fallback !== void 0)
1156
+ request2.fallback = fallback;
1144
1157
  sendRequest(refs, request2, (error2, response2) => {
1145
1158
  if (error2)
1146
1159
  return reject(new Error(error2));
@@ -1612,7 +1625,7 @@ function parseStackLinesV8(streamIn, lines, ident) {
1612
1625
  }
1613
1626
  function failureErrorWithLog(text, errors, warnings) {
1614
1627
  let limit = 5;
1615
- let summary = errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => {
1628
+ text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => {
1616
1629
  if (i === limit)
1617
1630
  return "\n...";
1618
1631
  if (!e.location)
@@ -1623,9 +1636,19 @@ error: ${e.text}`;
1623
1636
  return `
1624
1637
  ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
1625
1638
  }).join("");
1626
- let error = new Error(`${text}${summary}`);
1627
- error.errors = errors;
1628
- error.warnings = warnings;
1639
+ let error = new Error(text);
1640
+ for (const [key, value] of [["errors", errors], ["warnings", warnings]]) {
1641
+ Object.defineProperty(error, key, {
1642
+ configurable: true,
1643
+ enumerable: true,
1644
+ get: () => value,
1645
+ set: (value2) => Object.defineProperty(error, key, {
1646
+ configurable: true,
1647
+ enumerable: true,
1648
+ value: value2
1649
+ })
1650
+ });
1651
+ }
1629
1652
  return error;
1630
1653
  }
1631
1654
  function replaceDetailsInMessages(messages, stash) {
@@ -1703,11 +1726,12 @@ function sanitizeStringArray(values, property) {
1703
1726
  }
1704
1727
  return result;
1705
1728
  }
1706
- function convertOutputFiles({ path: path3, contents }) {
1729
+ function convertOutputFiles({ path: path3, contents, hash }) {
1707
1730
  let text = null;
1708
1731
  return {
1709
1732
  path: path3,
1710
1733
  contents,
1734
+ hash,
1711
1735
  get text() {
1712
1736
  const binary = this.contents;
1713
1737
  if (text === null || binary !== contents) {
@@ -1747,7 +1771,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1747
1771
  }
1748
1772
  }
1749
1773
  var _a;
1750
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.18.4";
1774
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.19.2";
1751
1775
  var esbuildCommandAndArgs = () => {
1752
1776
  if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1753
1777
  throw new Error(
@@ -1814,7 +1838,7 @@ var fsAsync = {
1814
1838
  }
1815
1839
  }
1816
1840
  };
1817
- var version = "0.18.4";
1841
+ var version = "0.19.2";
1818
1842
  var build = (options) => ensureServiceIsRunning().build(options);
1819
1843
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
1820
1844
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -1924,7 +1948,7 @@ var ensureServiceIsRunning = () => {
1924
1948
  if (longLivedService)
1925
1949
  return longLivedService;
1926
1950
  let [command, args] = esbuildCommandAndArgs();
1927
- let child = child_process.spawn(command, args.concat(`--service=${"0.18.4"}`, "--ping"), {
1951
+ let child = child_process.spawn(command, args.concat(`--service=${"0.19.2"}`, "--ping"), {
1928
1952
  windowsHide: true,
1929
1953
  stdio: ["pipe", "pipe", "inherit"],
1930
1954
  cwd: defaultWD
@@ -2024,7 +2048,7 @@ var runServiceSync = (callback) => {
2024
2048
  esbuild: node_exports
2025
2049
  });
2026
2050
  callback(service);
2027
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.18.4"}`), {
2051
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.19.2"}`), {
2028
2052
  cwd: defaultWD,
2029
2053
  windowsHide: true,
2030
2054
  input: stdin,
@@ -2044,7 +2068,7 @@ var workerThreadService = null;
2044
2068
  var startWorkerThreadService = (worker_threads2) => {
2045
2069
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2046
2070
  let worker = new worker_threads2.Worker(__filename, {
2047
- workerData: { workerPort, defaultWD, esbuildVersion: "0.18.4" },
2071
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.19.2" },
2048
2072
  transferList: [workerPort],
2049
2073
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2050
2074
  //
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild-wasm",
3
- "version": "0.18.4",
3
+ "version": "0.19.2",
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.18.4"
7
+ "esbuild-wasm": "0.19.2"
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.18.1
4
+ version: 0.19.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: 2023-07-03 00:00:00.000000000 Z
11
+ date: 2023-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.6.2
47
+ version: 0.6.3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.6.2
54
+ version: 0.6.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: listen
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -112,14 +112,14 @@ dependencies:
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: 3.0.7
115
+ version: 3.0.8
116
116
  type: :runtime
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: 3.0.7
122
+ version: 3.0.8
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: rackup
125
125
  requirement: !ruby/object:Gem::Requirement