@rolldown/browser 1.0.0-beta.9-commit.0ec9e7d → 1.0.0-rc.10
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 +961 -1551
- package/dist/config.d.mts +9 -6
- package/dist/config.mjs +9 -11
- package/dist/constructors-DsfxKD6A.js +68 -0
- package/dist/error-BeZaDkS8.js +157 -0
- package/dist/experimental-index.browser.mjs +278 -44
- package/dist/experimental-index.d.mts +228 -68
- package/dist/experimental-index.mjs +274 -55
- package/dist/experimental-runtime-types.d.ts +98 -0
- package/dist/filter-index.d.mts +104 -2
- package/dist/filter-index.mjs +144 -5
- package/dist/get-log-filter.d.mts +3 -0
- package/dist/get-log-filter.mjs +68 -0
- package/dist/index.browser.mjs +238 -3
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +53 -6
- package/dist/{shared/parse-ast-index-BHaE0ECV.cjs → normalize-string-or-regex-TtAGUp42.js} +74 -147
- package/dist/parallel-plugin-worker.mjs +27 -35
- package/dist/parallel-plugin.d.mts +7 -7
- package/dist/parallel-plugin.mjs +1 -2
- package/dist/parse-ast-index.d.mts +28 -5
- package/dist/parse-ast-index.mjs +60 -4
- package/dist/plugins-index.browser.mjs +40 -0
- package/dist/plugins-index.d.mts +33 -0
- package/dist/plugins-index.mjs +40 -0
- package/dist/resolve-tsconfig-DThkUPSZ.js +112 -0
- package/dist/rolldown-binding.wasi-browser.js +46 -24
- package/dist/rolldown-binding.wasi.cjs +67 -24
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/rolldown-build-Chx5S-TB.js +5349 -0
- package/dist/shared/bindingify-input-options-Czbczr8Z.mjs +2168 -0
- package/dist/shared/composable-filters-B2ByPP8y.mjs +224 -0
- package/dist/shared/constructors-BVnf_fH1.d.mts +37 -0
- package/dist/shared/constructors-CemeNi29.mjs +68 -0
- package/dist/shared/define-config-DJOr6Iwt.mjs +6 -0
- package/dist/shared/define-config-i6TWE2hm.d.mts +3855 -0
- package/dist/shared/error-CQ6njWsV.mjs +86 -0
- package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
- package/dist/shared/{load-config-D7UduHRZ.mjs → load-config-CxvL5JxT.mjs} +32 -36
- package/dist/shared/logging-C6h4g8dA.d.mts +50 -0
- package/dist/shared/{parse-ast-index-vu376yZ1.mjs → logs-D80CXhvg.mjs} +25 -123
- package/dist/shared/normalize-string-or-regex-CF3Uz6aU.mjs +57 -0
- package/dist/shared/parse-CRhjbrcT.mjs +73 -0
- package/dist/shared/{prompt-CxjDC0Gn.cjs → prompt-BYQIwEjg.mjs} +301 -310
- package/dist/shared/resolve-tsconfig-Cwoo4h_o.mjs +112 -0
- package/dist/shared/rolldown-C3wFxOwq.mjs +40 -0
- package/dist/shared/rolldown-build-ChZOz6BP.mjs +3318 -0
- package/dist/shared/transform-DEgNAQOQ.d.mts +149 -0
- package/dist/shared/types-Cx3HYorz.d.mts +1302 -0
- package/dist/shared/utils-6wxe_LMG.d.mts +22 -0
- package/dist/shared/watch-C1jC1oFT.mjs +373 -0
- package/dist/utils-index.browser.mjs +2414 -0
- package/dist/utils-index.d.mts +374 -0
- package/dist/utils-index.mjs +2415 -0
- package/package.json +33 -38
- package/dist/cli.cjs +0 -1748
- package/dist/cli.d.cts +0 -1
- package/dist/config.cjs +0 -12
- package/dist/config.d.cts +0 -11
- package/dist/experimental-index.cjs +0 -129
- package/dist/experimental-index.d.cts +0 -96
- package/dist/filter-index.cjs +0 -53
- package/dist/filter-index.d.cts +0 -3
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -3
- package/dist/parallel-plugin-worker.cjs +0 -33
- package/dist/parallel-plugin-worker.d.cts +0 -1
- package/dist/parallel-plugin.cjs +0 -8
- package/dist/parallel-plugin.d.cts +0 -14
- package/dist/parse-ast-index.cjs +0 -4
- package/dist/parse-ast-index.d.cts +0 -9
- package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
- package/dist/shared/chunk-DSsiIF1Z.mjs +0 -30
- package/dist/shared/define-config.d-D4lKXE9V.d.cts +0 -1165
- package/dist/shared/define-config.d-Dm9iNdt9.d.mts +0 -1165
- package/dist/shared/dist-BMVjvV-v.cjs +0 -249
- package/dist/shared/dist-CAn6dxW6.mjs +0 -153
- package/dist/shared/load-config-CtKjQ8Mn.cjs +0 -125
- package/dist/shared/prompt-GFYxfPw7.mjs +0 -854
- package/dist/shared/src-D0nc44MQ.mjs +0 -4691
- package/dist/shared/src-s89s870G.cjs +0 -4647
- package/dist/src-CeWghjQt.js +0 -4329
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { a as RolldownLog } from "./logging-C6h4g8dA.mjs";
|
|
2
|
+
import { BindingEnhancedTransformOptions, BindingEnhancedTransformResult, BindingTsconfigCompilerOptions as TsconfigCompilerOptions, BindingTsconfigRawOptions as TsconfigRawOptions, BindingTsconfigResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, SourceMap, TsconfigCache } from "../binding.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/resolve-tsconfig.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Cache for tsconfig resolution to avoid redundant file system operations.
|
|
7
|
+
*
|
|
8
|
+
* The cache stores resolved tsconfig configurations keyed by their file paths.
|
|
9
|
+
* When transforming multiple files in the same project, tsconfig lookups are
|
|
10
|
+
* deduplicated, improving performance.
|
|
11
|
+
*
|
|
12
|
+
* @category Utilities
|
|
13
|
+
* @experimental
|
|
14
|
+
*/
|
|
15
|
+
declare class TsconfigCache$1 extends TsconfigCache {
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
18
|
+
/** @hidden This is only expected to be used by Vite */
|
|
19
|
+
declare function resolveTsconfig(filename: string, cache?: TsconfigCache$1 | null): BindingTsconfigResult | null;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/utils/parse.d.ts
|
|
22
|
+
/**
|
|
23
|
+
* Result of parsing a code
|
|
24
|
+
*
|
|
25
|
+
* @category Utilities
|
|
26
|
+
*/
|
|
27
|
+
interface ParseResult$1 extends ParseResult {}
|
|
28
|
+
/**
|
|
29
|
+
* Options for parsing a code
|
|
30
|
+
*
|
|
31
|
+
* @category Utilities
|
|
32
|
+
*/
|
|
33
|
+
interface ParserOptions$1 extends ParserOptions {}
|
|
34
|
+
/**
|
|
35
|
+
* Parse JS/TS source asynchronously on a separate thread.
|
|
36
|
+
*
|
|
37
|
+
* Note that not all of the workload can happen on a separate thread.
|
|
38
|
+
* Parsing on Rust side does happen in a separate thread, but deserialization of the AST to JS objects
|
|
39
|
+
* has to happen on current thread. This synchronous deserialization work typically outweighs
|
|
40
|
+
* the asynchronous parsing by a factor of between 3 and 20.
|
|
41
|
+
*
|
|
42
|
+
* i.e. the majority of the workload cannot be parallelized by using this method.
|
|
43
|
+
*
|
|
44
|
+
* Generally {@linkcode parseSync} is preferable to use as it does not have the overhead of spawning a thread.
|
|
45
|
+
* If you need to parallelize parsing multiple files, it is recommended to use worker threads.
|
|
46
|
+
*
|
|
47
|
+
* @category Utilities
|
|
48
|
+
*/
|
|
49
|
+
declare function parse(filename: string, sourceText: string, options?: ParserOptions$1 | null): Promise<ParseResult$1>;
|
|
50
|
+
/**
|
|
51
|
+
* Parse JS/TS source synchronously on current thread.
|
|
52
|
+
*
|
|
53
|
+
* This is generally preferable over {@linkcode parse} (async) as it does not have the overhead
|
|
54
|
+
* of spawning a thread, and the majority of the workload cannot be parallelized anyway
|
|
55
|
+
* (see {@linkcode parse} documentation for details).
|
|
56
|
+
*
|
|
57
|
+
* If you need to parallelize parsing multiple files, it is recommended to use worker threads
|
|
58
|
+
* with {@linkcode parseSync} rather than using {@linkcode parse}.
|
|
59
|
+
*
|
|
60
|
+
* @category Utilities
|
|
61
|
+
*/
|
|
62
|
+
declare function parseSync(filename: string, sourceText: string, options?: ParserOptions$1 | null): ParseResult$1;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/utils/minify.d.ts
|
|
65
|
+
/**
|
|
66
|
+
* Options for minification.
|
|
67
|
+
*
|
|
68
|
+
* @category Utilities
|
|
69
|
+
*/
|
|
70
|
+
interface MinifyOptions$1 extends MinifyOptions {
|
|
71
|
+
inputMap?: SourceMap;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The result of minification.
|
|
75
|
+
*
|
|
76
|
+
* @category Utilities
|
|
77
|
+
*/
|
|
78
|
+
interface MinifyResult$1 extends MinifyResult {}
|
|
79
|
+
/**
|
|
80
|
+
* Minify asynchronously.
|
|
81
|
+
*
|
|
82
|
+
* Note: This function can be slower than {@linkcode minifySync} due to the overhead of spawning a thread.
|
|
83
|
+
*
|
|
84
|
+
* @category Utilities
|
|
85
|
+
* @experimental
|
|
86
|
+
*/
|
|
87
|
+
declare function minify(filename: string, sourceText: string, options?: MinifyOptions$1 | null): Promise<MinifyResult$1>;
|
|
88
|
+
/**
|
|
89
|
+
* Minify synchronously.
|
|
90
|
+
*
|
|
91
|
+
* @category Utilities
|
|
92
|
+
* @experimental
|
|
93
|
+
*/
|
|
94
|
+
declare function minifySync(filename: string, sourceText: string, options?: MinifyOptions$1 | null): MinifyResult$1;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/utils/transform.d.ts
|
|
97
|
+
/**
|
|
98
|
+
* Options for transforming a code.
|
|
99
|
+
*
|
|
100
|
+
* @category Utilities
|
|
101
|
+
*/
|
|
102
|
+
interface TransformOptions$1 extends BindingEnhancedTransformOptions {}
|
|
103
|
+
/**
|
|
104
|
+
* Result of transforming a code.
|
|
105
|
+
*
|
|
106
|
+
* @category Utilities
|
|
107
|
+
*/
|
|
108
|
+
type TransformResult = Omit<BindingEnhancedTransformResult, "errors" | "warnings"> & {
|
|
109
|
+
errors: Error[];
|
|
110
|
+
warnings: RolldownLog[];
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
|
114
|
+
*
|
|
115
|
+
* Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
|
|
116
|
+
*
|
|
117
|
+
* @param filename The name of the file being transformed. If this is a
|
|
118
|
+
* relative path, consider setting the {@linkcode TransformOptions#cwd} option.
|
|
119
|
+
* @param sourceText The source code to transform.
|
|
120
|
+
* @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
|
|
121
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
122
|
+
* Only used when `options.tsconfig` is `true`.
|
|
123
|
+
*
|
|
124
|
+
* @returns a promise that resolves to an object containing the transformed code,
|
|
125
|
+
* source maps, and any errors that occurred during parsing or transformation.
|
|
126
|
+
*
|
|
127
|
+
* @category Utilities
|
|
128
|
+
* @experimental
|
|
129
|
+
*/
|
|
130
|
+
declare function transform(filename: string, sourceText: string, options?: TransformOptions$1 | null, cache?: TsconfigCache$1 | null): Promise<TransformResult>;
|
|
131
|
+
/**
|
|
132
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
|
|
133
|
+
*
|
|
134
|
+
* @param filename The name of the file being transformed. If this is a
|
|
135
|
+
* relative path, consider setting the {@linkcode TransformOptions#cwd} option.
|
|
136
|
+
* @param sourceText The source code to transform.
|
|
137
|
+
* @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
|
|
138
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
139
|
+
* Only used when `options.tsconfig` is `true`.
|
|
140
|
+
*
|
|
141
|
+
* @returns an object containing the transformed code, source maps, and any errors
|
|
142
|
+
* that occurred during parsing or transformation.
|
|
143
|
+
*
|
|
144
|
+
* @category Utilities
|
|
145
|
+
* @experimental
|
|
146
|
+
*/
|
|
147
|
+
declare function transformSync(filename: string, sourceText: string, options?: TransformOptions$1 | null, cache?: TsconfigCache$1 | null): TransformResult;
|
|
148
|
+
//#endregion
|
|
149
|
+
export { transform as a, MinifyResult$1 as c, ParseResult$1 as d, ParserOptions$1 as f, resolveTsconfig as g, TsconfigCache$1 as h, TsconfigRawOptions as i, minify as l, parseSync as m, TransformResult as n, transformSync as o, parse as p, TsconfigCompilerOptions as r, MinifyOptions$1 as s, TransformOptions$1 as t, minifySync as u };
|