rolldown 1.0.0-beta.7-commit.46fbc61 → 1.0.0-beta.7-commit.a684277
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.cjs +124 -17
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +80 -15
- package/dist/experimental-index.cjs +31 -2
- package/dist/experimental-index.d.cts +94 -0
- package/dist/experimental-index.d.mts +94 -0
- package/dist/experimental-index.mjs +31 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.d.cts +1 -0
- package/dist/parallel-plugin-worker.d.mts +1 -0
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.cts +15 -0
- package/dist/parallel-plugin.d.mts +15 -0
- 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/shared/binding.d-BRtxlpZ6.d.mts +824 -0
- package/dist/shared/binding.d-CzSMPsR_.d.cts +824 -0
- package/dist/shared/input-options.d-Bc_A4cnr.d.cts +1072 -0
- package/dist/shared/input-options.d-Bk53WsIe.d.mts +1072 -0
- package/dist/shared/{parse-ast-index-CLx_7WML.cjs → parse-ast-index-3MkelEDZ.cjs} +10 -0
- package/dist/shared/{parse-ast-index-lybCSSSh.mjs → parse-ast-index-C93JXze5.mjs} +10 -0
- package/dist/shared/{src-CbcfNaXm.cjs → src--wu12-kY.cjs} +83 -4
- package/dist/shared/{src-Ca98NyM6.mjs → src-BBUt-xgm.mjs} +71 -4
- package/package.json +17 -21
- package/dist/tsconfig.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 -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/generated/hook-usage.d.ts +0 -29
- 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
|
@@ -420,6 +420,10 @@ function getCodeFrame(source, line, column) {
|
|
|
420
420
|
function rangeContains(range, index) {
|
|
421
421
|
return range.start <= index && index < range.end;
|
|
422
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* @param {string} source
|
|
425
|
+
* @param {import('./types').Options} [options]
|
|
426
|
+
*/
|
|
423
427
|
function getLocator(source, options = {}) {
|
|
424
428
|
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
425
429
|
let start = 0;
|
|
@@ -457,6 +461,12 @@ function getLocator(source, options = {}) {
|
|
|
457
461
|
}
|
|
458
462
|
return locator;
|
|
459
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* @param {string} source
|
|
466
|
+
* @param {string | number} search
|
|
467
|
+
* @param {import('./types').Options} [options]
|
|
468
|
+
* @returns {Location | undefined}
|
|
469
|
+
*/
|
|
460
470
|
function locate(source, search, options) {
|
|
461
471
|
return getLocator(source, options)(search, options && options.startIndex);
|
|
462
472
|
}
|
|
@@ -423,6 +423,10 @@ var init_code_frame = __esm({ "src/utils/code-frame.ts"() {
|
|
|
423
423
|
function rangeContains(range, index) {
|
|
424
424
|
return range.start <= index && index < range.end;
|
|
425
425
|
}
|
|
426
|
+
/**
|
|
427
|
+
* @param {string} source
|
|
428
|
+
* @param {import('./types').Options} [options]
|
|
429
|
+
*/
|
|
426
430
|
function getLocator(source, options = {}) {
|
|
427
431
|
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
428
432
|
let start = 0;
|
|
@@ -460,6 +464,12 @@ function getLocator(source, options = {}) {
|
|
|
460
464
|
}
|
|
461
465
|
return locator;
|
|
462
466
|
}
|
|
467
|
+
/**
|
|
468
|
+
* @param {string} source
|
|
469
|
+
* @param {string | number} search
|
|
470
|
+
* @param {import('./types').Options} [options]
|
|
471
|
+
* @returns {Location | undefined}
|
|
472
|
+
*/
|
|
463
473
|
function locate(source, search, options) {
|
|
464
474
|
return getLocator(source, options)(search, options && options.startIndex);
|
|
465
475
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_parse_ast_index = require('./parse-ast-index-
|
|
3
|
+
const require_parse_ast_index = require('./parse-ast-index-3MkelEDZ.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const ansis = require_chunk.__toESM(require("ansis"));
|
|
6
6
|
const __valibot_to_json_schema = require_chunk.__toESM(require("@valibot/to-json-schema"));
|
|
@@ -9,7 +9,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
9
9
|
const node_worker_threads = require_chunk.__toESM(require("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.a684277";
|
|
13
13
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
@@ -280,6 +280,16 @@ const ENUMERATED_PLUGIN_HOOK_NAMES = [
|
|
|
280
280
|
"intro",
|
|
281
281
|
"outro"
|
|
282
282
|
];
|
|
283
|
+
/**
|
|
284
|
+
* Names of all defined hooks. It's like
|
|
285
|
+
* ```js
|
|
286
|
+
* const DEFINED_HOOK_NAMES ={
|
|
287
|
+
* options: 'options',
|
|
288
|
+
* buildStart: 'buildStart',
|
|
289
|
+
* ...
|
|
290
|
+
* }
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
283
293
|
const DEFINED_HOOK_NAMES = {
|
|
284
294
|
[ENUMERATED_PLUGIN_HOOK_NAMES[0]]: ENUMERATED_PLUGIN_HOOK_NAMES[0],
|
|
285
295
|
[ENUMERATED_PLUGIN_HOOK_NAMES[1]]: ENUMERATED_PLUGIN_HOOK_NAMES[1],
|
|
@@ -616,6 +626,7 @@ const InputOptionsSchema = valibot.strictObject({
|
|
|
616
626
|
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."))
|
|
617
627
|
});
|
|
618
628
|
const InputCliOverrideSchema = valibot.strictObject({
|
|
629
|
+
input: valibot.pipe(valibot.optional(valibot.array(valibot.string())), valibot.description("Entry file")),
|
|
619
630
|
external: valibot.pipe(valibot.optional(valibot.array(valibot.string())), valibot.description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
620
631
|
inject: valibot.pipe(valibot.optional(valibot.record(valibot.string(), valibot.string())), valibot.description("Inject import statements on demand")),
|
|
621
632
|
treeshake: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("enable treeshaking")),
|
|
@@ -625,7 +636,6 @@ const InputCliOptionsSchema = valibot.omit(valibot.strictObject({
|
|
|
625
636
|
...InputOptionsSchema.entries,
|
|
626
637
|
...InputCliOverrideSchema.entries
|
|
627
638
|
}), [
|
|
628
|
-
"input",
|
|
629
639
|
"plugins",
|
|
630
640
|
"onwarn",
|
|
631
641
|
"onLog",
|
|
@@ -810,6 +820,12 @@ function getJsonSchema() {
|
|
|
810
820
|
|
|
811
821
|
//#endregion
|
|
812
822
|
//#region src/constants/plugin-context.ts
|
|
823
|
+
/**
|
|
824
|
+
* If Composed plugins call `this.resolve` with `skipSelf: true`, the composed plugins will be skipped as a whole.
|
|
825
|
+
* To prevent that, we use this symbol to store the actual caller of `this.resolve` with `skipSelf: true`. And we
|
|
826
|
+
* will modify the skipSelf option to `false` and use this symbol to skip the caller itself in the composed plugins
|
|
827
|
+
* internally.
|
|
828
|
+
*/
|
|
813
829
|
const SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF = Symbol("plugin-context-resolve-caller");
|
|
814
830
|
|
|
815
831
|
//#endregion
|
|
@@ -1872,6 +1888,67 @@ function bindingifyCloseWatcher(args) {
|
|
|
1872
1888
|
};
|
|
1873
1889
|
}
|
|
1874
1890
|
|
|
1891
|
+
//#endregion
|
|
1892
|
+
//#region src/plugin/generated/hook-usage.ts
|
|
1893
|
+
let HookUsageKind = /* @__PURE__ */ function(HookUsageKind$1) {
|
|
1894
|
+
HookUsageKind$1[HookUsageKind$1["buildStart"] = 1] = "buildStart";
|
|
1895
|
+
HookUsageKind$1[HookUsageKind$1["resolveId"] = 2] = "resolveId";
|
|
1896
|
+
HookUsageKind$1[HookUsageKind$1["resolveDynamicImport"] = 4] = "resolveDynamicImport";
|
|
1897
|
+
HookUsageKind$1[HookUsageKind$1["load"] = 8] = "load";
|
|
1898
|
+
HookUsageKind$1[HookUsageKind$1["transform"] = 16] = "transform";
|
|
1899
|
+
HookUsageKind$1[HookUsageKind$1["moduleParsed"] = 32] = "moduleParsed";
|
|
1900
|
+
HookUsageKind$1[HookUsageKind$1["buildEnd"] = 64] = "buildEnd";
|
|
1901
|
+
HookUsageKind$1[HookUsageKind$1["renderStart"] = 128] = "renderStart";
|
|
1902
|
+
HookUsageKind$1[HookUsageKind$1["renderError"] = 256] = "renderError";
|
|
1903
|
+
HookUsageKind$1[HookUsageKind$1["renderChunk"] = 512] = "renderChunk";
|
|
1904
|
+
HookUsageKind$1[HookUsageKind$1["augmentChunkHash"] = 1024] = "augmentChunkHash";
|
|
1905
|
+
HookUsageKind$1[HookUsageKind$1["generateBundle"] = 2048] = "generateBundle";
|
|
1906
|
+
HookUsageKind$1[HookUsageKind$1["writeBundle"] = 4096] = "writeBundle";
|
|
1907
|
+
HookUsageKind$1[HookUsageKind$1["closeBundle"] = 8192] = "closeBundle";
|
|
1908
|
+
HookUsageKind$1[HookUsageKind$1["watchChange"] = 16384] = "watchChange";
|
|
1909
|
+
HookUsageKind$1[HookUsageKind$1["closeWatcher"] = 32768] = "closeWatcher";
|
|
1910
|
+
HookUsageKind$1[HookUsageKind$1["transformAst"] = 65536] = "transformAst";
|
|
1911
|
+
HookUsageKind$1[HookUsageKind$1["banner"] = 131072] = "banner";
|
|
1912
|
+
HookUsageKind$1[HookUsageKind$1["footer"] = 262144] = "footer";
|
|
1913
|
+
HookUsageKind$1[HookUsageKind$1["intro"] = 524288] = "intro";
|
|
1914
|
+
HookUsageKind$1[HookUsageKind$1["outro"] = 1048576] = "outro";
|
|
1915
|
+
return HookUsageKind$1;
|
|
1916
|
+
}({});
|
|
1917
|
+
var HookUsage = class {
|
|
1918
|
+
bitflag = BigInt(0);
|
|
1919
|
+
constructor() {}
|
|
1920
|
+
union(kind) {
|
|
1921
|
+
this.bitflag |= BigInt(kind);
|
|
1922
|
+
}
|
|
1923
|
+
inner() {
|
|
1924
|
+
return Number(this.bitflag);
|
|
1925
|
+
}
|
|
1926
|
+
};
|
|
1927
|
+
function extractHookUsage(plugin) {
|
|
1928
|
+
let hookUsage = new HookUsage();
|
|
1929
|
+
if (plugin.buildStart) hookUsage.union(HookUsageKind.buildStart);
|
|
1930
|
+
if (plugin.resolveId) hookUsage.union(HookUsageKind.resolveId);
|
|
1931
|
+
if (plugin.resolveDynamicImport) hookUsage.union(HookUsageKind.resolveDynamicImport);
|
|
1932
|
+
if (plugin.load) hookUsage.union(HookUsageKind.load);
|
|
1933
|
+
if (plugin.transform) hookUsage.union(HookUsageKind.transform);
|
|
1934
|
+
if (plugin.moduleParsed) hookUsage.union(HookUsageKind.moduleParsed);
|
|
1935
|
+
if (plugin.buildEnd) hookUsage.union(HookUsageKind.buildEnd);
|
|
1936
|
+
if (plugin.renderStart) hookUsage.union(HookUsageKind.renderStart);
|
|
1937
|
+
if (plugin.renderError) hookUsage.union(HookUsageKind.renderError);
|
|
1938
|
+
if (plugin.renderChunk) hookUsage.union(HookUsageKind.renderChunk);
|
|
1939
|
+
if (plugin.augmentChunkHash) hookUsage.union(HookUsageKind.augmentChunkHash);
|
|
1940
|
+
if (plugin.generateBundle) hookUsage.union(HookUsageKind.generateBundle);
|
|
1941
|
+
if (plugin.writeBundle) hookUsage.union(HookUsageKind.writeBundle);
|
|
1942
|
+
if (plugin.closeBundle) hookUsage.union(HookUsageKind.closeBundle);
|
|
1943
|
+
if (plugin.watchChange) hookUsage.union(HookUsageKind.watchChange);
|
|
1944
|
+
if (plugin.closeWatcher) hookUsage.union(HookUsageKind.closeWatcher);
|
|
1945
|
+
if (plugin.banner) hookUsage.union(HookUsageKind.banner);
|
|
1946
|
+
if (plugin.footer) hookUsage.union(HookUsageKind.footer);
|
|
1947
|
+
if (plugin.intro) hookUsage.union(HookUsageKind.intro);
|
|
1948
|
+
if (plugin.outro) hookUsage.union(HookUsageKind.outro);
|
|
1949
|
+
return hookUsage;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1875
1952
|
//#endregion
|
|
1876
1953
|
//#region src/plugin/bindingify-plugin.ts
|
|
1877
1954
|
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -1905,6 +1982,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1905
1982
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
|
|
1906
1983
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
|
|
1907
1984
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
1985
|
+
let hookUsage = extractHookUsage(plugin).inner();
|
|
1908
1986
|
const result = {
|
|
1909
1987
|
name: plugin.name,
|
|
1910
1988
|
buildStart,
|
|
@@ -1949,7 +2027,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1949
2027
|
watchChange,
|
|
1950
2028
|
watchChangeMeta,
|
|
1951
2029
|
closeWatcher,
|
|
1952
|
-
closeWatcherMeta
|
|
2030
|
+
closeWatcherMeta,
|
|
2031
|
+
hookUsage
|
|
1953
2032
|
};
|
|
1954
2033
|
return wrapHandlers(result);
|
|
1955
2034
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __esm } from "./chunk-DUYDk_2O.mjs";
|
|
2
|
-
import { augmentCodeLocation, error, import_binding, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-
|
|
2
|
+
import { augmentCodeLocation, error, import_binding, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-C93JXze5.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import colors from "ansis";
|
|
5
5
|
import { toJsonSchema } from "@valibot/to-json-schema";
|
|
@@ -8,7 +8,7 @@ import { availableParallelism } from "node:os";
|
|
|
8
8
|
import { Worker } from "node:worker_threads";
|
|
9
9
|
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.0.0-beta.7-commit.
|
|
11
|
+
var version = "1.0.0-beta.7-commit.a684277";
|
|
12
12
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
@@ -709,6 +709,7 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
|
|
|
709
709
|
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."))
|
|
710
710
|
});
|
|
711
711
|
InputCliOverrideSchema = v.strictObject({
|
|
712
|
+
input: v.pipe(v.optional(v.array(v.string())), v.description("Entry file")),
|
|
712
713
|
external: v.pipe(v.optional(v.array(v.string())), v.description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
713
714
|
inject: v.pipe(v.optional(v.record(v.string(), v.string())), v.description("Inject import statements on demand")),
|
|
714
715
|
treeshake: v.pipe(v.optional(v.boolean()), v.description("enable treeshaking")),
|
|
@@ -718,7 +719,6 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
|
|
|
718
719
|
...InputOptionsSchema.entries,
|
|
719
720
|
...InputCliOverrideSchema.entries
|
|
720
721
|
}), [
|
|
721
|
-
"input",
|
|
722
722
|
"plugins",
|
|
723
723
|
"onwarn",
|
|
724
724
|
"onLog",
|
|
@@ -2016,6 +2016,70 @@ var init_bindingify_watch_hooks = __esm({ "src/plugin/bindingify-watch-hooks.ts"
|
|
|
2016
2016
|
init_plugin_context();
|
|
2017
2017
|
} });
|
|
2018
2018
|
|
|
2019
|
+
//#endregion
|
|
2020
|
+
//#region src/plugin/generated/hook-usage.ts
|
|
2021
|
+
function extractHookUsage(plugin) {
|
|
2022
|
+
let hookUsage = new HookUsage();
|
|
2023
|
+
if (plugin.buildStart) hookUsage.union(HookUsageKind.buildStart);
|
|
2024
|
+
if (plugin.resolveId) hookUsage.union(HookUsageKind.resolveId);
|
|
2025
|
+
if (plugin.resolveDynamicImport) hookUsage.union(HookUsageKind.resolveDynamicImport);
|
|
2026
|
+
if (plugin.load) hookUsage.union(HookUsageKind.load);
|
|
2027
|
+
if (plugin.transform) hookUsage.union(HookUsageKind.transform);
|
|
2028
|
+
if (plugin.moduleParsed) hookUsage.union(HookUsageKind.moduleParsed);
|
|
2029
|
+
if (plugin.buildEnd) hookUsage.union(HookUsageKind.buildEnd);
|
|
2030
|
+
if (plugin.renderStart) hookUsage.union(HookUsageKind.renderStart);
|
|
2031
|
+
if (plugin.renderError) hookUsage.union(HookUsageKind.renderError);
|
|
2032
|
+
if (plugin.renderChunk) hookUsage.union(HookUsageKind.renderChunk);
|
|
2033
|
+
if (plugin.augmentChunkHash) hookUsage.union(HookUsageKind.augmentChunkHash);
|
|
2034
|
+
if (plugin.generateBundle) hookUsage.union(HookUsageKind.generateBundle);
|
|
2035
|
+
if (plugin.writeBundle) hookUsage.union(HookUsageKind.writeBundle);
|
|
2036
|
+
if (plugin.closeBundle) hookUsage.union(HookUsageKind.closeBundle);
|
|
2037
|
+
if (plugin.watchChange) hookUsage.union(HookUsageKind.watchChange);
|
|
2038
|
+
if (plugin.closeWatcher) hookUsage.union(HookUsageKind.closeWatcher);
|
|
2039
|
+
if (plugin.banner) hookUsage.union(HookUsageKind.banner);
|
|
2040
|
+
if (plugin.footer) hookUsage.union(HookUsageKind.footer);
|
|
2041
|
+
if (plugin.intro) hookUsage.union(HookUsageKind.intro);
|
|
2042
|
+
if (plugin.outro) hookUsage.union(HookUsageKind.outro);
|
|
2043
|
+
return hookUsage;
|
|
2044
|
+
}
|
|
2045
|
+
var HookUsageKind, HookUsage;
|
|
2046
|
+
var init_hook_usage = __esm({ "src/plugin/generated/hook-usage.ts"() {
|
|
2047
|
+
HookUsageKind = /* @__PURE__ */ function(HookUsageKind$1) {
|
|
2048
|
+
HookUsageKind$1[HookUsageKind$1["buildStart"] = 1] = "buildStart";
|
|
2049
|
+
HookUsageKind$1[HookUsageKind$1["resolveId"] = 2] = "resolveId";
|
|
2050
|
+
HookUsageKind$1[HookUsageKind$1["resolveDynamicImport"] = 4] = "resolveDynamicImport";
|
|
2051
|
+
HookUsageKind$1[HookUsageKind$1["load"] = 8] = "load";
|
|
2052
|
+
HookUsageKind$1[HookUsageKind$1["transform"] = 16] = "transform";
|
|
2053
|
+
HookUsageKind$1[HookUsageKind$1["moduleParsed"] = 32] = "moduleParsed";
|
|
2054
|
+
HookUsageKind$1[HookUsageKind$1["buildEnd"] = 64] = "buildEnd";
|
|
2055
|
+
HookUsageKind$1[HookUsageKind$1["renderStart"] = 128] = "renderStart";
|
|
2056
|
+
HookUsageKind$1[HookUsageKind$1["renderError"] = 256] = "renderError";
|
|
2057
|
+
HookUsageKind$1[HookUsageKind$1["renderChunk"] = 512] = "renderChunk";
|
|
2058
|
+
HookUsageKind$1[HookUsageKind$1["augmentChunkHash"] = 1024] = "augmentChunkHash";
|
|
2059
|
+
HookUsageKind$1[HookUsageKind$1["generateBundle"] = 2048] = "generateBundle";
|
|
2060
|
+
HookUsageKind$1[HookUsageKind$1["writeBundle"] = 4096] = "writeBundle";
|
|
2061
|
+
HookUsageKind$1[HookUsageKind$1["closeBundle"] = 8192] = "closeBundle";
|
|
2062
|
+
HookUsageKind$1[HookUsageKind$1["watchChange"] = 16384] = "watchChange";
|
|
2063
|
+
HookUsageKind$1[HookUsageKind$1["closeWatcher"] = 32768] = "closeWatcher";
|
|
2064
|
+
HookUsageKind$1[HookUsageKind$1["transformAst"] = 65536] = "transformAst";
|
|
2065
|
+
HookUsageKind$1[HookUsageKind$1["banner"] = 131072] = "banner";
|
|
2066
|
+
HookUsageKind$1[HookUsageKind$1["footer"] = 262144] = "footer";
|
|
2067
|
+
HookUsageKind$1[HookUsageKind$1["intro"] = 524288] = "intro";
|
|
2068
|
+
HookUsageKind$1[HookUsageKind$1["outro"] = 1048576] = "outro";
|
|
2069
|
+
return HookUsageKind$1;
|
|
2070
|
+
}({});
|
|
2071
|
+
HookUsage = class {
|
|
2072
|
+
bitflag = BigInt(0);
|
|
2073
|
+
constructor() {}
|
|
2074
|
+
union(kind) {
|
|
2075
|
+
this.bitflag |= BigInt(kind);
|
|
2076
|
+
}
|
|
2077
|
+
inner() {
|
|
2078
|
+
return Number(this.bitflag);
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
} });
|
|
2082
|
+
|
|
2019
2083
|
//#endregion
|
|
2020
2084
|
//#region src/plugin/bindingify-plugin.ts
|
|
2021
2085
|
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -2049,6 +2113,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2049
2113
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
|
|
2050
2114
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
|
|
2051
2115
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
2116
|
+
let hookUsage = extractHookUsage(plugin).inner();
|
|
2052
2117
|
const result = {
|
|
2053
2118
|
name: plugin.name,
|
|
2054
2119
|
buildStart,
|
|
@@ -2093,7 +2158,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2093
2158
|
watchChange,
|
|
2094
2159
|
watchChangeMeta,
|
|
2095
2160
|
closeWatcher,
|
|
2096
|
-
closeWatcherMeta
|
|
2161
|
+
closeWatcherMeta,
|
|
2162
|
+
hookUsage
|
|
2097
2163
|
};
|
|
2098
2164
|
return wrapHandlers(result);
|
|
2099
2165
|
}
|
|
@@ -2139,6 +2205,7 @@ var init_bindingify_plugin = __esm({ "src/plugin/bindingify-plugin.ts"() {
|
|
|
2139
2205
|
init_bindingify_output_hooks();
|
|
2140
2206
|
init_logs();
|
|
2141
2207
|
init_bindingify_watch_hooks();
|
|
2208
|
+
init_hook_usage();
|
|
2142
2209
|
} });
|
|
2143
2210
|
|
|
2144
2211
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.0.0-beta.7-commit.
|
|
3
|
+
"version": "1.0.0-beta.7-commit.a684277",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"homepage": "https://rolldown.rs/",
|
|
@@ -28,25 +28,21 @@
|
|
|
28
28
|
"rolldown": "./bin/cli.mjs"
|
|
29
29
|
},
|
|
30
30
|
"main": "./dist/index.cjs",
|
|
31
|
-
"types": "./dist/
|
|
31
|
+
"types": "./dist/index.d.cts",
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
|
-
"types": "./dist/types/index.d.ts",
|
|
35
34
|
"require": "./dist/index.cjs",
|
|
36
35
|
"import": "./dist/index.mjs"
|
|
37
36
|
},
|
|
38
37
|
"./experimental": {
|
|
39
|
-
"types": "./dist/types/experimental-index.d.ts",
|
|
40
38
|
"require": "./dist/experimental-index.cjs",
|
|
41
39
|
"import": "./dist/experimental-index.mjs"
|
|
42
40
|
},
|
|
43
41
|
"./parallel-plugin": {
|
|
44
|
-
"types": "./dist/types/parallel-plugin.d.ts",
|
|
45
42
|
"require": "./dist/parallel-plugin.cjs",
|
|
46
43
|
"import": "./dist/parallel-plugin.mjs"
|
|
47
44
|
},
|
|
48
45
|
"./parseAst": {
|
|
49
|
-
"types": "./dist/types/parse-ast-index.d.ts",
|
|
50
46
|
"require": "./dist/parse-ast-index.cjs",
|
|
51
47
|
"import": "./dist/parse-ast-index.mjs"
|
|
52
48
|
},
|
|
@@ -114,6 +110,7 @@
|
|
|
114
110
|
"oxc-parser": "^0.64.0",
|
|
115
111
|
"pathe": "^2.0.3",
|
|
116
112
|
"remeda": "^2.10.0",
|
|
113
|
+
"rolldown-plugin-dts": "^0.7.12",
|
|
117
114
|
"rollup": "^4.18.0",
|
|
118
115
|
"signal-exit": "4.1.0",
|
|
119
116
|
"source-map": "^0.7.4",
|
|
@@ -122,22 +119,22 @@
|
|
|
122
119
|
"typedoc": "^0.28.0",
|
|
123
120
|
"typescript": "^5.7.3",
|
|
124
121
|
"unbuild": "^3.0.0",
|
|
125
|
-
"
|
|
126
|
-
"rolldown": "
|
|
122
|
+
"rolldown": "1.0.0-beta.7-commit.a684277",
|
|
123
|
+
"@rolldown/testing": "0.0.1"
|
|
127
124
|
},
|
|
128
125
|
"optionalDependencies": {
|
|
129
|
-
"@rolldown/binding-darwin-
|
|
130
|
-
"@rolldown/binding-
|
|
131
|
-
"@rolldown/binding-
|
|
132
|
-
"@rolldown/binding-
|
|
133
|
-
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.7-commit.
|
|
134
|
-
"@rolldown/binding-linux-
|
|
135
|
-
"@rolldown/binding-
|
|
136
|
-
"@rolldown/binding-linux-
|
|
137
|
-
"@rolldown/binding-
|
|
138
|
-
"@rolldown/binding-win32-
|
|
139
|
-
"@rolldown/binding-
|
|
140
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.7-commit.
|
|
126
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.7-commit.a684277",
|
|
127
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.7-commit.a684277",
|
|
128
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.7-commit.a684277",
|
|
129
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.7-commit.a684277",
|
|
130
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.7-commit.a684277",
|
|
131
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.7-commit.a684277",
|
|
132
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.7-commit.a684277",
|
|
133
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.7-commit.a684277",
|
|
134
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.7-commit.a684277",
|
|
135
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.7-commit.a684277",
|
|
136
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.7-commit.a684277",
|
|
137
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.7-commit.a684277"
|
|
141
138
|
},
|
|
142
139
|
"scripts": {
|
|
143
140
|
"# Scrips for binding #": "_",
|
|
@@ -147,7 +144,6 @@
|
|
|
147
144
|
"build-binding:wasi": "pnpm build-binding --target wasm32-wasip1-threads",
|
|
148
145
|
"build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads",
|
|
149
146
|
"# Scrips for node #": "_",
|
|
150
|
-
"build-types": "tsc -p ./tsconfig.json",
|
|
151
147
|
"build-node": "tsx ./build.ts",
|
|
152
148
|
"build-types-check": "tsc -p ./tsconfig.check.json",
|
|
153
149
|
"build-js-glue": "pnpm run --sequential \"/^build-(types|node|types-check)$/\"",
|