@kubb/agent 5.0.0-beta.75 → 5.0.0-beta.8
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +353 -418
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/node_modules/ajv/dist/2019.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/2019.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/2020.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/2020.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/ajv.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/ajv.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/index.d.ts +2 -1
- package/.output/server/node_modules/ajv/dist/compile/index.js +10 -3
- package/.output/server/node_modules/ajv/dist/compile/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js +1 -1
- package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/names.d.ts +1 -0
- package/.output/server/node_modules/ajv/dist/compile/names.js +1 -0
- package/.output/server/node_modules/ajv/dist/compile/names.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/compile/validate/index.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/compile/validate/index.js +18 -4
- package/.output/server/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/core.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/core.js +15 -1
- package/.output/server/node_modules/ajv/dist/core.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/draft4.d.ts +19 -0
- package/.output/server/node_modules/ajv/dist/draft4.js +57 -0
- package/.output/server/node_modules/ajv/dist/draft4.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-draft-04.json +138 -0
- package/.output/server/node_modules/ajv/dist/types/index.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +2 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.js +2 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/code.d.ts +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/code.js +10 -3
- package/.output/server/node_modules/ajv/dist/vocabularies/code.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.js +12 -2
- package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.js +56 -21
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/draft4.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft4.js +29 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft4.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/metadata.js +10 -2
- package/.output/server/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/oasContext.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/oasContext.js +26 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/oasContext.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +22 -3
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumber.d.ts +12 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumber.js +43 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumber.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +19 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.js +4 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/readOnly.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/readOnly.js +20 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/readOnly.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.js +8 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -1
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/writeOnly.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/writeOnly.js +20 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/writeOnly.js.map +1 -0
- package/.output/server/node_modules/ajv/lib/2019.ts +1 -0
- package/.output/server/node_modules/ajv/lib/2020.ts +1 -0
- package/.output/server/node_modules/ajv/lib/ajv.ts +1 -0
- package/.output/server/node_modules/ajv/lib/compile/index.ts +16 -3
- package/.output/server/node_modules/ajv/lib/compile/jtd/parse.ts +3 -1
- package/.output/server/node_modules/ajv/lib/compile/jtd/serialize.ts +3 -1
- package/.output/server/node_modules/ajv/lib/compile/names.ts +1 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/index.ts +21 -4
- package/.output/server/node_modules/ajv/lib/core.ts +20 -1
- package/.output/server/node_modules/ajv/lib/draft4.ts +79 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-draft-04.json +138 -0
- package/.output/server/node_modules/ajv/lib/types/index.ts +4 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +2 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +1 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/properties.ts +4 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/code.ts +10 -3
- package/.output/server/node_modules/ajv/lib/vocabularies/core/ref.ts +21 -5
- package/.output/server/node_modules/ajv/lib/vocabularies/discriminator/index.ts +69 -19
- package/.output/server/node_modules/ajv/lib/vocabularies/draft4.ts +32 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/metadata.ts +10 -2
- package/.output/server/node_modules/ajv/lib/vocabularies/oasContext.ts +27 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +29 -7
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/draft04/limitNumber.ts +75 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/draft04/limitNumberExclusive.ts +26 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/index.ts +4 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/readOnly.ts +23 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/required.ts +7 -1
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/writeOnly.ts +22 -0
- package/.output/server/node_modules/ajv/package.json +9 -6
- package/.output/server/node_modules/jiti/LICENSE +21 -0
- package/.output/server/node_modules/jiti/README.md +258 -0
- package/.output/server/node_modules/jiti/dist/babel.cjs +257 -0
- package/.output/server/node_modules/jiti/dist/jiti.cjs +1 -0
- package/.output/server/node_modules/jiti/lib/jiti-cli.mjs +34 -0
- package/.output/server/node_modules/jiti/lib/jiti-hooks.mjs +124 -0
- package/.output/server/node_modules/jiti/lib/jiti-native.mjs +121 -0
- package/.output/server/node_modules/jiti/lib/jiti-register.d.mts +1 -0
- package/.output/server/node_modules/jiti/lib/jiti-register.mjs +4 -0
- package/.output/server/node_modules/jiti/lib/jiti-static.mjs +23 -0
- package/.output/server/node_modules/jiti/lib/jiti.cjs +30 -0
- package/.output/server/node_modules/jiti/lib/jiti.d.cts +8 -0
- package/.output/server/node_modules/jiti/lib/jiti.d.mts +8 -0
- package/.output/server/node_modules/jiti/lib/jiti.mjs +29 -0
- package/.output/server/node_modules/jiti/lib/types.d.ts +420 -0
- package/.output/server/node_modules/jiti/package.json +146 -0
- package/.output/server/package.json +2 -5
- package/README.md +62 -27
- package/package.json +13 -12
- package/.output/server/node_modules/@rolldown/binding-linux-x64-gnu/package.json +0 -40
- package/.output/server/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node +0 -0
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js +0 -256
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js +0 -75
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/index.js +0 -3
- package/.output/server/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js +0 -70
- package/.output/server/node_modules/@rolldown/pluginutils/dist/index.js +0 -1
- package/.output/server/node_modules/@rolldown/pluginutils/dist/utils.js +0 -17
- package/.output/server/node_modules/@rolldown/pluginutils/package.json +0 -37
- package/.output/server/node_modules/rolldown/dist/index.mjs +0 -50
- package/.output/server/node_modules/rolldown/dist/parse-ast-index.mjs +0 -60
- package/.output/server/node_modules/rolldown/dist/shared/binding-BeU_1iEk.mjs +0 -582
- package/.output/server/node_modules/rolldown/dist/shared/bindingify-input-options-DbbBhzky.mjs +0 -2211
- package/.output/server/node_modules/rolldown/dist/shared/define-config-DJOr6Iwt.mjs +0 -6
- package/.output/server/node_modules/rolldown/dist/shared/error-DL-e8-oE.mjs +0 -85
- package/.output/server/node_modules/rolldown/dist/shared/logs-D80CXhvg.mjs +0 -180
- package/.output/server/node_modules/rolldown/dist/shared/misc-DJYbNKZX.mjs +0 -21
- package/.output/server/node_modules/rolldown/dist/shared/normalize-string-or-regex-CbQQ69gT.mjs +0 -66
- package/.output/server/node_modules/rolldown/dist/shared/parse-B_ZnWxLZ.mjs +0 -74
- package/.output/server/node_modules/rolldown/dist/shared/prompt-U5ajztzG.mjs +0 -847
- package/.output/server/node_modules/rolldown/dist/shared/rolldown-D3JZ9rMt.mjs +0 -40
- package/.output/server/node_modules/rolldown/dist/shared/rolldown-build-DSxL8qiP.mjs +0 -3325
- package/.output/server/node_modules/rolldown/dist/shared/watch-Bd8v9ewv.mjs +0 -374
- package/.output/server/node_modules/rolldown/package.json +0 -153
- package/.output/server/node_modules/unrun/dist/index.mjs +0 -2
- package/.output/server/node_modules/unrun/dist/src-GU5PtktT.mjs +0 -887
- package/.output/server/node_modules/unrun/package.json +0 -125
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { t as require_binding } from "./binding-BeU_1iEk.mjs";
|
|
2
|
-
//#region src/types/sourcemap.ts
|
|
3
|
-
function bindingifySourcemap(map) {
|
|
4
|
-
if (map == null) return;
|
|
5
|
-
return { inner: typeof map === "string" ? map : {
|
|
6
|
-
file: map.file ?? void 0,
|
|
7
|
-
mappings: map.mappings,
|
|
8
|
-
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
|
|
9
|
-
sources: map.sources?.map((s) => s ?? void 0),
|
|
10
|
-
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
|
|
11
|
-
names: map.names,
|
|
12
|
-
x_google_ignoreList: map.x_google_ignoreList,
|
|
13
|
-
debugId: "debugId" in map ? map.debugId : void 0
|
|
14
|
-
} };
|
|
15
|
-
}
|
|
16
|
-
require_binding();
|
|
17
|
-
function unwrapBindingResult(container) {
|
|
18
|
-
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) throw aggregateBindingErrorsIntoJsError(container.errors);
|
|
19
|
-
return container;
|
|
20
|
-
}
|
|
21
|
-
function normalizeBindingResult(container) {
|
|
22
|
-
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
|
23
|
-
return container;
|
|
24
|
-
}
|
|
25
|
-
function normalizeBindingError(e) {
|
|
26
|
-
return e.type === "JsError" ? e.field0 : Object.assign(/* @__PURE__ */ new Error(), {
|
|
27
|
-
code: e.field0.kind,
|
|
28
|
-
kind: e.field0.kind,
|
|
29
|
-
message: e.field0.message,
|
|
30
|
-
id: e.field0.id,
|
|
31
|
-
exporter: e.field0.exporter,
|
|
32
|
-
loc: e.field0.loc,
|
|
33
|
-
pos: e.field0.pos,
|
|
34
|
-
stack: void 0
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function aggregateBindingErrorsIntoJsError(rawErrors) {
|
|
38
|
-
const errors = rawErrors.map(normalizeBindingError);
|
|
39
|
-
let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
40
|
-
for (let i = 0; i < errors.length; i++) {
|
|
41
|
-
summary += "\n";
|
|
42
|
-
if (i >= 5) {
|
|
43
|
-
summary += "...";
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
summary += getErrorMessage(errors[i]);
|
|
47
|
-
}
|
|
48
|
-
const wrapper = new Error(summary);
|
|
49
|
-
Object.defineProperty(wrapper, "errors", {
|
|
50
|
-
configurable: true,
|
|
51
|
-
enumerable: true,
|
|
52
|
-
get: () => errors,
|
|
53
|
-
set: (value) => Object.defineProperty(wrapper, "errors", {
|
|
54
|
-
configurable: true,
|
|
55
|
-
enumerable: true,
|
|
56
|
-
value
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
return wrapper;
|
|
60
|
-
}
|
|
61
|
-
function getErrorMessage(e) {
|
|
62
|
-
if (Object.hasOwn(e, "kind")) return e.message;
|
|
63
|
-
let s = "";
|
|
64
|
-
if (e.plugin) s += `[plugin ${e.plugin}]`;
|
|
65
|
-
const id = e.id ?? e.loc?.file;
|
|
66
|
-
if (id) {
|
|
67
|
-
s += " " + id;
|
|
68
|
-
if (e.loc) s += `:${e.loc.line}:${e.loc.column}`;
|
|
69
|
-
}
|
|
70
|
-
if (s) s += "\n";
|
|
71
|
-
const message = `${e.name ?? "Error"}: ${e.message}`;
|
|
72
|
-
s += message;
|
|
73
|
-
if (e.frame) s = joinNewLine(s, e.frame);
|
|
74
|
-
if (e.stack) s = joinNewLine(s, e.stack.replace(message, ""));
|
|
75
|
-
if (e.cause) {
|
|
76
|
-
s = joinNewLine(s, "Caused by:");
|
|
77
|
-
s = joinNewLine(s, getErrorMessage(e.cause).split("\n").map((line) => " " + line).join("\n"));
|
|
78
|
-
}
|
|
79
|
-
return s;
|
|
80
|
-
}
|
|
81
|
-
function joinNewLine(s1, s2) {
|
|
82
|
-
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
export { bindingifySourcemap as a, unwrapBindingResult as i, normalizeBindingError as n, normalizeBindingResult as r, aggregateBindingErrorsIntoJsError as t };
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
//#region src/utils/code-frame.ts
|
|
2
|
-
function spaces(index) {
|
|
3
|
-
let result = "";
|
|
4
|
-
while (index--) result += " ";
|
|
5
|
-
return result;
|
|
6
|
-
}
|
|
7
|
-
function tabsToSpaces(value) {
|
|
8
|
-
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
9
|
-
}
|
|
10
|
-
const LINE_TRUNCATE_LENGTH = 120;
|
|
11
|
-
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
12
|
-
const ELLIPSIS = "...";
|
|
13
|
-
function getCodeFrame(source, line, column) {
|
|
14
|
-
let lines = source.split("\n");
|
|
15
|
-
if (line > lines.length) return "";
|
|
16
|
-
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
|
|
17
|
-
const frameStart = Math.max(0, line - 3);
|
|
18
|
-
let frameEnd = Math.min(line + 2, lines.length);
|
|
19
|
-
lines = lines.slice(frameStart, frameEnd);
|
|
20
|
-
while (!/\S/.test(lines[lines.length - 1])) {
|
|
21
|
-
lines.pop();
|
|
22
|
-
frameEnd -= 1;
|
|
23
|
-
}
|
|
24
|
-
const digits = String(frameEnd).length;
|
|
25
|
-
return lines.map((sourceLine, index) => {
|
|
26
|
-
const isErrorLine = frameStart + index + 1 === line;
|
|
27
|
-
let lineNumber = String(index + frameStart + 1);
|
|
28
|
-
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
29
|
-
let displayedLine = tabsToSpaces(sourceLine);
|
|
30
|
-
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
|
|
31
|
-
if (isErrorLine) {
|
|
32
|
-
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
33
|
-
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
34
|
-
}
|
|
35
|
-
return `${lineNumber}: ${displayedLine}`;
|
|
36
|
-
}).join("\n");
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/log/locate-character/index.js
|
|
40
|
-
/** @typedef {import('./types').Location} Location */
|
|
41
|
-
/**
|
|
42
|
-
* @param {import('./types').Range} range
|
|
43
|
-
* @param {number} index
|
|
44
|
-
*/
|
|
45
|
-
function rangeContains(range, index) {
|
|
46
|
-
return range.start <= index && index < range.end;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @param {string} source
|
|
50
|
-
* @param {import('./types').Options} [options]
|
|
51
|
-
*/
|
|
52
|
-
function getLocator(source, options = {}) {
|
|
53
|
-
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
54
|
-
let start = 0;
|
|
55
|
-
const ranges = source.split("\n").map((line, i) => {
|
|
56
|
-
const end = start + line.length + 1;
|
|
57
|
-
/** @type {import('./types').Range} */
|
|
58
|
-
const range = {
|
|
59
|
-
start,
|
|
60
|
-
end,
|
|
61
|
-
line: i
|
|
62
|
-
};
|
|
63
|
-
start = end;
|
|
64
|
-
return range;
|
|
65
|
-
});
|
|
66
|
-
let i = 0;
|
|
67
|
-
/**
|
|
68
|
-
* @param {string | number} search
|
|
69
|
-
* @param {number} [index]
|
|
70
|
-
* @returns {Location | undefined}
|
|
71
|
-
*/
|
|
72
|
-
function locator(search, index) {
|
|
73
|
-
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
74
|
-
if (search === -1) return void 0;
|
|
75
|
-
let range = ranges[i];
|
|
76
|
-
const d = search >= range.end ? 1 : -1;
|
|
77
|
-
while (range) {
|
|
78
|
-
if (rangeContains(range, search)) return {
|
|
79
|
-
line: offsetLine + range.line,
|
|
80
|
-
column: offsetColumn + search - range.start,
|
|
81
|
-
character: search
|
|
82
|
-
};
|
|
83
|
-
i += d;
|
|
84
|
-
range = ranges[i];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return locator;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* @param {string} source
|
|
91
|
-
* @param {string | number} search
|
|
92
|
-
* @param {import('./types').Options} [options]
|
|
93
|
-
* @returns {Location | undefined}
|
|
94
|
-
*/
|
|
95
|
-
function locate(source, search, options) {
|
|
96
|
-
return getLocator(source, options)(search, options && options.startIndex);
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/log/logs.ts
|
|
100
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLE_WATCHER_OPTION = "MULTIPLE_WATCHER_OPTION", PARSE_ERROR = "PARSE_ERROR";
|
|
101
|
-
function logParseError(message, id, pos) {
|
|
102
|
-
return {
|
|
103
|
-
code: PARSE_ERROR,
|
|
104
|
-
id,
|
|
105
|
-
message,
|
|
106
|
-
pos
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function logInvalidLogPosition(pluginName) {
|
|
110
|
-
return {
|
|
111
|
-
code: INVALID_LOG_POSITION,
|
|
112
|
-
message: `Plugin "${pluginName}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
116
|
-
return {
|
|
117
|
-
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
118
|
-
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function logCycleLoading(pluginName, moduleId) {
|
|
122
|
-
return {
|
|
123
|
-
code: CYCLE_LOADING,
|
|
124
|
-
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
function logMultipleWatcherOption() {
|
|
128
|
-
return {
|
|
129
|
-
code: MULTIPLE_WATCHER_OPTION,
|
|
130
|
-
message: `Found multiple watcher options at watch options, using first one to start watcher.`
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
function logPluginError(error, plugin, { hook, id } = {}) {
|
|
134
|
-
try {
|
|
135
|
-
const code = error.code;
|
|
136
|
-
if (!error.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error.pluginCode = code;
|
|
137
|
-
error.code = PLUGIN_ERROR;
|
|
138
|
-
error.plugin = plugin;
|
|
139
|
-
if (hook) error.hook = hook;
|
|
140
|
-
if (id) error.id = id;
|
|
141
|
-
} catch (_) {} finally {
|
|
142
|
-
return error;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
function error(base) {
|
|
146
|
-
if (!(base instanceof Error)) {
|
|
147
|
-
base = Object.assign(new Error(base.message), base);
|
|
148
|
-
Object.defineProperty(base, "name", {
|
|
149
|
-
value: "RolldownError",
|
|
150
|
-
writable: true
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
throw base;
|
|
154
|
-
}
|
|
155
|
-
function augmentCodeLocation(properties, pos, source, id) {
|
|
156
|
-
if (typeof pos === "object") {
|
|
157
|
-
const { line, column } = pos;
|
|
158
|
-
properties.loc = {
|
|
159
|
-
column,
|
|
160
|
-
file: id,
|
|
161
|
-
line
|
|
162
|
-
};
|
|
163
|
-
} else {
|
|
164
|
-
properties.pos = pos;
|
|
165
|
-
const location = locate(source, pos, { offsetLine: 1 });
|
|
166
|
-
if (!location) return;
|
|
167
|
-
const { line, column } = location;
|
|
168
|
-
properties.loc = {
|
|
169
|
-
column,
|
|
170
|
-
file: id,
|
|
171
|
-
line
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
if (properties.frame === void 0) {
|
|
175
|
-
const { line, column } = properties.loc;
|
|
176
|
-
properties.frame = getCodeFrame(source, line, column);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
//#endregion
|
|
180
|
-
export { logInvalidLogPosition as a, logPluginError as c, logInputHookInOutputPlugin as i, locate as l, error as n, logMultipleWatcherOption as o, logCycleLoading as r, logParseError as s, augmentCodeLocation as t, getCodeFrame as u };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//#region src/utils/misc.ts
|
|
2
|
-
function arraify(value) {
|
|
3
|
-
return Array.isArray(value) ? value : [value];
|
|
4
|
-
}
|
|
5
|
-
function isPromiseLike(value) {
|
|
6
|
-
return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
7
|
-
}
|
|
8
|
-
function unimplemented(info) {
|
|
9
|
-
if (info) throw new Error(`unimplemented: ${info}`);
|
|
10
|
-
throw new Error("unimplemented");
|
|
11
|
-
}
|
|
12
|
-
function unreachable(info) {
|
|
13
|
-
if (info) throw new Error(`unreachable: ${info}`);
|
|
14
|
-
throw new Error("unreachable");
|
|
15
|
-
}
|
|
16
|
-
function unsupported(info) {
|
|
17
|
-
throw new Error(`UNSUPPORTED: ${info}`);
|
|
18
|
-
}
|
|
19
|
-
function noop(..._args) {}
|
|
20
|
-
//#endregion
|
|
21
|
-
export { unreachable as a, unimplemented as i, isPromiseLike as n, unsupported as o, noop as r, arraify as t };
|
package/.output/server/node_modules/rolldown/dist/shared/normalize-string-or-regex-CbQQ69gT.mjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-BeU_1iEk.mjs";
|
|
2
|
-
import { c as logPluginError, n as error } from "./logs-D80CXhvg.mjs";
|
|
3
|
-
//#region src/builtin-plugin/utils.ts
|
|
4
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
|
-
var BuiltinPlugin = class {
|
|
6
|
-
/** Vite-specific option to control plugin ordering */
|
|
7
|
-
enforce;
|
|
8
|
-
constructor(name, _options) {
|
|
9
|
-
this.name = name;
|
|
10
|
-
this._options = _options;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
function makeBuiltinPluginCallable(plugin) {
|
|
14
|
-
let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
15
|
-
const wrappedPlugin = plugin;
|
|
16
|
-
for (const key in callablePlugin) {
|
|
17
|
-
const wrappedHook = async function(...args) {
|
|
18
|
-
try {
|
|
19
|
-
return await callablePlugin[key](...args);
|
|
20
|
-
} catch (e) {
|
|
21
|
-
if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
|
|
22
|
-
return error(logPluginError(e, plugin.name, {
|
|
23
|
-
hook: key,
|
|
24
|
-
id: key === "transform" ? args[2] : void 0
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const order = callablePlugin.getOrder(key);
|
|
29
|
-
if (order == void 0) wrappedPlugin[key] = wrappedHook;
|
|
30
|
-
else wrappedPlugin[key] = {
|
|
31
|
-
handler: wrappedHook,
|
|
32
|
-
order
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return wrappedPlugin;
|
|
36
|
-
}
|
|
37
|
-
function bindingifyBuiltInPlugin(plugin) {
|
|
38
|
-
return {
|
|
39
|
-
__name: plugin.name,
|
|
40
|
-
options: plugin._options
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function bindingifyManifestPlugin(plugin, pluginContextData) {
|
|
44
|
-
const { isOutputOptionsForLegacyChunks, ...options } = plugin._options;
|
|
45
|
-
return {
|
|
46
|
-
__name: plugin.name,
|
|
47
|
-
options: {
|
|
48
|
-
...options,
|
|
49
|
-
isLegacy: isOutputOptionsForLegacyChunks ? (opts) => {
|
|
50
|
-
return isOutputOptionsForLegacyChunks(pluginContextData.getOutputOptions(opts));
|
|
51
|
-
} : void 0
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
57
|
-
function normalizedStringOrRegex(pattern) {
|
|
58
|
-
if (!pattern) return;
|
|
59
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
60
|
-
return pattern;
|
|
61
|
-
}
|
|
62
|
-
function isReadonlyArray(input) {
|
|
63
|
-
return Array.isArray(input);
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { makeBuiltinPluginCallable as a, bindingifyManifestPlugin as i, BuiltinPlugin as n, bindingifyBuiltInPlugin as r, normalizedStringOrRegex as t };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-BeU_1iEk.mjs";
|
|
2
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.127.0/node_modules/oxc-parser/src-js/wrap.js
|
|
3
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4
|
-
function wrap(result) {
|
|
5
|
-
let program, module, comments, errors;
|
|
6
|
-
return {
|
|
7
|
-
get program() {
|
|
8
|
-
if (!program) program = jsonParseAst(result.program);
|
|
9
|
-
return program;
|
|
10
|
-
},
|
|
11
|
-
get module() {
|
|
12
|
-
if (!module) module = result.module;
|
|
13
|
-
return module;
|
|
14
|
-
},
|
|
15
|
-
get comments() {
|
|
16
|
-
if (!comments) comments = result.comments;
|
|
17
|
-
return comments;
|
|
18
|
-
},
|
|
19
|
-
get errors() {
|
|
20
|
-
if (!errors) errors = result.errors;
|
|
21
|
-
return errors;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function jsonParseAst(programJson) {
|
|
26
|
-
const { node: program, fixes } = JSON.parse(programJson);
|
|
27
|
-
for (const fixPath of fixes) applyFix(program, fixPath);
|
|
28
|
-
return program;
|
|
29
|
-
}
|
|
30
|
-
function applyFix(program, fixPath) {
|
|
31
|
-
let node = program;
|
|
32
|
-
for (const key of fixPath) node = node[key];
|
|
33
|
-
if (node.bigint) node.value = BigInt(node.bigint);
|
|
34
|
-
else try {
|
|
35
|
-
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
36
|
-
} catch {}
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/utils/parse.ts
|
|
40
|
-
/**
|
|
41
|
-
* Parse JS/TS source asynchronously on a separate thread.
|
|
42
|
-
*
|
|
43
|
-
* Note that not all of the workload can happen on a separate thread.
|
|
44
|
-
* Parsing on Rust side does happen in a separate thread, but deserialization of the AST to JS objects
|
|
45
|
-
* has to happen on current thread. This synchronous deserialization work typically outweighs
|
|
46
|
-
* the asynchronous parsing by a factor of between 3 and 20.
|
|
47
|
-
*
|
|
48
|
-
* i.e. the majority of the workload cannot be parallelized by using this method.
|
|
49
|
-
*
|
|
50
|
-
* Generally {@linkcode parseSync} is preferable to use as it does not have the overhead of spawning a thread.
|
|
51
|
-
* If you need to parallelize parsing multiple files, it is recommended to use worker threads.
|
|
52
|
-
*
|
|
53
|
-
* @category Utilities
|
|
54
|
-
*/
|
|
55
|
-
async function parse(filename, sourceText, options) {
|
|
56
|
-
return wrap(await (0, import_binding.parse)(filename, sourceText, options));
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Parse JS/TS source synchronously on current thread.
|
|
60
|
-
*
|
|
61
|
-
* This is generally preferable over {@linkcode parse} (async) as it does not have the overhead
|
|
62
|
-
* of spawning a thread, and the majority of the workload cannot be parallelized anyway
|
|
63
|
-
* (see {@linkcode parse} documentation for details).
|
|
64
|
-
*
|
|
65
|
-
* If you need to parallelize parsing multiple files, it is recommended to use worker threads
|
|
66
|
-
* with {@linkcode parseSync} rather than using {@linkcode parse}.
|
|
67
|
-
*
|
|
68
|
-
* @category Utilities
|
|
69
|
-
*/
|
|
70
|
-
function parseSync(filename, sourceText, options) {
|
|
71
|
-
return wrap((0, import_binding.parseSync)(filename, sourceText, options));
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
export { parseSync as n, parse as t };
|