rolldown 1.0.0-beta.1-commit.35fb1f8 → 1.0.0-beta.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/bin/cli.mjs +2 -0
- package/dist/cli.cjs +1748 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1745 -0
- package/dist/config.cjs +12 -0
- package/dist/config.d.cts +12 -0
- package/dist/config.d.mts +12 -0
- package/dist/config.mjs +10 -0
- package/dist/experimental-index.cjs +132 -0
- package/dist/experimental-index.d.cts +96 -0
- package/dist/experimental-index.d.mts +96 -0
- package/dist/experimental-index.mjs +91 -0
- package/dist/filter-index.cjs +105 -0
- package/dist/filter-index.d.cts +5 -0
- package/dist/filter-index.d.mts +5 -0
- package/dist/filter-index.mjs +44 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +5 -0
- package/dist/{cjs/parallel-plugin-worker.cjs → parallel-plugin-worker.cjs} +7 -14
- package/dist/parallel-plugin-worker.d.cts +1 -0
- package/dist/parallel-plugin-worker.d.mts +1 -0
- package/dist/{esm/parallel-plugin-worker.mjs → parallel-plugin-worker.mjs} +5 -11
- package/dist/{cjs/parallel-plugin.cjs → parallel-plugin.cjs} +1 -2
- package/dist/parallel-plugin.d.cts +15 -0
- package/dist/parallel-plugin.d.mts +15 -0
- package/dist/{esm/parallel-plugin.mjs → parallel-plugin.mjs} +0 -1
- package/dist/parse-ast-index.cjs +4 -0
- package/dist/parse-ast-index.d.cts +9 -0
- package/dist/parse-ast-index.d.mts +9 -0
- package/dist/parse-ast-index.mjs +3 -0
- package/dist/shared/binding.d-Bl5Vi4GH.d.mts +1702 -0
- package/dist/shared/binding.d-DcFBMcjI.d.cts +1702 -0
- package/dist/shared/{chunk-qZFfknuJ.cjs → chunk-DDkG_k5U.cjs} +0 -1
- package/dist/shared/define-config.d-B2xOSmbM.d.cts +1082 -0
- package/dist/shared/define-config.d-USfUuKiR.d.mts +1082 -0
- package/dist/shared/load-config-D6gW8FDa.cjs +125 -0
- package/dist/shared/load-config-eyuttVHY.mjs +119 -0
- package/dist/shared/misc-BKp5iIef.cjs +67 -0
- package/dist/shared/misc-BN0nse6C.mjs +25 -0
- package/dist/shared/{binding-fhgdIkpS.cjs → parse-ast-index-BvK1MT-L.cjs} +347 -309
- package/dist/shared/{binding-Bl7VQy7c.mjs → parse-ast-index-PSQWLeSo.mjs} +334 -277
- package/dist/shared/prompt-8EeOGx1_.cjs +854 -0
- package/dist/shared/prompt-C3zHEaSG.mjs +852 -0
- package/dist/shared/src-C2v46mL8.cjs +4654 -0
- package/dist/shared/src-D-VRn8rI.mjs +4456 -0
- package/package.json +62 -61
- package/bin/cli.js +0 -2
- package/dist/cjs/cli.cjs +0 -769
- package/dist/cjs/experimental-index.cjs +0 -79
- package/dist/cjs/index.cjs +0 -8
- package/dist/cjs/parse-ast-index.cjs +0 -57
- package/dist/esm/cli.mjs +0 -766
- package/dist/esm/experimental-index.mjs +0 -56
- package/dist/esm/index.mjs +0 -4
- package/dist/esm/parse-ast-index.mjs +0 -55
- package/dist/shared/consola_36c0034f-Cx52UqEq.mjs +0 -832
- package/dist/shared/consola_36c0034f-CynBWXXO.cjs +0 -859
- package/dist/shared/prompt-B58MxVuU.cjs +0 -762
- package/dist/shared/prompt-DjjlOckE.mjs +0 -758
- package/dist/shared/src-Busnx6mE.cjs +0 -2812
- package/dist/shared/src-DNOXsZr0.mjs +0 -2631
- package/dist/tsconfig.dts.tsbuildinfo +0 -1
- package/dist/types/api/build.d.ts +0 -18
- package/dist/types/api/experimental.d.ts +0 -7
- package/dist/types/api/rolldown/index.d.ts +0 -3
- package/dist/types/api/rolldown/rolldown-build.d.ts +0 -12
- package/dist/types/api/watch/index.d.ts +0 -3
- package/dist/types/api/watch/watch-emitter.d.ts +0 -31
- package/dist/types/api/watch/watcher.d.ts +0 -13
- package/dist/types/binding.d.ts +0 -1287
- package/dist/types/builtin-plugin/alias-plugin.d.ts +0 -10
- package/dist/types/builtin-plugin/constructors.d.ts +0 -20
- package/dist/types/builtin-plugin/replace-plugin.d.ts +0 -28
- package/dist/types/builtin-plugin/transform-plugin.d.ts +0 -9
- package/dist/types/builtin-plugin/utils.d.ts +0 -8
- package/dist/types/cli/arguments/alias.d.ts +0 -16
- package/dist/types/cli/arguments/index.d.ts +0 -15
- package/dist/types/cli/arguments/normalize.d.ts +0 -12
- package/dist/types/cli/arguments/utils.d.ts +0 -8
- package/dist/types/cli/colors.d.ts +0 -11
- package/dist/types/cli/commands/bundle.d.ts +0 -3
- package/dist/types/cli/commands/help.d.ts +0 -1
- package/dist/types/cli/index.d.ts +0 -1
- package/dist/types/cli/load-config.d.ts +0 -3
- package/dist/types/cli/logger.d.ts +0 -5
- package/dist/types/constants/plugin-context.d.ts +0 -7
- package/dist/types/constants/plugin.d.ts +0 -45
- package/dist/types/experimental-index.d.ts +0 -9
- package/dist/types/index.d.ts +0 -28
- package/dist/types/log/logHandler.d.ts +0 -4
- package/dist/types/log/logger.d.ts +0 -6
- package/dist/types/log/logging.d.ts +0 -11
- package/dist/types/log/logs.d.ts +0 -18
- package/dist/types/options/input-options.d.ts +0 -125
- package/dist/types/options/normalized-input-options.d.ts +0 -18
- package/dist/types/options/normalized-output-options.d.ts +0 -67
- package/dist/types/options/output-options.d.ts +0 -80
- package/dist/types/options/watch-options.d.ts +0 -5
- package/dist/types/parallel-plugin-worker.d.ts +0 -1
- package/dist/types/parallel-plugin.d.ts +0 -1
- package/dist/types/parse-ast-index.d.ts +0 -4
- package/dist/types/plugin/bindingify-build-hooks.d.ts +0 -10
- package/dist/types/plugin/bindingify-hook-filter.d.ts +0 -7
- package/dist/types/plugin/bindingify-output-hooks.d.ts +0 -14
- package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +0 -8
- package/dist/types/plugin/bindingify-plugin.d.ts +0 -15
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +0 -5
- package/dist/types/plugin/hook-filter.d.ts +0 -48
- package/dist/types/plugin/index.d.ts +0 -126
- package/dist/types/plugin/minimal-plugin-context.d.ts +0 -15
- package/dist/types/plugin/parallel-plugin-implementation.d.ts +0 -10
- package/dist/types/plugin/parallel-plugin.d.ts +0 -9
- package/dist/types/plugin/plugin-context-data.d.ts +0 -16
- package/dist/types/plugin/plugin-context.d.ts +0 -52
- package/dist/types/plugin/plugin-driver.d.ts +0 -8
- package/dist/types/plugin/transform-plugin-context.d.ts +0 -17
- package/dist/types/types/assert.d.ts +0 -13
- package/dist/types/types/config-export.d.ts +0 -5
- package/dist/types/types/misc.d.ts +0 -40
- package/dist/types/types/module-info.d.ts +0 -15
- package/dist/types/types/module-side-effects.d.ts +0 -10
- package/dist/types/types/output-bundle.d.ts +0 -4
- package/dist/types/types/rolldown-options.d.ts +0 -5
- package/dist/types/types/rolldown-output.d.ts +0 -63
- package/dist/types/types/schema.d.ts +0 -33
- package/dist/types/types/sourcemap.d.ts +0 -13
- package/dist/types/types/utils.d.ts +0 -13
- package/dist/types/utils/asset-source.d.ts +0 -4
- package/dist/types/utils/async-flatten.d.ts +0 -1
- package/dist/types/utils/bindingify-input-options.d.ts +0 -7
- package/dist/types/utils/bindingify-output-options.d.ts +0 -3
- package/dist/types/utils/code-frame.d.ts +0 -1
- package/dist/types/utils/compose-js-plugins.d.ts +0 -2
- package/dist/types/utils/create-bundler-option.d.ts +0 -11
- package/dist/types/utils/create-bundler.d.ts +0 -8
- package/dist/types/utils/define-config.d.ts +0 -5
- package/dist/types/utils/error.d.ts +0 -2
- package/dist/types/utils/initialize-parallel-plugins.d.ts +0 -19
- package/dist/types/utils/misc.d.ts +0 -6
- package/dist/types/utils/normalize-hook.d.ts +0 -7
- package/dist/types/utils/normalize-plugin-option.d.ts +0 -13
- package/dist/types/utils/normalize-string-or-regex.d.ts +0 -2
- package/dist/types/utils/plugin/index.d.ts +0 -2
- package/dist/types/utils/transform-module-info.d.ts +0 -4
- package/dist/types/utils/transform-rendered-chunk.d.ts +0 -4
- package/dist/types/utils/transform-rendered-module.d.ts +0 -3
- package/dist/types/utils/transform-side-effects.d.ts +0 -3
- package/dist/types/utils/transform-sourcemap.d.ts +0 -3
- package/dist/types/utils/transform-to-rollup-output.d.ts +0 -11
- package/dist/types/utils/validator.d.ts +0 -7
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { import_binding } from "../shared/binding-Bl7VQy7c.mjs";
|
|
2
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-DNOXsZr0.mjs";
|
|
3
|
-
import { pathToFileURL } from "node:url";
|
|
4
|
-
|
|
5
|
-
//#region src/plugin/parallel-plugin.ts
|
|
6
|
-
function defineParallelPlugin(pluginPath) {
|
|
7
|
-
return (options) => {
|
|
8
|
-
return { _parallel: {
|
|
9
|
-
fileUrl: pathToFileURL(pluginPath).href,
|
|
10
|
-
options
|
|
11
|
-
} };
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/api/experimental.ts
|
|
17
|
-
const experimental_scan = async (input) => {
|
|
18
|
-
const { bundler, stopWorkers } = await createBundler(input, {});
|
|
19
|
-
const output = await bundler.scan();
|
|
20
|
-
handleOutputErrors(output);
|
|
21
|
-
await stopWorkers?.();
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/builtin-plugin/transform-plugin.ts
|
|
26
|
-
function normalizeEcmaTransformPluginConfig(config) {
|
|
27
|
-
if (!config) return undefined;
|
|
28
|
-
let normalizedConfig = {
|
|
29
|
-
...config,
|
|
30
|
-
exclude: normalizedStringOrRegex(config.exclude),
|
|
31
|
-
include: normalizedStringOrRegex(config.include)
|
|
32
|
-
};
|
|
33
|
-
return normalizedConfig;
|
|
34
|
-
}
|
|
35
|
-
function transformPlugin(config) {
|
|
36
|
-
return new BuiltinPlugin("builtin:transform", normalizeEcmaTransformPluginConfig(config));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/builtin-plugin/replace-plugin.ts
|
|
41
|
-
function replacePlugin(values = {}, options = {}) {
|
|
42
|
-
return new BuiltinPlugin("builtin:replace", {
|
|
43
|
-
...options,
|
|
44
|
-
values
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/builtin-plugin/alias-plugin.ts
|
|
50
|
-
function aliasPlugin(config) {
|
|
51
|
-
return new BuiltinPlugin("builtin:alias", config);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
var transform = import_binding.transform;
|
|
56
|
-
export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
|
package/dist/esm/index.mjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { error, getCodeFrame, import_binding, locate, logParseError } from "../shared/binding-Bl7VQy7c.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/parse-ast-index.ts
|
|
4
|
-
function wrap(result, sourceText) {
|
|
5
|
-
let program, module, comments, errors, magicString;
|
|
6
|
-
return {
|
|
7
|
-
get program() {
|
|
8
|
-
if (!errors) errors = result.errors;
|
|
9
|
-
if (errors.length > 0) return normalizeParseError(sourceText, errors);
|
|
10
|
-
if (!program) program = JSON.parse(result.program);
|
|
11
|
-
return program;
|
|
12
|
-
},
|
|
13
|
-
get module() {
|
|
14
|
-
if (!module) module = result.module;
|
|
15
|
-
return module;
|
|
16
|
-
},
|
|
17
|
-
get comments() {
|
|
18
|
-
if (!comments) comments = result.comments;
|
|
19
|
-
return comments;
|
|
20
|
-
},
|
|
21
|
-
get errors() {
|
|
22
|
-
if (!errors) errors = result.errors;
|
|
23
|
-
return errors;
|
|
24
|
-
},
|
|
25
|
-
get magicString() {
|
|
26
|
-
if (!magicString) magicString = result.magicString;
|
|
27
|
-
return magicString;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function normalizeParseError(sourceText, errors) {
|
|
32
|
-
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
33
|
-
for (let i = 0; i < errors.length; i++) {
|
|
34
|
-
if (i >= 5) {
|
|
35
|
-
message += "\n...";
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
const e = errors[i];
|
|
39
|
-
message += e.message + "\n" + e.labels.map((label) => {
|
|
40
|
-
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
41
|
-
if (!location) return;
|
|
42
|
-
return getCodeFrame(sourceText, location.line, location.column);
|
|
43
|
-
}).filter(Boolean).join("\n");
|
|
44
|
-
}
|
|
45
|
-
return error(logParseError(message));
|
|
46
|
-
}
|
|
47
|
-
function parseAst(filename, sourceText, options) {
|
|
48
|
-
return wrap((0, import_binding.parseSync)(filename, sourceText, options), sourceText);
|
|
49
|
-
}
|
|
50
|
-
async function parseAstAsync(filename, sourceText, options) {
|
|
51
|
-
return wrap(await (0, import_binding.parseAsync)(filename, sourceText, options), sourceText);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
export { parseAst, parseAstAsync };
|