@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,3 +1,24 @@
|
|
|
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
|
+
|
|
21
|
+
//#endregion
|
|
1
22
|
//#region ../pluginutils/dist/utils.js
|
|
2
23
|
const postfixRE = /[?#].*$/;
|
|
3
24
|
function cleanUrl(url) {
|
|
@@ -144,52 +165,52 @@ function queries(queryFilter) {
|
|
|
144
165
|
return new Query(key, value);
|
|
145
166
|
}));
|
|
146
167
|
}
|
|
147
|
-
function interpreter(exprs, code
|
|
168
|
+
function interpreter(exprs, code, id, moduleType, importerId) {
|
|
148
169
|
let arr = [];
|
|
149
170
|
if (Array.isArray(exprs)) arr = exprs;
|
|
150
171
|
else arr = [exprs];
|
|
151
|
-
return interpreterImpl(arr, code
|
|
172
|
+
return interpreterImpl(arr, code, id, moduleType, importerId);
|
|
152
173
|
}
|
|
153
|
-
function interpreterImpl(expr, code
|
|
174
|
+
function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) {
|
|
154
175
|
let hasInclude = false;
|
|
155
176
|
for (const e of expr) switch (e.kind) {
|
|
156
177
|
case "include":
|
|
157
178
|
hasInclude = true;
|
|
158
|
-
if (exprInterpreter(e.expr, code
|
|
179
|
+
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return true;
|
|
159
180
|
break;
|
|
160
181
|
case "exclude":
|
|
161
|
-
if (exprInterpreter(e.expr, code
|
|
182
|
+
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return false;
|
|
162
183
|
break;
|
|
163
184
|
}
|
|
164
185
|
return !hasInclude;
|
|
165
186
|
}
|
|
166
|
-
function exprInterpreter(expr, code
|
|
187
|
+
function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
|
|
167
188
|
switch (expr.kind) {
|
|
168
|
-
case "and": return expr.args.every((e) => exprInterpreter(e, code
|
|
169
|
-
case "or": return expr.args.some((e) => exprInterpreter(e, code
|
|
170
|
-
case "not": return !exprInterpreter(expr.expr, code
|
|
189
|
+
case "and": return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
|
190
|
+
case "or": return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
|
191
|
+
case "not": return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx);
|
|
171
192
|
case "id": {
|
|
172
|
-
if (id
|
|
173
|
-
let idToMatch = id
|
|
193
|
+
if (id === void 0) throw new Error("`id` is required for `id` expression");
|
|
194
|
+
let idToMatch = id;
|
|
174
195
|
if (expr.params.cleanUrl) idToMatch = cleanUrl(idToMatch);
|
|
175
196
|
return typeof expr.pattern === "string" ? idToMatch === expr.pattern : expr.pattern.test(idToMatch);
|
|
176
197
|
}
|
|
177
198
|
case "importerId": {
|
|
178
|
-
if (importerId
|
|
179
|
-
let importerIdToMatch = importerId
|
|
199
|
+
if (importerId === void 0) return false;
|
|
200
|
+
let importerIdToMatch = importerId;
|
|
180
201
|
if (expr.params.cleanUrl) importerIdToMatch = cleanUrl(importerIdToMatch);
|
|
181
202
|
return typeof expr.pattern === "string" ? importerIdToMatch === expr.pattern : expr.pattern.test(importerIdToMatch);
|
|
182
203
|
}
|
|
183
204
|
case "moduleType":
|
|
184
|
-
if (moduleType
|
|
185
|
-
return moduleType
|
|
205
|
+
if (moduleType === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
|
|
206
|
+
return moduleType === expr.pattern;
|
|
186
207
|
case "code":
|
|
187
|
-
if (code
|
|
188
|
-
return typeof expr.pattern === "string" ? code
|
|
208
|
+
if (code === void 0) throw new Error("`code` is required for `code` expression");
|
|
209
|
+
return typeof expr.pattern === "string" ? code.includes(expr.pattern) : expr.pattern.test(code);
|
|
189
210
|
case "query": {
|
|
190
|
-
if (id
|
|
211
|
+
if (id === void 0) throw new Error("`id` is required for `Query` expression");
|
|
191
212
|
if (!ctx.urlSearchParamsCache) {
|
|
192
|
-
let queryString = extractQueryWithoutFragment(id
|
|
213
|
+
let queryString = extractQueryWithoutFragment(id);
|
|
193
214
|
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
|
|
194
215
|
}
|
|
195
216
|
let urlParams = ctx.urlSearchParamsCache;
|
|
@@ -203,4 +224,4 @@ function exprInterpreter(expr, code$1, id$1, moduleType$1, importerId$1, ctx = {
|
|
|
203
224
|
}
|
|
204
225
|
|
|
205
226
|
//#endregion
|
|
206
|
-
export { id as a, interpreter as c, not as d, or as f, exprInterpreter as i, interpreterImpl as l, query as m, code as n, importerId as o, queries as p, exclude as r, include as s, and as t, moduleType as u };
|
|
227
|
+
export { noop as _, id as a, unsupported as b, interpreter as c, not as d, or as f, isPromiseLike as g, arraify as h, exprInterpreter as i, interpreterImpl as l, query as m, code as n, importerId as o, queries as p, exclude as r, include as s, and as t, moduleType as u, unimplemented as v, unreachable as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { S as BindingViteWasmHelperPluginConfig, _ as BindingViteModulePreloadPolyfillPluginConfig, b as BindingViteResolvePluginConfig, f as BindingViteBuildImportAnalysisPluginConfig, h as BindingViteJsonPluginConfig, i as BindingEsmExternalRequirePluginConfig, m as BindingViteImportGlobPluginConfig, o as BindingIsolatedDeclarationPluginConfig, p as BindingViteDynamicImportVarsPluginConfig, v as BindingViteReactRefreshWrapperPluginConfig, y as BindingViteReporterPluginConfig } from "./binding-CAB1xlCZ.mjs";
|
|
2
|
+
import { s as StringOrRegExp, t as BuiltinPlugin } from "./utils-0UHbNgk4.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/constructors.d.ts
|
|
5
5
|
declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
@@ -24,7 +24,5 @@ type ViteReactRefreshWrapperPluginConfig = Omit<BindingViteReactRefreshWrapperPl
|
|
|
24
24
|
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
25
25
|
};
|
|
26
26
|
declare function viteReactRefreshWrapperPlugin(config: ViteReactRefreshWrapperPluginConfig): BuiltinPlugin;
|
|
27
|
-
declare function viteHtmlInlineProxyPlugin(config: BindingViteHtmlInlineProxyPluginConfig): BuiltinPlugin;
|
|
28
|
-
declare function viteAssetImportMetaUrlPlugin(config: BindingViteAssetImportMetaUrlPluginConfig): BuiltinPlugin;
|
|
29
27
|
//#endregion
|
|
30
|
-
export {
|
|
28
|
+
export { viteImportGlobPlugin as a, viteModulePreloadPolyfillPlugin as c, viteResolvePlugin as d, viteWasmFallbackPlugin as f, viteDynamicImportVarsPlugin as i, viteReactRefreshWrapperPlugin as l, viteWebWorkerPostPlugin as m, isolatedDeclarationPlugin as n, viteJsonPlugin as o, viteWasmHelperPlugin as p, viteBuildImportAnalysisPlugin as r, viteLoadFallbackPlugin as s, esmExternalRequirePlugin as t, viteReporterPlugin as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Bn5eoSii.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/builtin-plugin/constructors.ts
|
|
4
4
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
@@ -56,12 +56,6 @@ function viteReactRefreshWrapperPlugin(config) {
|
|
|
56
56
|
}
|
|
57
57
|
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
|
|
58
58
|
}
|
|
59
|
-
function viteHtmlInlineProxyPlugin(config) {
|
|
60
|
-
return new BuiltinPlugin("builtin:vite-html-inline-proxy", config);
|
|
61
|
-
}
|
|
62
|
-
function viteAssetImportMetaUrlPlugin(config) {
|
|
63
|
-
return new BuiltinPlugin("builtin:vite-asset-import-meta-url", config);
|
|
64
|
-
}
|
|
65
59
|
|
|
66
60
|
//#endregion
|
|
67
|
-
export {
|
|
61
|
+
export { viteImportGlobPlugin as a, viteModulePreloadPolyfillPlugin as c, viteResolvePlugin as d, viteWasmFallbackPlugin as f, viteDynamicImportVarsPlugin as i, viteReactRefreshWrapperPlugin as l, viteWebWorkerPostPlugin as m, isolatedDeclarationPlugin as n, viteJsonPlugin as o, viteWasmHelperPlugin as p, viteBuildImportAnalysisPlugin as r, viteLoadFallbackPlugin as s, esmExternalRequirePlugin as t, viteReporterPlugin as u };
|