@rollipop/rolldown 1.0.0-rc.2 → 1.0.0-rc.4
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/bin/cli.mjs +0 -1
- package/dist/cli.mjs +28 -1008
- package/dist/config.d.mts +10 -5
- package/dist/config.mjs +10 -14
- package/dist/experimental-index.d.mts +86 -14
- package/dist/experimental-index.mjs +77 -22
- package/dist/experimental-runtime-types.d.ts +0 -5
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +25 -8
- package/dist/get-log-filter.d.mts +3 -7
- package/dist/get-log-filter.mjs +23 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +10 -12
- package/dist/parallel-plugin-worker.mjs +7 -8
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parallel-plugin.mjs +1 -2
- package/dist/parse-ast-index.d.mts +26 -2
- package/dist/parse-ast-index.mjs +61 -4
- package/dist/plugins-index.d.mts +8 -5
- package/dist/plugins-index.mjs +9 -8
- package/dist/shared/{binding-Bo6UcGYl.d.mts → binding-BohGL_65.d.mts} +310 -120
- package/dist/shared/{binding-9QXxzPo6.mjs → binding-BuW0Fhs2.mjs} +39 -42
- package/dist/shared/{bindingify-input-options-C--dZCPv.mjs → bindingify-input-options-o_7NioSs.mjs} +77 -161
- package/dist/shared/{constructors-B64fS2o1.d.mts → constructors-Dg8A45sy.d.mts} +9 -4
- package/dist/shared/{constructors-DsYXT8FB.mjs → constructors-FqGyV5fj.mjs} +8 -7
- package/dist/shared/{define-config-DT_Hpxdr.d.mts → define-config-BvszQ-i2.d.mts} +212 -71
- package/dist/shared/{define-config-BVG4QvnP.mjs → define-config-DJOr6Iwt.mjs} +1 -2
- package/dist/shared/error-BjNWBTlf.mjs +85 -0
- package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
- package/dist/shared/{load-config-TBowPn4n.mjs → load-config-2dmAH96P.mjs} +11 -5
- package/dist/shared/{logs-NH298mHo.mjs → logs-D80CXhvg.mjs} +6 -9
- package/dist/shared/{misc-CCZIsXVO.mjs → misc-DJYbNKZX.mjs} +1 -2
- package/dist/shared/{normalize-string-or-regex-CaBvmZZK.mjs → normalize-string-or-regex-BU5HSJy4.mjs} +3 -6
- package/dist/shared/parse-Bt4kI3ey.mjs +74 -0
- package/dist/shared/{prompt-CI-U8Lh4.mjs → prompt-BYQIwEjg.mjs} +1 -3
- package/dist/shared/{rolldown-5hTSdYMy.mjs → rolldown-B4lV-glW.mjs} +2 -4
- package/dist/shared/rolldown-build-tLuGZc7p.mjs +3318 -0
- package/dist/shared/transform-BoJxrM-e.d.mts +132 -0
- package/dist/shared/transform-Cbhgjik0.mjs +90 -0
- package/dist/shared/{watch-CkctCkiN.mjs → watch-hs9ntURJ.mjs} +71 -76
- package/dist/utils-index.d.mts +376 -0
- package/dist/utils-index.mjs +2417 -0
- package/package.json +18 -17
- package/dist/cli-setup.d.mts +0 -1
- package/dist/cli-setup.mjs +0 -17
- package/dist/shared/parse-ast-index-BQ9Myuc2.mjs +0 -99
- package/dist/shared/rolldown-build-B7oitB1K.mjs +0 -2374
- /package/dist/shared/{logging-CE90D8JR.d.mts → logging-C6h4g8dA.d.mts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rollipop/rolldown",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundler",
|
|
@@ -45,15 +45,16 @@
|
|
|
45
45
|
"./parallelPlugin": "./dist/parallel-plugin.mjs",
|
|
46
46
|
"./parseAst": "./dist/parse-ast-index.mjs",
|
|
47
47
|
"./package.json": "./package.json",
|
|
48
|
-
"./plugins": "./dist/plugins-index.mjs"
|
|
48
|
+
"./plugins": "./dist/plugins-index.mjs",
|
|
49
|
+
"./utils": "./dist/utils-index.mjs"
|
|
49
50
|
},
|
|
50
51
|
"publishConfig": {
|
|
51
52
|
"access": "public",
|
|
52
53
|
"registry": "https://registry.npmjs.org/"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@oxc-project/types": "=0.
|
|
56
|
-
"@rollipop/rolldown-pluginutils": "1.0.0-rc.
|
|
56
|
+
"@oxc-project/types": "=0.115.0",
|
|
57
|
+
"@rollipop/rolldown-pluginutils": "1.0.0-rc.4"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@napi-rs/cli": "^3.4.1",
|
|
@@ -64,21 +65,21 @@
|
|
|
64
65
|
"consola": "^3.4.2",
|
|
65
66
|
"execa": "^9.2.0",
|
|
66
67
|
"glob": "^13.0.0",
|
|
67
|
-
"oxc-parser": "=0.
|
|
68
|
+
"oxc-parser": "=0.115.0",
|
|
68
69
|
"pathe": "^2.0.3",
|
|
69
70
|
"remeda": "^2.10.0",
|
|
70
|
-
"rolldown": "1.0.0-rc.
|
|
71
|
-
"rolldown-plugin-dts": "^0.
|
|
71
|
+
"rolldown": "1.0.0-rc.6",
|
|
72
|
+
"rolldown-plugin-dts": "^0.22.0",
|
|
72
73
|
"rollup": "^4.18.0",
|
|
73
74
|
"signal-exit": "4.1.0",
|
|
74
75
|
"source-map": "0.7.6",
|
|
75
76
|
"typescript": "^5.8.3",
|
|
76
77
|
"valibot": "1.2.0",
|
|
77
|
-
"@rollipop/rolldown": "1.0.0-rc.
|
|
78
|
+
"@rollipop/rolldown": "1.0.0-rc.4"
|
|
78
79
|
},
|
|
79
80
|
"napi": {
|
|
80
81
|
"binaryName": "rolldown-binding",
|
|
81
|
-
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\
|
|
82
|
+
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\nexport type BindingResult<T> = { errors: BindingError[], isBindingErrors: boolean } | T\n\n",
|
|
82
83
|
"packageName": "@rollipop/rolldown-binding",
|
|
83
84
|
"targets": [
|
|
84
85
|
"x86_64-apple-darwin",
|
|
@@ -95,14 +96,14 @@
|
|
|
95
96
|
"node": "^20.19.0 || >=22.12.0"
|
|
96
97
|
},
|
|
97
98
|
"optionalDependencies": {
|
|
98
|
-
"@rollipop/rolldown-binding-darwin-x64": "1.0.0-rc.
|
|
99
|
-
"@rollipop/rolldown-binding-win32-x64-msvc": "1.0.0-rc.
|
|
100
|
-
"@rollipop/rolldown-binding-linux-x64-gnu": "1.0.0-rc.
|
|
101
|
-
"@rollipop/rolldown-binding-linux-x64-musl": "1.0.0-rc.
|
|
102
|
-
"@rollipop/rolldown-binding-linux-arm64-gnu": "1.0.0-rc.
|
|
103
|
-
"@rollipop/rolldown-binding-darwin-arm64": "1.0.0-rc.
|
|
104
|
-
"@rollipop/rolldown-binding-linux-arm64-musl": "1.0.0-rc.
|
|
105
|
-
"@rollipop/rolldown-binding-win32-arm64-msvc": "1.0.0-rc.
|
|
99
|
+
"@rollipop/rolldown-binding-darwin-x64": "1.0.0-rc.4",
|
|
100
|
+
"@rollipop/rolldown-binding-win32-x64-msvc": "1.0.0-rc.4",
|
|
101
|
+
"@rollipop/rolldown-binding-linux-x64-gnu": "1.0.0-rc.4",
|
|
102
|
+
"@rollipop/rolldown-binding-linux-x64-musl": "1.0.0-rc.4",
|
|
103
|
+
"@rollipop/rolldown-binding-linux-arm64-gnu": "1.0.0-rc.4",
|
|
104
|
+
"@rollipop/rolldown-binding-darwin-arm64": "1.0.0-rc.4",
|
|
105
|
+
"@rollipop/rolldown-binding-linux-arm64-musl": "1.0.0-rc.4",
|
|
106
|
+
"@rollipop/rolldown-binding-win32-arm64-msvc": "1.0.0-rc.4"
|
|
106
107
|
},
|
|
107
108
|
"scripts": {
|
|
108
109
|
"# Scrips for binding #": "_",
|
package/dist/cli-setup.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/cli-setup.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-9QXxzPo6.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/cli/setup-index.ts
|
|
4
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
|
-
let isWatchMode = false;
|
|
6
|
-
for (let i = 0; i < process.argv.length; i++) {
|
|
7
|
-
const arg = process.argv[i];
|
|
8
|
-
if (arg === "--watch" || arg === "-w") {
|
|
9
|
-
isWatchMode = true;
|
|
10
|
-
break;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (isWatchMode) (0, import_binding.createTokioRuntime)(32);
|
|
14
|
-
else (0, import_binding.createTokioRuntime)(4);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-9QXxzPo6.mjs";
|
|
2
|
-
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-NH298mHo.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.111.0/node_modules/oxc-parser/src-js/wrap.js
|
|
5
|
-
function wrap$1(result) {
|
|
6
|
-
let program, module, comments, errors;
|
|
7
|
-
return {
|
|
8
|
-
get program() {
|
|
9
|
-
if (!program) program = jsonParseAst(result.program);
|
|
10
|
-
return program;
|
|
11
|
-
},
|
|
12
|
-
get module() {
|
|
13
|
-
if (!module) module = result.module;
|
|
14
|
-
return module;
|
|
15
|
-
},
|
|
16
|
-
get comments() {
|
|
17
|
-
if (!comments) comments = result.comments;
|
|
18
|
-
return comments;
|
|
19
|
-
},
|
|
20
|
-
get errors() {
|
|
21
|
-
if (!errors) errors = result.errors;
|
|
22
|
-
return errors;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function jsonParseAst(programJson) {
|
|
27
|
-
const { node: program, fixes } = JSON.parse(programJson);
|
|
28
|
-
for (const fixPath of fixes) applyFix(program, fixPath);
|
|
29
|
-
return program;
|
|
30
|
-
}
|
|
31
|
-
function applyFix(program, fixPath) {
|
|
32
|
-
let node = program;
|
|
33
|
-
for (const key of fixPath) node = node[key];
|
|
34
|
-
if (node.bigint) node.value = BigInt(node.bigint);
|
|
35
|
-
else try {
|
|
36
|
-
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
37
|
-
} catch {}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/utils/parse.ts
|
|
42
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
43
|
-
/**
|
|
44
|
-
* Parse asynchronously.
|
|
45
|
-
*
|
|
46
|
-
* Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
|
|
47
|
-
*/
|
|
48
|
-
async function parse(filename, sourceText, options) {
|
|
49
|
-
return wrap$1(await (0, import_binding.parse)(filename, sourceText, options));
|
|
50
|
-
}
|
|
51
|
-
/** Parse synchronously. */
|
|
52
|
-
function parseSync(filename, sourceText, options) {
|
|
53
|
-
return wrap$1((0, import_binding.parseSync)(filename, sourceText, options));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/parse-ast-index.ts
|
|
58
|
-
function wrap(result, filename, sourceText) {
|
|
59
|
-
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
|
|
60
|
-
return result.program;
|
|
61
|
-
}
|
|
62
|
-
function normalizeParseError(filename, sourceText, errors) {
|
|
63
|
-
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
64
|
-
const pos = errors[0]?.labels?.[0]?.start;
|
|
65
|
-
for (let i = 0; i < errors.length; i++) {
|
|
66
|
-
if (i >= 5) {
|
|
67
|
-
message += "\n...";
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
const e = errors[i];
|
|
71
|
-
message += e.message + "\n" + e.labels.map((label) => {
|
|
72
|
-
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
73
|
-
if (!location) return;
|
|
74
|
-
return getCodeFrame(sourceText, location.line, location.column);
|
|
75
|
-
}).filter(Boolean).join("\n");
|
|
76
|
-
}
|
|
77
|
-
const log = logParseError(message, filename, pos);
|
|
78
|
-
if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
|
|
79
|
-
return error(log);
|
|
80
|
-
}
|
|
81
|
-
const defaultParserOptions = {
|
|
82
|
-
lang: "js",
|
|
83
|
-
preserveParens: false
|
|
84
|
-
};
|
|
85
|
-
function parseAst(sourceText, options, filename) {
|
|
86
|
-
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
87
|
-
...defaultParserOptions,
|
|
88
|
-
...options
|
|
89
|
-
}), filename, sourceText);
|
|
90
|
-
}
|
|
91
|
-
async function parseAstAsync(sourceText, options, filename) {
|
|
92
|
-
return wrap(await parse(filename ?? "file.js", sourceText, {
|
|
93
|
-
...defaultParserOptions,
|
|
94
|
-
...options
|
|
95
|
-
}), filename, sourceText);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
//#endregion
|
|
99
|
-
export { parseSync as i, parseAstAsync as n, parse as r, parseAst as t };
|