@rolldown/browser 1.0.0-beta.9-commit.8371a90 → 1.0.0-beta.9-commit.273d50e
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 +2 -2
- package/dist/cli.mjs +44 -55
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +4 -5
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +1 -1
- package/dist/experimental-index.d.cts +1 -1
- package/dist/experimental-index.d.mts +1 -1
- package/dist/experimental-index.mjs +3 -4
- package/dist/filter-index.d.cts +1 -1
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -6
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/parallel-plugin-worker.cjs +1 -1
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.cts +1 -1
- package/dist/parallel-plugin.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasi-browser.js +1 -0
- package/dist/rolldown-binding.wasi.cjs +1 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{define-config.d-Sf3K9yNa.d.mts → define-config.d-GTTTro2-.d.mts} +4 -14
- package/dist/shared/{define-config.d-D11P5huJ.d.cts → define-config.d-gqmzo185.d.cts} +4 -14
- package/dist/shared/dist-DRt7s0oH.mjs +147 -0
- package/dist/shared/{load-config--4dZSqAQ.mjs → load-config-gIb0d07e.mjs} +1 -1
- package/dist/shared/{load-config-CT3T7nfY.cjs → load-config-xy-ScCWb.cjs} +1 -1
- package/dist/shared/{parse-ast-index-vu376yZ1.mjs → parse-ast-index-Bx70S80g.mjs} +3 -13
- package/dist/shared/{src-CXLmg0t5.mjs → src-CA0na5_d.mjs} +185 -579
- package/dist/shared/{src-HTcyNJiS.cjs → src-j8qvGwKp.cjs} +21 -40
- package/dist/{src-CB1SRiRS.js → src-D3kPdsBX.js} +22 -41
- package/package.json +1 -1
- package/dist/shared/dist-CAn6dxW6.mjs +0 -153
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
//#region src/utils/misc.ts
|
|
2
|
+
function arraify(value) {
|
|
3
|
+
return Array.isArray(value) ? value : [value];
|
|
4
|
+
}
|
|
5
|
+
function isNullish(value) {
|
|
6
|
+
return value === null || value === void 0;
|
|
7
|
+
}
|
|
8
|
+
function isPromiseLike(value) {
|
|
9
|
+
return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
10
|
+
}
|
|
11
|
+
function unimplemented(info) {
|
|
12
|
+
if (info) throw new Error(`unimplemented: ${info}`);
|
|
13
|
+
throw new Error("unimplemented");
|
|
14
|
+
}
|
|
15
|
+
function unreachable(info) {
|
|
16
|
+
if (info) throw new Error(`unreachable: ${info}`);
|
|
17
|
+
throw new Error("unreachable");
|
|
18
|
+
}
|
|
19
|
+
function unsupported(info) {
|
|
20
|
+
throw new Error(`UNSUPPORTED: ${info}`);
|
|
21
|
+
}
|
|
22
|
+
function noop(..._args) {}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../pluginutils/dist/index.js
|
|
26
|
+
var And = class {
|
|
27
|
+
kind;
|
|
28
|
+
args;
|
|
29
|
+
constructor(...args) {
|
|
30
|
+
if (args.length === 0) throw new Error("`And` expects at least one operand");
|
|
31
|
+
this.args = args;
|
|
32
|
+
this.kind = "and";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var Or = class {
|
|
36
|
+
kind;
|
|
37
|
+
args;
|
|
38
|
+
constructor(...args) {
|
|
39
|
+
if (args.length === 0) throw new Error("`Or` expects at least one operand");
|
|
40
|
+
this.args = args;
|
|
41
|
+
this.kind = "or";
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var Not = class {
|
|
45
|
+
kind;
|
|
46
|
+
expr;
|
|
47
|
+
constructor(expr) {
|
|
48
|
+
this.expr = expr;
|
|
49
|
+
this.kind = "not";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var Id = class {
|
|
53
|
+
kind;
|
|
54
|
+
pattern;
|
|
55
|
+
params;
|
|
56
|
+
constructor(pattern, params) {
|
|
57
|
+
this.pattern = pattern;
|
|
58
|
+
this.kind = "id";
|
|
59
|
+
this.params = params ?? { cleanUrl: false };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var ModuleType = class {
|
|
63
|
+
kind;
|
|
64
|
+
pattern;
|
|
65
|
+
constructor(pattern) {
|
|
66
|
+
this.pattern = pattern;
|
|
67
|
+
this.kind = "moduleType";
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var Code = class {
|
|
71
|
+
kind;
|
|
72
|
+
pattern;
|
|
73
|
+
constructor(expr) {
|
|
74
|
+
this.pattern = expr;
|
|
75
|
+
this.kind = "code";
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var Query = class {
|
|
79
|
+
kind;
|
|
80
|
+
key;
|
|
81
|
+
pattern;
|
|
82
|
+
constructor(key, pattern) {
|
|
83
|
+
this.pattern = pattern;
|
|
84
|
+
this.key = key;
|
|
85
|
+
this.kind = "query";
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var Include = class {
|
|
89
|
+
kind;
|
|
90
|
+
expr;
|
|
91
|
+
constructor(expr) {
|
|
92
|
+
this.expr = expr;
|
|
93
|
+
this.kind = "include";
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var Exclude = class {
|
|
97
|
+
kind;
|
|
98
|
+
expr;
|
|
99
|
+
constructor(expr) {
|
|
100
|
+
this.expr = expr;
|
|
101
|
+
this.kind = "exclude";
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
function and(...args) {
|
|
105
|
+
return new And(...args);
|
|
106
|
+
}
|
|
107
|
+
function or(...args) {
|
|
108
|
+
return new Or(...args);
|
|
109
|
+
}
|
|
110
|
+
function not(expr) {
|
|
111
|
+
return new Not(expr);
|
|
112
|
+
}
|
|
113
|
+
function id(pattern, params) {
|
|
114
|
+
return new Id(pattern, params);
|
|
115
|
+
}
|
|
116
|
+
function moduleType(pattern) {
|
|
117
|
+
return new ModuleType(pattern);
|
|
118
|
+
}
|
|
119
|
+
function code(pattern) {
|
|
120
|
+
return new Code(pattern);
|
|
121
|
+
}
|
|
122
|
+
function query(key, pattern) {
|
|
123
|
+
return new Query(key, pattern);
|
|
124
|
+
}
|
|
125
|
+
function include(expr) {
|
|
126
|
+
return new Include(expr);
|
|
127
|
+
}
|
|
128
|
+
function exclude(expr) {
|
|
129
|
+
return new Exclude(expr);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* convert a queryObject to FilterExpression like
|
|
133
|
+
* ```js
|
|
134
|
+
* and(query(k1, v1), query(k2, v2))
|
|
135
|
+
* ```
|
|
136
|
+
* @param queryFilterObject The query filter object needs to be matched.
|
|
137
|
+
* @returns a `And` FilterExpression
|
|
138
|
+
*/
|
|
139
|
+
function queries(queryFilter) {
|
|
140
|
+
let arr = Object.entries(queryFilter).map(([key, value]) => {
|
|
141
|
+
return new Query(key, value);
|
|
142
|
+
});
|
|
143
|
+
return and(...arr);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
//#endregion
|
|
147
|
+
export { and as and$1, arraify, code as code$1, exclude as exclude$1, id as id$1, include as include$1, isNullish, isPromiseLike, moduleType as moduleType$1, noop, not as not$1, or as or$1, queries as queries$1, query as query$1, unimplemented, unreachable, unsupported };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __esm } from "./chunk-DSsiIF1Z.mjs";
|
|
2
|
-
import { init_rolldown, rolldown } from "./src-
|
|
2
|
+
import { init_rolldown, rolldown } from "./src-CA0na5_d.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { cwd } from "node:process";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
|
-
const require_src = require('./src-
|
|
2
|
+
const require_src = require('./src-j8qvGwKp.cjs');
|
|
3
3
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
4
4
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
@@ -10,6 +10,9 @@ function spaces(index) {
|
|
|
10
10
|
function tabsToSpaces(value) {
|
|
11
11
|
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
12
12
|
}
|
|
13
|
+
const LINE_TRUNCATE_LENGTH = 120;
|
|
14
|
+
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
15
|
+
const ELLIPSIS = "...";
|
|
13
16
|
function getCodeFrame(source, line, column) {
|
|
14
17
|
let lines = source.split("\n");
|
|
15
18
|
if (line > lines.length) return "";
|
|
@@ -35,12 +38,6 @@ function getCodeFrame(source, line, column) {
|
|
|
35
38
|
return `${lineNumber}: ${displayedLine}`;
|
|
36
39
|
}).join("\n");
|
|
37
40
|
}
|
|
38
|
-
var LINE_TRUNCATE_LENGTH, MIN_CHARACTERS_SHOWN_AFTER_LOCATION, ELLIPSIS;
|
|
39
|
-
var init_code_frame = __esm({ "src/utils/code-frame.ts"() {
|
|
40
|
-
LINE_TRUNCATE_LENGTH = 120;
|
|
41
|
-
MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
42
|
-
ELLIPSIS = "...";
|
|
43
|
-
} });
|
|
44
41
|
|
|
45
42
|
//#endregion
|
|
46
43
|
//#region src/log/locate-character/index.js
|
|
@@ -102,7 +99,6 @@ function getLocator(source, options = {}) {
|
|
|
102
99
|
function locate(source, search, options) {
|
|
103
100
|
return getLocator(source, options)(search, options && options.startIndex);
|
|
104
101
|
}
|
|
105
|
-
var init_locate_character = __esm({ "src/log/locate-character/index.js"() {} });
|
|
106
102
|
|
|
107
103
|
//#endregion
|
|
108
104
|
//#region src/log/logs.ts
|
|
@@ -184,8 +180,6 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
184
180
|
}
|
|
185
181
|
var INVALID_LOG_POSITION, PLUGIN_ERROR, INPUT_HOOK_IN_OUTPUT_PLUGIN, CYCLE_LOADING, MULTIPLY_NOTIFY_OPTION, PARSE_ERROR;
|
|
186
182
|
var init_logs = __esm({ "src/log/logs.ts"() {
|
|
187
|
-
init_code_frame();
|
|
188
|
-
init_locate_character();
|
|
189
183
|
INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR";
|
|
190
184
|
} });
|
|
191
185
|
|
|
@@ -225,7 +219,6 @@ function applyFix(program, fixPath) {
|
|
|
225
219
|
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
226
220
|
} catch (_err) {}
|
|
227
221
|
}
|
|
228
|
-
var init_wrap = __esm({ "../../node_modules/.pnpm/oxc-parser@0.72.0/node_modules/oxc-parser/wrap.mjs"() {} });
|
|
229
222
|
|
|
230
223
|
//#endregion
|
|
231
224
|
//#region src/parse-ast-index.ts
|
|
@@ -264,10 +257,7 @@ async function parseAstAsync(sourceText, options, filename) {
|
|
|
264
257
|
}
|
|
265
258
|
var defaultParserOptions;
|
|
266
259
|
var init_parse_ast_index = __esm({ "src/parse-ast-index.ts"() {
|
|
267
|
-
init_locate_character();
|
|
268
260
|
init_logs();
|
|
269
|
-
init_code_frame();
|
|
270
|
-
init_wrap();
|
|
271
261
|
defaultParserOptions = {
|
|
272
262
|
lang: "js",
|
|
273
263
|
preserveParens: false
|