nitro-nightly 3.0.1-20260106-202835-5325b208 → 3.0.1-20260106-205209-b085a480
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/_build/common.mjs +24899 -0
- package/dist/_build/rolldown.mjs +6 -9
- package/dist/_build/rollup.mjs +6 -8
- package/dist/_build/vite.build.mjs +1 -1
- package/dist/{_dev.mjs → _chunks/dev.mjs} +4 -7
- package/dist/{_nitro.mjs → _chunks/nitro.mjs} +16 -195
- package/dist/_chunks/nitro2.mjs +101 -0
- package/dist/_chunks/utils.mjs +278 -0
- package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +32 -4
- package/dist/_libs/@jridgewell/gen-mapping.mjs +304 -2
- package/dist/_libs/@jridgewell/remapping.mjs +1 -2
- package/dist/_libs/@rollup/plugin-commonjs.mjs +75 -31
- package/dist/_libs/@rollup/plugin-inject.mjs +1 -3
- package/dist/_libs/@rollup/plugin-json.mjs +1 -1
- package/dist/_libs/@rollup/plugin-node-resolve.mjs +1111 -7
- package/dist/_libs/c12.mjs +597 -41
- package/dist/_libs/chokidar.mjs +235 -2
- package/dist/_libs/confbox.mjs +454 -1476
- package/dist/_libs/estree-walker.mjs +1 -144
- package/dist/_libs/giget.mjs +2235 -1377
- package/dist/_libs/httpxy.mjs +1 -1
- package/dist/_libs/unimport.mjs +1547 -1772
- package/dist/_presets.mjs +3 -9
- package/dist/builder.mjs +7 -12
- package/dist/cli/_chunks/{build2.mjs → build.mjs} +1 -1
- package/dist/cli/_chunks/dev.mjs +3 -5
- package/dist/cli/_chunks/list.mjs +1 -1
- package/dist/cli/_chunks/prepare.mjs +1 -1
- package/dist/cli/_chunks/run.mjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/vite.mjs +14 -1128
- package/package.json +1 -1
- package/dist/_build/rollup2.mjs +0 -56
- package/dist/_build/shared.mjs +0 -60
- package/dist/_build/shared2.mjs +0 -40
- package/dist/_build/shared3.mjs +0 -68
- package/dist/_libs/@jridgewell/resolve-uri.mjs +0 -166
- package/dist/_libs/@jridgewell/sourcemap-codec.mjs +0 -167
- package/dist/_libs/@jridgewell/trace-mapping.mjs +0 -141
- package/dist/_libs/@rolldown/pluginutils.mjs +0 -31
- package/dist/_libs/@rollup/plugin-replace.mjs +0 -104
- package/dist/_libs/@rollup/pluginutils.mjs +0 -241
- package/dist/_libs/acorn.mjs +0 -5034
- package/dist/_libs/commondir.mjs +0 -22
- package/dist/_libs/deepmerge.mjs +0 -86
- package/dist/_libs/dot-prop.mjs +0 -138
- package/dist/_libs/dotenv.mjs +0 -345
- package/dist/_libs/duplexer.mjs +0 -71
- package/dist/_libs/etag.mjs +0 -80
- package/dist/_libs/exsolve.mjs +0 -1007
- package/dist/_libs/fdir.mjs +0 -514
- package/dist/_libs/function-bind.mjs +0 -63
- package/dist/_libs/gzip-size.mjs +0 -21
- package/dist/_libs/hasown.mjs +0 -14
- package/dist/_libs/is-core-module.mjs +0 -220
- package/dist/_libs/is-module.mjs +0 -13
- package/dist/_libs/is-reference.mjs +0 -33
- package/dist/_libs/js-tokens.mjs +0 -382
- package/dist/_libs/knitwork.mjs +0 -124
- package/dist/_libs/local-pkg.mjs +0 -125
- package/dist/_libs/magic-string.mjs +0 -939
- package/dist/_libs/mime.mjs +0 -1391
- package/dist/_libs/mlly.mjs +0 -1415
- package/dist/_libs/node-fetch-native.mjs +0 -7
- package/dist/_libs/nypm.mjs +0 -239
- package/dist/_libs/path-parse.mjs +0 -47
- package/dist/_libs/pathe.mjs +0 -202
- package/dist/_libs/perfect-debounce.mjs +0 -89
- package/dist/_libs/picomatch.mjs +0 -1673
- package/dist/_libs/pkg-types.mjs +0 -197
- package/dist/_libs/pretty-bytes.mjs +0 -116
- package/dist/_libs/quansync.mjs +0 -90
- package/dist/_libs/rc9.mjs +0 -136
- package/dist/_libs/readdirp.mjs +0 -237
- package/dist/_libs/resolve.mjs +0 -689
- package/dist/_libs/std-env.mjs +0 -158
- package/dist/_libs/strip-literal.mjs +0 -51
- package/dist/_libs/tinyexec.mjs +0 -627
- package/dist/_libs/tinyglobby.mjs +0 -292
- package/dist/_libs/unplugin-utils.mjs +0 -61
- package/dist/_libs/unplugin.mjs +0 -1225
- package/dist/_libs/untyped.mjs +0 -271
- package/dist/_libs/unwasm.mjs +0 -5895
- package/dist/_libs/webpack-virtual-modules.mjs +0 -272
- package/dist/_nitro2.mjs +0 -303
- /package/dist/{_rolldown.mjs → _common.mjs} +0 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { i as __toESM, r as __require, t as __commonJSMin } from "../_common.mjs";
|
|
2
|
+
import { Ft as resolve, Pt as relative, dt as a, kt as dirname, rt as glob } from "../_build/common.mjs";
|
|
3
|
+
import fs, { promises } from "node:fs";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
import { colors } from "consola/utils";
|
|
6
|
+
import zlib from "node:zlib";
|
|
7
|
+
import "node:stream";
|
|
8
|
+
|
|
9
|
+
//#region src/utils/parallel.ts
|
|
10
|
+
async function runParallel(inputs, cb, opts) {
|
|
11
|
+
const tasks = /* @__PURE__ */ new Set();
|
|
12
|
+
function queueNext() {
|
|
13
|
+
const route = inputs.values().next().value;
|
|
14
|
+
if (!route) return;
|
|
15
|
+
inputs.delete(route);
|
|
16
|
+
const task = (opts.interval ? new Promise((resolve$1) => setTimeout(resolve$1, opts.interval)) : Promise.resolve()).then(() => cb(route)).catch((error) => {
|
|
17
|
+
console.error(error);
|
|
18
|
+
});
|
|
19
|
+
tasks.add(task);
|
|
20
|
+
return task.then(() => {
|
|
21
|
+
tasks.delete(task);
|
|
22
|
+
if (inputs.size > 0) return refillQueue();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function refillQueue() {
|
|
26
|
+
const workers = Math.min(opts.concurrency - tasks.size, inputs.size);
|
|
27
|
+
return Promise.all(Array.from({ length: workers }, () => queueNext()));
|
|
28
|
+
}
|
|
29
|
+
await refillQueue();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js
|
|
34
|
+
var require_duplexer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
35
|
+
var Stream = __require("stream");
|
|
36
|
+
var writeMethods = [
|
|
37
|
+
"write",
|
|
38
|
+
"end",
|
|
39
|
+
"destroy"
|
|
40
|
+
];
|
|
41
|
+
var readMethods = ["resume", "pause"];
|
|
42
|
+
var readEvents = ["data", "close"];
|
|
43
|
+
var slice = Array.prototype.slice;
|
|
44
|
+
module.exports = duplex;
|
|
45
|
+
function forEach(arr, fn) {
|
|
46
|
+
if (arr.forEach) return arr.forEach(fn);
|
|
47
|
+
for (var i = 0; i < arr.length; i++) fn(arr[i], i);
|
|
48
|
+
}
|
|
49
|
+
function duplex(writer, reader) {
|
|
50
|
+
var stream = new Stream();
|
|
51
|
+
var ended = false;
|
|
52
|
+
forEach(writeMethods, proxyWriter);
|
|
53
|
+
forEach(readMethods, proxyReader);
|
|
54
|
+
forEach(readEvents, proxyStream);
|
|
55
|
+
reader.on("end", handleEnd);
|
|
56
|
+
writer.on("drain", function() {
|
|
57
|
+
stream.emit("drain");
|
|
58
|
+
});
|
|
59
|
+
writer.on("error", reemit);
|
|
60
|
+
reader.on("error", reemit);
|
|
61
|
+
stream.writable = writer.writable;
|
|
62
|
+
stream.readable = reader.readable;
|
|
63
|
+
return stream;
|
|
64
|
+
function proxyWriter(methodName) {
|
|
65
|
+
stream[methodName] = method;
|
|
66
|
+
function method() {
|
|
67
|
+
return writer[methodName].apply(writer, arguments);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function proxyReader(methodName) {
|
|
71
|
+
stream[methodName] = method;
|
|
72
|
+
function method() {
|
|
73
|
+
stream.emit(methodName);
|
|
74
|
+
var func = reader[methodName];
|
|
75
|
+
if (func) return func.apply(reader, arguments);
|
|
76
|
+
reader.emit(methodName);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function proxyStream(methodName) {
|
|
80
|
+
reader.on(methodName, reemit$1);
|
|
81
|
+
function reemit$1() {
|
|
82
|
+
var args = slice.call(arguments);
|
|
83
|
+
args.unshift(methodName);
|
|
84
|
+
stream.emit.apply(stream, args);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function handleEnd() {
|
|
88
|
+
if (ended) return;
|
|
89
|
+
ended = true;
|
|
90
|
+
var args = slice.call(arguments);
|
|
91
|
+
args.unshift("end");
|
|
92
|
+
stream.emit.apply(stream, args);
|
|
93
|
+
}
|
|
94
|
+
function reemit(err) {
|
|
95
|
+
stream.emit("error", err);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js
|
|
102
|
+
var import_duplexer = /* @__PURE__ */ __toESM(require_duplexer(), 1);
|
|
103
|
+
const getOptions = (options) => ({
|
|
104
|
+
level: 9,
|
|
105
|
+
...options
|
|
106
|
+
});
|
|
107
|
+
const gzip = promisify(zlib.gzip);
|
|
108
|
+
async function gzipSize(input, options) {
|
|
109
|
+
if (!input) return 0;
|
|
110
|
+
return (await gzip(input, getOptions(options))).length;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region node_modules/.pnpm/pretty-bytes@7.1.0/node_modules/pretty-bytes/index.js
|
|
115
|
+
const BYTE_UNITS = [
|
|
116
|
+
"B",
|
|
117
|
+
"kB",
|
|
118
|
+
"MB",
|
|
119
|
+
"GB",
|
|
120
|
+
"TB",
|
|
121
|
+
"PB",
|
|
122
|
+
"EB",
|
|
123
|
+
"ZB",
|
|
124
|
+
"YB"
|
|
125
|
+
];
|
|
126
|
+
const BIBYTE_UNITS = [
|
|
127
|
+
"B",
|
|
128
|
+
"KiB",
|
|
129
|
+
"MiB",
|
|
130
|
+
"GiB",
|
|
131
|
+
"TiB",
|
|
132
|
+
"PiB",
|
|
133
|
+
"EiB",
|
|
134
|
+
"ZiB",
|
|
135
|
+
"YiB"
|
|
136
|
+
];
|
|
137
|
+
const BIT_UNITS = [
|
|
138
|
+
"b",
|
|
139
|
+
"kbit",
|
|
140
|
+
"Mbit",
|
|
141
|
+
"Gbit",
|
|
142
|
+
"Tbit",
|
|
143
|
+
"Pbit",
|
|
144
|
+
"Ebit",
|
|
145
|
+
"Zbit",
|
|
146
|
+
"Ybit"
|
|
147
|
+
];
|
|
148
|
+
const BIBIT_UNITS = [
|
|
149
|
+
"b",
|
|
150
|
+
"kibit",
|
|
151
|
+
"Mibit",
|
|
152
|
+
"Gibit",
|
|
153
|
+
"Tibit",
|
|
154
|
+
"Pibit",
|
|
155
|
+
"Eibit",
|
|
156
|
+
"Zibit",
|
|
157
|
+
"Yibit"
|
|
158
|
+
];
|
|
159
|
+
const toLocaleString = (number, locale, options) => {
|
|
160
|
+
let result = number;
|
|
161
|
+
if (typeof locale === "string" || Array.isArray(locale)) result = number.toLocaleString(locale, options);
|
|
162
|
+
else if (locale === true || options !== void 0) result = number.toLocaleString(void 0, options);
|
|
163
|
+
return result;
|
|
164
|
+
};
|
|
165
|
+
const log10 = (numberOrBigInt) => {
|
|
166
|
+
if (typeof numberOrBigInt === "number") return Math.log10(numberOrBigInt);
|
|
167
|
+
const string = numberOrBigInt.toString(10);
|
|
168
|
+
return string.length + Math.log10(`0.${string.slice(0, 15)}`);
|
|
169
|
+
};
|
|
170
|
+
const log = (numberOrBigInt) => {
|
|
171
|
+
if (typeof numberOrBigInt === "number") return Math.log(numberOrBigInt);
|
|
172
|
+
return log10(numberOrBigInt) * Math.log(10);
|
|
173
|
+
};
|
|
174
|
+
const divide = (numberOrBigInt, divisor) => {
|
|
175
|
+
if (typeof numberOrBigInt === "number") return numberOrBigInt / divisor;
|
|
176
|
+
const integerPart = numberOrBigInt / BigInt(divisor);
|
|
177
|
+
const remainder = numberOrBigInt % BigInt(divisor);
|
|
178
|
+
return Number(integerPart) + Number(remainder) / divisor;
|
|
179
|
+
};
|
|
180
|
+
const applyFixedWidth = (result, fixedWidth) => {
|
|
181
|
+
if (fixedWidth === void 0) return result;
|
|
182
|
+
if (typeof fixedWidth !== "number" || !Number.isSafeInteger(fixedWidth) || fixedWidth < 0) throw new TypeError(`Expected fixedWidth to be a non-negative integer, got ${typeof fixedWidth}: ${fixedWidth}`);
|
|
183
|
+
if (fixedWidth === 0) return result;
|
|
184
|
+
return result.length < fixedWidth ? result.padStart(fixedWidth, " ") : result;
|
|
185
|
+
};
|
|
186
|
+
const buildLocaleOptions = (options) => {
|
|
187
|
+
const { minimumFractionDigits, maximumFractionDigits } = options;
|
|
188
|
+
if (minimumFractionDigits === void 0 && maximumFractionDigits === void 0) return;
|
|
189
|
+
return {
|
|
190
|
+
...minimumFractionDigits !== void 0 && { minimumFractionDigits },
|
|
191
|
+
...maximumFractionDigits !== void 0 && { maximumFractionDigits },
|
|
192
|
+
roundingMode: "trunc"
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
function prettyBytes(number, options) {
|
|
196
|
+
if (typeof number !== "bigint" && !Number.isFinite(number)) throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
|
|
197
|
+
options = {
|
|
198
|
+
bits: false,
|
|
199
|
+
binary: false,
|
|
200
|
+
space: true,
|
|
201
|
+
nonBreakingSpace: false,
|
|
202
|
+
...options
|
|
203
|
+
};
|
|
204
|
+
const UNITS = options.bits ? options.binary ? BIBIT_UNITS : BIT_UNITS : options.binary ? BIBYTE_UNITS : BYTE_UNITS;
|
|
205
|
+
const separator = options.space ? options.nonBreakingSpace ? "\xA0" : " " : "";
|
|
206
|
+
const isZero = typeof number === "number" ? number === 0 : number === 0n;
|
|
207
|
+
if (options.signed && isZero) return applyFixedWidth(` 0${separator}${UNITS[0]}`, options.fixedWidth);
|
|
208
|
+
const isNegative = number < 0;
|
|
209
|
+
const prefix = isNegative ? "-" : options.signed ? "+" : "";
|
|
210
|
+
if (isNegative) number = -number;
|
|
211
|
+
const localeOptions = buildLocaleOptions(options);
|
|
212
|
+
let result;
|
|
213
|
+
if (number < 1) result = prefix + toLocaleString(number, options.locale, localeOptions) + separator + UNITS[0];
|
|
214
|
+
else {
|
|
215
|
+
const exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(1024) : log10(number) / 3), UNITS.length - 1);
|
|
216
|
+
number = divide(number, (options.binary ? 1024 : 1e3) ** exponent);
|
|
217
|
+
if (!localeOptions) {
|
|
218
|
+
const minPrecision = Math.max(3, Math.floor(number).toString().length);
|
|
219
|
+
number = number.toPrecision(minPrecision);
|
|
220
|
+
}
|
|
221
|
+
const numberString = toLocaleString(Number(number), options.locale, localeOptions);
|
|
222
|
+
const unit = UNITS[exponent];
|
|
223
|
+
result = prefix + numberString + separator + unit;
|
|
224
|
+
}
|
|
225
|
+
return applyFixedWidth(result, options.fixedWidth);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/utils/fs-tree.ts
|
|
230
|
+
async function generateFSTree(dir, options = {}) {
|
|
231
|
+
if (a) return;
|
|
232
|
+
const files = await glob("**/*.*", {
|
|
233
|
+
cwd: dir,
|
|
234
|
+
ignore: ["*.map"]
|
|
235
|
+
});
|
|
236
|
+
const items = [];
|
|
237
|
+
await runParallel(new Set(files), async (file) => {
|
|
238
|
+
const path = resolve(dir, file);
|
|
239
|
+
const src = await promises.readFile(path);
|
|
240
|
+
const size = src.byteLength;
|
|
241
|
+
const gzip$1 = options.compressedSizes ? await gzipSize(src) : 0;
|
|
242
|
+
items.push({
|
|
243
|
+
file,
|
|
244
|
+
path,
|
|
245
|
+
size,
|
|
246
|
+
gzip: gzip$1
|
|
247
|
+
});
|
|
248
|
+
}, { concurrency: 10 });
|
|
249
|
+
items.sort((a$1, b) => a$1.path.localeCompare(b.path));
|
|
250
|
+
let totalSize = 0;
|
|
251
|
+
let totalGzip = 0;
|
|
252
|
+
let totalNodeModulesSize = 0;
|
|
253
|
+
let totalNodeModulesGzip = 0;
|
|
254
|
+
let treeText = "";
|
|
255
|
+
for (const [index, item] of items.entries()) {
|
|
256
|
+
let dir$1 = dirname(item.file);
|
|
257
|
+
if (dir$1 === ".") dir$1 = "";
|
|
258
|
+
const rpath = relative(process.cwd(), item.path);
|
|
259
|
+
const treeChar = index === items.length - 1 ? "└─" : "├─";
|
|
260
|
+
if (item.file.includes("node_modules")) {
|
|
261
|
+
totalNodeModulesSize += item.size;
|
|
262
|
+
totalNodeModulesGzip += item.gzip;
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
treeText += colors.gray(` ${treeChar} ${rpath} (${prettyBytes(item.size)})`);
|
|
266
|
+
if (options.compressedSizes) treeText += colors.gray(` (${prettyBytes(item.gzip)} gzip)`);
|
|
267
|
+
treeText += "\n";
|
|
268
|
+
totalSize += item.size;
|
|
269
|
+
totalGzip += item.gzip;
|
|
270
|
+
}
|
|
271
|
+
treeText += `${colors.cyan("Σ Total size:")} ${prettyBytes(totalSize + totalNodeModulesSize)}`;
|
|
272
|
+
if (options.compressedSizes) treeText += ` (${prettyBytes(totalGzip + totalNodeModulesGzip)} gzip)`;
|
|
273
|
+
treeText += "\n";
|
|
274
|
+
return treeText;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
//#endregion
|
|
278
|
+
export { runParallel as n, generateFSTree as t };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { n as __exportAll } from "../../
|
|
2
|
-
import {
|
|
3
|
-
import { t as stripLiteral } from "../strip-literal.mjs";
|
|
4
|
-
import { t as exactRegex } from "../@rolldown/pluginutils.mjs";
|
|
1
|
+
import { n as __exportAll } from "../../_common.mjs";
|
|
2
|
+
import { G as stripLiteral, K as MagicString } from "../../_build/common.mjs";
|
|
5
3
|
import fs from "node:fs";
|
|
6
4
|
import { fileURLToPath } from "node:url";
|
|
7
5
|
import path from "node:path";
|
|
@@ -10,6 +8,36 @@ import { createHash } from "node:crypto";
|
|
|
10
8
|
import { isCSSRequest, normalizePath } from "vite";
|
|
11
9
|
import assert$1 from "node:assert/strict";
|
|
12
10
|
|
|
11
|
+
//#region node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.55/node_modules/@rolldown/pluginutils/dist/simple-filters.js
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a RegExp that matches the exact string specified.
|
|
14
|
+
*
|
|
15
|
+
* This is useful for plugin hook filters.
|
|
16
|
+
*
|
|
17
|
+
* @param str the string to match.
|
|
18
|
+
* @param flags flags for the RegExp.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { exactRegex } from '@rolldown/pluginutils';
|
|
23
|
+
* const plugin = {
|
|
24
|
+
* name: 'plugin',
|
|
25
|
+
* resolveId: {
|
|
26
|
+
* filter: { id: exactRegex('foo') },
|
|
27
|
+
* handler(id) {} // will only be called for `foo`
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function exactRegex(str, flags) {
|
|
33
|
+
return new RegExp(`^${escapeRegex(str)}$`, flags);
|
|
34
|
+
}
|
|
35
|
+
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
|
|
36
|
+
function escapeRegex(str) {
|
|
37
|
+
return str.replace(escapeRegexRE, "\\$&");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
13
41
|
//#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.5_@types+node@25.0.3_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@hiogawa/vite-plugin-fullstack/dist/plugin-B4MlD0Bd.js
|
|
14
42
|
function parseIdQuery(id) {
|
|
15
43
|
if (!id.includes("?")) return {
|
|
@@ -1,5 +1,307 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as encode, q as decode } from "../../_build/common.mjs";
|
|
2
2
|
|
|
3
|
+
//#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
4
|
+
const schemeRegex = /^[\w+.-]+:\/\//;
|
|
5
|
+
/**
|
|
6
|
+
* Matches the parts of a URL:
|
|
7
|
+
* 1. Scheme, including ":", guaranteed.
|
|
8
|
+
* 2. User/password, including "@", optional.
|
|
9
|
+
* 3. Host, guaranteed.
|
|
10
|
+
* 4. Port, including ":", optional.
|
|
11
|
+
* 5. Path, including "/", optional.
|
|
12
|
+
* 6. Query, including "?", optional.
|
|
13
|
+
* 7. Hash, including "#", optional.
|
|
14
|
+
*/
|
|
15
|
+
const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
16
|
+
/**
|
|
17
|
+
* File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
|
|
18
|
+
* with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
|
|
19
|
+
*
|
|
20
|
+
* 1. Host, optional.
|
|
21
|
+
* 2. Path, which may include "/", guaranteed.
|
|
22
|
+
* 3. Query, including "?", optional.
|
|
23
|
+
* 4. Hash, including "#", optional.
|
|
24
|
+
*/
|
|
25
|
+
const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
26
|
+
function isAbsoluteUrl(input) {
|
|
27
|
+
return schemeRegex.test(input);
|
|
28
|
+
}
|
|
29
|
+
function isSchemeRelativeUrl(input) {
|
|
30
|
+
return input.startsWith("//");
|
|
31
|
+
}
|
|
32
|
+
function isAbsolutePath(input) {
|
|
33
|
+
return input.startsWith("/");
|
|
34
|
+
}
|
|
35
|
+
function isFileUrl(input) {
|
|
36
|
+
return input.startsWith("file:");
|
|
37
|
+
}
|
|
38
|
+
function isRelative(input) {
|
|
39
|
+
return /^[.?#]/.test(input);
|
|
40
|
+
}
|
|
41
|
+
function parseAbsoluteUrl(input) {
|
|
42
|
+
const match = urlRegex.exec(input);
|
|
43
|
+
return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
|
|
44
|
+
}
|
|
45
|
+
function parseFileUrl(input) {
|
|
46
|
+
const match = fileRegex.exec(input);
|
|
47
|
+
const path = match[2];
|
|
48
|
+
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
|
|
49
|
+
}
|
|
50
|
+
function makeUrl(scheme, user, host, port, path, query, hash) {
|
|
51
|
+
return {
|
|
52
|
+
scheme,
|
|
53
|
+
user,
|
|
54
|
+
host,
|
|
55
|
+
port,
|
|
56
|
+
path,
|
|
57
|
+
query,
|
|
58
|
+
hash,
|
|
59
|
+
type: 7
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function parseUrl(input) {
|
|
63
|
+
if (isSchemeRelativeUrl(input)) {
|
|
64
|
+
const url$1 = parseAbsoluteUrl("http:" + input);
|
|
65
|
+
url$1.scheme = "";
|
|
66
|
+
url$1.type = 6;
|
|
67
|
+
return url$1;
|
|
68
|
+
}
|
|
69
|
+
if (isAbsolutePath(input)) {
|
|
70
|
+
const url$1 = parseAbsoluteUrl("http://foo.com" + input);
|
|
71
|
+
url$1.scheme = "";
|
|
72
|
+
url$1.host = "";
|
|
73
|
+
url$1.type = 5;
|
|
74
|
+
return url$1;
|
|
75
|
+
}
|
|
76
|
+
if (isFileUrl(input)) return parseFileUrl(input);
|
|
77
|
+
if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
|
|
78
|
+
const url = parseAbsoluteUrl("http://foo.com/" + input);
|
|
79
|
+
url.scheme = "";
|
|
80
|
+
url.host = "";
|
|
81
|
+
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
82
|
+
return url;
|
|
83
|
+
}
|
|
84
|
+
function stripPathFilename(path) {
|
|
85
|
+
if (path.endsWith("/..")) return path;
|
|
86
|
+
const index = path.lastIndexOf("/");
|
|
87
|
+
return path.slice(0, index + 1);
|
|
88
|
+
}
|
|
89
|
+
function mergePaths(url, base) {
|
|
90
|
+
normalizePath(base, base.type);
|
|
91
|
+
if (url.path === "/") url.path = base.path;
|
|
92
|
+
else url.path = stripPathFilename(base.path) + url.path;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The path can have empty directories "//", unneeded parents "foo/..", or current directory
|
|
96
|
+
* "foo/.". We need to normalize to a standard representation.
|
|
97
|
+
*/
|
|
98
|
+
function normalizePath(url, type) {
|
|
99
|
+
const rel = type <= 4;
|
|
100
|
+
const pieces = url.path.split("/");
|
|
101
|
+
let pointer = 1;
|
|
102
|
+
let positive = 0;
|
|
103
|
+
let addTrailingSlash = false;
|
|
104
|
+
for (let i = 1; i < pieces.length; i++) {
|
|
105
|
+
const piece = pieces[i];
|
|
106
|
+
if (!piece) {
|
|
107
|
+
addTrailingSlash = true;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
addTrailingSlash = false;
|
|
111
|
+
if (piece === ".") continue;
|
|
112
|
+
if (piece === "..") {
|
|
113
|
+
if (positive) {
|
|
114
|
+
addTrailingSlash = true;
|
|
115
|
+
positive--;
|
|
116
|
+
pointer--;
|
|
117
|
+
} else if (rel) pieces[pointer++] = piece;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
pieces[pointer++] = piece;
|
|
121
|
+
positive++;
|
|
122
|
+
}
|
|
123
|
+
let path = "";
|
|
124
|
+
for (let i = 1; i < pointer; i++) path += "/" + pieces[i];
|
|
125
|
+
if (!path || addTrailingSlash && !path.endsWith("/..")) path += "/";
|
|
126
|
+
url.path = path;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Attempts to resolve `input` URL/path relative to `base`.
|
|
130
|
+
*/
|
|
131
|
+
function resolve(input, base) {
|
|
132
|
+
if (!input && !base) return "";
|
|
133
|
+
const url = parseUrl(input);
|
|
134
|
+
let inputType = url.type;
|
|
135
|
+
if (base && inputType !== 7) {
|
|
136
|
+
const baseUrl = parseUrl(base);
|
|
137
|
+
const baseType = baseUrl.type;
|
|
138
|
+
switch (inputType) {
|
|
139
|
+
case 1: url.hash = baseUrl.hash;
|
|
140
|
+
case 2: url.query = baseUrl.query;
|
|
141
|
+
case 3:
|
|
142
|
+
case 4: mergePaths(url, baseUrl);
|
|
143
|
+
case 5:
|
|
144
|
+
url.user = baseUrl.user;
|
|
145
|
+
url.host = baseUrl.host;
|
|
146
|
+
url.port = baseUrl.port;
|
|
147
|
+
case 6: url.scheme = baseUrl.scheme;
|
|
148
|
+
}
|
|
149
|
+
if (baseType > inputType) inputType = baseType;
|
|
150
|
+
}
|
|
151
|
+
normalizePath(url, inputType);
|
|
152
|
+
const queryHash = url.query + url.hash;
|
|
153
|
+
switch (inputType) {
|
|
154
|
+
case 2:
|
|
155
|
+
case 3: return queryHash;
|
|
156
|
+
case 4: {
|
|
157
|
+
const path = url.path.slice(1);
|
|
158
|
+
if (!path) return queryHash || ".";
|
|
159
|
+
if (isRelative(base || input) && !isRelative(path)) return "./" + path + queryHash;
|
|
160
|
+
return path + queryHash;
|
|
161
|
+
}
|
|
162
|
+
case 5: return url.path + queryHash;
|
|
163
|
+
default: return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
169
|
+
function stripFilename(path) {
|
|
170
|
+
if (!path) return "";
|
|
171
|
+
const index = path.lastIndexOf("/");
|
|
172
|
+
return path.slice(0, index + 1);
|
|
173
|
+
}
|
|
174
|
+
function resolver(mapUrl, sourceRoot) {
|
|
175
|
+
const from = stripFilename(mapUrl);
|
|
176
|
+
const prefix = sourceRoot ? sourceRoot + "/" : "";
|
|
177
|
+
return (source) => resolve(prefix + (source || ""), from);
|
|
178
|
+
}
|
|
179
|
+
var COLUMN$1 = 0;
|
|
180
|
+
function maybeSort(mappings, owned) {
|
|
181
|
+
const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
|
|
182
|
+
if (unsortedIndex === mappings.length) return mappings;
|
|
183
|
+
if (!owned) mappings = mappings.slice();
|
|
184
|
+
for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) mappings[i] = sortSegments(mappings[i], owned);
|
|
185
|
+
return mappings;
|
|
186
|
+
}
|
|
187
|
+
function nextUnsortedSegmentLine(mappings, start) {
|
|
188
|
+
for (let i = start; i < mappings.length; i++) if (!isSorted(mappings[i])) return i;
|
|
189
|
+
return mappings.length;
|
|
190
|
+
}
|
|
191
|
+
function isSorted(line) {
|
|
192
|
+
for (let j = 1; j < line.length; j++) if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) return false;
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
function sortSegments(line, owned) {
|
|
196
|
+
if (!owned) line = line.slice();
|
|
197
|
+
return line.sort(sortComparator);
|
|
198
|
+
}
|
|
199
|
+
function sortComparator(a, b) {
|
|
200
|
+
return a[COLUMN$1] - b[COLUMN$1];
|
|
201
|
+
}
|
|
202
|
+
var found = false;
|
|
203
|
+
function binarySearch(haystack, needle, low, high) {
|
|
204
|
+
while (low <= high) {
|
|
205
|
+
const mid = low + (high - low >> 1);
|
|
206
|
+
const cmp = haystack[mid][COLUMN$1] - needle;
|
|
207
|
+
if (cmp === 0) {
|
|
208
|
+
found = true;
|
|
209
|
+
return mid;
|
|
210
|
+
}
|
|
211
|
+
if (cmp < 0) low = mid + 1;
|
|
212
|
+
else high = mid - 1;
|
|
213
|
+
}
|
|
214
|
+
found = false;
|
|
215
|
+
return low - 1;
|
|
216
|
+
}
|
|
217
|
+
function upperBound(haystack, needle, index) {
|
|
218
|
+
for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN$1] !== needle) break;
|
|
219
|
+
return index;
|
|
220
|
+
}
|
|
221
|
+
function lowerBound(haystack, needle, index) {
|
|
222
|
+
for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN$1] !== needle) break;
|
|
223
|
+
return index;
|
|
224
|
+
}
|
|
225
|
+
function memoizedState() {
|
|
226
|
+
return {
|
|
227
|
+
lastKey: -1,
|
|
228
|
+
lastNeedle: -1,
|
|
229
|
+
lastIndex: -1
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
233
|
+
const { lastKey, lastNeedle, lastIndex } = state;
|
|
234
|
+
let low = 0;
|
|
235
|
+
let high = haystack.length - 1;
|
|
236
|
+
if (key === lastKey) {
|
|
237
|
+
if (needle === lastNeedle) {
|
|
238
|
+
found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
|
|
239
|
+
return lastIndex;
|
|
240
|
+
}
|
|
241
|
+
if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex;
|
|
242
|
+
else high = lastIndex;
|
|
243
|
+
}
|
|
244
|
+
state.lastKey = key;
|
|
245
|
+
state.lastNeedle = needle;
|
|
246
|
+
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
247
|
+
}
|
|
248
|
+
function parse(map) {
|
|
249
|
+
return typeof map === "string" ? JSON.parse(map) : map;
|
|
250
|
+
}
|
|
251
|
+
var LEAST_UPPER_BOUND = -1;
|
|
252
|
+
var GREATEST_LOWER_BOUND = 1;
|
|
253
|
+
var TraceMap = class {
|
|
254
|
+
constructor(map, mapUrl) {
|
|
255
|
+
const isString = typeof map === "string";
|
|
256
|
+
if (!isString && map._decodedMemo) return map;
|
|
257
|
+
const parsed = parse(map);
|
|
258
|
+
const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
259
|
+
this.version = version;
|
|
260
|
+
this.file = file;
|
|
261
|
+
this.names = names || [];
|
|
262
|
+
this.sourceRoot = sourceRoot;
|
|
263
|
+
this.sources = sources;
|
|
264
|
+
this.sourcesContent = sourcesContent;
|
|
265
|
+
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
|
266
|
+
const resolve$1 = resolver(mapUrl, sourceRoot);
|
|
267
|
+
this.resolvedSources = sources.map(resolve$1);
|
|
268
|
+
const { mappings } = parsed;
|
|
269
|
+
if (typeof mappings === "string") {
|
|
270
|
+
this._encoded = mappings;
|
|
271
|
+
this._decoded = void 0;
|
|
272
|
+
} else if (Array.isArray(mappings)) {
|
|
273
|
+
this._encoded = void 0;
|
|
274
|
+
this._decoded = maybeSort(mappings, isString);
|
|
275
|
+
} else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
|
|
276
|
+
else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
|
|
277
|
+
this._decodedMemo = memoizedState();
|
|
278
|
+
this._bySources = void 0;
|
|
279
|
+
this._bySourceMemos = void 0;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
function cast$1(map) {
|
|
283
|
+
return map;
|
|
284
|
+
}
|
|
285
|
+
function decodedMappings(map) {
|
|
286
|
+
var _a;
|
|
287
|
+
return (_a = cast$1(map))._decoded || (_a._decoded = decode(cast$1(map)._encoded));
|
|
288
|
+
}
|
|
289
|
+
function traceSegment(map, line, column) {
|
|
290
|
+
const decoded = decodedMappings(map);
|
|
291
|
+
if (line >= decoded.length) return null;
|
|
292
|
+
const segments = decoded[line];
|
|
293
|
+
const index = traceSegmentInternal(segments, cast$1(map)._decodedMemo, line, column, GREATEST_LOWER_BOUND);
|
|
294
|
+
return index === -1 ? null : segments[index];
|
|
295
|
+
}
|
|
296
|
+
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
297
|
+
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
298
|
+
if (found) index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
|
|
299
|
+
else if (bias === LEAST_UPPER_BOUND) index++;
|
|
300
|
+
if (index === -1 || index === segments.length) return -1;
|
|
301
|
+
return index;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
//#endregion
|
|
3
305
|
//#region node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
|
|
4
306
|
var SetArray = class {
|
|
5
307
|
constructor() {
|
|
@@ -143,4 +445,4 @@ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIn
|
|
|
143
445
|
}
|
|
144
446
|
|
|
145
447
|
//#endregion
|
|
146
|
-
export { toDecodedMap as a, setSourceContent as i, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, GenMapping as t };
|
|
448
|
+
export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as toDecodedMap, i as setSourceContent, n as maybeAddSegment, o as toEncodedMap, r as setIgnore, t as GenMapping } from "./gen-mapping.mjs";
|
|
1
|
+
import { a as toDecodedMap, c as decodedMappings, i as setSourceContent, l as traceSegment, n as maybeAddSegment, o as toEncodedMap, r as setIgnore, s as TraceMap, t as GenMapping } from "./gen-mapping.mjs";
|
|
3
2
|
|
|
4
3
|
//#region node_modules/.pnpm/@jridgewell+remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs
|
|
5
4
|
var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
|