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,661 +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 __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined") return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __commonJS = (cb, mod) => function __require2() {
15
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
- };
17
-
18
- // ../node_modules/isexe/windows.js
19
- var require_windows = __commonJS({
20
- "../node_modules/isexe/windows.js"(exports, module) {
21
- module.exports = isexe;
22
- isexe.sync = sync;
23
- var fs = __require("fs");
24
- function checkPathExt(path, options) {
25
- var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
26
- if (!pathext) {
27
- return true;
28
- }
29
- pathext = pathext.split(";");
30
- if (pathext.indexOf("") !== -1) {
31
- return true;
32
- }
33
- for (var i = 0; i < pathext.length; i++) {
34
- var p = pathext[i].toLowerCase();
35
- if (p && path.substr(-p.length).toLowerCase() === p) {
36
- return true;
37
- }
38
- }
39
- return false;
40
- }
41
- function checkStat(stat, path, options) {
42
- if (!stat.isSymbolicLink() && !stat.isFile()) {
43
- return false;
44
- }
45
- return checkPathExt(path, options);
46
- }
47
- function isexe(path, options, cb) {
48
- fs.stat(path, function(er, stat) {
49
- cb(er, er ? false : checkStat(stat, path, options));
50
- });
51
- }
52
- function sync(path, options) {
53
- return checkStat(fs.statSync(path), path, options);
54
- }
55
- }
56
- });
57
-
58
- // ../node_modules/isexe/mode.js
59
- var require_mode = __commonJS({
60
- "../node_modules/isexe/mode.js"(exports, module) {
61
- module.exports = isexe;
62
- isexe.sync = sync;
63
- var fs = __require("fs");
64
- function isexe(path, options, cb) {
65
- fs.stat(path, function(er, stat) {
66
- cb(er, er ? false : checkStat(stat, options));
67
- });
68
- }
69
- function sync(path, options) {
70
- return checkStat(fs.statSync(path), options);
71
- }
72
- function checkStat(stat, options) {
73
- return stat.isFile() && checkMode(stat, options);
74
- }
75
- function checkMode(stat, options) {
76
- var mod = stat.mode;
77
- var uid = stat.uid;
78
- var gid = stat.gid;
79
- var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
80
- var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
81
- var u = parseInt("100", 8);
82
- var g = parseInt("010", 8);
83
- var o = parseInt("001", 8);
84
- var ug = u | g;
85
- var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
86
- return ret;
87
- }
88
- }
89
- });
90
-
91
- // ../node_modules/isexe/index.js
92
- var require_isexe = __commonJS({
93
- "../node_modules/isexe/index.js"(exports, module) {
94
- var fs = __require("fs");
95
- var core;
96
- if (process.platform === "win32" || global.TESTING_WINDOWS) {
97
- core = require_windows();
98
- } else {
99
- core = require_mode();
100
- }
101
- module.exports = isexe;
102
- isexe.sync = sync;
103
- function isexe(path, options, cb) {
104
- if (typeof options === "function") {
105
- cb = options;
106
- options = {};
107
- }
108
- if (!cb) {
109
- if (typeof Promise !== "function") {
110
- throw new TypeError("callback not provided");
111
- }
112
- return new Promise(function(resolve, reject) {
113
- isexe(path, options || {}, function(er, is) {
114
- if (er) {
115
- reject(er);
116
- } else {
117
- resolve(is);
118
- }
119
- });
120
- });
121
- }
122
- core(path, options || {}, function(er, is) {
123
- if (er) {
124
- if (er.code === "EACCES" || options && options.ignoreErrors) {
125
- er = null;
126
- is = false;
127
- }
128
- }
129
- cb(er, is);
130
- });
131
- }
132
- function sync(path, options) {
133
- try {
134
- return core.sync(path, options || {});
135
- } catch (er) {
136
- if (options && options.ignoreErrors || er.code === "EACCES") {
137
- return false;
138
- } else {
139
- throw er;
140
- }
141
- }
142
- }
143
- }
144
- });
145
-
146
- // ../node_modules/which/which.js
147
- var require_which = __commonJS({
148
- "../node_modules/which/which.js"(exports, module) {
149
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
150
- var path = __require("path");
151
- var COLON = isWindows ? ";" : ":";
152
- var isexe = require_isexe();
153
- var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
154
- var getPathInfo = (cmd, opt) => {
155
- const colon = opt.colon || COLON;
156
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
157
- // windows always checks the cwd first
158
- ...isWindows ? [process.cwd()] : [],
159
- ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
160
- "").split(colon)
161
- ];
162
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
163
- const pathExt = isWindows ? pathExtExe.split(colon) : [""];
164
- if (isWindows) {
165
- if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
166
- pathExt.unshift("");
167
- }
168
- return {
169
- pathEnv,
170
- pathExt,
171
- pathExtExe
172
- };
173
- };
174
- var which = (cmd, opt, cb) => {
175
- if (typeof opt === "function") {
176
- cb = opt;
177
- opt = {};
178
- }
179
- if (!opt)
180
- opt = {};
181
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
182
- const found = [];
183
- const step = (i) => new Promise((resolve, reject) => {
184
- if (i === pathEnv.length)
185
- return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
186
- const ppRaw = pathEnv[i];
187
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
188
- const pCmd = path.join(pathPart, cmd);
189
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
190
- resolve(subStep(p, i, 0));
191
- });
192
- const subStep = (p, i, ii) => new Promise((resolve, reject) => {
193
- if (ii === pathExt.length)
194
- return resolve(step(i + 1));
195
- const ext = pathExt[ii];
196
- isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
197
- if (!er && is) {
198
- if (opt.all)
199
- found.push(p + ext);
200
- else
201
- return resolve(p + ext);
202
- }
203
- return resolve(subStep(p, i, ii + 1));
204
- });
205
- });
206
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
207
- };
208
- var whichSync = (cmd, opt) => {
209
- opt = opt || {};
210
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
211
- const found = [];
212
- for (let i = 0; i < pathEnv.length; i++) {
213
- const ppRaw = pathEnv[i];
214
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
215
- const pCmd = path.join(pathPart, cmd);
216
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
217
- for (let j = 0; j < pathExt.length; j++) {
218
- const cur = p + pathExt[j];
219
- try {
220
- const is = isexe.sync(cur, { pathExt: pathExtExe });
221
- if (is) {
222
- if (opt.all)
223
- found.push(cur);
224
- else
225
- return cur;
226
- }
227
- } catch (ex) {
228
- }
229
- }
230
- }
231
- if (opt.all && found.length)
232
- return found;
233
- if (opt.nothrow)
234
- return null;
235
- throw getNotFoundError(cmd);
236
- };
237
- module.exports = which;
238
- which.sync = whichSync;
239
- }
240
- });
241
-
242
- // ../node_modules/path-key/index.js
243
- var require_path_key = __commonJS({
244
- "../node_modules/path-key/index.js"(exports, module) {
245
- "use strict";
246
- var pathKey = (options = {}) => {
247
- const environment = options.env || process.env;
248
- const platform = options.platform || process.platform;
249
- if (platform !== "win32") {
250
- return "PATH";
251
- }
252
- return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
253
- };
254
- module.exports = pathKey;
255
- module.exports.default = pathKey;
256
- }
257
- });
258
-
259
- // ../node_modules/cross-spawn/lib/util/resolveCommand.js
260
- var require_resolveCommand = __commonJS({
261
- "../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
262
- "use strict";
263
- var path = __require("path");
264
- var which = require_which();
265
- var getPathKey = require_path_key();
266
- function resolveCommandAttempt(parsed, withoutPathExt) {
267
- const env = parsed.options.env || process.env;
268
- const cwd = process.cwd();
269
- const hasCustomCwd = parsed.options.cwd != null;
270
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
271
- if (shouldSwitchCwd) {
272
- try {
273
- process.chdir(parsed.options.cwd);
274
- } catch (err) {
275
- }
276
- }
277
- let resolved;
278
- try {
279
- resolved = which.sync(parsed.command, {
280
- path: env[getPathKey({ env })],
281
- pathExt: withoutPathExt ? path.delimiter : void 0
282
- });
283
- } catch (e) {
284
- } finally {
285
- if (shouldSwitchCwd) {
286
- process.chdir(cwd);
287
- }
288
- }
289
- if (resolved) {
290
- resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
291
- }
292
- return resolved;
293
- }
294
- function resolveCommand(parsed) {
295
- return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
296
- }
297
- module.exports = resolveCommand;
298
- }
299
- });
300
-
301
- // ../node_modules/cross-spawn/lib/util/escape.js
302
- var require_escape = __commonJS({
303
- "../node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
304
- "use strict";
305
- var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
306
- function escapeCommand(arg) {
307
- arg = arg.replace(metaCharsRegExp, "^$1");
308
- return arg;
309
- }
310
- function escapeArgument(arg, doubleEscapeMetaChars) {
311
- arg = `${arg}`;
312
- arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
313
- arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
314
- arg = `"${arg}"`;
315
- arg = arg.replace(metaCharsRegExp, "^$1");
316
- if (doubleEscapeMetaChars) {
317
- arg = arg.replace(metaCharsRegExp, "^$1");
318
- }
319
- return arg;
320
- }
321
- module.exports.command = escapeCommand;
322
- module.exports.argument = escapeArgument;
323
- }
324
- });
325
-
326
- // ../node_modules/shebang-regex/index.js
327
- var require_shebang_regex = __commonJS({
328
- "../node_modules/shebang-regex/index.js"(exports, module) {
329
- "use strict";
330
- module.exports = /^#!(.*)/;
331
- }
332
- });
333
-
334
- // ../node_modules/shebang-command/index.js
335
- var require_shebang_command = __commonJS({
336
- "../node_modules/shebang-command/index.js"(exports, module) {
337
- "use strict";
338
- var shebangRegex = require_shebang_regex();
339
- module.exports = (string = "") => {
340
- const match = string.match(shebangRegex);
341
- if (!match) {
342
- return null;
343
- }
344
- const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
345
- const binary = path.split("/").pop();
346
- if (binary === "env") {
347
- return argument;
348
- }
349
- return argument ? `${binary} ${argument}` : binary;
350
- };
351
- }
352
- });
353
-
354
- // ../node_modules/cross-spawn/lib/util/readShebang.js
355
- var require_readShebang = __commonJS({
356
- "../node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
357
- "use strict";
358
- var fs = __require("fs");
359
- var shebangCommand = require_shebang_command();
360
- function readShebang(command) {
361
- const size = 150;
362
- const buffer = Buffer.alloc(size);
363
- let fd;
364
- try {
365
- fd = fs.openSync(command, "r");
366
- fs.readSync(fd, buffer, 0, size, 0);
367
- fs.closeSync(fd);
368
- } catch (e) {
369
- }
370
- return shebangCommand(buffer.toString());
371
- }
372
- module.exports = readShebang;
373
- }
374
- });
375
-
376
- // ../node_modules/cross-spawn/lib/parse.js
377
- var require_parse = __commonJS({
378
- "../node_modules/cross-spawn/lib/parse.js"(exports, module) {
379
- "use strict";
380
- var path = __require("path");
381
- var resolveCommand = require_resolveCommand();
382
- var escape = require_escape();
383
- var readShebang = require_readShebang();
384
- var isWin = process.platform === "win32";
385
- var isExecutableRegExp = /\.(?:com|exe)$/i;
386
- var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
387
- function detectShebang(parsed) {
388
- parsed.file = resolveCommand(parsed);
389
- const shebang = parsed.file && readShebang(parsed.file);
390
- if (shebang) {
391
- parsed.args.unshift(parsed.file);
392
- parsed.command = shebang;
393
- return resolveCommand(parsed);
394
- }
395
- return parsed.file;
396
- }
397
- function parseNonShell(parsed) {
398
- if (!isWin) {
399
- return parsed;
400
- }
401
- const commandFile = detectShebang(parsed);
402
- const needsShell = !isExecutableRegExp.test(commandFile);
403
- if (parsed.options.forceShell || needsShell) {
404
- const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
405
- parsed.command = path.normalize(parsed.command);
406
- parsed.command = escape.command(parsed.command);
407
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
408
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
409
- parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
410
- parsed.command = process.env.comspec || "cmd.exe";
411
- parsed.options.windowsVerbatimArguments = true;
412
- }
413
- return parsed;
414
- }
415
- function parse(command, args, options) {
416
- if (args && !Array.isArray(args)) {
417
- options = args;
418
- args = null;
419
- }
420
- args = args ? args.slice(0) : [];
421
- options = Object.assign({}, options);
422
- const parsed = {
423
- command,
424
- args,
425
- options,
426
- file: void 0,
427
- original: {
428
- command,
429
- args
430
- }
431
- };
432
- return options.shell ? parsed : parseNonShell(parsed);
433
- }
434
- module.exports = parse;
435
- }
436
- });
437
-
438
- // ../node_modules/cross-spawn/lib/enoent.js
439
- var require_enoent = __commonJS({
440
- "../node_modules/cross-spawn/lib/enoent.js"(exports, module) {
441
- "use strict";
442
- var isWin = process.platform === "win32";
443
- function notFoundError(original, syscall) {
444
- return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
445
- code: "ENOENT",
446
- errno: "ENOENT",
447
- syscall: `${syscall} ${original.command}`,
448
- path: original.command,
449
- spawnargs: original.args
450
- });
451
- }
452
- function hookChildProcess(cp, parsed) {
453
- if (!isWin) {
454
- return;
455
- }
456
- const originalEmit = cp.emit;
457
- cp.emit = function(name, arg1) {
458
- if (name === "exit") {
459
- const err = verifyENOENT(arg1, parsed);
460
- if (err) {
461
- return originalEmit.call(cp, "error", err);
462
- }
463
- }
464
- return originalEmit.apply(cp, arguments);
465
- };
466
- }
467
- function verifyENOENT(status, parsed) {
468
- if (isWin && status === 1 && !parsed.file) {
469
- return notFoundError(parsed.original, "spawn");
470
- }
471
- return null;
472
- }
473
- function verifyENOENTSync(status, parsed) {
474
- if (isWin && status === 1 && !parsed.file) {
475
- return notFoundError(parsed.original, "spawnSync");
476
- }
477
- return null;
478
- }
479
- module.exports = {
480
- hookChildProcess,
481
- verifyENOENT,
482
- verifyENOENTSync,
483
- notFoundError
484
- };
485
- }
486
- });
487
-
488
- // ../node_modules/cross-spawn/index.js
489
- var require_cross_spawn = __commonJS({
490
- "../node_modules/cross-spawn/index.js"(exports, module) {
491
- "use strict";
492
- var cp = __require("child_process");
493
- var parse = require_parse();
494
- var enoent = require_enoent();
495
- function spawn(command, args, options) {
496
- const parsed = parse(command, args, options);
497
- const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
498
- enoent.hookChildProcess(spawned, parsed);
499
- return spawned;
500
- }
501
- function spawnSync(command, args, options) {
502
- const parsed = parse(command, args, options);
503
- const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
504
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
505
- return result;
506
- }
507
- module.exports = spawn;
508
- module.exports.spawn = spawn;
509
- module.exports.sync = spawnSync;
510
- module.exports._parse = parse;
511
- module.exports._enoent = enoent;
512
- }
513
- });
514
-
515
- // ../node_modules/cross-env/src/is-windows.js
516
- var require_is_windows = __commonJS({
517
- "../node_modules/cross-env/src/is-windows.js"(exports, module) {
518
- module.exports = () => process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE);
519
- }
520
- });
521
-
522
- // ../node_modules/cross-env/src/command.js
523
- var require_command = __commonJS({
524
- "../node_modules/cross-env/src/command.js"(exports, module) {
525
- var path = __require("path");
526
- var isWindows = require_is_windows();
527
- module.exports = commandConvert;
528
- function commandConvert(command, env, normalize = false) {
529
- if (!isWindows()) {
530
- return command;
531
- }
532
- const envUnixRegex = /\$(\w+)|\${(\w+)}/g;
533
- const convertedCmd = command.replace(envUnixRegex, (match, $1, $2) => {
534
- const varName = $1 || $2;
535
- return env[varName] ? `%${varName}%` : "";
536
- });
537
- return normalize === true ? path.normalize(convertedCmd) : convertedCmd;
538
- }
539
- }
540
- });
541
-
542
- // ../node_modules/cross-env/src/variable.js
543
- var require_variable = __commonJS({
544
- "../node_modules/cross-env/src/variable.js"(exports, module) {
545
- var isWindows = require_is_windows();
546
- var pathLikeEnvVarWhitelist = /* @__PURE__ */ new Set(["PATH", "NODE_PATH"]);
547
- module.exports = varValueConvert;
548
- function replaceListDelimiters(varValue, varName = "") {
549
- const targetSeparator = isWindows() ? ";" : ":";
550
- if (!pathLikeEnvVarWhitelist.has(varName)) {
551
- return varValue;
552
- }
553
- return varValue.replace(/(\\*):/g, (match, backslashes) => {
554
- if (backslashes.length % 2) {
555
- return match.substr(1);
556
- }
557
- return backslashes + targetSeparator;
558
- });
559
- }
560
- function resolveEnvVars(varValue) {
561
- const envUnixRegex = /(\\*)(\$(\w+)|\${(\w+)})/g;
562
- return varValue.replace(
563
- envUnixRegex,
564
- (_, escapeChars, varNameWithDollarSign, varName, altVarName) => {
565
- if (escapeChars.length % 2 === 1) {
566
- return varNameWithDollarSign;
567
- }
568
- return escapeChars.substr(0, escapeChars.length / 2) + (process.env[varName || altVarName] || "");
569
- }
570
- );
571
- }
572
- function varValueConvert(originalValue, originalName) {
573
- return resolveEnvVars(replaceListDelimiters(originalValue, originalName));
574
- }
575
- }
576
- });
577
-
578
- // ../node_modules/cross-env/src/index.js
579
- var require_src = __commonJS({
580
- "../node_modules/cross-env/src/index.js"(exports, module) {
581
- var { spawn } = require_cross_spawn();
582
- var commandConvert = require_command();
583
- var varValueConvert = require_variable();
584
- module.exports = crossEnv;
585
- var envSetterRegex = /(\w+)=('(.*)'|"(.*)"|(.*))/;
586
- function crossEnv(args, options = {}) {
587
- const [envSetters, command, commandArgs] = parseCommand(args);
588
- const env = getEnvVars(envSetters);
589
- if (command) {
590
- const proc = spawn(
591
- // run `path.normalize` for command(on windows)
592
- commandConvert(command, env, true),
593
- // by default normalize is `false`, so not run for cmd args
594
- commandArgs.map((arg) => commandConvert(arg, env)),
595
- {
596
- stdio: "inherit",
597
- shell: options.shell,
598
- env
599
- }
600
- );
601
- process.on("SIGTERM", () => proc.kill("SIGTERM"));
602
- process.on("SIGINT", () => proc.kill("SIGINT"));
603
- process.on("SIGBREAK", () => proc.kill("SIGBREAK"));
604
- process.on("SIGHUP", () => proc.kill("SIGHUP"));
605
- proc.on("exit", (code, signal) => {
606
- let crossEnvExitCode = code;
607
- if (crossEnvExitCode === null) {
608
- crossEnvExitCode = signal === "SIGINT" ? 0 : 1;
609
- }
610
- process.exit(crossEnvExitCode);
611
- });
612
- return proc;
613
- }
614
- return null;
615
- }
616
- function parseCommand(args) {
617
- const envSetters = {};
618
- let command = null;
619
- let commandArgs = [];
620
- for (let i = 0; i < args.length; i++) {
621
- const match = envSetterRegex.exec(args[i]);
622
- if (match) {
623
- let value;
624
- if (typeof match[3] !== "undefined") {
625
- value = match[3];
626
- } else if (typeof match[4] === "undefined") {
627
- value = match[5];
628
- } else {
629
- value = match[4];
630
- }
631
- envSetters[match[1]] = value;
632
- } else {
633
- let cStart = [];
634
- cStart = args.slice(i).map((a) => {
635
- const re = /\\\\|(\\)?'|([\\])(?=[$"\\])/g;
636
- return a.replace(re, (m) => {
637
- if (m === "\\\\") return "\\";
638
- if (m === "\\'") return "'";
639
- return "";
640
- });
641
- });
642
- command = cStart[0];
643
- commandArgs = cStart.slice(1);
644
- break;
645
- }
646
- }
647
- return [envSetters, command, commandArgs];
648
- }
649
- function getEnvVars(envSetters) {
650
- const envVars = { ...process.env };
651
- if (process.env.APPDATA) {
652
- envVars.APPDATA = process.env.APPDATA;
653
- }
654
- Object.keys(envSetters).forEach((varName) => {
655
- envVars[varName] = varValueConvert(envSetters[varName], varName);
656
- });
657
- return envVars;
658
- }
659
- }
660
- });
661
- export default require_src();