dinou 9.3.0 → 10.0.1

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.
Files changed (166) hide show
  1. package/CHANGELOG.md +196 -0
  2. package/README.md +157 -132
  3. package/dinou/adapters/bun.js +34 -5
  4. package/dinou/adapters/cloudflare.js +110 -17
  5. package/dinou/adapters/deno.js +46 -8
  6. package/dinou/adapters/netlify.js +86 -50
  7. package/dinou/adapters/node.js +8 -0
  8. package/dinou/assets.d.ts +32 -5
  9. package/dinou/bun/build.js +190 -106
  10. package/dinou/cli.js +992 -532
  11. package/dinou/cloudflare/build.js +187 -106
  12. package/dinou/compiled/autoprefixer/index.js +509 -517
  13. package/dinou/compiled/babel-core/index.js +738 -716
  14. package/dinou/compiled/babel-generator/index.js +341 -299
  15. package/dinou/compiled/babel-loader/index.js +766 -744
  16. package/dinou/compiled/babel-parser/index.js +2 -2
  17. package/dinou/compiled/babel-plugin-react-compiler/index.js +178 -178
  18. package/dinou/compiled/babel-plugin-syntax-import-meta/index.js +4 -4
  19. package/dinou/compiled/babel-preset-react/index.js +752 -730
  20. package/dinou/compiled/babel-preset-typescript/index.js +738 -716
  21. package/dinou/compiled/babel-traverse/index.js +463 -433
  22. package/dinou/compiled/babel-types/index.js +176 -176
  23. package/dinou/compiled/chokidar/index.js +4 -4
  24. package/dinou/compiled/commander/index.js +15 -15
  25. package/dinou/compiled/copy-webpack-plugin/index.js +433 -425
  26. package/dinou/compiled/css-loader/index.js +289 -289
  27. package/dinou/compiled/css-loader/runtime/api.js +85 -0
  28. package/dinou/compiled/css-loader/runtime/getUrl.js +26 -0
  29. package/dinou/compiled/css-loader/runtime/noSourceMaps.js +5 -0
  30. package/dinou/compiled/css-loader/runtime/package.json +3 -0
  31. package/dinou/compiled/css-loader/runtime/sourceMaps.js +16 -0
  32. package/dinou/compiled/fast-glob/index.js +5810 -0
  33. package/dinou/compiled/generic-names/index.js +16 -16
  34. package/dinou/compiled/mini-css-extract-plugin/{chunk-YYEJWYXE.js → chunk-R6DP5ZYM.js} +36 -36
  35. package/dinou/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +253 -0
  36. package/dinou/compiled/mini-css-extract-plugin/hmr/normalize-url.js +39 -0
  37. package/dinou/compiled/mini-css-extract-plugin/hmr/package.json +3 -0
  38. package/dinou/compiled/mini-css-extract-plugin/index.js +1 -1
  39. package/dinou/compiled/mini-css-extract-plugin/loader.js +5 -5
  40. package/dinou/compiled/postcss/index.js +83 -83
  41. package/dinou/compiled/postcss-import/index.js +147 -117
  42. package/dinou/compiled/postcss-modules/index.js +216 -216
  43. package/dinou/compiled/resolve/index.js +1224 -0
  44. package/dinou/compiled/rollup-plugin-babel/index.js +753 -731
  45. package/dinou/compiled/rollup-plugin-commonjs/index.js +43 -38
  46. package/dinou/compiled/rollup-plugin-delete/index.js +615 -253
  47. package/dinou/compiled/rollup-plugin-json/index.js +22 -18
  48. package/dinou/compiled/rollup-plugin-node-resolve/index.js +130 -100
  49. package/dinou/compiled/rollup-plugin-postcss/index.js +3299 -3277
  50. package/dinou/compiled/rollup-plugin-replace/index.js +34 -29
  51. package/dinou/compiled/tailwindcss-postcss/index.js +214 -211
  52. package/dinou/compiled/vendors-manifest.json +59 -83
  53. package/dinou/core/asset-extensions.js +482 -33
  54. package/dinou/core/bailout-proxy.js +21 -2
  55. package/dinou/core/build-static-pages.js +523 -371
  56. package/dinou/core/builtin-asset-extensions.js +63 -0
  57. package/dinou/core/cache-revalidate.js +449 -256
  58. package/dinou/core/cache-slot.js +289 -79
  59. package/dinou/core/client-webpack.jsx +470 -39
  60. package/dinou/core/client.jsx +402 -39
  61. package/dinou/core/config.js +3 -0
  62. package/dinou/core/copy-static-dirs.js +98 -0
  63. package/dinou/core/createScopedName.js +22 -4
  64. package/dinou/core/dinou-paths.js +1 -1
  65. package/dinou/core/discover-layouts.js +200 -0
  66. package/dinou/core/edge-ssr.js +1 -1
  67. package/dinou/core/ensure-vendor-mode.js +78 -19
  68. package/dinou/core/env.js +544 -0
  69. package/dinou/core/export-static.js +41 -9
  70. package/dinou/core/generate-route-types.js +989 -95
  71. package/dinou/core/generate-static-rsc.js +5 -6
  72. package/dinou/core/generate-static.js +45 -6
  73. package/dinou/core/get-abs-path-with-ext.js +217 -75
  74. package/dinou/core/get-asset-from-manifest.js +19 -8
  75. package/dinou/core/get-error-jsx.js +4 -5
  76. package/dinou/core/get-file-path-and-dynamic-params.js +561 -338
  77. package/dinou/core/get-jsx.js +220 -53
  78. package/dinou/core/handler.js +1647 -466
  79. package/dinou/core/import-module.js +7 -0
  80. package/dinou/core/layout-functions.js +72 -13
  81. package/dinou/core/link.jsx +34 -6
  82. package/dinou/core/load-dinou-config.js +520 -89
  83. package/dinou/core/manifest-provider.js +4 -14
  84. package/dinou/core/navigation-utils.js +141 -3
  85. package/dinou/core/navigation.js +134 -50
  86. package/dinou/core/node-middleware-runner.js +165 -0
  87. package/dinou/core/postcss-pipeline.js +236 -0
  88. package/dinou/core/ppr-context.js +114 -22
  89. package/dinou/core/ppr-runtime.js +391 -127
  90. package/dinou/core/redirect.jsx +1 -1
  91. package/dinou/core/render-jsx-to-client-jsx.js +216 -48
  92. package/dinou/core/request-context.js +59 -3
  93. package/dinou/core/resolve-contextual-dinou.js +523 -0
  94. package/dinou/core/resolve-setup-files.js +85 -27
  95. package/dinou/core/revalidating.js +10 -2
  96. package/dinou/core/route-generator.js +6 -2
  97. package/dinou/core/rsc-renderer.js +4 -1
  98. package/dinou/core/run-ssg.js +6 -0
  99. package/dinou/core/runtime-env.js +265 -0
  100. package/dinou/core/server-css-modules-plugin.js +155 -0
  101. package/dinou/core/server-function-proxy-webpack.js +27 -2
  102. package/dinou/core/server-function-proxy.js +27 -2
  103. package/dinou/core/slot.js +47 -2
  104. package/dinou/core/static-assets.js +503 -0
  105. package/dinou/core/storage-adapter.js +452 -24
  106. package/dinou/core/transform-server-functions.js +272 -24
  107. package/dinou/core/tsconfig-aliases.js +964 -0
  108. package/dinou/core/uneject.js +640 -0
  109. package/dinou/core/url-resolver.js +1 -1
  110. package/dinou/core/vfs.js +11 -2
  111. package/dinou/css.d.ts +4 -1
  112. package/dinou/deno/build.js +205 -153
  113. package/dinou/deno/seed-kv.js +4 -0
  114. package/dinou/env.d.ts +22 -2
  115. package/dinou/esbuild/build.js +40 -50
  116. package/dinou/esbuild/dev.js +33 -7
  117. package/dinou/esbuild/helpers-esbuild/get-config-esbuild-prod.js +41 -16
  118. package/dinou/esbuild/helpers-esbuild/get-config-esbuild.js +51 -49
  119. package/dinou/esbuild/helpers-esbuild/get-esbuild-entries.js +73 -60
  120. package/dinou/esbuild/helpers-esbuild/swc-disk-cache.js +35 -16
  121. package/dinou/esbuild/helpers-esbuild/write.js +13 -3
  122. package/dinou/esbuild/plugins-esbuild/assets-plugin.js +100 -238
  123. package/dinou/esbuild/plugins-esbuild/babel-react-compiler-plugin.js +73 -29
  124. package/dinou/esbuild/plugins-esbuild/css-processor-plugin.js +283 -91
  125. package/dinou/esbuild/plugins-esbuild/manifest-generator-plugin.js +3 -5
  126. package/dinou/esbuild/plugins-esbuild/react-client-manifest-plugin.js +9 -3
  127. package/dinou/esbuild/plugins-esbuild/server-functions-plugin.js +4 -3
  128. package/dinou/esbuild/plugins-esbuild/stable-chunk-names-and-maps-plugin.js +10 -1
  129. package/dinou/esbuild/plugins-postcss/postcss-extract-plugin.js +84 -21
  130. package/dinou/esbuild/react-refresh/esm-hmr/client.js +31 -10
  131. package/dinou/esbuild/react-refresh/esm-hmr-plugin.js +48 -18
  132. package/dinou/esbuild/react-refresh/is-react-refresh-boundary.js +9 -1
  133. package/dinou/esbuild/react-refresh/react-refresh-runtime.js +13 -7
  134. package/dinou/index.d.ts +1028 -88
  135. package/dinou/node/build.js +138 -74
  136. package/dinou/node/bundle-dual-engine.js +393 -131
  137. package/dinou/node/dev.js +1005 -275
  138. package/dinou/package.json +11 -34
  139. package/dinou/rollup/postcss.config.js +3 -4
  140. package/dinou/rollup/react-refresh/esm-hmr/client.js +31 -10
  141. package/dinou/rollup/react-refresh/react-refresh-wrap-modules.js +16 -13
  142. package/dinou/rollup/react-refresh/rollup-plugin-esm-hmr.js +53 -7
  143. package/dinou/rollup/rollup-plugins/dinou-asset-plugin.js +58 -20
  144. package/dinou/rollup/rollup-plugins/manifest-generator-plugin.js +16 -7
  145. package/dinou/rollup/rollup-plugins/rollup-plugin-react-client-manifest.js +118 -42
  146. package/dinou/rollup/rollup-plugins/rollup-plugin-server-functions.js +48 -36
  147. package/dinou/rollup/rollup.config.js +174 -101
  148. package/dinou/scripts/build-vendors.js +123 -33
  149. package/dinou/server.d.ts +126 -15
  150. package/dinou/webpack/helpers/get-webpack-entries.js +87 -41
  151. package/dinou/webpack/helpers/patch-webpack-internals.js +93 -1
  152. package/dinou/webpack/loaders/server-functions-loader.js +1 -1
  153. package/dinou/webpack/plugins/manifest-generator-plugin.js +27 -7
  154. package/dinou/webpack/plugins/server-functions-plugin.js +39 -12
  155. package/dinou/webpack/plugins/webpack-memory-plugin.js +25 -12
  156. package/dinou/webpack/postcss.config.js +3 -4
  157. package/dinou/webpack/webpack.config.js +408 -132
  158. package/eject.js +6 -224
  159. package/package.json +7 -9
  160. package/dinou/compiled/cross-env/index.js +0 -661
  161. package/dinou/compiled/dotenv/index.js +0 -375
  162. package/dinou/compiled/esbuild-copy-static-files/index.js +0 -63
  163. package/dinou/compiled/esbuild-tsconfig-paths/index.js +0 -1314
  164. package/dinou/compiled/rollup-plugin-copy/index.js +0 -12066
  165. package/dinou/compiled/rollup-plugin-tsconfig-paths/index.js +0 -569
  166. package/dinou/compiled/tsconfig-paths-webpack-plugin/index.js +0 -3956
