@rolldown/browser 1.0.0-beta.7-commit.a7cf9ac → 1.0.0-beta.7-commit.b80d472
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/browser.mjs +67 -4
- package/dist/cli.cjs +81 -16
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +81 -16
- package/dist/experimental-index.cjs +3 -3
- package/dist/experimental-index.d.cts +65 -0
- package/dist/experimental-index.d.mts +65 -0
- package/dist/experimental-index.mjs +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +3 -3
- package/dist/parallel-plugin-worker.d.cts +1 -0
- package/dist/parallel-plugin-worker.d.mts +1 -0
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.cts +14 -0
- package/dist/parallel-plugin.d.mts +14 -0
- package/dist/parallel-plugin.mjs +0 -1
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +9 -0
- package/dist/parse-ast-index.d.mts +9 -0
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/chunk-DSsiIF1Z.mjs +30 -0
- package/dist/shared/{chunk-Dc32QXFI.cjs → chunk-qZFfknuJ.cjs} +9 -0
- package/dist/shared/input-options.d-Dhy0onEz.d.mts +1046 -0
- package/dist/shared/input-options.d-DuEVbue0.d.cts +1046 -0
- package/dist/shared/{parse-ast-index-CBDb3Hys.mjs → parse-ast-index-B5HMwEw9.mjs} +1 -1
- package/dist/shared/{parse-ast-index-Rn-i2y3M.cjs → parse-ast-index-lAAkaDQi.cjs} +1 -1
- package/dist/shared/{prompt-B3VJLbs9.mjs → prompt-B7SnYdwU.mjs} +1 -1
- package/dist/shared/{prompt-wpCBKCzA.cjs → prompt-_yrURmmm.cjs} +1 -1
- package/dist/shared/{src-B0csdUUQ.mjs → src-BL95s43J.mjs} +73 -6
- package/dist/shared/{src-B0-c-FLL.cjs → src-C47ObUwZ.cjs} +69 -6
- package/package.json +5 -12
- package/dist/shared/chunk-BuCFLigr.mjs +0 -12
- 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 -15
- 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 -1507
- package/dist/types/builtin-plugin/alias-plugin.d.ts +0 -10
- package/dist/types/builtin-plugin/constructors.d.ts +0 -23
- package/dist/types/builtin-plugin/replace-plugin.d.ts +0 -27
- 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 -16
- package/dist/types/cli/arguments/utils.d.ts +0 -8
- 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 -5
- 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 -31
- package/dist/types/log/log-handler.d.ts +0 -4
- package/dist/types/log/logger.d.ts +0 -6
- package/dist/types/log/logging.d.ts +0 -12
- package/dist/types/log/logs.d.ts +0 -18
- package/dist/types/options/generated/checks-options.d.ts +0 -57
- package/dist/types/options/input-options.d.ts +0 -185
- package/dist/types/options/normalized-input-options.d.ts +0 -18
- package/dist/types/options/normalized-output-options.d.ts +0 -70
- package/dist/types/options/output-options.d.ts +0 -182
- 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 -5
- 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 -17
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +0 -5
- package/dist/types/plugin/hook-filter.d.ts +0 -49
- package/dist/types/plugin/index.d.ts +0 -141
- package/dist/types/plugin/minimal-plugin-context.d.ts +0 -24
- 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 -22
- package/dist/types/plugin/plugin-context.d.ts +0 -67
- package/dist/types/plugin/plugin-driver.d.ts +0 -10
- package/dist/types/plugin/transform-plugin-context.d.ts +0 -28
- package/dist/types/plugin/with-filter.d.ts +0 -10
- package/dist/types/types/assert.d.ts +0 -14
- 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 -12
- 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 -66
- package/dist/types/types/schema.d.ts +0 -33
- package/dist/types/types/sourcemap.d.ts +0 -14
- package/dist/types/types/utils.d.ts +0 -13
- package/dist/types/types.d.ts +0 -7
- 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 -5
- 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 -9
- 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 -17
- package/dist/types/utils/misc.d.ts +0 -7
- 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/resolved-external.d.ts +0 -4
- 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 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_chunk = require('./chunk-
|
|
2
|
+
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
3
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
|
|
4
4
|
const ansis = require_chunk.__toESM(require("ansis"));
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_chunk = require('./chunk-
|
|
2
|
+
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
3
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
4
4
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
5
5
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __esm } from "./chunk-
|
|
2
|
-
import { augmentCodeLocation, error, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-
|
|
1
|
+
import { __esm } from "./chunk-DSsiIF1Z.mjs";
|
|
2
|
+
import { augmentCodeLocation, error, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-B5HMwEw9.mjs";
|
|
3
3
|
import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import colors from "ansis";
|
|
@@ -9,7 +9,7 @@ import { availableParallelism } from "node:os";
|
|
|
9
9
|
import { Worker } from "node:worker_threads";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.0.0-beta.7-commit.
|
|
12
|
+
var version = "1.0.0-beta.7-commit.b80d472";
|
|
13
13
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
@@ -707,9 +707,10 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
|
|
|
707
707
|
dropLabels: v.pipe(v.optional(v.array(v.string())), v.description("Remove labeled statements with these label names")),
|
|
708
708
|
checks: v.optional(ChecksOptionsSchema),
|
|
709
709
|
keepNames: v.pipe(v.optional(v.boolean()), v.description("Keep function/class name")),
|
|
710
|
-
debug: v.pipe(v.optional(v.object({
|
|
710
|
+
debug: v.pipe(v.optional(v.object({ sessionId: v.pipe(v.optional(v.string()), v.description("Used to name the build.")) })), v.description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly."))
|
|
711
711
|
});
|
|
712
712
|
InputCliOverrideSchema = v.strictObject({
|
|
713
|
+
input: v.pipe(v.optional(v.array(v.string())), v.description("Entry file")),
|
|
713
714
|
external: v.pipe(v.optional(v.array(v.string())), v.description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
714
715
|
inject: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Inject import statements on demand")),
|
|
715
716
|
treeshake: v.pipe(v.optional(v.boolean()), v.description("enable treeshaking")),
|
|
@@ -719,7 +720,6 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
|
|
|
719
720
|
...InputOptionsSchema.entries,
|
|
720
721
|
...InputCliOverrideSchema.entries
|
|
721
722
|
}), [
|
|
722
|
-
"input",
|
|
723
723
|
"plugins",
|
|
724
724
|
"onwarn",
|
|
725
725
|
"onLog",
|
|
@@ -2017,6 +2017,70 @@ var init_bindingify_watch_hooks = __esm({ "src/plugin/bindingify-watch-hooks.ts"
|
|
|
2017
2017
|
init_plugin_context();
|
|
2018
2018
|
} });
|
|
2019
2019
|
|
|
2020
|
+
//#endregion
|
|
2021
|
+
//#region src/plugin/generated/hook-usage.ts
|
|
2022
|
+
function extractHookUsage(plugin) {
|
|
2023
|
+
let hookUsage = new HookUsage();
|
|
2024
|
+
if (plugin.buildStart) hookUsage.union(HookUsageKind.buildStart);
|
|
2025
|
+
if (plugin.resolveId) hookUsage.union(HookUsageKind.resolveId);
|
|
2026
|
+
if (plugin.resolveDynamicImport) hookUsage.union(HookUsageKind.resolveDynamicImport);
|
|
2027
|
+
if (plugin.load) hookUsage.union(HookUsageKind.load);
|
|
2028
|
+
if (plugin.transform) hookUsage.union(HookUsageKind.transform);
|
|
2029
|
+
if (plugin.moduleParsed) hookUsage.union(HookUsageKind.moduleParsed);
|
|
2030
|
+
if (plugin.buildEnd) hookUsage.union(HookUsageKind.buildEnd);
|
|
2031
|
+
if (plugin.renderStart) hookUsage.union(HookUsageKind.renderStart);
|
|
2032
|
+
if (plugin.renderError) hookUsage.union(HookUsageKind.renderError);
|
|
2033
|
+
if (plugin.renderChunk) hookUsage.union(HookUsageKind.renderChunk);
|
|
2034
|
+
if (plugin.augmentChunkHash) hookUsage.union(HookUsageKind.augmentChunkHash);
|
|
2035
|
+
if (plugin.generateBundle) hookUsage.union(HookUsageKind.generateBundle);
|
|
2036
|
+
if (plugin.writeBundle) hookUsage.union(HookUsageKind.writeBundle);
|
|
2037
|
+
if (plugin.closeBundle) hookUsage.union(HookUsageKind.closeBundle);
|
|
2038
|
+
if (plugin.watchChange) hookUsage.union(HookUsageKind.watchChange);
|
|
2039
|
+
if (plugin.closeWatcher) hookUsage.union(HookUsageKind.closeWatcher);
|
|
2040
|
+
if (plugin.banner) hookUsage.union(HookUsageKind.banner);
|
|
2041
|
+
if (plugin.footer) hookUsage.union(HookUsageKind.footer);
|
|
2042
|
+
if (plugin.intro) hookUsage.union(HookUsageKind.intro);
|
|
2043
|
+
if (plugin.outro) hookUsage.union(HookUsageKind.outro);
|
|
2044
|
+
return hookUsage;
|
|
2045
|
+
}
|
|
2046
|
+
var HookUsageKind, HookUsage;
|
|
2047
|
+
var init_hook_usage = __esm({ "src/plugin/generated/hook-usage.ts"() {
|
|
2048
|
+
HookUsageKind = /* @__PURE__ */ function(HookUsageKind$1) {
|
|
2049
|
+
HookUsageKind$1[HookUsageKind$1["buildStart"] = 1] = "buildStart";
|
|
2050
|
+
HookUsageKind$1[HookUsageKind$1["resolveId"] = 2] = "resolveId";
|
|
2051
|
+
HookUsageKind$1[HookUsageKind$1["resolveDynamicImport"] = 4] = "resolveDynamicImport";
|
|
2052
|
+
HookUsageKind$1[HookUsageKind$1["load"] = 8] = "load";
|
|
2053
|
+
HookUsageKind$1[HookUsageKind$1["transform"] = 16] = "transform";
|
|
2054
|
+
HookUsageKind$1[HookUsageKind$1["moduleParsed"] = 32] = "moduleParsed";
|
|
2055
|
+
HookUsageKind$1[HookUsageKind$1["buildEnd"] = 64] = "buildEnd";
|
|
2056
|
+
HookUsageKind$1[HookUsageKind$1["renderStart"] = 128] = "renderStart";
|
|
2057
|
+
HookUsageKind$1[HookUsageKind$1["renderError"] = 256] = "renderError";
|
|
2058
|
+
HookUsageKind$1[HookUsageKind$1["renderChunk"] = 512] = "renderChunk";
|
|
2059
|
+
HookUsageKind$1[HookUsageKind$1["augmentChunkHash"] = 1024] = "augmentChunkHash";
|
|
2060
|
+
HookUsageKind$1[HookUsageKind$1["generateBundle"] = 2048] = "generateBundle";
|
|
2061
|
+
HookUsageKind$1[HookUsageKind$1["writeBundle"] = 4096] = "writeBundle";
|
|
2062
|
+
HookUsageKind$1[HookUsageKind$1["closeBundle"] = 8192] = "closeBundle";
|
|
2063
|
+
HookUsageKind$1[HookUsageKind$1["watchChange"] = 16384] = "watchChange";
|
|
2064
|
+
HookUsageKind$1[HookUsageKind$1["closeWatcher"] = 32768] = "closeWatcher";
|
|
2065
|
+
HookUsageKind$1[HookUsageKind$1["transformAst"] = 65536] = "transformAst";
|
|
2066
|
+
HookUsageKind$1[HookUsageKind$1["banner"] = 131072] = "banner";
|
|
2067
|
+
HookUsageKind$1[HookUsageKind$1["footer"] = 262144] = "footer";
|
|
2068
|
+
HookUsageKind$1[HookUsageKind$1["intro"] = 524288] = "intro";
|
|
2069
|
+
HookUsageKind$1[HookUsageKind$1["outro"] = 1048576] = "outro";
|
|
2070
|
+
return HookUsageKind$1;
|
|
2071
|
+
}({});
|
|
2072
|
+
HookUsage = class {
|
|
2073
|
+
bitflag = BigInt(0);
|
|
2074
|
+
constructor() {}
|
|
2075
|
+
union(kind) {
|
|
2076
|
+
this.bitflag |= BigInt(kind);
|
|
2077
|
+
}
|
|
2078
|
+
inner() {
|
|
2079
|
+
return Number(this.bitflag);
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
} });
|
|
2083
|
+
|
|
2020
2084
|
//#endregion
|
|
2021
2085
|
//#region src/plugin/bindingify-plugin.ts
|
|
2022
2086
|
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -2050,6 +2114,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2050
2114
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
|
|
2051
2115
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
|
|
2052
2116
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
2117
|
+
let hookUsage = extractHookUsage(plugin).inner();
|
|
2053
2118
|
const result = {
|
|
2054
2119
|
name: plugin.name,
|
|
2055
2120
|
buildStart,
|
|
@@ -2094,7 +2159,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2094
2159
|
watchChange,
|
|
2095
2160
|
watchChangeMeta,
|
|
2096
2161
|
closeWatcher,
|
|
2097
|
-
closeWatcherMeta
|
|
2162
|
+
closeWatcherMeta,
|
|
2163
|
+
hookUsage
|
|
2098
2164
|
};
|
|
2099
2165
|
return wrapHandlers(result);
|
|
2100
2166
|
}
|
|
@@ -2140,6 +2206,7 @@ var init_bindingify_plugin = __esm({ "src/plugin/bindingify-plugin.ts"() {
|
|
|
2140
2206
|
init_bindingify_output_hooks();
|
|
2141
2207
|
init_logs();
|
|
2142
2208
|
init_bindingify_watch_hooks();
|
|
2209
|
+
init_hook_usage();
|
|
2143
2210
|
} });
|
|
2144
2211
|
|
|
2145
2212
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_chunk = require('./chunk-
|
|
3
|
-
const require_parse_ast_index = require('./parse-ast-index-
|
|
2
|
+
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
+
const require_parse_ast_index = require('./parse-ast-index-lAAkaDQi.cjs');
|
|
4
4
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
|
|
5
5
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
6
|
const ansis = require_chunk.__toESM(require("ansis"));
|
|
@@ -10,7 +10,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
10
10
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
11
11
|
|
|
12
12
|
//#region package.json
|
|
13
|
-
var version = "1.0.0-beta.7-commit.
|
|
13
|
+
var version = "1.0.0-beta.7-commit.b80d472";
|
|
14
14
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
@@ -614,9 +614,10 @@ const InputOptionsSchema = valibot.strictObject({
|
|
|
614
614
|
dropLabels: valibot.pipe(valibot.optional(valibot.array(valibot.string())), valibot.description("Remove labeled statements with these label names")),
|
|
615
615
|
checks: valibot.optional(ChecksOptionsSchema),
|
|
616
616
|
keepNames: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("Keep function/class name")),
|
|
617
|
-
debug: valibot.pipe(valibot.optional(valibot.object({
|
|
617
|
+
debug: valibot.pipe(valibot.optional(valibot.object({ sessionId: valibot.pipe(valibot.optional(valibot.string()), valibot.description("Used to name the build.")) })), valibot.description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly."))
|
|
618
618
|
});
|
|
619
619
|
const InputCliOverrideSchema = valibot.strictObject({
|
|
620
|
+
input: valibot.pipe(valibot.optional(valibot.array(valibot.string())), valibot.description("Entry file")),
|
|
620
621
|
external: valibot.pipe(valibot.optional(valibot.array(valibot.string())), valibot.description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
621
622
|
inject: valibot.pipe(valibot.optional(valibot.record(valibot.string(), valibot.string())), valibot.description("Inject import statements on demand")),
|
|
622
623
|
treeshake: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("enable treeshaking")),
|
|
@@ -626,7 +627,6 @@ const InputCliOptionsSchema = valibot.omit(valibot.strictObject({
|
|
|
626
627
|
...InputOptionsSchema.entries,
|
|
627
628
|
...InputCliOverrideSchema.entries
|
|
628
629
|
}), [
|
|
629
|
-
"input",
|
|
630
630
|
"plugins",
|
|
631
631
|
"onwarn",
|
|
632
632
|
"onLog",
|
|
@@ -1873,6 +1873,67 @@ function bindingifyCloseWatcher(args) {
|
|
|
1873
1873
|
};
|
|
1874
1874
|
}
|
|
1875
1875
|
|
|
1876
|
+
//#endregion
|
|
1877
|
+
//#region src/plugin/generated/hook-usage.ts
|
|
1878
|
+
let HookUsageKind = /* @__PURE__ */ function(HookUsageKind$1) {
|
|
1879
|
+
HookUsageKind$1[HookUsageKind$1["buildStart"] = 1] = "buildStart";
|
|
1880
|
+
HookUsageKind$1[HookUsageKind$1["resolveId"] = 2] = "resolveId";
|
|
1881
|
+
HookUsageKind$1[HookUsageKind$1["resolveDynamicImport"] = 4] = "resolveDynamicImport";
|
|
1882
|
+
HookUsageKind$1[HookUsageKind$1["load"] = 8] = "load";
|
|
1883
|
+
HookUsageKind$1[HookUsageKind$1["transform"] = 16] = "transform";
|
|
1884
|
+
HookUsageKind$1[HookUsageKind$1["moduleParsed"] = 32] = "moduleParsed";
|
|
1885
|
+
HookUsageKind$1[HookUsageKind$1["buildEnd"] = 64] = "buildEnd";
|
|
1886
|
+
HookUsageKind$1[HookUsageKind$1["renderStart"] = 128] = "renderStart";
|
|
1887
|
+
HookUsageKind$1[HookUsageKind$1["renderError"] = 256] = "renderError";
|
|
1888
|
+
HookUsageKind$1[HookUsageKind$1["renderChunk"] = 512] = "renderChunk";
|
|
1889
|
+
HookUsageKind$1[HookUsageKind$1["augmentChunkHash"] = 1024] = "augmentChunkHash";
|
|
1890
|
+
HookUsageKind$1[HookUsageKind$1["generateBundle"] = 2048] = "generateBundle";
|
|
1891
|
+
HookUsageKind$1[HookUsageKind$1["writeBundle"] = 4096] = "writeBundle";
|
|
1892
|
+
HookUsageKind$1[HookUsageKind$1["closeBundle"] = 8192] = "closeBundle";
|
|
1893
|
+
HookUsageKind$1[HookUsageKind$1["watchChange"] = 16384] = "watchChange";
|
|
1894
|
+
HookUsageKind$1[HookUsageKind$1["closeWatcher"] = 32768] = "closeWatcher";
|
|
1895
|
+
HookUsageKind$1[HookUsageKind$1["transformAst"] = 65536] = "transformAst";
|
|
1896
|
+
HookUsageKind$1[HookUsageKind$1["banner"] = 131072] = "banner";
|
|
1897
|
+
HookUsageKind$1[HookUsageKind$1["footer"] = 262144] = "footer";
|
|
1898
|
+
HookUsageKind$1[HookUsageKind$1["intro"] = 524288] = "intro";
|
|
1899
|
+
HookUsageKind$1[HookUsageKind$1["outro"] = 1048576] = "outro";
|
|
1900
|
+
return HookUsageKind$1;
|
|
1901
|
+
}({});
|
|
1902
|
+
var HookUsage = class {
|
|
1903
|
+
bitflag = BigInt(0);
|
|
1904
|
+
constructor() {}
|
|
1905
|
+
union(kind) {
|
|
1906
|
+
this.bitflag |= BigInt(kind);
|
|
1907
|
+
}
|
|
1908
|
+
inner() {
|
|
1909
|
+
return Number(this.bitflag);
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
function extractHookUsage(plugin) {
|
|
1913
|
+
let hookUsage = new HookUsage();
|
|
1914
|
+
if (plugin.buildStart) hookUsage.union(HookUsageKind.buildStart);
|
|
1915
|
+
if (plugin.resolveId) hookUsage.union(HookUsageKind.resolveId);
|
|
1916
|
+
if (plugin.resolveDynamicImport) hookUsage.union(HookUsageKind.resolveDynamicImport);
|
|
1917
|
+
if (plugin.load) hookUsage.union(HookUsageKind.load);
|
|
1918
|
+
if (plugin.transform) hookUsage.union(HookUsageKind.transform);
|
|
1919
|
+
if (plugin.moduleParsed) hookUsage.union(HookUsageKind.moduleParsed);
|
|
1920
|
+
if (plugin.buildEnd) hookUsage.union(HookUsageKind.buildEnd);
|
|
1921
|
+
if (plugin.renderStart) hookUsage.union(HookUsageKind.renderStart);
|
|
1922
|
+
if (plugin.renderError) hookUsage.union(HookUsageKind.renderError);
|
|
1923
|
+
if (plugin.renderChunk) hookUsage.union(HookUsageKind.renderChunk);
|
|
1924
|
+
if (plugin.augmentChunkHash) hookUsage.union(HookUsageKind.augmentChunkHash);
|
|
1925
|
+
if (plugin.generateBundle) hookUsage.union(HookUsageKind.generateBundle);
|
|
1926
|
+
if (plugin.writeBundle) hookUsage.union(HookUsageKind.writeBundle);
|
|
1927
|
+
if (plugin.closeBundle) hookUsage.union(HookUsageKind.closeBundle);
|
|
1928
|
+
if (plugin.watchChange) hookUsage.union(HookUsageKind.watchChange);
|
|
1929
|
+
if (plugin.closeWatcher) hookUsage.union(HookUsageKind.closeWatcher);
|
|
1930
|
+
if (plugin.banner) hookUsage.union(HookUsageKind.banner);
|
|
1931
|
+
if (plugin.footer) hookUsage.union(HookUsageKind.footer);
|
|
1932
|
+
if (plugin.intro) hookUsage.union(HookUsageKind.intro);
|
|
1933
|
+
if (plugin.outro) hookUsage.union(HookUsageKind.outro);
|
|
1934
|
+
return hookUsage;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1876
1937
|
//#endregion
|
|
1877
1938
|
//#region src/plugin/bindingify-plugin.ts
|
|
1878
1939
|
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -1906,6 +1967,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1906
1967
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
|
|
1907
1968
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
|
|
1908
1969
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
1970
|
+
let hookUsage = extractHookUsage(plugin).inner();
|
|
1909
1971
|
const result = {
|
|
1910
1972
|
name: plugin.name,
|
|
1911
1973
|
buildStart,
|
|
@@ -1950,7 +2012,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1950
2012
|
watchChange,
|
|
1951
2013
|
watchChangeMeta,
|
|
1952
2014
|
closeWatcher,
|
|
1953
|
-
closeWatcherMeta
|
|
2015
|
+
closeWatcherMeta,
|
|
2016
|
+
hookUsage
|
|
1954
2017
|
};
|
|
1955
2018
|
return wrapHandlers(result);
|
|
1956
2019
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolldown/browser",
|
|
3
|
-
"version": "1.0.0-beta.7-commit.
|
|
3
|
+
"version": "1.0.0-beta.7-commit.b80d472",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"type": "module",
|
|
@@ -28,26 +28,22 @@
|
|
|
28
28
|
},
|
|
29
29
|
"main": "./dist/index.cjs",
|
|
30
30
|
"module": "./dist/index.mjs",
|
|
31
|
-
"types": "./dist/
|
|
31
|
+
"types": "./dist/index.d.cts",
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
|
-
"types": "./dist/types/index.d.ts",
|
|
35
34
|
"browser": "./dist/browser.mjs",
|
|
36
|
-
"
|
|
35
|
+
"require": "./dist/index.cjs",
|
|
37
36
|
"import": "./dist/index.mjs"
|
|
38
37
|
},
|
|
39
38
|
"./experimental": {
|
|
40
|
-
"types": "./dist/types/experimental-index.d.ts",
|
|
41
39
|
"require": "./dist/experimental-index.cjs",
|
|
42
40
|
"import": "./dist/experimental-index.mjs"
|
|
43
41
|
},
|
|
44
42
|
"./parallel-plugin": {
|
|
45
|
-
"types": "./dist/types/parallel-plugin.d.ts",
|
|
46
43
|
"require": "./dist/parallel-plugin.cjs",
|
|
47
44
|
"import": "./dist/parallel-plugin.mjs"
|
|
48
45
|
},
|
|
49
46
|
"./parseAst": {
|
|
50
|
-
"types": "./dist/types/parse-ast-index.d.ts",
|
|
51
47
|
"require": "./dist/parse-ast-index.cjs",
|
|
52
48
|
"import": "./dist/parse-ast-index.mjs"
|
|
53
49
|
},
|
|
@@ -75,11 +71,8 @@
|
|
|
75
71
|
},
|
|
76
72
|
"scripts": {
|
|
77
73
|
"build": "pnpm run build:debug",
|
|
78
|
-
"build
|
|
79
|
-
"build:
|
|
80
|
-
"build:release": "pnpm run --sequential \"/^build-(types|pkg:release)$/\"",
|
|
81
|
-
"build-pkg:debug": "pnpm run --filter rolldown build-browser:debug",
|
|
82
|
-
"build-pkg:release": "pnpm run --filter rolldown build-browser:release",
|
|
74
|
+
"build:debug": "pnpm run --filter rolldown build-browser:debug",
|
|
75
|
+
"build:release": "pnpm run --filter rolldown build-browser:release",
|
|
83
76
|
"build-node": "cross-env BROWSER_PKG=1 pnpm run --filter rolldown build-node",
|
|
84
77
|
"preinstall": "npx only-allow pnpm"
|
|
85
78
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region rolldown:runtime
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __esm = (fn, res) => function() {
|
|
5
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
|
-
};
|
|
7
|
-
var __commonJS = (cb, mod) => function() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { __commonJS, __esm };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { InputOptions } from '../options/input-options';
|
|
2
|
-
import { OutputOptions } from '../options/output-options';
|
|
3
|
-
import type { RolldownOutput } from '../types/rolldown-output';
|
|
4
|
-
export interface BuildOptions extends InputOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Write the output to the file system
|
|
7
|
-
*
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
write?: boolean;
|
|
11
|
-
output?: OutputOptions;
|
|
12
|
-
}
|
|
13
|
-
declare function build(options: BuildOptions): Promise<RolldownOutput>;
|
|
14
|
-
/**
|
|
15
|
-
* Build multiple outputs __sequentially__.
|
|
16
|
-
*/
|
|
17
|
-
declare function build(options: BuildOptions[]): Promise<RolldownOutput[]>;
|
|
18
|
-
export { build };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { InputOptions } from '../options/input-options';
|
|
2
|
-
/**
|
|
3
|
-
* This is an experimental API. It's behavior may change in the future.
|
|
4
|
-
*
|
|
5
|
-
* Calling this API will only execute the scan stage of rolldown.
|
|
6
|
-
*/
|
|
7
|
-
export declare const experimental_scan: (input: InputOptions) => Promise<void>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BindingHmrOutput } from '../../binding';
|
|
2
|
-
import type { InputOptions } from '../../options/input-options';
|
|
3
|
-
import type { OutputOptions } from '../../options/output-options';
|
|
4
|
-
import type { RolldownOutput } from '../../types/rolldown-output';
|
|
5
|
-
export declare class RolldownBuild {
|
|
6
|
-
#private;
|
|
7
|
-
constructor(inputOptions: InputOptions);
|
|
8
|
-
get closed(): boolean;
|
|
9
|
-
generate(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
10
|
-
write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
11
|
-
close(): Promise<void>;
|
|
12
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
13
|
-
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutput | undefined>;
|
|
14
|
-
get watchFiles(): string[];
|
|
15
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { BindingWatcherEvent } from '../../binding';
|
|
2
|
-
import { MaybePromise } from '../../types/utils';
|
|
3
|
-
export type WatcherEvent = 'close' | 'event' | 'restart' | 'change';
|
|
4
|
-
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
5
|
-
export type RollupWatcherEvent = {
|
|
6
|
-
code: 'START';
|
|
7
|
-
} | {
|
|
8
|
-
code: 'BUNDLE_START';
|
|
9
|
-
} | {
|
|
10
|
-
code: 'BUNDLE_END';
|
|
11
|
-
duration: number;
|
|
12
|
-
output: readonly string[];
|
|
13
|
-
} | {
|
|
14
|
-
code: 'END';
|
|
15
|
-
} | {
|
|
16
|
-
code: 'ERROR';
|
|
17
|
-
error: Error;
|
|
18
|
-
};
|
|
19
|
-
export declare class WatcherEmitter {
|
|
20
|
-
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
|
|
21
|
-
timer: any;
|
|
22
|
-
constructor();
|
|
23
|
-
on(event: 'change', listener: (id: string, change: {
|
|
24
|
-
event: ChangeEvent;
|
|
25
|
-
}) => MaybePromise<void>): this;
|
|
26
|
-
on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
|
|
27
|
-
on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this;
|
|
28
|
-
onEvent(event: BindingWatcherEvent): Promise<void>;
|
|
29
|
-
close(): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
export type RolldownWatcher = WatcherEmitter;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BindingWatcher } from '../../binding';
|
|
2
|
-
import { WatchOptions } from '../../options/watch-options';
|
|
3
|
-
import { WatcherEmitter } from './watch-emitter';
|
|
4
|
-
export declare class Watcher {
|
|
5
|
-
closed: boolean;
|
|
6
|
-
inner: BindingWatcher;
|
|
7
|
-
emitter: WatcherEmitter;
|
|
8
|
-
stopWorkers: ((() => Promise<void>) | undefined)[];
|
|
9
|
-
constructor(emitter: WatcherEmitter, inner: BindingWatcher, stopWorkers: ((() => Promise<void>) | undefined)[]);
|
|
10
|
-
close(): Promise<void>;
|
|
11
|
-
start(): void;
|
|
12
|
-
}
|
|
13
|
-
export declare function createWatcher(emitter: WatcherEmitter, input: WatchOptions | WatchOptions[]): Promise<void>;
|