@rolldown/browser 1.0.0-beta.59 → 1.0.0-beta.60
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.mjs +32 -32
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +7 -7
- package/dist/{constructors-c0HHH7Qq.js → constructors-CPMzz58l.js} +2 -8
- package/dist/experimental-index.browser.mjs +4 -37
- package/dist/experimental-index.d.mts +5 -63
- package/dist/experimental-index.mjs +6 -39
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -2
- package/dist/get-log-filter.d.mts +1 -1
- package/dist/index.browser.mjs +6 -6
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/normalize-string-or-regex-DcX5TPjK.js +247 -0
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/rolldown-binding.wasi-browser.js +0 -1
- package/dist/rolldown-binding.wasi.cjs +0 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-Bfw5c2c3.js → rolldown-build-Zb6e1FlF.js} +657 -78
- package/dist/shared/{binding-MAEzB4KA.d.mts → binding-CAB1xlCZ.d.mts} +58 -134
- package/dist/shared/{bindingify-input-options-BTd8uAdf.mjs → bindingify-input-options-C4xVxTKf.mjs} +600 -50
- package/dist/shared/{composable-filters-C5qA4jo-.mjs → composable-filters-DmVadxLf.mjs} +41 -20
- package/dist/shared/{constructors-CQP6o3cR.d.mts → constructors-D_KDVVwY.d.mts} +3 -5
- package/dist/shared/{constructors-C8tBnLHP.mjs → constructors-KqJrL3Ok.mjs} +2 -8
- package/dist/shared/{define-config-CpZLzJD0.d.mts → define-config-CUEbSpq4.d.mts} +954 -408
- package/dist/shared/{load-config-cKGxDu4K.mjs → load-config-DN8SQL2o.mjs} +1 -1
- package/dist/shared/{logging-B4x9qar8.d.mts → logging-DGAQcdLz.d.mts} +4 -0
- package/dist/shared/{logs-DEfpOy5A.mjs → logs-cXucB9vK.mjs} +8 -8
- package/dist/shared/normalize-string-or-regex-Bn5eoSii.mjs +60 -0
- package/dist/shared/{parse-ast-index-BLdgtc2B.mjs → parse-ast-index-B54CTqgh.mjs} +2 -2
- package/dist/shared/{prompt-CNt8OM9C.mjs → prompt-D80rO-gq.mjs} +220 -220
- package/dist/shared/{rolldown-8m9pjMU2.mjs → rolldown-BhEWsQWt.mjs} +1 -1
- package/dist/shared/{rolldown-build-DKF_S8hw.mjs → rolldown-build-PEQvqPGC.mjs} +46 -35
- package/dist/shared/{utils-BGxZdOXA.d.mts → utils-0UHbNgk4.d.mts} +2 -11
- package/dist/shared/{watch-BEzOq0zm.mjs → watch-avpeg13R.mjs} +11 -12
- package/package.json +1 -1
- package/dist/normalize-string-or-regex-BB1FWNyl.js +0 -872
- package/dist/shared/misc-BubmxcE3.mjs +0 -22
- package/dist/shared/normalize-string-or-regex-DJ5EwPtg.mjs +0 -669
- /package/dist/shared/{define-config-BF4P-Pum.mjs → define-config-DrUTwApf.mjs} +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
//#region src/log/logging.d.ts
|
|
2
|
+
/** @inline */
|
|
2
3
|
type LogLevel = "info" | "debug" | "warn";
|
|
4
|
+
/** @inline */
|
|
3
5
|
type LogLevelOption = LogLevel | "silent";
|
|
6
|
+
/** @inline */
|
|
4
7
|
type LogLevelWithError = LogLevel | "error";
|
|
5
8
|
interface RollupLog {
|
|
6
9
|
binding?: string;
|
|
@@ -26,6 +29,7 @@ interface RollupLog {
|
|
|
26
29
|
stack?: string;
|
|
27
30
|
url?: string;
|
|
28
31
|
}
|
|
32
|
+
/** @inline */
|
|
29
33
|
type RollupLogWithString = RollupLog | string;
|
|
30
34
|
/** @category Plugin APIs */
|
|
31
35
|
interface RollupError extends RollupLog {
|
|
@@ -132,16 +132,16 @@ function logMultiplyNotifyOption() {
|
|
|
132
132
|
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function logPluginError(error
|
|
135
|
+
function logPluginError(error, plugin, { hook, id } = {}) {
|
|
136
136
|
try {
|
|
137
|
-
const code = error
|
|
138
|
-
if (!error
|
|
139
|
-
error
|
|
140
|
-
error
|
|
141
|
-
if (hook) error
|
|
142
|
-
if (id) error
|
|
137
|
+
const code = error.code;
|
|
138
|
+
if (!error.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error.pluginCode = code;
|
|
139
|
+
error.code = PLUGIN_ERROR;
|
|
140
|
+
error.plugin = plugin;
|
|
141
|
+
if (hook) error.hook = hook;
|
|
142
|
+
if (id) error.id = id;
|
|
143
143
|
} catch (_) {} finally {
|
|
144
|
-
return error
|
|
144
|
+
return error;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
function error(base) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { c as logPluginError, n as error } from "./logs-cXucB9vK.mjs";
|
|
2
|
+
import { BindingCallableBuiltinPlugin } from "../rolldown-binding.wasi.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/builtin-plugin/utils.ts
|
|
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 BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
15
|
+
const wrappedPlugin = plugin;
|
|
16
|
+
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args) {
|
|
17
|
+
try {
|
|
18
|
+
return await callablePlugin[key](...args);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
|
|
21
|
+
return error(logPluginError(e, plugin.name, {
|
|
22
|
+
hook: key,
|
|
23
|
+
id: key === "transform" ? args[2] : void 0
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return wrappedPlugin;
|
|
28
|
+
}
|
|
29
|
+
function bindingifyBuiltInPlugin(plugin) {
|
|
30
|
+
return {
|
|
31
|
+
__name: plugin.name,
|
|
32
|
+
options: plugin._options
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function bindingifyManifestPlugin(plugin, pluginContextData) {
|
|
36
|
+
const { isOutputOptionsForLegacyChunks, ...options } = plugin._options;
|
|
37
|
+
return {
|
|
38
|
+
__name: plugin.name,
|
|
39
|
+
options: {
|
|
40
|
+
...options,
|
|
41
|
+
isLegacy: isOutputOptionsForLegacyChunks ? (opts) => {
|
|
42
|
+
return isOutputOptionsForLegacyChunks(pluginContextData.getOutputOptions(opts));
|
|
43
|
+
} : void 0
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
50
|
+
function normalizedStringOrRegex(pattern) {
|
|
51
|
+
if (!pattern) return;
|
|
52
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
53
|
+
return pattern;
|
|
54
|
+
}
|
|
55
|
+
function isReadonlyArray(input) {
|
|
56
|
+
return Array.isArray(input);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { makeBuiltinPluginCallable as a, bindingifyManifestPlugin as i, BuiltinPlugin as n, bindingifyBuiltInPlugin as r, normalizedStringOrRegex as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-
|
|
1
|
+
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-cXucB9vK.mjs";
|
|
2
2
|
import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
|
|
3
3
|
|
|
4
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
4
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.108.0/node_modules/oxc-parser/src-js/wrap.js
|
|
5
5
|
function wrap$1(result) {
|
|
6
6
|
let program, module, comments, errors;
|
|
7
7
|
return {
|