nitro 3.0.260415-beta → 3.0.260429-beta
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.
- package/dist/THIRD-PARTY-LICENSES.md +32 -2
- package/dist/_build/common.mjs +43 -29
- package/dist/_build/rolldown.mjs +1 -1
- package/dist/_build/rollup.mjs +2 -2
- package/dist/_build/vite.build.mjs +1 -1
- package/dist/_chunks/nitro.mjs +5 -5
- package/dist/_chunks/nitro2.mjs +1 -1
- package/dist/_chunks/nitro3.mjs +1 -1
- package/dist/_chunks/nitro4.mjs +2 -2
- package/dist/_chunks/utils.mjs +2 -2
- package/dist/_common.mjs +1 -1
- package/dist/_dev.mjs +3 -2
- package/dist/_libs/c12+rc9.mjs +21 -9
- package/dist/_libs/hasown+resolve+deepmerge.mjs +47 -34
- package/dist/_libs/httpxy.d.mts +1 -3
- package/dist/_libs/httpxy.mjs +5 -5
- package/dist/_libs/nypm+tinyexec.mjs +129 -98
- package/dist/_libs/pkg-types.d.mts +7 -4
- package/dist/_libs/plugin-inject.mjs +3 -1
- package/dist/_libs/pluginutils.mjs +4 -2
- package/dist/_libs/readdirp+chokidar.mjs +2 -1
- package/dist/_libs/{unimport+unplugin.mjs → unimport+unplugin+oxc-parser.mjs} +49 -37
- package/dist/_libs/unplugin+unimport.d.mts +1 -1
- package/dist/_presets.mjs +2 -1
- package/dist/cli/_chunks/build.mjs +1 -1
- package/dist/cli/_chunks/deploy.mjs +1 -1
- package/dist/cli/_chunks/dev.mjs +1 -1
- package/dist/cli/_chunks/list.mjs +1 -1
- package/dist/cli/_chunks/prepare.mjs +1 -1
- package/dist/cli/_chunks/preview.mjs +1 -1
- package/dist/cli/_chunks/run.mjs +1 -1
- package/dist/docs/0.docs/5.cache.md +53 -9
- package/dist/node_modules/ufo/dist/index.mjs +2 -2
- package/dist/node_modules/ufo/package.json +9 -9
- package/dist/presets/azure/runtime/azure-swa.mjs +2 -0
- package/dist/runtime/internal/route-rules.d.mts +1 -0
- package/dist/runtime/internal/route-rules.mjs +29 -1
- package/dist/runtime/internal/routes/scalar.mjs +1 -0
- package/dist/types/index.d.mts +922 -64
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +11 -5
- package/package.json +28 -27
- package/dist/_libs/_.mjs +0 -2
- package/dist/_libs/_2.mjs +0 -2
- package/dist/_libs/_3.mjs +0 -2
- package/dist/_libs/_4.mjs +0 -2
- package/dist/_libs/_5.mjs +0 -2
- package/dist/_libs/_6.mjs +0 -2
- package/dist/_libs/_7.mjs +0 -2
- package/dist/_libs/escape-string-regexp.mjs +0 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __exportAll } from "../_common.mjs";
|
|
2
|
+
import { ft as resolve$1, lt as join$1, ut as normalize$1 } from "../_build/common.mjs";
|
|
2
3
|
import { createRequire } from "node:module";
|
|
3
4
|
import { existsSync } from "node:fs";
|
|
4
5
|
import { readFile } from "node:fs/promises";
|
|
@@ -6,67 +7,66 @@ import { delimiter, dirname, join, normalize, resolve } from "node:path";
|
|
|
6
7
|
import { cwd } from "node:process";
|
|
7
8
|
import { PassThrough } from "node:stream";
|
|
8
9
|
import { spawn } from "node:child_process";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
const
|
|
10
|
+
import { pipeline } from "node:stream/promises";
|
|
11
|
+
import u from "node:readline";
|
|
12
|
+
var d = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
|
|
13
|
+
var f = /* @__PURE__ */ createRequire(import.meta.url);
|
|
14
|
+
const p = /^path$/i;
|
|
15
|
+
const m = {
|
|
14
16
|
key: "PATH",
|
|
15
17
|
value: ""
|
|
16
18
|
};
|
|
17
|
-
function
|
|
19
|
+
function h(e) {
|
|
18
20
|
for (const t in e) {
|
|
19
|
-
if (!Object.prototype.hasOwnProperty.call(e, t) || !
|
|
21
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !p.test(t)) continue;
|
|
20
22
|
const n = e[t];
|
|
21
|
-
if (!n) return
|
|
23
|
+
if (!n) return m;
|
|
22
24
|
return {
|
|
23
25
|
key: t,
|
|
24
26
|
value: n
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
|
-
return
|
|
29
|
+
return m;
|
|
28
30
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
const
|
|
31
|
+
function g(e, t) {
|
|
32
|
+
const n = t.value.split(delimiter);
|
|
33
|
+
const a = [];
|
|
32
34
|
let s = e;
|
|
33
35
|
let c;
|
|
34
36
|
do {
|
|
35
|
-
|
|
37
|
+
a.push(resolve(s, "node_modules", ".bin"));
|
|
36
38
|
c = s;
|
|
37
39
|
s = dirname(s);
|
|
38
40
|
} while (s !== c);
|
|
39
|
-
|
|
41
|
+
a.push(dirname(process.execPath));
|
|
42
|
+
const l = a.concat(n).join(delimiter);
|
|
40
43
|
return {
|
|
41
44
|
key: t.key,
|
|
42
45
|
value: l
|
|
43
46
|
};
|
|
44
47
|
}
|
|
45
|
-
function
|
|
48
|
+
function _(e, t) {
|
|
46
49
|
const n = {
|
|
47
50
|
...process.env,
|
|
48
51
|
...t
|
|
49
52
|
};
|
|
50
|
-
const r =
|
|
53
|
+
const r = g(e, h(n));
|
|
51
54
|
n[r.key] = r.value;
|
|
52
55
|
return n;
|
|
53
56
|
}
|
|
54
|
-
const
|
|
57
|
+
const v = (e) => {
|
|
55
58
|
let t = e.length;
|
|
56
59
|
const n = new PassThrough();
|
|
57
60
|
const r = () => {
|
|
58
|
-
if (--t === 0) n.
|
|
61
|
+
if (--t === 0) n.end();
|
|
59
62
|
};
|
|
60
|
-
for (const t of e) {
|
|
61
|
-
t.pipe(n, { end: false });
|
|
62
|
-
t.on("end", r);
|
|
63
|
-
}
|
|
63
|
+
for (const t of e) pipeline(t, n, { end: false }).then(r).catch(r);
|
|
64
64
|
return n;
|
|
65
65
|
};
|
|
66
|
-
var
|
|
66
|
+
var y = /* @__PURE__ */ d(((e, t) => {
|
|
67
67
|
t.exports = a;
|
|
68
68
|
a.sync = o;
|
|
69
|
-
var n =
|
|
69
|
+
var n = f("fs");
|
|
70
70
|
function r(e, t) {
|
|
71
71
|
var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
|
|
72
72
|
if (!n) return true;
|
|
@@ -91,10 +91,10 @@ var _ = /* @__PURE__ */ l(((e, t) => {
|
|
|
91
91
|
return i(n.statSync(e), e, t);
|
|
92
92
|
}
|
|
93
93
|
}));
|
|
94
|
-
var
|
|
94
|
+
var b = /* @__PURE__ */ d(((e, t) => {
|
|
95
95
|
t.exports = r;
|
|
96
96
|
r.sync = i;
|
|
97
|
-
var n =
|
|
97
|
+
var n = f("fs");
|
|
98
98
|
function r(e, t, r) {
|
|
99
99
|
n.stat(e, function(e, n) {
|
|
100
100
|
r(e, e ? false : a(n, t));
|
|
@@ -119,11 +119,11 @@ var v = /* @__PURE__ */ l(((e, t) => {
|
|
|
119
119
|
return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
|
|
120
120
|
}
|
|
121
121
|
}));
|
|
122
|
-
var
|
|
123
|
-
|
|
122
|
+
var x = /* @__PURE__ */ d(((e, t) => {
|
|
123
|
+
f("fs");
|
|
124
124
|
var n;
|
|
125
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) n =
|
|
126
|
-
else n =
|
|
125
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) n = y();
|
|
126
|
+
else n = b();
|
|
127
127
|
t.exports = r;
|
|
128
128
|
r.sync = i;
|
|
129
129
|
function r(e, t, i) {
|
|
@@ -159,11 +159,11 @@ var y = /* @__PURE__ */ l(((e, t) => {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
}));
|
|
162
|
-
var
|
|
162
|
+
var S = /* @__PURE__ */ d(((e, t) => {
|
|
163
163
|
const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
164
|
-
const r =
|
|
164
|
+
const r = f("path");
|
|
165
165
|
const i = n ? ";" : ":";
|
|
166
|
-
const a =
|
|
166
|
+
const a = x();
|
|
167
167
|
const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
|
|
168
168
|
const s = (e, t) => {
|
|
169
169
|
const r = t.colon || i;
|
|
@@ -229,7 +229,7 @@ var b = /* @__PURE__ */ l(((e, t) => {
|
|
|
229
229
|
t.exports = c;
|
|
230
230
|
c.sync = l;
|
|
231
231
|
}));
|
|
232
|
-
var
|
|
232
|
+
var C = /* @__PURE__ */ d(((e, t) => {
|
|
233
233
|
const n = (e = {}) => {
|
|
234
234
|
const t = e.env || process.env;
|
|
235
235
|
if ((e.platform || process.platform) !== "win32") return "PATH";
|
|
@@ -238,10 +238,10 @@ var x = /* @__PURE__ */ l(((e, t) => {
|
|
|
238
238
|
t.exports = n;
|
|
239
239
|
t.exports.default = n;
|
|
240
240
|
}));
|
|
241
|
-
var
|
|
242
|
-
const n =
|
|
243
|
-
const r =
|
|
244
|
-
const i =
|
|
241
|
+
var w = /* @__PURE__ */ d(((e, t) => {
|
|
242
|
+
const n = f("path");
|
|
243
|
+
const r = S();
|
|
244
|
+
const i = C();
|
|
245
245
|
function a(e, t) {
|
|
246
246
|
const a = e.options.env || process.env;
|
|
247
247
|
const o = process.cwd();
|
|
@@ -267,7 +267,7 @@ var S = /* @__PURE__ */ l(((e, t) => {
|
|
|
267
267
|
}
|
|
268
268
|
t.exports = o;
|
|
269
269
|
}));
|
|
270
|
-
var
|
|
270
|
+
var T = /* @__PURE__ */ d(((e, t) => {
|
|
271
271
|
const n = /([()\][%!^"`<>&|;, *?])/g;
|
|
272
272
|
function r(e) {
|
|
273
273
|
e = e.replace(n, "^$1");
|
|
@@ -285,11 +285,11 @@ var C = /* @__PURE__ */ l(((e, t) => {
|
|
|
285
285
|
t.exports.command = r;
|
|
286
286
|
t.exports.argument = i;
|
|
287
287
|
}));
|
|
288
|
-
var
|
|
288
|
+
var E = /* @__PURE__ */ d(((e, t) => {
|
|
289
289
|
t.exports = /^#!(.*)/;
|
|
290
290
|
}));
|
|
291
|
-
var
|
|
292
|
-
const n =
|
|
291
|
+
var D = /* @__PURE__ */ d(((e, t) => {
|
|
292
|
+
const n = E();
|
|
293
293
|
t.exports = (e = "") => {
|
|
294
294
|
const t = e.match(n);
|
|
295
295
|
if (!t) return null;
|
|
@@ -299,9 +299,9 @@ var T = /* @__PURE__ */ l(((e, t) => {
|
|
|
299
299
|
return i ? `${a} ${i}` : a;
|
|
300
300
|
};
|
|
301
301
|
}));
|
|
302
|
-
var
|
|
303
|
-
const n =
|
|
304
|
-
const r =
|
|
302
|
+
var O = /* @__PURE__ */ d(((e, t) => {
|
|
303
|
+
const n = f("fs");
|
|
304
|
+
const r = D();
|
|
305
305
|
function i(e) {
|
|
306
306
|
const t = 150;
|
|
307
307
|
const i = Buffer.alloc(t);
|
|
@@ -315,11 +315,11 @@ var E = /* @__PURE__ */ l(((e, t) => {
|
|
|
315
315
|
}
|
|
316
316
|
t.exports = i;
|
|
317
317
|
}));
|
|
318
|
-
var
|
|
319
|
-
const n =
|
|
320
|
-
const r =
|
|
321
|
-
const i =
|
|
322
|
-
const a =
|
|
318
|
+
var k = /* @__PURE__ */ d(((e, t) => {
|
|
319
|
+
const n = f("path");
|
|
320
|
+
const r = w();
|
|
321
|
+
const i = T();
|
|
322
|
+
const a = O();
|
|
323
323
|
const o = process.platform === "win32";
|
|
324
324
|
const s = /\.(?:com|exe)$/i;
|
|
325
325
|
const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
@@ -333,7 +333,7 @@ var D = /* @__PURE__ */ l(((e, t) => {
|
|
|
333
333
|
}
|
|
334
334
|
return e.file;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function u(e) {
|
|
337
337
|
if (!o) return e;
|
|
338
338
|
const t = l(e);
|
|
339
339
|
const r = !s.test(t);
|
|
@@ -353,7 +353,7 @@ var D = /* @__PURE__ */ l(((e, t) => {
|
|
|
353
353
|
}
|
|
354
354
|
return e;
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function d(e, t, n) {
|
|
357
357
|
if (t && !Array.isArray(t)) {
|
|
358
358
|
n = t;
|
|
359
359
|
t = null;
|
|
@@ -370,11 +370,11 @@ var D = /* @__PURE__ */ l(((e, t) => {
|
|
|
370
370
|
args: t
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
|
-
return n.shell ? r :
|
|
373
|
+
return n.shell ? r : u(r);
|
|
374
374
|
}
|
|
375
|
-
t.exports =
|
|
375
|
+
t.exports = d;
|
|
376
376
|
}));
|
|
377
|
-
var
|
|
377
|
+
var A = /* @__PURE__ */ d(((e, t) => {
|
|
378
378
|
const n = process.platform === "win32";
|
|
379
379
|
function r(e, t) {
|
|
380
380
|
return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
|
|
@@ -411,10 +411,10 @@ var O = /* @__PURE__ */ l(((e, t) => {
|
|
|
411
411
|
notFoundError: r
|
|
412
412
|
};
|
|
413
413
|
}));
|
|
414
|
-
var
|
|
415
|
-
const n =
|
|
416
|
-
const r =
|
|
417
|
-
const i =
|
|
414
|
+
var M = (/* @__PURE__ */ d(((e, t) => {
|
|
415
|
+
const n = f("child_process");
|
|
416
|
+
const r = k();
|
|
417
|
+
const i = A();
|
|
418
418
|
function a(e, t, a) {
|
|
419
419
|
const o = r(e, t, a);
|
|
420
420
|
const s = n.spawn(o.command, o.args, o.options);
|
|
@@ -433,9 +433,7 @@ var A = (/* @__PURE__ */ l(((e, t) => {
|
|
|
433
433
|
t.exports._parse = r;
|
|
434
434
|
t.exports._enoent = i;
|
|
435
435
|
})))();
|
|
436
|
-
var
|
|
437
|
-
result;
|
|
438
|
-
output;
|
|
436
|
+
var N = class extends Error {
|
|
439
437
|
get exitCode() {
|
|
440
438
|
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
441
439
|
}
|
|
@@ -445,18 +443,18 @@ var j = class extends Error {
|
|
|
445
443
|
this.output = t;
|
|
446
444
|
}
|
|
447
445
|
};
|
|
448
|
-
const
|
|
446
|
+
const F = {
|
|
449
447
|
timeout: void 0,
|
|
450
448
|
persist: false
|
|
451
449
|
};
|
|
452
|
-
const
|
|
453
|
-
function
|
|
450
|
+
const L = { windowsHide: true };
|
|
451
|
+
function R(e, t) {
|
|
454
452
|
return {
|
|
455
453
|
command: normalize(e),
|
|
456
454
|
args: t ?? []
|
|
457
455
|
};
|
|
458
456
|
}
|
|
459
|
-
function
|
|
457
|
+
function z(e) {
|
|
460
458
|
const t = new AbortController();
|
|
461
459
|
for (const n of e) {
|
|
462
460
|
if (n.aborted) {
|
|
@@ -470,12 +468,14 @@ function F(e) {
|
|
|
470
468
|
}
|
|
471
469
|
return t.signal;
|
|
472
470
|
}
|
|
473
|
-
async function
|
|
471
|
+
async function B(e) {
|
|
474
472
|
let t = "";
|
|
475
|
-
|
|
473
|
+
try {
|
|
474
|
+
for await (const n of e) t += n.toString();
|
|
475
|
+
} catch {}
|
|
476
476
|
return t;
|
|
477
477
|
}
|
|
478
|
-
var
|
|
478
|
+
var V = class {
|
|
479
479
|
_process;
|
|
480
480
|
_aborted = false;
|
|
481
481
|
_options;
|
|
@@ -495,7 +495,7 @@ var L = class {
|
|
|
495
495
|
}
|
|
496
496
|
constructor(e, t, n) {
|
|
497
497
|
this._options = {
|
|
498
|
-
...
|
|
498
|
+
...F,
|
|
499
499
|
...n
|
|
500
500
|
};
|
|
501
501
|
this._command = e;
|
|
@@ -514,7 +514,7 @@ var L = class {
|
|
|
514
514
|
return this._process?.killed === true;
|
|
515
515
|
}
|
|
516
516
|
pipe(e, t, n) {
|
|
517
|
-
return
|
|
517
|
+
return W(e, t, {
|
|
518
518
|
...n,
|
|
519
519
|
stdin: this
|
|
520
520
|
});
|
|
@@ -525,29 +525,30 @@ var L = class {
|
|
|
525
525
|
const t = [];
|
|
526
526
|
if (this._streamErr) t.push(this._streamErr);
|
|
527
527
|
if (this._streamOut) t.push(this._streamOut);
|
|
528
|
-
const n =
|
|
529
|
-
const r =
|
|
528
|
+
const n = v(t);
|
|
529
|
+
const r = u.createInterface({ input: n });
|
|
530
530
|
for await (const e of r) yield e.toString();
|
|
531
531
|
await this._processClosed;
|
|
532
532
|
e.removeAllListeners();
|
|
533
533
|
if (this._thrownError) throw this._thrownError;
|
|
534
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
534
|
+
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new N(this);
|
|
535
535
|
}
|
|
536
536
|
async _waitForOutput() {
|
|
537
537
|
const e = this._process;
|
|
538
538
|
if (!e) throw new Error("No process was started");
|
|
539
|
-
const [t, n] = await Promise.all([this._streamOut ?
|
|
539
|
+
const [t, n] = await Promise.all([this._streamOut ? B(this._streamOut) : "", this._streamErr ? B(this._streamErr) : ""]);
|
|
540
540
|
await this._processClosed;
|
|
541
|
-
|
|
541
|
+
const { stdin: r } = this._options;
|
|
542
|
+
if (r && typeof r !== "string") await r;
|
|
542
543
|
e.removeAllListeners();
|
|
543
544
|
if (this._thrownError) throw this._thrownError;
|
|
544
|
-
const
|
|
545
|
+
const i = {
|
|
545
546
|
stderr: n,
|
|
546
547
|
stdout: t,
|
|
547
548
|
exitCode: this.exitCode
|
|
548
549
|
};
|
|
549
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
550
|
-
return
|
|
550
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new N(this, i);
|
|
551
|
+
return i;
|
|
551
552
|
}
|
|
552
553
|
then(e, t) {
|
|
553
554
|
return this._waitForOutput().then(e, t);
|
|
@@ -558,7 +559,7 @@ var L = class {
|
|
|
558
559
|
const e = cwd();
|
|
559
560
|
const n = this._options;
|
|
560
561
|
const r = {
|
|
561
|
-
...
|
|
562
|
+
...L,
|
|
562
563
|
...n.nodeOptions
|
|
563
564
|
};
|
|
564
565
|
const i = [];
|
|
@@ -566,19 +567,20 @@ var L = class {
|
|
|
566
567
|
if (n.timeout !== void 0) i.push(AbortSignal.timeout(n.timeout));
|
|
567
568
|
if (n.signal !== void 0) i.push(n.signal);
|
|
568
569
|
if (n.persist === true) r.detached = true;
|
|
569
|
-
if (i.length > 0) r.signal =
|
|
570
|
-
r.env =
|
|
571
|
-
const { command: a, args:
|
|
572
|
-
const c = (0,
|
|
570
|
+
if (i.length > 0) r.signal = z(i);
|
|
571
|
+
r.env = _(e, r.env);
|
|
572
|
+
const { command: a, args: o } = R(this._command, this._args);
|
|
573
|
+
const c = (0, M._parse)(a, o, r);
|
|
573
574
|
const l = spawn(c.command, c.args, c.options);
|
|
574
575
|
if (l.stderr) this._streamErr = l.stderr;
|
|
575
576
|
if (l.stdout) this._streamOut = l.stdout;
|
|
576
577
|
this._process = l;
|
|
577
578
|
l.once("error", this._onError);
|
|
578
579
|
l.once("close", this._onClose);
|
|
579
|
-
if (
|
|
580
|
-
const {
|
|
581
|
-
if (e)
|
|
580
|
+
if (l.stdin) {
|
|
581
|
+
const { stdin: e } = n;
|
|
582
|
+
if (typeof e === "string") l.stdin.end(e);
|
|
583
|
+
else e?.process?.stdout?.pipe(l.stdin);
|
|
582
584
|
}
|
|
583
585
|
}
|
|
584
586
|
_resetState() {
|
|
@@ -599,12 +601,18 @@ var L = class {
|
|
|
599
601
|
if (this._resolveClose) this._resolveClose();
|
|
600
602
|
};
|
|
601
603
|
};
|
|
602
|
-
const
|
|
603
|
-
const r = new
|
|
604
|
+
const U = (e, t, n) => {
|
|
605
|
+
const r = new V(e, t, n);
|
|
604
606
|
r.spawn();
|
|
605
607
|
return r;
|
|
606
608
|
};
|
|
607
|
-
const
|
|
609
|
+
const W = U;
|
|
610
|
+
var dist_exports = /* @__PURE__ */ __exportAll({
|
|
611
|
+
addDependency: () => addDependency,
|
|
612
|
+
addDevDependency: () => addDevDependency,
|
|
613
|
+
detectPackageManager: () => detectPackageManager,
|
|
614
|
+
packageManagers: () => packageManagers
|
|
615
|
+
});
|
|
608
616
|
async function findup(cwd, match, options = {}) {
|
|
609
617
|
const segments = normalize$1(cwd).split("/");
|
|
610
618
|
while (segments.length > 0) {
|
|
@@ -613,11 +621,32 @@ async function findup(cwd, match, options = {}) {
|
|
|
613
621
|
segments.pop();
|
|
614
622
|
}
|
|
615
623
|
}
|
|
616
|
-
async function readPackageJSON(cwd) {
|
|
624
|
+
async function readPackageJSON(cwd, options = {}) {
|
|
617
625
|
return findup(cwd, (p) => {
|
|
618
626
|
const pkgPath = join(p, "package.json");
|
|
619
627
|
if (existsSync(pkgPath)) return readFile(pkgPath, "utf8").then((data) => JSON.parse(data));
|
|
620
|
-
});
|
|
628
|
+
}, options);
|
|
629
|
+
}
|
|
630
|
+
async function readInstalledPackageJSON(pkgName, cwd) {
|
|
631
|
+
const pkgJSONPath = await findup(cwd, (p) => {
|
|
632
|
+
const candidate = join(p, "node_modules", pkgName, "package.json");
|
|
633
|
+
if (existsSync(candidate)) return candidate;
|
|
634
|
+
}, { includeParentDirs: true });
|
|
635
|
+
if (!pkgJSONPath) return null;
|
|
636
|
+
try {
|
|
637
|
+
return JSON.parse(await readFile(pkgJSONPath, "utf8"));
|
|
638
|
+
} catch {
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
async function readPackageJSONFromResolver(requireFn, pkgName) {
|
|
643
|
+
let resolved;
|
|
644
|
+
try {
|
|
645
|
+
resolved = requireFn.resolve(pkgName);
|
|
646
|
+
} catch {
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
return readPackageJSON(resolved, { includeParentDirs: true });
|
|
621
650
|
}
|
|
622
651
|
function cached(fn) {
|
|
623
652
|
let v;
|
|
@@ -632,7 +661,7 @@ function cached(fn) {
|
|
|
632
661
|
const hasCorepack = cached(async () => {
|
|
633
662
|
if (globalThis.process?.versions?.webcontainer) return false;
|
|
634
663
|
try {
|
|
635
|
-
const { exitCode } = await
|
|
664
|
+
const { exitCode } = await U("corepack", ["--version"]);
|
|
636
665
|
return exitCode === 0;
|
|
637
666
|
} catch {
|
|
638
667
|
return false;
|
|
@@ -640,7 +669,7 @@ const hasCorepack = cached(async () => {
|
|
|
640
669
|
});
|
|
641
670
|
async function executeCommand(command, args, options = {}) {
|
|
642
671
|
const xArgs = command !== "npm" && command !== "bun" && command !== "deno" && options.corepack !== false && await hasCorepack() ? ["corepack", [command, ...args]] : [command, args];
|
|
643
|
-
const { exitCode, stdout, stderr } = await
|
|
672
|
+
const { exitCode, stdout, stderr } = await U(xArgs[0], xArgs[1], { nodeOptions: {
|
|
644
673
|
cwd: resolve$1(options.cwd || process.cwd()),
|
|
645
674
|
env: options.env,
|
|
646
675
|
stdio: options.silent ? "pipe" : "inherit"
|
|
@@ -797,8 +826,10 @@ async function addDependency(name, options = {}) {
|
|
|
797
826
|
const _require = createRequire(join(resolvedOptions.cwd, "/_.js"));
|
|
798
827
|
for (const _name of names) {
|
|
799
828
|
const pkgName = _name.match(/^(.[^@]+)/)?.[0];
|
|
800
|
-
|
|
801
|
-
|
|
829
|
+
if (!pkgName) continue;
|
|
830
|
+
let pkg = await readPackageJSONFromResolver(_require, pkgName);
|
|
831
|
+
if (pkg?.name !== pkgName) pkg = await readInstalledPackageJSON(pkgName, resolvedOptions.cwd);
|
|
832
|
+
if (!pkg?.peerDependencies) continue;
|
|
802
833
|
for (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {
|
|
803
834
|
if (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;
|
|
804
835
|
if (existingPkg?.dependencies?.[peerDependency] || existingPkg?.devDependencies?.[peerDependency]) continue;
|
|
@@ -819,4 +850,4 @@ async function addDevDependency(name, options = {}) {
|
|
|
819
850
|
dev: true
|
|
820
851
|
});
|
|
821
852
|
}
|
|
822
|
-
export {
|
|
853
|
+
export { dist_exports as t };
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/tsconfig/types.d.ts
|
|
2
4
|
type StripEnums<T extends Record<string, any>> = { [K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any };
|
|
3
5
|
interface TSConfig {
|
|
4
|
-
compilerOptions?: StripEnums<CompilerOptions>;
|
|
6
|
+
compilerOptions?: StripEnums<ts.CompilerOptions>;
|
|
5
7
|
exclude?: string[];
|
|
6
8
|
compileOnSave?: boolean;
|
|
7
9
|
extends?: string | string[];
|
|
8
10
|
files?: string[];
|
|
9
11
|
include?: string[];
|
|
10
|
-
typeAcquisition?: TypeAcquisition;
|
|
12
|
+
typeAcquisition?: ts.TypeAcquisition;
|
|
11
13
|
references?: {
|
|
12
14
|
path: string;
|
|
13
15
|
}[];
|
|
14
|
-
}
|
|
16
|
+
} //#endregion
|
|
17
|
+
//#region src/tsconfig/utils.d.ts
|
|
15
18
|
/**
|
|
16
19
|
* Defines a TSConfig structure.
|
|
17
20
|
* @param tsconfig - The contents of `tsconfig.json` as an object. See {@link TSConfig}.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { n as __exportAll } from "../_common.mjs";
|
|
1
2
|
import { S as MagicString, c as walk, i as createFilter, r as attachScopes, s as makeLegalIdentifier } from "../_build/common.mjs";
|
|
2
3
|
import { sep } from "path";
|
|
4
|
+
var es_exports = /* @__PURE__ */ __exportAll({ default: () => inject });
|
|
3
5
|
var escape = function(str) {
|
|
4
6
|
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
|
|
5
7
|
};
|
|
@@ -126,4 +128,4 @@ function inject(options) {
|
|
|
126
128
|
}
|
|
127
129
|
};
|
|
128
130
|
}
|
|
129
|
-
export { inject as t };
|
|
131
|
+
export { inject as n, es_exports as t };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as __exportAll } from "../_common.mjs";
|
|
1
2
|
import { S as MagicString, x as stripLiteral } from "../_build/common.mjs";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -272,7 +273,7 @@ function assetsPlugin(pluginOpts) {
|
|
|
272
273
|
load: {
|
|
273
274
|
filter: { id: /^\0virtual:fullstack\// },
|
|
274
275
|
async handler(id) {
|
|
275
|
-
if (id === "\0virtual:fullstack/runtime") return `export const mergeAssets = ${(await
|
|
276
|
+
if (id === "\0virtual:fullstack/runtime") return `export const mergeAssets = ${(await Promise.resolve().then(() => runtime_exports)).mergeAssets.toString()};`;
|
|
276
277
|
const parsed = parseAssetsVirtual(id);
|
|
277
278
|
if (!parsed) return;
|
|
278
279
|
assert$1.notEqual(this.environment.name, "client");
|
|
@@ -595,6 +596,7 @@ function assetsURL(url, config) {
|
|
|
595
596
|
function assetsURLDev(url, config) {
|
|
596
597
|
return config.base + url;
|
|
597
598
|
}
|
|
599
|
+
var runtime_exports = /* @__PURE__ */ __exportAll({ mergeAssets: () => mergeAssets });
|
|
598
600
|
function mergeAssets(...args) {
|
|
599
601
|
const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
|
|
600
602
|
const css = uniqBy(args.flatMap((h) => h.css), (a) => a.href);
|
|
@@ -617,4 +619,4 @@ function mergeAssets(...args) {
|
|
|
617
619
|
});
|
|
618
620
|
}
|
|
619
621
|
}
|
|
620
|
-
export { assetsPlugin as n,
|
|
622
|
+
export { assetsPlugin as n, runtime_exports as t };
|
|
@@ -1338,7 +1338,8 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1338
1338
|
if (!this._userIgnored) {
|
|
1339
1339
|
const { cwd } = this.options;
|
|
1340
1340
|
const ignored = (this.options.ignored || []).map(normalizeIgnored(cwd));
|
|
1341
|
-
|
|
1341
|
+
const list = [...[...this._ignoredPaths].map(normalizeIgnored(cwd)), ...ignored];
|
|
1342
|
+
this._userIgnored = anymatch(list, void 0);
|
|
1342
1343
|
}
|
|
1343
1344
|
return this._userIgnored(path, stats);
|
|
1344
1345
|
}
|