@@ -1,1314 +0,0 @@
1
- import { createRequire as __dinou_createRequire } from "node:module";
2
- import { fileURLToPath as __dinou_fileURLToPath } from "node:url";
3
- import __dinou_path from "node:path";
4
- const require = __dinou_createRequire(import.meta.url);
5
- const __filename = __dinou_fileURLToPath(import.meta.url);
6
- const __dirname = __dinou_path.dirname(__filename);
7
- var __create = Object.create;
8
- var __defProp = Object.defineProperty;
9
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
- var __getOwnPropNames = Object.getOwnPropertyNames;
11
- var __getProtoOf = Object.getPrototypeOf;
12
- var __hasOwnProp = Object.prototype.hasOwnProperty;
13
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
14
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
15
- }) : x)(function(x) {
16
- if (typeof require !== "undefined") return require.apply(this, arguments);
17
- throw Error('Dynamic require of "' + x + '" is not supported');
18
- });
19
- var __commonJS = (cb, mod) => function __require2() {
20
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
- };
22
- var __copyProps = (to, from, except, desc) => {
23
- if (from && typeof from === "object" || typeof from === "function") {
24
- for (let key of __getOwnPropNames(from))
25
- if (!__hasOwnProp.call(to, key) && key !== except)
26
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
- }
28
- return to;
29
- };
30
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
- // If the importer is in node compatibility mode or this is not an ESM
32
- // file that has been converted to a CommonJS file using a Babel-
33
- // compatible transform (i.e. "__esModule" has not been set), then set
34
- // "default" to the CommonJS "module.exports" for node compatibility.
35
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
36
- mod
37
- ));
38
-
39
- // ../node_modules/yocto-queue/index.js
40
- var require_yocto_queue = __commonJS({
41
- "../node_modules/yocto-queue/index.js"(exports, module) {
42
- var Node = class {
43
- /// value;
44
- /// next;
45
- constructor(value) {
46
- this.value = value;
47
- this.next = void 0;
48
- }
49
- };
50
- var Queue = class {
51
- // TODO: Use private class fields when targeting Node.js 12.
52
- // #_head;
53
- // #_tail;
54
- // #_size;
55
- constructor() {
56
- this.clear();
57
- }
58
- enqueue(value) {
59
- const node = new Node(value);
60
- if (this._head) {
61
- this._tail.next = node;
62
- this._tail = node;
63
- } else {
64
- this._head = node;
65
- this._tail = node;
66
- }
67
- this._size++;
68
- }
69
- dequeue() {
70
- const current = this._head;
71
- if (!current) {
72
- return;
73
- }
74
- this._head = this._head.next;
75
- this._size--;
76
- return current.value;
77
- }
78
- clear() {
79
- this._head = void 0;
80
- this._tail = void 0;
81
- this._size = 0;
82
- }
83
- get size() {
84
- return this._size;
85
- }
86
- *[Symbol.iterator]() {
87
- let current = this._head;
88
- while (current) {
89
- yield current.value;
90
- current = current.next;
91
- }
92
- }
93
- };
94
- module.exports = Queue;
95
- }
96
- });
97
-
98
- // ../node_modules/p-limit/index.js
99
- var require_p_limit = __commonJS({
100
- "../node_modules/p-limit/index.js"(exports, module) {
101
- "use strict";
102
- var Queue = require_yocto_queue();
103
- var pLimit = (concurrency) => {
104
- if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
105
- throw new TypeError("Expected `concurrency` to be a number from 1 and up");
106
- }
107
- const queue = new Queue();
108
- let activeCount = 0;
109
- const next = () => {
110
- activeCount--;
111
- if (queue.size > 0) {
112
- queue.dequeue()();
113
- }
114
- };
115
- const run = async (fn, resolve, ...args) => {
116
- activeCount++;
117
- const result = (async () => fn(...args))();
118
- resolve(result);
119
- try {
120
- await result;
121
- } catch {
122
- }
123
- next();
124
- };
125
- const enqueue = (fn, resolve, ...args) => {
126
- queue.enqueue(run.bind(null, fn, resolve, ...args));
127
- (async () => {
128
- await Promise.resolve();
129
- if (activeCount < concurrency && queue.size > 0) {
130
- queue.dequeue()();
131
- }
132
- })();
133
- };
134
- const generator = (fn, ...args) => new Promise((resolve) => {
135
- enqueue(fn, resolve, ...args);
136
- });
137
- Object.defineProperties(generator, {
138
- activeCount: {
139
- get: () => activeCount
140
- },
141
- pendingCount: {
142
- get: () => queue.size
143
- },
144
- clearQueue: {
145
- value: () => {
146
- queue.clear();
147
- }
148
- }
149
- });
150
- return generator;
151
- };
152
- module.exports = pLimit;
153
- }
154
- });
155
-
156
- // ../node_modules/p-locate/index.js
157
- var require_p_locate = __commonJS({
158
- "../node_modules/p-locate/index.js"(exports, module) {
159
- "use strict";
160
- var pLimit = require_p_limit();
161
- var EndError = class extends Error {
162
- constructor(value) {
163
- super();
164
- this.value = value;
165
- }
166
- };
167
- var testElement = async (element, tester) => tester(await element);
168
- var finder = async (element) => {
169
- const values = await Promise.all(element);
170
- if (values[1] === true) {
171
- throw new EndError(values[0]);
172
- }
173
- return false;
174
- };
175
- var pLocate = async (iterable, tester, options) => {
176
- options = {
177
- concurrency: Infinity,
178
- preserveOrder: true,
179
- ...options
180
- };
181
- const limit = pLimit(options.concurrency);
182
- const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
183
- const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
184
- try {
185
- await Promise.all(items.map((element) => checkLimit(finder, element)));
186
- } catch (error) {
187
- if (error instanceof EndError) {
188
- return error.value;
189
- }
190
- throw error;
191
- }
192
- };
193
- module.exports = pLocate;
194
- }
195
- });
196
-
197
- // ../node_modules/locate-path/index.js
198
- var require_locate_path = __commonJS({
199
- "../node_modules/locate-path/index.js"(exports, module) {
200
- "use strict";
201
- var path = __require("path");
202
- var fs = __require("fs");
203
- var { promisify } = __require("util");
204
- var pLocate = require_p_locate();
205
- var fsStat = promisify(fs.stat);
206
- var fsLStat = promisify(fs.lstat);
207
- var typeMappings = {
208
- directory: "isDirectory",
209
- file: "isFile"
210
- };
211
- function checkType({ type }) {
212
- if (type in typeMappings) {
213
- return;
214
- }
215
- throw new Error(`Invalid type specified: ${type}`);
216
- }
217
- var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
218
- module.exports = async (paths, options) => {
219
- options = {
220
- cwd: process.cwd(),
221
- type: "file",
222
- allowSymlinks: true,
223
- ...options
224
- };
225
- checkType(options);
226
- const statFn = options.allowSymlinks ? fsStat : fsLStat;
227
- return pLocate(paths, async (path_) => {
228
- try {
229
- const stat = await statFn(path.resolve(options.cwd, path_));
230
- return matchType(options.type, stat);
231
- } catch {
232
- return false;
233
- }
234
- }, options);
235
- };
236
- module.exports.sync = (paths, options) => {
237
- options = {
238
- cwd: process.cwd(),
239
- allowSymlinks: true,
240
- type: "file",
241
- ...options
242
- };
243
- checkType(options);
244
- const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
245
- for (const path_ of paths) {
246
- try {
247
- const stat = statFn(path.resolve(options.cwd, path_));
248
- if (matchType(options.type, stat)) {
249
- return path_;
250
- }
251
- } catch {
252
- }
253
- }
254
- };
255
- }
256
- });
257
-
258
- // ../node_modules/path-exists/index.js
259
- var require_path_exists = __commonJS({
260
- "../node_modules/path-exists/index.js"(exports, module) {
261
- "use strict";
262
- var fs = __require("fs");
263
- var { promisify } = __require("util");
264
- var pAccess = promisify(fs.access);
265
- module.exports = async (path) => {
266
- try {
267
- await pAccess(path);
268
- return true;
269
- } catch (_) {
270
- return false;
271
- }
272
- };
273
- module.exports.sync = (path) => {
274
- try {
275
- fs.accessSync(path);
276
- return true;
277
- } catch (_) {
278
- return false;
279
- }
280
- };
281
- }
282
- });
283
-
284
- // ../node_modules/find-up/index.js
285
- var require_find_up = __commonJS({
286
- "../node_modules/find-up/index.js"(exports, module) {
287
- "use strict";
288
- var path = __require("path");
289
- var locatePath = require_locate_path();
290
- var pathExists = require_path_exists();
291
- var stop = /* @__PURE__ */ Symbol("findUp.stop");
292
- module.exports = async (name, options = {}) => {
293
- let directory = path.resolve(options.cwd || "");
294
- const { root } = path.parse(directory);
295
- const paths = [].concat(name);
296
- const runMatcher = async (locateOptions) => {
297
- if (typeof name !== "function") {
298
- return locatePath(paths, locateOptions);
299
- }
300
- const foundPath = await name(locateOptions.cwd);
301
- if (typeof foundPath === "string") {
302
- return locatePath([foundPath], locateOptions);
303
- }
304
- return foundPath;
305
- };
306
- while (true) {
307
- const foundPath = await runMatcher({ ...options, cwd: directory });
308
- if (foundPath === stop) {
309
- return;
310
- }
311
- if (foundPath) {
312
- return path.resolve(directory, foundPath);
313
- }
314
- if (directory === root) {
315
- return;
316
- }
317
- directory = path.dirname(directory);
318
- }
319
- };
320
- module.exports.sync = (name, options = {}) => {
321
- let directory = path.resolve(options.cwd || "");
322
- const { root } = path.parse(directory);
323
- const paths = [].concat(name);
324
- const runMatcher = (locateOptions) => {
325
- if (typeof name !== "function") {
326
- return locatePath.sync(paths, locateOptions);
327
- }
328
- const foundPath = name(locateOptions.cwd);
329
- if (typeof foundPath === "string") {
330
- return locatePath.sync([foundPath], locateOptions);
331
- }
332
- return foundPath;
333
- };
334
- while (true) {
335
- const foundPath = runMatcher({ ...options, cwd: directory });
336
- if (foundPath === stop) {
337
- return;
338
- }
339
- if (foundPath) {
340
- return path.resolve(directory, foundPath);
341
- }
342
- if (directory === root) {
343
- return;
344
- }
345
- directory = path.dirname(directory);
346
- }
347
- };
348
- module.exports.exists = pathExists;
349
- module.exports.sync.exists = pathExists.sync;
350
- module.exports.stop = stop;
351
- }
352
- });
353
-
354
- // ../node_modules/strip-json-comments/index.js
355
- var require_strip_json_comments = __commonJS({
356
- "../node_modules/strip-json-comments/index.js"(exports, module) {
357
- "use strict";
358
- var singleComment = /* @__PURE__ */ Symbol("singleComment");
359
- var multiComment = /* @__PURE__ */ Symbol("multiComment");
360
- var stripWithoutWhitespace = () => "";
361
- var stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, " ");
362
- var isEscaped = (jsonString, quotePosition) => {
363
- let index = quotePosition - 1;
364
- let backslashCount = 0;
365
- while (jsonString[index] === "\\") {
366
- index -= 1;
367
- backslashCount += 1;
368
- }
369
- return Boolean(backslashCount % 2);
370
- };
371
- module.exports = (jsonString, options = {}) => {
372
- if (typeof jsonString !== "string") {
373
- throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);
374
- }
375
- const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
376
- let insideString = false;
377
- let insideComment = false;
378
- let offset = 0;
379
- let result = "";
380
- for (let i = 0; i < jsonString.length; i++) {
381
- const currentCharacter = jsonString[i];
382
- const nextCharacter = jsonString[i + 1];
383
- if (!insideComment && currentCharacter === '"') {
384
- const escaped = isEscaped(jsonString, i);
385
- if (!escaped) {
386
- insideString = !insideString;
387
- }
388
- }
389
- if (insideString) {
390
- continue;
391
- }
392
- if (!insideComment && currentCharacter + nextCharacter === "//") {
393
- result += jsonString.slice(offset, i);
394
- offset = i;
395
- insideComment = singleComment;
396
- i++;
397
- } else if (insideComment === singleComment && currentCharacter + nextCharacter === "\r\n") {
398
- i++;
399
- insideComment = false;
400
- result += strip(jsonString, offset, i);
401
- offset = i;
402
- continue;
403
- } else if (insideComment === singleComment && currentCharacter === "\n") {
404
- insideComment = false;
405
- result += strip(jsonString, offset, i);
406
- offset = i;
407
- } else if (!insideComment && currentCharacter + nextCharacter === "/*") {
408
- result += jsonString.slice(offset, i);
409
- offset = i;
410
- insideComment = multiComment;
411
- i++;
412
- continue;
413
- } else if (insideComment === multiComment && currentCharacter + nextCharacter === "*/") {
414
- i++;
415
- insideComment = false;
416
- result += strip(jsonString, offset, i + 1);
417
- offset = i + 1;
418
- continue;
419
- }
420
- }
421
- return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
422
- };
423
- }
424
- });
425
-
426
- // ../node_modules/ms/index.js
427
- var require_ms = __commonJS({
428
- "../node_modules/ms/index.js"(exports, module) {
429
- var s = 1e3;
430
- var m = s * 60;
431
- var h = m * 60;
432
- var d = h * 24;
433
- var w = d * 7;
434
- var y = d * 365.25;
435
- module.exports = function(val, options) {
436
- options = options || {};
437
- var type = typeof val;
438
- if (type === "string" && val.length > 0) {
439
- return parse(val);
440
- } else if (type === "number" && isFinite(val)) {
441
- return options.long ? fmtLong(val) : fmtShort(val);
442
- }
443
- throw new Error(
444
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
445
- );
446
- };
447
- function parse(str) {
448
- str = String(str);
449
- if (str.length > 100) {
450
- return;
451
- }
452
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
453
- str
454
- );
455
- if (!match) {
456
- return;
457
- }
458
- var n = parseFloat(match[1]);
459
- var type = (match[2] || "ms").toLowerCase();
460
- switch (type) {
461
- case "years":
462
- case "year":
463
- case "yrs":
464
- case "yr":
465
- case "y":
466
- return n * y;
467
- case "weeks":
468
- case "week":
469
- case "w":
470
- return n * w;
471
- case "days":
472
- case "day":
473
- case "d":
474
- return n * d;
475
- case "hours":
476
- case "hour":
477
- case "hrs":
478
- case "hr":
479
- case "h":
480
- return n * h;
481
- case "minutes":
482
- case "minute":
483
- case "mins":
484
- case "min":
485
- case "m":
486
- return n * m;
487
- case "seconds":
488
- case "second":
489
- case "secs":
490
- case "sec":
491
- case "s":
492
- return n * s;
493
- case "milliseconds":
494
- case "millisecond":
495
- case "msecs":
496
- case "msec":
497
- case "ms":
498
- return n;
499
- default:
500
- return void 0;
501
- }
502
- }
503
- function fmtShort(ms) {
504
- var msAbs = Math.abs(ms);
505
- if (msAbs >= d) {
506
- return Math.round(ms / d) + "d";
507
- }
508
- if (msAbs >= h) {
509
- return Math.round(ms / h) + "h";
510
- }
511
- if (msAbs >= m) {
512
- return Math.round(ms / m) + "m";
513
- }
514
- if (msAbs >= s) {
515
- return Math.round(ms / s) + "s";
516
- }
517
- return ms + "ms";
518
- }
519
- function fmtLong(ms) {
520
- var msAbs = Math.abs(ms);
521
- if (msAbs >= d) {
522
- return plural(ms, msAbs, d, "day");
523
- }
524
- if (msAbs >= h) {
525
- return plural(ms, msAbs, h, "hour");
526
- }
527
- if (msAbs >= m) {
528
- return plural(ms, msAbs, m, "minute");
529
- }
530
- if (msAbs >= s) {
531
- return plural(ms, msAbs, s, "second");
532
- }
533
- return ms + " ms";
534
- }
535
- function plural(ms, msAbs, n, name) {
536
- var isPlural = msAbs >= n * 1.5;
537
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
538
- }
539
- }
540
- });
541
-
542
- // ../node_modules/debug/src/common.js
543
- var require_common = __commonJS({
544
- "../node_modules/debug/src/common.js"(exports, module) {
545
- function setup(env) {
546
- createDebug.debug = createDebug;
547
- createDebug.default = createDebug;
548
- createDebug.coerce = coerce;
549
- createDebug.disable = disable;
550
- createDebug.enable = enable;
551
- createDebug.enabled = enabled;
552
- createDebug.humanize = require_ms();
553
- createDebug.destroy = destroy;
554
- Object.keys(env).forEach((key) => {
555
- createDebug[key] = env[key];
556
- });
557
- createDebug.names = [];
558
- createDebug.skips = [];
559
- createDebug.formatters = {};
560
- function selectColor(namespace) {
561
- let hash = 0;
562
- for (let i = 0; i < namespace.length; i++) {
563
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
564
- hash |= 0;
565
- }
566
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
567
- }
568
- createDebug.selectColor = selectColor;
569
- function createDebug(namespace) {
570
- let prevTime;
571
- let enableOverride = null;
572
- let namespacesCache;
573
- let enabledCache;
574
- function debug(...args) {
575
- if (!debug.enabled) {
576
- return;
577
- }
578
- const self = debug;
579
- const curr = Number(/* @__PURE__ */ new Date());
580
- const ms = curr - (prevTime || curr);
581
- self.diff = ms;
582
- self.prev = prevTime;
583
- self.curr = curr;
584
- prevTime = curr;
585
- args[0] = createDebug.coerce(args[0]);
586
- if (typeof args[0] !== "string") {
587
- args.unshift("%O");
588
- }
589
- let index = 0;
590
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
591
- if (match === "%%") {
592
- return "%";
593
- }
594
- index++;
595
- const formatter = createDebug.formatters[format];
596
- if (typeof formatter === "function") {
597
- const val = args[index];
598
- match = formatter.call(self, val);
599
- args.splice(index, 1);
600
- index--;
601
- }
602
- return match;
603
- });
604
- createDebug.formatArgs.call(self, args);
605
- const logFn = self.log || createDebug.log;
606
- logFn.apply(self, args);
607
- }
608
- debug.namespace = namespace;
609
- debug.useColors = createDebug.useColors();
610
- debug.color = createDebug.selectColor(namespace);
611
- debug.extend = extend;
612
- debug.destroy = createDebug.destroy;
613
- Object.defineProperty(debug, "enabled", {
614
- enumerable: true,
615
- configurable: false,
616
- get: () => {
617
- if (enableOverride !== null) {
618
- return enableOverride;
619
- }
620
- if (namespacesCache !== createDebug.namespaces) {
621
- namespacesCache = createDebug.namespaces;
622
- enabledCache = createDebug.enabled(namespace);
623
- }
624
- return enabledCache;
625
- },
626
- set: (v) => {
627
- enableOverride = v;
628
- }
629
- });
630
- if (typeof createDebug.init === "function") {
631
- createDebug.init(debug);
632
- }
633
- return debug;
634
- }
635
- function extend(namespace, delimiter) {
636
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
637
- newDebug.log = this.log;
638
- return newDebug;
639
- }
640
- function enable(namespaces) {
641
- createDebug.save(namespaces);
642
- createDebug.namespaces = namespaces;
643
- createDebug.names = [];
644
- createDebug.skips = [];
645
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
646
- for (const ns of split) {
647
- if (ns[0] === "-") {
648
- createDebug.skips.push(ns.slice(1));
649
- } else {
650
- createDebug.names.push(ns);
651
- }
652
- }
653
- }
654
- function matchesTemplate(search, template) {
655
- let searchIndex = 0;
656
- let templateIndex = 0;
657
- let starIndex = -1;
658
- let matchIndex = 0;
659
- while (searchIndex < search.length) {
660
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
661
- if (template[templateIndex] === "*") {
662
- starIndex = templateIndex;
663
- matchIndex = searchIndex;
664
- templateIndex++;
665
- } else {
666
- searchIndex++;
667
- templateIndex++;
668
- }
669
- } else if (starIndex !== -1) {
670
- templateIndex = starIndex + 1;
671
- matchIndex++;
672
- searchIndex = matchIndex;
673
- } else {
674
- return false;
675
- }
676
- }
677
- while (templateIndex < template.length && template[templateIndex] === "*") {
678
- templateIndex++;
679
- }
680
- return templateIndex === template.length;
681
- }
682
- function disable() {
683
- const namespaces = [
684
- ...createDebug.names,
685
- ...createDebug.skips.map((namespace) => "-" + namespace)
686
- ].join(",");
687
- createDebug.enable("");
688
- return namespaces;
689
- }
690
- function enabled(name) {
691
- for (const skip of createDebug.skips) {
692
- if (matchesTemplate(name, skip)) {
693
- return false;
694
- }
695
- }
696
- for (const ns of createDebug.names) {
697
- if (matchesTemplate(name, ns)) {
698
- return true;
699
- }
700
- }
701
- return false;
702
- }
703
- function coerce(val) {
704
- if (val instanceof Error) {
705
- return val.stack || val.message;
706
- }
707
- return val;
708
- }
709
- function destroy() {
710
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
711
- }
712
- createDebug.enable(createDebug.load());
713
- return createDebug;
714
- }
715
- module.exports = setup;
716
- }
717
- });
718
-
719
- // ../node_modules/debug/src/browser.js
720
- var require_browser = __commonJS({
721
- "../node_modules/debug/src/browser.js"(exports, module) {
722
- exports.formatArgs = formatArgs;
723
- exports.save = save;
724
- exports.load = load;
725
- exports.useColors = useColors;
726
- exports.storage = localstorage();
727
- exports.destroy = /* @__PURE__ */ (() => {
728
- let warned = false;
729
- return () => {
730
- if (!warned) {
731
- warned = true;
732
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
733
- }
734
- };
735
- })();
736
- exports.colors = [
737
- "#0000CC",
738
- "#0000FF",
739
- "#0033CC",
740
- "#0033FF",
741
- "#0066CC",
742
- "#0066FF",
743
- "#0099CC",
744
- "#0099FF",
745
- "#00CC00",
746
- "#00CC33",
747
- "#00CC66",
748
- "#00CC99",
749
- "#00CCCC",
750
- "#00CCFF",
751
- "#3300CC",
752
- "#3300FF",
753
- "#3333CC",
754
- "#3333FF",
755
- "#3366CC",
756
- "#3366FF",
757
- "#3399CC",
758
- "#3399FF",
759
- "#33CC00",
760
- "#33CC33",
761
- "#33CC66",
762
- "#33CC99",
763
- "#33CCCC",
764
- "#33CCFF",
765
- "#6600CC",
766
- "#6600FF",
767
- "#6633CC",
768
- "#6633FF",
769
- "#66CC00",
770
- "#66CC33",
771
- "#9900CC",
772
- "#9900FF",
773
- "#9933CC",
774
- "#9933FF",
775
- "#99CC00",
776
- "#99CC33",
777
- "#CC0000",
778
- "#CC0033",
779
- "#CC0066",
780
- "#CC0099",
781
- "#CC00CC",
782
- "#CC00FF",
783
- "#CC3300",
784
- "#CC3333",
785
- "#CC3366",
786
- "#CC3399",
787
- "#CC33CC",
788
- "#CC33FF",
789
- "#CC6600",
790
- "#CC6633",
791
- "#CC9900",
792
- "#CC9933",
793
- "#CCCC00",
794
- "#CCCC33",
795
- "#FF0000",
796
- "#FF0033",
797
- "#FF0066",
798
- "#FF0099",
799
- "#FF00CC",
800
- "#FF00FF",
801
- "#FF3300",
802
- "#FF3333",
803
- "#FF3366",
804
- "#FF3399",
805
- "#FF33CC",
806
- "#FF33FF",
807
- "#FF6600",
808
- "#FF6633",
809
- "#FF9900",
810
- "#FF9933",
811
- "#FFCC00",
812
- "#FFCC33"
813
- ];
814
- function useColors() {
815
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
816
- return true;
817
- }
818
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
819
- return false;
820
- }
821
- let m;
822
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
823
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
824
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
825
- typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
826
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
827
- }
828
- function formatArgs(args) {
829
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
830
- if (!this.useColors) {
831
- return;
832
- }
833
- const c = "color: " + this.color;
834
- args.splice(1, 0, c, "color: inherit");
835
- let index = 0;
836
- let lastC = 0;
837
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
838
- if (match === "%%") {
839
- return;
840
- }
841
- index++;
842
- if (match === "%c") {
843
- lastC = index;
844
- }
845
- });
846
- args.splice(lastC, 0, c);
847
- }
848
- exports.log = console.debug || console.log || (() => {
849
- });
850
- function save(namespaces) {
851
- try {
852
- if (namespaces) {
853
- exports.storage.setItem("debug", namespaces);
854
- } else {
855
- exports.storage.removeItem("debug");
856
- }
857
- } catch (error) {
858
- }
859
- }
860
- function load() {
861
- let r;
862
- try {
863
- r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
864
- } catch (error) {
865
- }
866
- if (!r && typeof process !== "undefined" && "env" in process) {
867
- r = process.env.DEBUG;
868
- }
869
- return r;
870
- }
871
- function localstorage() {
872
- try {
873
- return localStorage;
874
- } catch (error) {
875
- }
876
- }
877
- module.exports = require_common()(exports);
878
- var { formatters } = module.exports;
879
- formatters.j = function(v) {
880
- try {
881
- return JSON.stringify(v);
882
- } catch (error) {
883
- return "[UnexpectedJSONParseError]: " + error.message;
884
- }
885
- };
886
- }
887
- });
888
-
889
- // ../node_modules/has-flag/index.js
890
- var require_has_flag = __commonJS({
891
- "../node_modules/has-flag/index.js"(exports, module) {
892
- "use strict";
893
- module.exports = (flag, argv = process.argv) => {
894
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
895
- const position = argv.indexOf(prefix + flag);
896
- const terminatorPosition = argv.indexOf("--");
897
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
898
- };
899
- }
900
- });
901
-
902
- // ../node_modules/supports-color/index.js
903
- var require_supports_color = __commonJS({
904
- "../node_modules/supports-color/index.js"(exports, module) {
905
- "use strict";
906
- var os = __require("os");
907
- var tty = __require("tty");
908
- var hasFlag = require_has_flag();
909
- var { env } = process;
910
- var flagForceColor;
911
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
912
- flagForceColor = 0;
913
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
914
- flagForceColor = 1;
915
- }
916
- function envForceColor() {
917
- if ("FORCE_COLOR" in env) {
918
- if (env.FORCE_COLOR === "true") {
919
- return 1;
920
- }
921
- if (env.FORCE_COLOR === "false") {
922
- return 0;
923
- }
924
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
925
- }
926
- }
927
- function translateLevel(level) {
928
- if (level === 0) {
929
- return false;
930
- }
931
- return {
932
- level,
933
- hasBasic: true,
934
- has256: level >= 2,
935
- has16m: level >= 3
936
- };
937
- }
938
- function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
939
- const noFlagForceColor = envForceColor();
940
- if (noFlagForceColor !== void 0) {
941
- flagForceColor = noFlagForceColor;
942
- }
943
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
944
- if (forceColor === 0) {
945
- return 0;
946
- }
947
- if (sniffFlags) {
948
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
949
- return 3;
950
- }
951
- if (hasFlag("color=256")) {
952
- return 2;
953
- }
954
- }
955
- if (haveStream && !streamIsTTY && forceColor === void 0) {
956
- return 0;
957
- }
958
- const min = forceColor || 0;
959
- if (env.TERM === "dumb") {
960
- return min;
961
- }
962
- if (process.platform === "win32") {
963
- const osRelease = os.release().split(".");
964
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
965
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
966
- }
967
- return 1;
968
- }
969
- if ("CI" in env) {
970
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
971
- return 1;
972
- }
973
- return min;
974
- }
975
- if ("TEAMCITY_VERSION" in env) {
976
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
977
- }
978
- if (env.COLORTERM === "truecolor") {
979
- return 3;
980
- }
981
- if ("TERM_PROGRAM" in env) {
982
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
983
- switch (env.TERM_PROGRAM) {
984
- case "iTerm.app":
985
- return version >= 3 ? 3 : 2;
986
- case "Apple_Terminal":
987
- return 2;
988
- }
989
- }
990
- if (/-256(color)?$/i.test(env.TERM)) {
991
- return 2;
992
- }
993
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
994
- return 1;
995
- }
996
- if ("COLORTERM" in env) {
997
- return 1;
998
- }
999
- return min;
1000
- }
1001
- function getSupportLevel(stream, options = {}) {
1002
- const level = supportsColor(stream, {
1003
- streamIsTTY: stream && stream.isTTY,
1004
- ...options
1005
- });
1006
- return translateLevel(level);
1007
- }
1008
- module.exports = {
1009
- supportsColor: getSupportLevel,
1010
- stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
1011
- stderr: getSupportLevel({ isTTY: tty.isatty(2) })
1012
- };
1013
- }
1014
- });
1015
-
1016
- // ../node_modules/debug/src/node.js
1017
- var require_node = __commonJS({
1018
- "../node_modules/debug/src/node.js"(exports, module) {
1019
- var tty = __require("tty");
1020
- var util = __require("util");
1021
- exports.init = init;
1022
- exports.log = log;
1023
- exports.formatArgs = formatArgs;
1024
- exports.save = save;
1025
- exports.load = load;
1026
- exports.useColors = useColors;
1027
- exports.destroy = util.deprecate(
1028
- () => {
1029
- },
1030
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
1031
- );
1032
- exports.colors = [6, 2, 3, 4, 5, 1];
1033
- try {
1034
- const supportsColor = require_supports_color();
1035
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
1036
- exports.colors = [
1037
- 20,
1038
- 21,
1039
- 26,
1040
- 27,
1041
- 32,
1042
- 33,
1043
- 38,
1044
- 39,
1045
- 40,
1046
- 41,
1047
- 42,
1048
- 43,
1049
- 44,
1050
- 45,
1051
- 56,
1052
- 57,
1053
- 62,
1054
- 63,
1055
- 68,
1056
- 69,
1057
- 74,
1058
- 75,
1059
- 76,
1060
- 77,
1061
- 78,
1062
- 79,
1063
- 80,
1064
- 81,
1065
- 92,
1066
- 93,
1067
- 98,
1068
- 99,
1069
- 112,
1070
- 113,
1071
- 128,
1072
- 129,
1073
- 134,
1074
- 135,
1075
- 148,
1076
- 149,
1077
- 160,
1078
- 161,
1079
- 162,
1080
- 163,
1081
- 164,
1082
- 165,
1083
- 166,
1084
- 167,
1085
- 168,
1086
- 169,
1087
- 170,
1088
- 171,
1089
- 172,
1090
- 173,
1091
- 178,
1092
- 179,
1093
- 184,
1094
- 185,
1095
- 196,
1096
- 197,
1097
- 198,
1098
- 199,
1099
- 200,
1100
- 201,
1101
- 202,
1102
- 203,
1103
- 204,
1104
- 205,
1105
- 206,
1106
- 207,
1107
- 208,
1108
- 209,
1109
- 214,
1110
- 215,
1111
- 220,
1112
- 221
1113
- ];
1114
- }
1115
- } catch (error) {
1116
- }
1117
- exports.inspectOpts = Object.keys(process.env).filter((key) => {
1118
- return /^debug_/i.test(key);
1119
- }).reduce((obj, key) => {
1120
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
1121
- return k.toUpperCase();
1122
- });
1123
- let val = process.env[key];
1124
- if (/^(yes|on|true|enabled)$/i.test(val)) {
1125
- val = true;
1126
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
1127
- val = false;
1128
- } else if (val === "null") {
1129
- val = null;
1130
- } else {
1131
- val = Number(val);
1132
- }
1133
- obj[prop] = val;
1134
- return obj;
1135
- }, {});
1136
- function useColors() {
1137
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
1138
- }
1139
- function formatArgs(args) {
1140
- const { namespace: name, useColors: useColors2 } = this;
1141
- if (useColors2) {
1142
- const c = this.color;
1143
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
1144
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
1145
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
1146
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
1147
- } else {
1148
- args[0] = getDate() + name + " " + args[0];
1149
- }
1150
- }
1151
- function getDate() {
1152
- if (exports.inspectOpts.hideDate) {
1153
- return "";
1154
- }
1155
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
1156
- }
1157
- function log(...args) {
1158
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
1159
- }
1160
- function save(namespaces) {
1161
- if (namespaces) {
1162
- process.env.DEBUG = namespaces;
1163
- } else {
1164
- delete process.env.DEBUG;
1165
- }
1166
- }
1167
- function load() {
1168
- return process.env.DEBUG;
1169
- }
1170
- function init(debug) {
1171
- debug.inspectOpts = {};
1172
- const keys = Object.keys(exports.inspectOpts);
1173
- for (let i = 0; i < keys.length; i++) {
1174
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
1175
- }
1176
- }
1177
- module.exports = require_common()(exports);
1178
- var { formatters } = module.exports;
1179
- formatters.o = function(v) {
1180
- this.inspectOpts.colors = this.useColors;
1181
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
1182
- };
1183
- formatters.O = function(v) {
1184
- this.inspectOpts.colors = this.useColors;
1185
- return util.inspect(v, this.inspectOpts);
1186
- };
1187
- }
1188
- });
1189
-
1190
- // ../node_modules/debug/src/index.js
1191
- var require_src = __commonJS({
1192
- "../node_modules/debug/src/index.js"(exports, module) {
1193
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
1194
- module.exports = require_browser();
1195
- } else {
1196
- module.exports = require_node();
1197
- }
1198
- }
1199
- });
1200
-
1201
- // ../node_modules/@esbuild-plugins/tsconfig-paths/dist/index.js
1202
- var require_dist = __commonJS({
1203
- "../node_modules/@esbuild-plugins/tsconfig-paths/dist/index.js"(exports) {
1204
- "use strict";
1205
- var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
1206
- function adopt(value) {
1207
- return value instanceof P ? value : new P(function(resolve) {
1208
- resolve(value);
1209
- });
1210
- }
1211
- return new (P || (P = Promise))(function(resolve, reject) {
1212
- function fulfilled(value) {
1213
- try {
1214
- step(generator.next(value));
1215
- } catch (e) {
1216
- reject(e);
1217
- }
1218
- }
1219
- function rejected(value) {
1220
- try {
1221
- step(generator["throw"](value));
1222
- } catch (e) {
1223
- reject(e);
1224
- }
1225
- }
1226
- function step(result) {
1227
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
1228
- }
1229
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1230
- });
1231
- };
1232
- var __importDefault = exports && exports.__importDefault || function(mod) {
1233
- return mod && mod.__esModule ? mod : { "default": mod };
1234
- };
1235
- Object.defineProperty(exports, "__esModule", { value: true });
1236
- exports.TsconfigPathsPlugin = void 0;
1237
- var fs_1 = __importDefault(__require("fs"));
1238
- var typescript_1 = __require("typescript");
1239
- var find_up_1 = __importDefault(require_find_up());
1240
- var strip_json_comments_1 = __importDefault(require_strip_json_comments());
1241
- var NAME = "tsconfig-paths";
1242
- var debug = require_src()(NAME);
1243
- function TsconfigPathsPlugin2({ name = NAME, absolute = true, onResolved, tsconfig }) {
1244
- debug("setup");
1245
- const compilerOptions = loadCompilerOptions(tsconfig);
1246
- return {
1247
- name,
1248
- setup: function setup({ onResolve }) {
1249
- onResolve({ filter: /.*/ }, (args) => __awaiter(this, void 0, void 0, function* () {
1250
- const hasMatchingPath = Object.keys((compilerOptions === null || compilerOptions === void 0 ? void 0 : compilerOptions.paths) || {}).some((path) => new RegExp(path.replace("*", "\\w*")).test(args.path));
1251
- if (!hasMatchingPath) {
1252
- return null;
1253
- }
1254
- const { resolvedModule } = typescript_1.nodeModuleNameResolver(args.path, args.importer, compilerOptions || {}, typescript_1.sys);
1255
- if (!resolvedModule) {
1256
- return null;
1257
- }
1258
- const { resolvedFileName } = resolvedModule;
1259
- if (!resolvedFileName || resolvedFileName.endsWith(".d.ts")) {
1260
- return null;
1261
- }
1262
- let resolved = absolute ? typescript_1.sys.resolvePath(resolvedFileName) : resolvedFileName;
1263
- if (onResolved) {
1264
- onResolved(resolved);
1265
- }
1266
- return {
1267
- path: resolved
1268
- };
1269
- }));
1270
- }
1271
- };
1272
- }
1273
- exports.TsconfigPathsPlugin = TsconfigPathsPlugin2;
1274
- function loadJSON(p) {
1275
- try {
1276
- let data = fs_1.default.readFileSync(p).toString();
1277
- data = strip_json_comments_1.default(data);
1278
- return JSON.parse(data);
1279
- } catch (e) {
1280
- throw new Error(`Cannot load json for '${p}'`);
1281
- }
1282
- }
1283
- function loadCompilerOptions(tsconfig) {
1284
- if (!tsconfig) {
1285
- const configPath = find_up_1.default.sync(["tsconfig.json", "jsconfig.json"]);
1286
- if (configPath) {
1287
- const config = loadJSON(configPath);
1288
- return config["compilerOptions"] || {};
1289
- }
1290
- }
1291
- if (typeof tsconfig === "string") {
1292
- if (fs_1.default.existsSync(tsconfig)) {
1293
- const config = loadJSON(tsconfig);
1294
- return config["compilerOptions"] || {};
1295
- }
1296
- }
1297
- if (tsconfig && tsconfig["compilerOptions"]) {
1298
- return tsconfig["compilerOptions"];
1299
- }
1300
- return {};
1301
- }
1302
- exports.default = TsconfigPathsPlugin2;
1303
- }
1304
- });
1305
-
1306
- // esbuild-tsconfig-paths-wrapper.js
1307
- var import_tsconfig_paths = __toESM(require_dist());
1308
- var actual = import_tsconfig_paths.default?.default || import_tsconfig_paths.default;
1309
- var TsconfigPathsPlugin = actual.TsconfigPathsPlugin || actual;
1310
- var esbuild_tsconfig_paths_wrapper_default = actual;
1311
- export {
1312
- TsconfigPathsPlugin,
1313
- esbuild_tsconfig_paths_wrapper_default as default
1314
- };