@rolldown/browser 1.0.0-beta.10-commit.885ee53 → 1.0.0-beta.10-commit.174c548
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/cli.cjs +6 -8
- package/dist/cli.mjs +1077 -1036
- package/dist/config.cjs +3 -3
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +5 -4
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +2 -2
- package/dist/experimental-index.d.mts +2 -2
- package/dist/experimental-index.mjs +14 -3
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +2 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -3
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.mjs +33 -27
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/chunk-DSsiIF1Z.mjs +30 -0
- package/dist/shared/{define-config-cqCLLLZ-.d.mts → define-config-BIXBk1MV.d.mts} +1 -1
- package/dist/shared/dist-DeDsdiza.mjs +153 -0
- package/dist/shared/{load-config-0bnuUeT5.cjs → load-config-Bh4s7mv7.cjs} +1 -1
- package/dist/shared/{load-config-F7nMcxMb.mjs → load-config-NxVyTTYe.mjs} +19 -14
- package/dist/shared/{parse-ast-index-C31FpvkE.mjs → parse-ast-index-B3Tue26H.mjs} +28 -10
- package/dist/shared/{parse-ast-index-BuelS_NF.cjs → parse-ast-index-DL8_b_QU.cjs} +1 -1
- package/dist/shared/prompt-jPdbaKAj.mjs +854 -0
- package/dist/shared/{src-B3FAi7gC.cjs → src-C1WG6B4S.cjs} +86 -16
- package/dist/shared/{src-6t_bV_L5.mjs → src-zY8hlbF2.mjs} +1422 -1132
- package/dist/{src-1eaUHc8G.js → src-DLpA6Cgv.js} +6 -6
- package/package.json +2 -2
- package/dist/shared/dist-BoWaIc-K.mjs +0 -147
- package/dist/shared/prompt-C3zHEaSG.mjs +0 -852
- /package/dist/shared/{binding-Dod8fhx9.d.mts → binding-CHPrEDXp.d.mts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
2
|
const require_dist = require('./dist-BMVjvV-v.cjs');
|
|
3
|
-
const require_parse_ast_index = require('./parse-ast-index-
|
|
3
|
+
const require_parse_ast_index = require('./parse-ast-index-DL8_b_QU.cjs');
|
|
4
4
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
|
|
5
5
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
6
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
@@ -8,7 +8,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
8
8
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
9
9
|
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.0.0-beta.10-commit.
|
|
11
|
+
var version = "1.0.0-beta.10-commit.174c548";
|
|
12
12
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
@@ -1409,11 +1409,15 @@ function safeParse(schema, input, config2) {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
|
|
1411
1411
|
//#endregion
|
|
1412
|
-
//#region ../../node_modules/.pnpm/@valibot+to-json-schema@1.
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1412
|
+
//#region ../../node_modules/.pnpm/@valibot+to-json-schema@1.3.0_valibot@1.1.0_typescript@5.8.3_/node_modules/@valibot/to-json-schema/dist/index.js
|
|
1413
|
+
/**
|
|
1414
|
+
* Adds an error message to the errors array.
|
|
1415
|
+
*
|
|
1416
|
+
* @param errors The array of error messages.
|
|
1417
|
+
* @param message The error message to add.
|
|
1418
|
+
*
|
|
1419
|
+
* @returns The new errors.
|
|
1420
|
+
*/
|
|
1417
1421
|
function addError(errors, message) {
|
|
1418
1422
|
if (errors) {
|
|
1419
1423
|
errors.push(message);
|
|
@@ -1421,6 +1425,12 @@ function addError(errors, message) {
|
|
|
1421
1425
|
}
|
|
1422
1426
|
return [message];
|
|
1423
1427
|
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Throws an error or logs a warning based on the configuration.
|
|
1430
|
+
*
|
|
1431
|
+
* @param message The message to throw or log.
|
|
1432
|
+
* @param config The conversion configuration.
|
|
1433
|
+
*/
|
|
1424
1434
|
function handleError(message, config) {
|
|
1425
1435
|
switch (config?.errorMode) {
|
|
1426
1436
|
case "ignore": break;
|
|
@@ -1431,7 +1441,17 @@ function handleError(message, config) {
|
|
|
1431
1441
|
default: throw new Error(message);
|
|
1432
1442
|
}
|
|
1433
1443
|
}
|
|
1444
|
+
/**
|
|
1445
|
+
* Converts any supported Valibot action to the JSON Schema format.
|
|
1446
|
+
*
|
|
1447
|
+
* @param jsonSchema The JSON Schema object.
|
|
1448
|
+
* @param valibotAction The Valibot action object.
|
|
1449
|
+
* @param config The conversion configuration.
|
|
1450
|
+
*
|
|
1451
|
+
* @returns The converted JSON Schema.
|
|
1452
|
+
*/
|
|
1434
1453
|
function convertAction(jsonSchema, valibotAction, config) {
|
|
1454
|
+
if (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;
|
|
1435
1455
|
let errors;
|
|
1436
1456
|
switch (valibotAction.type) {
|
|
1437
1457
|
case "base64": {
|
|
@@ -1594,7 +1614,28 @@ function convertAction(jsonSchema, valibotAction, config) {
|
|
|
1594
1614
|
if (errors) for (const message of errors) handleError(message, config);
|
|
1595
1615
|
return jsonSchema;
|
|
1596
1616
|
}
|
|
1597
|
-
|
|
1617
|
+
/**
|
|
1618
|
+
* Flattens a Valibot pipe by recursively expanding nested pipes.
|
|
1619
|
+
*
|
|
1620
|
+
* @param pipe The pipeline to flatten.
|
|
1621
|
+
*
|
|
1622
|
+
* @returns A flat pipeline.
|
|
1623
|
+
*/
|
|
1624
|
+
function flattenPipe(pipe$1) {
|
|
1625
|
+
return pipe$1.flatMap((item) => "pipe" in item ? flattenPipe(item.pipe) : item);
|
|
1626
|
+
}
|
|
1627
|
+
let refCount = 0;
|
|
1628
|
+
/**
|
|
1629
|
+
* Converts any supported Valibot schema to the JSON Schema format.
|
|
1630
|
+
*
|
|
1631
|
+
* @param jsonSchema The JSON Schema object.
|
|
1632
|
+
* @param valibotSchema The Valibot schema object.
|
|
1633
|
+
* @param config The conversion configuration.
|
|
1634
|
+
* @param context The conversion context.
|
|
1635
|
+
* @param skipRef Whether to skip using a reference.
|
|
1636
|
+
*
|
|
1637
|
+
* @returns The converted JSON Schema.
|
|
1638
|
+
*/
|
|
1598
1639
|
function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {
|
|
1599
1640
|
if (!skipRef) {
|
|
1600
1641
|
const referenceId = context.referenceMap.get(valibotSchema);
|
|
@@ -1613,10 +1654,20 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
|
|
|
1613
1654
|
}
|
|
1614
1655
|
}
|
|
1615
1656
|
if ("pipe" in valibotSchema) {
|
|
1616
|
-
|
|
1617
|
-
|
|
1657
|
+
const flatPipe = flattenPipe(valibotSchema.pipe);
|
|
1658
|
+
let startIndex = 0;
|
|
1659
|
+
let stopIndex = flatPipe.length - 1;
|
|
1660
|
+
if (config?.typeMode === "input") {
|
|
1661
|
+
const inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === "schema" || item.kind === "transformation" && (item.type === "find_item" || item.type === "parse_json" || item.type === "raw_transform" || item.type === "reduce_items" || item.type === "stringify_json" || item.type === "transform"));
|
|
1662
|
+
if (inputStopIndex !== -1) stopIndex = inputStopIndex;
|
|
1663
|
+
} else if (config?.typeMode === "output") {
|
|
1664
|
+
const outputStartIndex = flatPipe.findLastIndex((item) => item.kind === "schema");
|
|
1665
|
+
if (outputStartIndex !== -1) startIndex = outputStartIndex;
|
|
1666
|
+
}
|
|
1667
|
+
for (let index = startIndex; index <= stopIndex; index++) {
|
|
1668
|
+
const valibotPipeItem = flatPipe[index];
|
|
1618
1669
|
if (valibotPipeItem.kind === "schema") {
|
|
1619
|
-
if (index >
|
|
1670
|
+
if (index > startIndex) handleError("Set the \"typeMode\" config to \"input\" or \"output\" to convert pipelines with multiple schemas.", config);
|
|
1620
1671
|
jsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);
|
|
1621
1672
|
} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);
|
|
1622
1673
|
}
|
|
@@ -1735,7 +1786,7 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
|
|
|
1735
1786
|
const refOverride = config.overrideRef({
|
|
1736
1787
|
...context,
|
|
1737
1788
|
referenceId,
|
|
1738
|
-
valibotSchema,
|
|
1789
|
+
valibotSchema: wrappedValibotSchema,
|
|
1739
1790
|
jsonSchema
|
|
1740
1791
|
});
|
|
1741
1792
|
if (refOverride) jsonSchema.$ref = refOverride;
|
|
@@ -1757,6 +1808,25 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
|
|
|
1757
1808
|
if (errors) for (const message of errors) handleError(message, config);
|
|
1758
1809
|
return jsonSchema;
|
|
1759
1810
|
}
|
|
1811
|
+
let store;
|
|
1812
|
+
/**
|
|
1813
|
+
* Returns the current global schema definitions.
|
|
1814
|
+
*
|
|
1815
|
+
* @returns The schema definitions.
|
|
1816
|
+
*
|
|
1817
|
+
* @beta
|
|
1818
|
+
*/
|
|
1819
|
+
function getGlobalDefs() {
|
|
1820
|
+
return store;
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Converts a Valibot schema to the JSON Schema format.
|
|
1824
|
+
*
|
|
1825
|
+
* @param schema The Valibot schema object.
|
|
1826
|
+
* @param config The JSON Schema configuration.
|
|
1827
|
+
*
|
|
1828
|
+
* @returns The converted JSON Schema.
|
|
1829
|
+
*/
|
|
1760
1830
|
function toJsonSchema(schema, config) {
|
|
1761
1831
|
const context = {
|
|
1762
1832
|
definitions: {},
|
|
@@ -2426,7 +2496,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
|
|
|
2426
2496
|
}
|
|
2427
2497
|
|
|
2428
2498
|
//#endregion
|
|
2429
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2499
|
+
//#region ../../node_modules/.pnpm/remeda@2.22.5/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2430
2500
|
function u$1(o$1, n$1, a$2) {
|
|
2431
2501
|
let t$2 = (r$1) => o$1(r$1, ...n$1);
|
|
2432
2502
|
return a$2 === void 0 ? t$2 : Object.assign(t$2, {
|
|
@@ -2436,7 +2506,7 @@ function u$1(o$1, n$1, a$2) {
|
|
|
2436
2506
|
}
|
|
2437
2507
|
|
|
2438
2508
|
//#endregion
|
|
2439
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2509
|
+
//#region ../../node_modules/.pnpm/remeda@2.22.5/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2440
2510
|
function u(r$1, n$1, o$1) {
|
|
2441
2511
|
let a$2 = r$1.length - n$1.length;
|
|
2442
2512
|
if (a$2 === 0) return r$1(...n$1);
|
|
@@ -2445,7 +2515,7 @@ function u(r$1, n$1, o$1) {
|
|
|
2445
2515
|
}
|
|
2446
2516
|
|
|
2447
2517
|
//#endregion
|
|
2448
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2518
|
+
//#region ../../node_modules/.pnpm/remeda@2.22.5/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2449
2519
|
function d(...r$1) {
|
|
2450
2520
|
return u(i, r$1);
|
|
2451
2521
|
}
|
|
@@ -2456,7 +2526,7 @@ var i = (r$1, t$2) => {
|
|
|
2456
2526
|
};
|
|
2457
2527
|
|
|
2458
2528
|
//#endregion
|
|
2459
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2529
|
+
//#region ../../node_modules/.pnpm/remeda@2.22.5/node_modules/remeda/dist/chunk-5NQBDF4H.js
|
|
2460
2530
|
function t(...n$1) {
|
|
2461
2531
|
return u(Object.keys, n$1);
|
|
2462
2532
|
}
|