@rolldown/browser 1.0.0-rc.3 → 1.0.0-rc.5
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 +9 -8
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +8 -7
- package/dist/{constructors-B8gqcrFr.js → constructors-D2wC6vT5.js} +2 -5
- package/dist/error-Cqi7XTjG.js +158 -0
- package/dist/experimental-index.browser.mjs +61 -32
- package/dist/experimental-index.d.mts +74 -29
- package/dist/experimental-index.mjs +63 -34
- package/dist/filter-index.d.mts +1 -1
- package/dist/get-log-filter.d.mts +3 -7
- package/dist/index.browser.mjs +3 -2
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +8 -7
- 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 +2 -2
- 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 +4 -0
- package/dist/rolldown-binding.wasi.cjs +4 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-D38aLTC9.js → rolldown-build-D_uxS53o.js} +39 -152
- package/dist/shared/{bindingify-input-options-C95V1-v7.mjs → bindingify-input-options-CntM6OGD.mjs} +19 -94
- 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-C3-RX4yW.d.mts → define-config-CMsxCx69.d.mts} +79 -6
- package/dist/shared/error-DTJQ7tjB.mjs +89 -0
- package/dist/shared/get-log-filter-MhZu4MML.d.mts +7 -0
- package/dist/shared/{load-config-By_XBxvI.mjs → load-config-DwB0RYGU.mjs} +1 -1
- 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-Dltex8ec.mjs → parse-TCwR4L_P.mjs} +21 -4
- package/dist/shared/{rolldown-BMW1SW-b.mjs → rolldown-aTvfnZNF.mjs} +1 -1
- package/dist/shared/{rolldown-build-DS1J_xeK.mjs → rolldown-build-Bvz-G_y6.mjs} +23 -8
- package/dist/shared/transform-ChAcTNv3.d.mts +92 -0
- package/dist/shared/transform-DhHPKnL-.mjs +90 -0
- package/dist/shared/{types-B9-K3ZPX.d.mts → types-CMaRlYYn.d.mts} +2 -2
- package/dist/shared/{watch-BvXJc2Ra.mjs → watch-BWJtu1lP.mjs} +4 -3
- package/dist/transform-BQei0Mty.js +90 -0
- package/dist/utils-index.browser.mjs +2405 -0
- package/dist/utils-index.d.mts +350 -0
- package/dist/utils-index.mjs +2406 -0
- package/package.json +1 -1
- /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
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { i as logInputHookInOutputPlugin, n as error } from "./logs-
|
|
2
|
-
import { n as BuiltinPlugin } from "./normalize-string-or-regex-
|
|
3
|
-
import {
|
|
1
|
+
import { i as logInputHookInOutputPlugin, n as error } from "./logs-CCc_0vhs.mjs";
|
|
2
|
+
import { n as BuiltinPlugin } from "./normalize-string-or-regex-CdT2cmt4.mjs";
|
|
3
|
+
import { _ as LOG_LEVEL_WARN, a as transformToRollupOutput, b as VERSION, c as transformAssetSource, d as MinimalPluginContextImpl, f as normalizeHook, g as LOG_LEVEL_INFO, h as LOG_LEVEL_ERROR, i as transformModuleInfo, l as lazyProp, m as LOG_LEVEL_DEBUG, o as transformRenderedChunk, p as normalizeLog, s as __decorate, t as bindingifyInputOptions, u as PlainObjectLike, v as logLevelPriority } from "./bindingify-input-options-CntM6OGD.mjs";
|
|
4
4
|
import { v as unimplemented } from "./composable-filters-CIxSuZSM.mjs";
|
|
5
|
+
import { i as unwrapBindingResult } from "./error-DTJQ7tjB.mjs";
|
|
5
6
|
import { Worker } from "node:worker_threads";
|
|
6
7
|
import { BindingBundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
7
8
|
import path, { sep } from "node:path";
|
|
@@ -1593,7 +1594,8 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1593
1594
|
couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warnings when Rolldown could not clean the output directory")),
|
|
1594
1595
|
pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process")),
|
|
1595
1596
|
duplicateShebang: pipe(optional(boolean()), description("Whether to emit warnings when both the code and postBanner contain shebang")),
|
|
1596
|
-
unsupportedTsconfigOption: pipe(optional(boolean()), description("Whether to emit warnings when a tsconfig option or combination of options is not supported"))
|
|
1597
|
+
unsupportedTsconfigOption: pipe(optional(boolean()), description("Whether to emit warnings when a tsconfig option or combination of options is not supported")),
|
|
1598
|
+
ineffectiveDynamicImport: pipe(optional(boolean()), description("Whether to emit warnings when a module is dynamically imported but also statically imported, making the dynamic import ineffective for code splitting"))
|
|
1597
1599
|
});
|
|
1598
1600
|
isTypeTrue();
|
|
1599
1601
|
const CompressOptionsKeepNamesSchema = strictObject({
|
|
@@ -1817,7 +1819,9 @@ const AdvancedChunksSchema = strictObject({
|
|
|
1817
1819
|
minShareCount: optional(number()),
|
|
1818
1820
|
maxSize: optional(number()),
|
|
1819
1821
|
minModuleSize: optional(number()),
|
|
1820
|
-
maxModuleSize: optional(number())
|
|
1822
|
+
maxModuleSize: optional(number()),
|
|
1823
|
+
entriesAware: optional(boolean()),
|
|
1824
|
+
entriesAwareMergeThreshold: optional(number())
|
|
1821
1825
|
})))
|
|
1822
1826
|
});
|
|
1823
1827
|
isTypeTrue();
|
|
@@ -1886,7 +1890,12 @@ const OutputOptionsSchema = strictObject({
|
|
|
1886
1890
|
manualChunks: optional(ManualChunksFunctionSchema),
|
|
1887
1891
|
codeSplitting: optional(union([boolean(), AdvancedChunksSchema])),
|
|
1888
1892
|
advancedChunks: optional(AdvancedChunksSchema),
|
|
1889
|
-
legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
|
|
1893
|
+
legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control legal comments in the output")),
|
|
1894
|
+
comments: pipe(optional(union([boolean(), strictObject({
|
|
1895
|
+
legal: optional(boolean()),
|
|
1896
|
+
annotation: optional(boolean()),
|
|
1897
|
+
jsdoc: optional(boolean())
|
|
1898
|
+
})])), description("Control comments in the output")),
|
|
1890
1899
|
plugins: optional(custom(() => true)),
|
|
1891
1900
|
polyfillRequire: pipe(optional(boolean()), description("Disable require polyfill injection")),
|
|
1892
1901
|
hoistTransitiveImports: optional(literal(false)),
|
|
@@ -2969,7 +2978,7 @@ function createConsola(options = {}) {
|
|
|
2969
2978
|
defaults: { level },
|
|
2970
2979
|
stdout: process.stdout,
|
|
2971
2980
|
stderr: process.stderr,
|
|
2972
|
-
prompt: (...args) => import("./prompt-
|
|
2981
|
+
prompt: (...args) => import("./prompt-BcvPElI8.mjs").then((m) => m.prompt(...args)),
|
|
2973
2982
|
reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
2974
2983
|
...options
|
|
2975
2984
|
});
|
|
@@ -3012,7 +3021,7 @@ function createTestingLogger() {
|
|
|
3012
3021
|
//#endregion
|
|
3013
3022
|
//#region src/utils/bindingify-output-options.ts
|
|
3014
3023
|
function bindingifyOutputOptions(outputOptions) {
|
|
3015
|
-
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
|
|
3024
|
+
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
|
|
3016
3025
|
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks);
|
|
3017
3026
|
return {
|
|
3018
3027
|
dir,
|
|
@@ -3053,6 +3062,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3053
3062
|
preserveModules,
|
|
3054
3063
|
virtualDirname,
|
|
3055
3064
|
legalComments,
|
|
3065
|
+
comments: bindingifyComments(comments),
|
|
3056
3066
|
preserveModulesRoot,
|
|
3057
3067
|
topLevelVar,
|
|
3058
3068
|
minifyInternalExports: outputOptions.minifyInternalExports,
|
|
@@ -3101,6 +3111,11 @@ function bindingifyAssetFilenames(assetFileNames) {
|
|
|
3101
3111
|
};
|
|
3102
3112
|
return assetFileNames;
|
|
3103
3113
|
}
|
|
3114
|
+
function bindingifyComments(comments) {
|
|
3115
|
+
if (comments == null) return;
|
|
3116
|
+
if (typeof comments === "boolean") return comments;
|
|
3117
|
+
return comments;
|
|
3118
|
+
}
|
|
3104
3119
|
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks) {
|
|
3105
3120
|
let inlineDynamicImports;
|
|
3106
3121
|
let effectiveChunksOption;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { a as RolldownLog } from "./logging-C28dTP71.mjs";
|
|
2
|
+
import { BindingEnhancedTransformOptions, BindingEnhancedTransformResult, BindingTsconfigCompilerOptions as TsconfigCompilerOptions, BindingTsconfigRawOptions as TsconfigRawOptions, MinifyOptions, MinifyResult, ParseResult, ParserOptions as ParserOptions$1, SourceMap, TsconfigCache } from "../binding.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/parse.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Parse JS/TS source asynchronously on a separate thread.
|
|
7
|
+
*
|
|
8
|
+
* Note that not all of the workload can happen on a separate thread.
|
|
9
|
+
* Parsing on Rust side does happen in a separate thread, but deserialization of the AST to JS objects
|
|
10
|
+
* has to happen on current thread. This synchronous deserialization work typically outweighs
|
|
11
|
+
* the asynchronous parsing by a factor of between 3 and 20.
|
|
12
|
+
*
|
|
13
|
+
* i.e. the majority of the workload cannot be parallelized by using this method.
|
|
14
|
+
*
|
|
15
|
+
* Generally `parseSync` is preferable to use as it does not have the overhead of spawning a thread.
|
|
16
|
+
* If you need to parallelize parsing multiple files, it is recommended to use worker threads.
|
|
17
|
+
*/
|
|
18
|
+
declare function parse(filename: string, sourceText: string, options?: ParserOptions$1 | null): Promise<ParseResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Parse JS/TS source synchronously on current thread.
|
|
21
|
+
*
|
|
22
|
+
* This is generally preferable over `parse` (async) as it does not have the overhead
|
|
23
|
+
* of spawning a thread, and the majority of the workload cannot be parallelized anyway
|
|
24
|
+
* (see `parse` documentation for details).
|
|
25
|
+
*
|
|
26
|
+
* If you need to parallelize parsing multiple files, it is recommended to use worker threads
|
|
27
|
+
* with `parseSync` rather than using `parse`.
|
|
28
|
+
*/
|
|
29
|
+
declare function parseSync(filename: string, sourceText: string, options?: ParserOptions$1 | null): ParseResult;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/utils/minify.d.ts
|
|
32
|
+
type MinifyOptions$1 = MinifyOptions & {
|
|
33
|
+
inputMap?: SourceMap;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Minify asynchronously.
|
|
37
|
+
*
|
|
38
|
+
* Note: This function can be slower than `minifySync` due to the overhead of spawning a thread.
|
|
39
|
+
*
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
declare function minify(filename: string, sourceText: string, options?: MinifyOptions$1 | null): Promise<MinifyResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Minify synchronously.
|
|
45
|
+
*
|
|
46
|
+
* @experimental
|
|
47
|
+
*/
|
|
48
|
+
declare function minifySync(filename: string, sourceText: string, options?: MinifyOptions$1 | null): MinifyResult;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/utils/transform.d.ts
|
|
51
|
+
type TransformResult = Omit<BindingEnhancedTransformResult, "errors" | "warnings"> & {
|
|
52
|
+
errors: Error[];
|
|
53
|
+
warnings: RolldownLog[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
|
57
|
+
*
|
|
58
|
+
* Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
|
|
59
|
+
*
|
|
60
|
+
* @param filename The name of the file being transformed. If this is a
|
|
61
|
+
* relative path, consider setting the {@link TransformOptions#cwd} option.
|
|
62
|
+
* @param source_text The source code to transform.
|
|
63
|
+
* @param options The transform options including tsconfig and inputMap. See {@link
|
|
64
|
+
* BindingEnhancedTransformOptions} for more information.
|
|
65
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
66
|
+
* Only used when `options.tsconfig` is `true`.
|
|
67
|
+
*
|
|
68
|
+
* @returns a promise that resolves to an object containing the transformed code,
|
|
69
|
+
* source maps, and any errors that occurred during parsing or transformation.
|
|
70
|
+
*
|
|
71
|
+
* @experimental
|
|
72
|
+
*/
|
|
73
|
+
declare function transform(filename: string, sourceText: string, options?: BindingEnhancedTransformOptions | null, cache?: TsconfigCache | null): Promise<TransformResult>;
|
|
74
|
+
/**
|
|
75
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
|
|
76
|
+
*
|
|
77
|
+
* @param filename The name of the file being transformed. If this is a
|
|
78
|
+
* relative path, consider setting the {@link TransformOptions#cwd} option.
|
|
79
|
+
* @param source_text The source code to transform.
|
|
80
|
+
* @param options The transform options including tsconfig and inputMap. See {@link
|
|
81
|
+
* BindingEnhancedTransformOptions} for more information.
|
|
82
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
83
|
+
* Only used when `options.tsconfig` is `true`.
|
|
84
|
+
*
|
|
85
|
+
* @returns an object containing the transformed code, source maps, and any errors
|
|
86
|
+
* that occurred during parsing or transformation.
|
|
87
|
+
*
|
|
88
|
+
* @experimental
|
|
89
|
+
*/
|
|
90
|
+
declare function transformSync(filename: string, sourceText: string, options?: BindingEnhancedTransformOptions | null, cache?: TsconfigCache | null): TransformResult;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { TsconfigRawOptions as a, MinifyOptions$1 as c, minifySync as d, ParseResult as f, parseSync as h, TsconfigCompilerOptions as i, MinifyResult as l, parse as m, TransformResult as n, transform as o, ParserOptions$1 as p, TsconfigCache as r, transformSync as s, BindingEnhancedTransformOptions as t, minify as u };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-DTJQ7tjB.mjs";
|
|
2
|
+
import { TsconfigCache, collapseSourcemaps, enhancedTransform, enhancedTransformSync, minify, minifySync } from "../rolldown-binding.wasi.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/minify.ts
|
|
5
|
+
/**
|
|
6
|
+
* Minify asynchronously.
|
|
7
|
+
*
|
|
8
|
+
* Note: This function can be slower than `minifySync` due to the overhead of spawning a thread.
|
|
9
|
+
*
|
|
10
|
+
* @experimental
|
|
11
|
+
*/
|
|
12
|
+
async function minify$1(filename, sourceText, options) {
|
|
13
|
+
const inputMap = bindingifySourcemap(options?.inputMap);
|
|
14
|
+
const result = await minify(filename, sourceText, options);
|
|
15
|
+
if (result.map && inputMap) result.map = {
|
|
16
|
+
version: 3,
|
|
17
|
+
...collapseSourcemaps([inputMap, bindingifySourcemap(result.map)])
|
|
18
|
+
};
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Minify synchronously.
|
|
23
|
+
*
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
function minifySync$1(filename, sourceText, options) {
|
|
27
|
+
const inputMap = bindingifySourcemap(options?.inputMap);
|
|
28
|
+
const result = minifySync(filename, sourceText, options);
|
|
29
|
+
if (result.map && inputMap) result.map = {
|
|
30
|
+
version: 3,
|
|
31
|
+
...collapseSourcemaps([inputMap, bindingifySourcemap(result.map)])
|
|
32
|
+
};
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/utils/transform.ts
|
|
38
|
+
/**
|
|
39
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
|
40
|
+
*
|
|
41
|
+
* Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
|
|
42
|
+
*
|
|
43
|
+
* @param filename The name of the file being transformed. If this is a
|
|
44
|
+
* relative path, consider setting the {@link TransformOptions#cwd} option.
|
|
45
|
+
* @param source_text The source code to transform.
|
|
46
|
+
* @param options The transform options including tsconfig and inputMap. See {@link
|
|
47
|
+
* BindingEnhancedTransformOptions} for more information.
|
|
48
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
49
|
+
* Only used when `options.tsconfig` is `true`.
|
|
50
|
+
*
|
|
51
|
+
* @returns a promise that resolves to an object containing the transformed code,
|
|
52
|
+
* source maps, and any errors that occurred during parsing or transformation.
|
|
53
|
+
*
|
|
54
|
+
* @experimental
|
|
55
|
+
*/
|
|
56
|
+
async function transform(filename, sourceText, options, cache) {
|
|
57
|
+
const result = await enhancedTransform(filename, sourceText, options, cache);
|
|
58
|
+
return {
|
|
59
|
+
...result,
|
|
60
|
+
errors: result.errors.map(normalizeBindingError),
|
|
61
|
+
warnings: result.warnings.map((w) => w.field0)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
|
|
66
|
+
*
|
|
67
|
+
* @param filename The name of the file being transformed. If this is a
|
|
68
|
+
* relative path, consider setting the {@link TransformOptions#cwd} option.
|
|
69
|
+
* @param source_text The source code to transform.
|
|
70
|
+
* @param options The transform options including tsconfig and inputMap. See {@link
|
|
71
|
+
* BindingEnhancedTransformOptions} for more information.
|
|
72
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
73
|
+
* Only used when `options.tsconfig` is `true`.
|
|
74
|
+
*
|
|
75
|
+
* @returns an object containing the transformed code, source maps, and any errors
|
|
76
|
+
* that occurred during parsing or transformation.
|
|
77
|
+
*
|
|
78
|
+
* @experimental
|
|
79
|
+
*/
|
|
80
|
+
function transformSync(filename, sourceText, options, cache) {
|
|
81
|
+
const result = enhancedTransformSync(filename, sourceText, options, cache);
|
|
82
|
+
return {
|
|
83
|
+
...result,
|
|
84
|
+
errors: result.errors.map(normalizeBindingError),
|
|
85
|
+
warnings: result.warnings.map((w) => w.field0)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { minifySync$1 as a, minify$1 as i, transform as n, transformSync as r, TsconfigCache as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@oxc-project+types@0.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@oxc-project+types@0.114.0/node_modules/@oxc-project/types/types.d.ts
|
|
2
2
|
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
3
3
|
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`.
|
|
4
4
|
interface Program extends Span {
|
|
@@ -1297,4 +1297,4 @@ interface Span {
|
|
|
1297
1297
|
type ModuleKind = "script" | "module" | "commonjs";
|
|
1298
1298
|
type Node = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
|
|
1299
1299
|
//#endregion
|
|
1300
|
-
export { Program as t };
|
|
1300
|
+
export { JSXClosingElement as $, TaggedTemplateExpression as $n, TSFunctionType as $t, ExportAllDeclaration as A, TSRestType as An, ReturnStatement as At, IdentifierName as B, TSTypeAssertion as Bn, TSAsExpression as Bt, ClassBody as C, TSNumberKeyword as Cn, ObjectPattern as Ct, Decorator as D, TSParenthesizedType as Dn, Program as Dt, DebuggerStatement as E, TSParameterProperty as En, PrivateIdentifier as Et, ForInStatement as F, TSThisParameter as Fn, Super as Ft, ImportDefaultSpecifier as G, TSTypeParameterInstantiation as Gn, TSConditionalType as Gt, IfStatement as H, TSTypeOperator as Hn, TSBooleanKeyword as Ht, ForOfStatement as I, TSThisType as In, SwitchCase as It, ImportSpecifier as J, TSTypeReference as Jn, TSEnumBody as Jt, ImportExpression as K, TSTypePredicate as Kn, TSConstructSignatureDeclaration as Kt, ForStatement as L, TSTupleType as Ln, SwitchStatement as Lt, ExportNamedDeclaration as M, TSStringKeyword as Mn, SpreadElement as Mt, ExportSpecifier as N, TSSymbolKeyword as Nn, StaticBlock as Nt, DoWhileStatement as O, TSPropertySignature as On, PropertyDefinition as Ot, ExpressionStatement as P, TSTemplateLiteralType as Pn, StringLiteral as Pt, JSXAttribute as Q, TSVoidKeyword as Qn, TSExternalModuleReference as Qt, FormalParameterRest as R, TSTypeAliasDeclaration as Rn, TSAnyKeyword as Rt, Class as S, TSNullKeyword as Sn, ObjectExpression as St, ContinueStatement as T, TSOptionalType as Tn, ParenthesizedExpression as Tt, ImportAttribute as U, TSTypeParameter as Un, TSCallSignatureDeclaration as Ut, IdentifierReference as V, TSTypeLiteral as Vn, TSBigIntKeyword as Vt, ImportDeclaration as W, TSTypeParameterDeclaration as Wn, TSClassImplements as Wt, JSDocNullableType as X, TSUnionType as Xn, TSEnumMember as Xt, JSDocNonNullableType as Y, TSUndefinedKeyword as Yn, TSEnumDeclaration as Yt, JSDocUnknownType as Z, TSUnknownKeyword as Zn, TSExportAssignment as Zt, BooleanLiteral as _, TSModuleDeclaration as _n, MetaProperty as _t, AssignmentExpression as a, TSIndexedAccessType as an, UnaryExpression as ar, JSXIdentifier as at, CatchClause as b, TSNeverKeyword as bn, NullLiteral as bt, AssignmentTargetPropertyProperty as c, TSInterfaceBody as cn, VariableDeclaration as cr, JSXOpeningElement as ct, BigIntLiteral as d, TSIntersectionType as dn, WithStatement as dr, JSXSpreadChild as dt, TSGlobalDeclaration as en, TemplateElement as er, JSXClosingFragment as et, BinaryExpression as f, TSIntrinsicKeyword as fn, YieldExpression as fr, JSXText as ft, BlockStatement as g, TSModuleBlock as gn, MemberExpression as gt, BindingRestElement as h, TSMethodSignature as hn, LogicalExpression as ht, ArrowFunctionExpression as i, TSIndexSignatureName as in, TryStatement as ir, JSXFragment as it, ExportDefaultDeclaration as j, TSSatisfiesExpression as jn, SequenceExpression as jt, EmptyStatement as k, TSQualifiedName as kn, RegExpLiteral as kt, AssignmentTargetRest as l, TSInterfaceDeclaration as ln, VariableDeclarator as lr, JSXOpeningFragment as lt, BindingProperty as m, TSMappedType as mn, LabeledStatement as mt, ArrayExpression as n, TSImportType as nn, ThisExpression as nr, JSXEmptyExpression as nt, AssignmentPattern as o, TSInferType as on, UpdateExpression as or, JSXMemberExpression as ot, BindingIdentifier as p, TSLiteralType as pn, LabelIdentifier as pt, ImportNamespaceSpecifier as q, TSTypeQuery as qn, TSConstructorType as qt, ArrayPattern as r, TSIndexSignature as rn, ThrowStatement as rr, JSXExpressionContainer as rt, AssignmentTargetProperty as s, TSInstantiationExpression as sn, V8IntrinsicExpression as sr, JSXNamespacedName as st, AccessorProperty as t, TSImportEqualsDeclaration as tn, TemplateLiteral as tr, JSXElement as tt, AwaitExpression as u, TSInterfaceHeritage as un, WhileStatement as ur, JSXSpreadAttribute as ut, BreakStatement as v, TSNamedTupleMember as vn, MethodDefinition as vt, ConditionalExpression as w, TSObjectKeyword as wn, ObjectProperty as wt, ChainExpression as x, TSNonNullExpression as xn, NumericLiteral as xt, CallExpression as y, TSNamespaceExportDeclaration as yn, NewExpression as yt, Function as z, TSTypeAnnotation as zn, TSArrayType as zt };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { o as logMultiplyNotifyOption } from "./logs-
|
|
2
|
-
import {
|
|
1
|
+
import { o as logMultiplyNotifyOption } from "./logs-CCc_0vhs.mjs";
|
|
2
|
+
import { _ as LOG_LEVEL_WARN } from "./bindingify-input-options-CntM6OGD.mjs";
|
|
3
3
|
import { h as arraify } from "./composable-filters-CIxSuZSM.mjs";
|
|
4
|
-
import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-
|
|
4
|
+
import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-Bvz-G_y6.mjs";
|
|
5
|
+
import { t as aggregateBindingErrorsIntoJsError } from "./error-DTJQ7tjB.mjs";
|
|
5
6
|
import { BindingWatcher, shutdownAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
6
7
|
|
|
7
8
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { n as normalizeBindingError, s as bindingifySourcemap } from "./error-Cqi7XTjG.js";
|
|
2
|
+
import { TsconfigCache, collapseSourcemaps, enhancedTransform, enhancedTransformSync, minify, minifySync } from "./rolldown-binding.wasi-browser.js";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/minify.ts
|
|
5
|
+
/**
|
|
6
|
+
* Minify asynchronously.
|
|
7
|
+
*
|
|
8
|
+
* Note: This function can be slower than `minifySync` due to the overhead of spawning a thread.
|
|
9
|
+
*
|
|
10
|
+
* @experimental
|
|
11
|
+
*/
|
|
12
|
+
async function minify$1(filename, sourceText, options) {
|
|
13
|
+
const inputMap = bindingifySourcemap(options?.inputMap);
|
|
14
|
+
const result = await minify(filename, sourceText, options);
|
|
15
|
+
if (result.map && inputMap) result.map = {
|
|
16
|
+
version: 3,
|
|
17
|
+
...collapseSourcemaps([inputMap, bindingifySourcemap(result.map)])
|
|
18
|
+
};
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Minify synchronously.
|
|
23
|
+
*
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
function minifySync$1(filename, sourceText, options) {
|
|
27
|
+
const inputMap = bindingifySourcemap(options?.inputMap);
|
|
28
|
+
const result = minifySync(filename, sourceText, options);
|
|
29
|
+
if (result.map && inputMap) result.map = {
|
|
30
|
+
version: 3,
|
|
31
|
+
...collapseSourcemaps([inputMap, bindingifySourcemap(result.map)])
|
|
32
|
+
};
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/utils/transform.ts
|
|
38
|
+
/**
|
|
39
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
|
40
|
+
*
|
|
41
|
+
* Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
|
|
42
|
+
*
|
|
43
|
+
* @param filename The name of the file being transformed. If this is a
|
|
44
|
+
* relative path, consider setting the {@link TransformOptions#cwd} option.
|
|
45
|
+
* @param source_text The source code to transform.
|
|
46
|
+
* @param options The transform options including tsconfig and inputMap. See {@link
|
|
47
|
+
* BindingEnhancedTransformOptions} for more information.
|
|
48
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
49
|
+
* Only used when `options.tsconfig` is `true`.
|
|
50
|
+
*
|
|
51
|
+
* @returns a promise that resolves to an object containing the transformed code,
|
|
52
|
+
* source maps, and any errors that occurred during parsing or transformation.
|
|
53
|
+
*
|
|
54
|
+
* @experimental
|
|
55
|
+
*/
|
|
56
|
+
async function transform(filename, sourceText, options, cache) {
|
|
57
|
+
const result = await enhancedTransform(filename, sourceText, options, cache);
|
|
58
|
+
return {
|
|
59
|
+
...result,
|
|
60
|
+
errors: result.errors.map(normalizeBindingError),
|
|
61
|
+
warnings: result.warnings.map((w) => w.field0)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
|
|
66
|
+
*
|
|
67
|
+
* @param filename The name of the file being transformed. If this is a
|
|
68
|
+
* relative path, consider setting the {@link TransformOptions#cwd} option.
|
|
69
|
+
* @param source_text The source code to transform.
|
|
70
|
+
* @param options The transform options including tsconfig and inputMap. See {@link
|
|
71
|
+
* BindingEnhancedTransformOptions} for more information.
|
|
72
|
+
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
|
73
|
+
* Only used when `options.tsconfig` is `true`.
|
|
74
|
+
*
|
|
75
|
+
* @returns an object containing the transformed code, source maps, and any errors
|
|
76
|
+
* that occurred during parsing or transformation.
|
|
77
|
+
*
|
|
78
|
+
* @experimental
|
|
79
|
+
*/
|
|
80
|
+
function transformSync(filename, sourceText, options, cache) {
|
|
81
|
+
const result = enhancedTransformSync(filename, sourceText, options, cache);
|
|
82
|
+
return {
|
|
83
|
+
...result,
|
|
84
|
+
errors: result.errors.map(normalizeBindingError),
|
|
85
|
+
warnings: result.warnings.map((w) => w.field0)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { minifySync$1 as a, minify$1 as i, transform as n, transformSync as r, TsconfigCache as t };
|