@rolldown/browser 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/dist/cli.mjs +11 -990
- package/dist/config.d.mts +1 -4
- package/dist/config.mjs +8 -11
- package/dist/{constructors-B8gqcrFr.js → constructors-D2wC6vT5.js} +2 -5
- package/dist/error-DfXdOVMF.js +158 -0
- package/dist/experimental-index.browser.mjs +61 -5
- package/dist/experimental-index.d.mts +74 -16
- package/dist/experimental-index.mjs +63 -7
- package/dist/filter-index.d.mts +1 -1
- package/dist/get-log-filter.d.mts +1 -1
- package/dist/get-log-filter.mjs +1 -2
- package/dist/index.browser.mjs +4 -3
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +9 -8
- package/dist/{normalize-string-or-regex-CL-PJZI7.js → normalize-string-or-regex-B0X1hEA4.js} +1 -1
- package/dist/parallel-plugin-worker.mjs +4 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +44 -1
- package/dist/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +2 -2
- package/dist/plugins-index.mjs +2 -2
- package/dist/rolldown-binding.wasi-browser.js +6 -0
- package/dist/rolldown-binding.wasi.cjs +6 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-BntP6Bjl.js → rolldown-build-gXO5p6r0.js} +507 -161
- package/dist/shared/{bindingify-input-options-CObJx_Uj.mjs → bindingify-input-options-B32m-wO8.mjs} +40 -97
- package/dist/shared/{constructors-5bt5oBhE.d.mts → constructors-CtryxP-m.d.mts} +3 -4
- package/dist/shared/{constructors-BTW-c3jX.mjs → constructors-f9W8MQZ_.mjs} +2 -5
- package/dist/shared/{define-config-C-sO_cLw.d.mts → define-config-MImu5XA0.d.mts} +63 -26
- package/dist/shared/error-DTJQ7tjB.mjs +89 -0
- package/dist/shared/{load-config-hx3WBhLe.mjs → load-config-nINjF42i.mjs} +2 -2
- package/dist/shared/{logs-B2CASPcx.mjs → logs-CCc_0vhs.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-DIwprzLy.mjs → normalize-string-or-regex-CdT2cmt4.mjs} +1 -1
- package/dist/shared/parse-C5IFYsFB.mjs +72 -0
- package/dist/shared/{rolldown-D2E0YTeB.mjs → rolldown-CkjERUOD.mjs} +1 -1
- package/dist/shared/{rolldown-build-Do6WlRGM.mjs → rolldown-build-nvl-pSiK.mjs} +1011 -17
- package/dist/shared/transform-ChAcTNv3.d.mts +92 -0
- package/dist/shared/transform-DhHPKnL-.mjs +90 -0
- package/dist/shared/{types-CIhJMr1h.d.mts → types-C2Sw7GCQ.d.mts} +1 -1
- package/dist/shared/{watch-BsneBCNP.mjs → watch-CC4jn0NJ.mjs} +4 -3
- package/dist/transform-DmR2FE2Q.js +90 -0
- package/dist/utils-index.browser.mjs +4 -0
- package/dist/utils-index.d.mts +2 -0
- package/dist/utils-index.mjs +5 -0
- package/package.json +1 -1
- package/dist/shared/parse-ast-index-BQpfNG1v.mjs +0 -98
- /package/dist/shared/{define-config-Dlptvz3X.mjs → define-config-BVG4QvnP.mjs} +0 -0
- /package/dist/shared/{logging-RB67zQ4N.d.mts → logging-C28dTP71.d.mts} +0 -0
- /package/dist/shared/{prompt-CYPmuhh-.mjs → prompt-BcvPElI8.mjs} +0 -0
- /package/dist/shared/{utils-CqMTwlsR.d.mts → utils-DOXNRW_3.d.mts} +0 -0
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-CCc_0vhs.mjs";
|
|
2
|
+
import { n as parseSync, t as parse } from "./shared/parse-C5IFYsFB.mjs";
|
|
2
3
|
|
|
4
|
+
//#region src/parse-ast-index.ts
|
|
5
|
+
function wrap(result, filename, sourceText) {
|
|
6
|
+
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
|
|
7
|
+
return result.program;
|
|
8
|
+
}
|
|
9
|
+
function normalizeParseError(filename, sourceText, errors) {
|
|
10
|
+
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
11
|
+
const pos = errors[0]?.labels?.[0]?.start;
|
|
12
|
+
for (let i = 0; i < errors.length; i++) {
|
|
13
|
+
if (i >= 5) {
|
|
14
|
+
message += "\n...";
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
const e = errors[i];
|
|
18
|
+
message += e.message + "\n" + e.labels.map((label) => {
|
|
19
|
+
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
20
|
+
if (!location) return;
|
|
21
|
+
return getCodeFrame(sourceText, location.line, location.column);
|
|
22
|
+
}).filter(Boolean).join("\n");
|
|
23
|
+
}
|
|
24
|
+
const log = logParseError(message, filename, pos);
|
|
25
|
+
if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
|
|
26
|
+
return error(log);
|
|
27
|
+
}
|
|
28
|
+
const defaultParserOptions = {
|
|
29
|
+
lang: "js",
|
|
30
|
+
preserveParens: false
|
|
31
|
+
};
|
|
32
|
+
function parseAst(sourceText, options, filename) {
|
|
33
|
+
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
34
|
+
...defaultParserOptions,
|
|
35
|
+
...options
|
|
36
|
+
}), filename, sourceText);
|
|
37
|
+
}
|
|
38
|
+
async function parseAstAsync(sourceText, options, filename) {
|
|
39
|
+
return wrap(await parse(filename ?? "file.js", sourceText, {
|
|
40
|
+
...defaultParserOptions,
|
|
41
|
+
...options
|
|
42
|
+
}), filename, sourceText);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
3
46
|
export { parseAst, parseAstAsync };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./constructors-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-B0X1hEA4.js";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./constructors-D2wC6vT5.js";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
5
5
|
/**
|
package/dist/plugins-index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BuiltinPlugin } from "./shared/utils-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import { t as BuiltinPlugin } from "./shared/utils-DOXNRW_3.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-CtryxP-m.mjs";
|
|
3
3
|
import { BindingReplacePluginConfig } from "../binding.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/builtin-plugin/replace-plugin.d.ts
|
package/dist/plugins-index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-CdT2cmt4.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-f9W8MQZ_.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
5
5
|
/**
|
|
@@ -92,6 +92,7 @@ export const BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallable
|
|
|
92
92
|
export const BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
93
93
|
export const BindingDecodedMap = __napiModule.exports.BindingDecodedMap
|
|
94
94
|
export const BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
95
|
+
export const BindingLoadPluginContext = __napiModule.exports.BindingLoadPluginContext
|
|
95
96
|
export const BindingMagicString = __napiModule.exports.BindingMagicString
|
|
96
97
|
export const BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
97
98
|
export const BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
@@ -110,6 +111,7 @@ export const BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
|
110
111
|
export const ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
111
112
|
export const ScheduledBuild = __napiModule.exports.ScheduledBuild
|
|
112
113
|
export const TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
114
|
+
export const TsconfigCache = __napiModule.exports.TsconfigCache
|
|
113
115
|
export const BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
114
116
|
export const BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
115
117
|
export const BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
@@ -118,9 +120,13 @@ export const BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
|
118
120
|
export const BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
119
121
|
export const BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
120
122
|
export const BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
123
|
+
export const collapseSourcemaps = __napiModule.exports.collapseSourcemaps
|
|
121
124
|
export const createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
125
|
+
export const enhancedTransform = __napiModule.exports.enhancedTransform
|
|
126
|
+
export const enhancedTransformSync = __napiModule.exports.enhancedTransformSync
|
|
122
127
|
export const FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
123
128
|
export const initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
124
129
|
export const registerPlugins = __napiModule.exports.registerPlugins
|
|
130
|
+
export const resolveTsconfig = __napiModule.exports.resolveTsconfig
|
|
125
131
|
export const shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
126
132
|
export const startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
@@ -137,6 +137,7 @@ module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallab
|
|
|
137
137
|
module.exports.BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
138
138
|
module.exports.BindingDecodedMap = __napiModule.exports.BindingDecodedMap
|
|
139
139
|
module.exports.BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
140
|
+
module.exports.BindingLoadPluginContext = __napiModule.exports.BindingLoadPluginContext
|
|
140
141
|
module.exports.BindingMagicString = __napiModule.exports.BindingMagicString
|
|
141
142
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
142
143
|
module.exports.BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
@@ -155,6 +156,7 @@ module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
|
155
156
|
module.exports.ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
156
157
|
module.exports.ScheduledBuild = __napiModule.exports.ScheduledBuild
|
|
157
158
|
module.exports.TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
159
|
+
module.exports.TsconfigCache = __napiModule.exports.TsconfigCache
|
|
158
160
|
module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
159
161
|
module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
160
162
|
module.exports.BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
@@ -163,9 +165,13 @@ module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
|
163
165
|
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
164
166
|
module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
165
167
|
module.exports.BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
168
|
+
module.exports.collapseSourcemaps = __napiModule.exports.collapseSourcemaps
|
|
166
169
|
module.exports.createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
170
|
+
module.exports.enhancedTransform = __napiModule.exports.enhancedTransform
|
|
171
|
+
module.exports.enhancedTransformSync = __napiModule.exports.enhancedTransformSync
|
|
167
172
|
module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
168
173
|
module.exports.initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
169
174
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
175
|
+
module.exports.resolveTsconfig = __napiModule.exports.resolveTsconfig
|
|
170
176
|
module.exports.shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
171
177
|
module.exports.startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
Binary file
|