rolldown 1.0.0-beta.7-commit.139c54d → 1.0.0-beta.7-commit.e117288
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/cjs/cli.cjs +2 -2
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +2 -2
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/{src-DGUmeSRg.cjs → src-0U2mwYW1.cjs} +13 -3
- package/dist/shared/{src-B2OfQx0E.mjs → src-CzwAPLbe.mjs} +13 -3
- package/dist/types/plugin/hook-filter.d.ts +6 -5
- package/dist/types/plugin/index.d.ts +4 -3
- package/dist/types/plugin/plugin-context-data.d.ts +4 -0
- package/package.json +14 -14
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-0U2mwYW1.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-DbQWN9pL.cjs');
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
@@ -1393,7 +1393,7 @@ function collectOutputEntries(output) {
|
|
|
1393
1393
|
return output.map((chunk) => ({
|
|
1394
1394
|
type: chunk.type,
|
|
1395
1395
|
fileName: chunk.fileName,
|
|
1396
|
-
size: chunk.type === "chunk" ? chunk.code
|
|
1396
|
+
size: chunk.type === "chunk" ? Buffer.byteLength(chunk.code) : Buffer.byteLength(chunk.source)
|
|
1397
1397
|
}));
|
|
1398
1398
|
}
|
|
1399
1399
|
function collectOutputLayoutAdjustmentSizes(entries) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-0U2mwYW1.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-DbQWN9pL.cjs');
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-0U2mwYW1.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-DbQWN9pL.cjs');
|
|
5
5
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
6
6
|
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { colors } from "../shared/parse-ast-index-B-UemHTj.mjs";
|
|
2
|
-
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-
|
|
2
|
+
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-CzwAPLbe.mjs";
|
|
3
3
|
import process$1, { cwd } from "node:process";
|
|
4
4
|
import path, { sep } from "node:path";
|
|
5
5
|
import fs from "node:fs";
|
|
@@ -1389,7 +1389,7 @@ function collectOutputEntries(output) {
|
|
|
1389
1389
|
return output.map((chunk) => ({
|
|
1390
1390
|
type: chunk.type,
|
|
1391
1391
|
fileName: chunk.fileName,
|
|
1392
|
-
size: chunk.type === "chunk" ? chunk.code
|
|
1392
|
+
size: chunk.type === "chunk" ? Buffer.byteLength(chunk.code) : Buffer.byteLength(chunk.source)
|
|
1393
1393
|
}));
|
|
1394
1394
|
}
|
|
1395
1395
|
function collectOutputLayoutAdjustmentSizes(entries) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { import_binding } from "../shared/parse-ast-index-B-UemHTj.mjs";
|
|
2
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
2
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CzwAPLbe.mjs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
|
|
5
5
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../shared/parse-ast-index-B-UemHTj.mjs";
|
|
2
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CzwAPLbe.mjs";
|
|
3
3
|
|
|
4
4
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { import_binding } from "../shared/parse-ast-index-B-UemHTj.mjs";
|
|
2
|
-
import { PluginContextData, bindingifyPlugin } from "../shared/src-
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "../shared/src-CzwAPLbe.mjs";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -891,6 +891,7 @@ function transformToRenderedModule(bindingRenderedModule) {
|
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/utils/transform-rendered-chunk.ts
|
|
893
893
|
function transformRenderedChunk(chunk) {
|
|
894
|
+
let modules = null;
|
|
894
895
|
return {
|
|
895
896
|
get name() {
|
|
896
897
|
return chunk.name;
|
|
@@ -920,7 +921,8 @@ function transformRenderedChunk(chunk) {
|
|
|
920
921
|
return chunk.dynamicImports;
|
|
921
922
|
},
|
|
922
923
|
get modules() {
|
|
923
|
-
|
|
924
|
+
if (!modules) modules = transformChunkModules(chunk.modules);
|
|
925
|
+
return modules;
|
|
924
926
|
}
|
|
925
927
|
};
|
|
926
928
|
}
|
|
@@ -1698,7 +1700,8 @@ function bindingifyRenderChunk(args) {
|
|
|
1698
1700
|
const { handler, meta } = normalizeHook(hook);
|
|
1699
1701
|
return {
|
|
1700
1702
|
plugin: async (ctx, code, chunk, opts, chunks) => {
|
|
1701
|
-
|
|
1703
|
+
if (args.pluginContextData.getRenderChunkMeta() == null) args.pluginContextData.setRenderChunkMeta({ chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
|
|
1704
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), args.pluginContextData.getRenderChunkMeta());
|
|
1702
1705
|
if (ret == null) return;
|
|
1703
1706
|
if (typeof ret === "string") return { code: ret };
|
|
1704
1707
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1976,6 +1979,7 @@ var PluginContextData = class {
|
|
|
1976
1979
|
moduleOptionMap = new Map();
|
|
1977
1980
|
resolveOptionsMap = new Map();
|
|
1978
1981
|
loadModulePromiseMap = new Map();
|
|
1982
|
+
meta = null;
|
|
1979
1983
|
updateModuleOption(id, option) {
|
|
1980
1984
|
const existing = this.moduleOptionMap.get(id);
|
|
1981
1985
|
if (existing) {
|
|
@@ -2040,6 +2044,12 @@ var PluginContextData = class {
|
|
|
2040
2044
|
removeSavedResolveOptions(receipt) {
|
|
2041
2045
|
this.resolveOptionsMap.delete(receipt);
|
|
2042
2046
|
}
|
|
2047
|
+
setRenderChunkMeta(meta) {
|
|
2048
|
+
this.meta = meta;
|
|
2049
|
+
}
|
|
2050
|
+
getRenderChunkMeta() {
|
|
2051
|
+
return this.meta;
|
|
2052
|
+
}
|
|
2043
2053
|
};
|
|
2044
2054
|
|
|
2045
2055
|
//#endregion
|
|
@@ -2853,7 +2863,7 @@ const watch = (input) => {
|
|
|
2853
2863
|
|
|
2854
2864
|
//#endregion
|
|
2855
2865
|
//#region package.json
|
|
2856
|
-
var version = "1.0.0-beta.7-commit.
|
|
2866
|
+
var version = "1.0.0-beta.7-commit.e117288";
|
|
2857
2867
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2858
2868
|
|
|
2859
2869
|
//#endregion
|
|
@@ -889,6 +889,7 @@ function transformToRenderedModule(bindingRenderedModule) {
|
|
|
889
889
|
//#endregion
|
|
890
890
|
//#region src/utils/transform-rendered-chunk.ts
|
|
891
891
|
function transformRenderedChunk(chunk) {
|
|
892
|
+
let modules = null;
|
|
892
893
|
return {
|
|
893
894
|
get name() {
|
|
894
895
|
return chunk.name;
|
|
@@ -918,7 +919,8 @@ function transformRenderedChunk(chunk) {
|
|
|
918
919
|
return chunk.dynamicImports;
|
|
919
920
|
},
|
|
920
921
|
get modules() {
|
|
921
|
-
|
|
922
|
+
if (!modules) modules = transformChunkModules(chunk.modules);
|
|
923
|
+
return modules;
|
|
922
924
|
}
|
|
923
925
|
};
|
|
924
926
|
}
|
|
@@ -1696,7 +1698,8 @@ function bindingifyRenderChunk(args) {
|
|
|
1696
1698
|
const { handler, meta } = normalizeHook(hook);
|
|
1697
1699
|
return {
|
|
1698
1700
|
plugin: async (ctx, code, chunk, opts, chunks) => {
|
|
1699
|
-
|
|
1701
|
+
if (args.pluginContextData.getRenderChunkMeta() == null) args.pluginContextData.setRenderChunkMeta({ chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
|
|
1702
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), args.pluginContextData.getRenderChunkMeta());
|
|
1700
1703
|
if (ret == null) return;
|
|
1701
1704
|
if (typeof ret === "string") return { code: ret };
|
|
1702
1705
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1974,6 +1977,7 @@ var PluginContextData = class {
|
|
|
1974
1977
|
moduleOptionMap = new Map();
|
|
1975
1978
|
resolveOptionsMap = new Map();
|
|
1976
1979
|
loadModulePromiseMap = new Map();
|
|
1980
|
+
meta = null;
|
|
1977
1981
|
updateModuleOption(id, option) {
|
|
1978
1982
|
const existing = this.moduleOptionMap.get(id);
|
|
1979
1983
|
if (existing) {
|
|
@@ -2038,6 +2042,12 @@ var PluginContextData = class {
|
|
|
2038
2042
|
removeSavedResolveOptions(receipt) {
|
|
2039
2043
|
this.resolveOptionsMap.delete(receipt);
|
|
2040
2044
|
}
|
|
2045
|
+
setRenderChunkMeta(meta) {
|
|
2046
|
+
this.meta = meta;
|
|
2047
|
+
}
|
|
2048
|
+
getRenderChunkMeta() {
|
|
2049
|
+
return this.meta;
|
|
2050
|
+
}
|
|
2041
2051
|
};
|
|
2042
2052
|
|
|
2043
2053
|
//#endregion
|
|
@@ -2851,7 +2861,7 @@ const watch = (input) => {
|
|
|
2851
2861
|
|
|
2852
2862
|
//#endregion
|
|
2853
2863
|
//#region package.json
|
|
2854
|
-
var version = "1.0.0-beta.7-commit.
|
|
2864
|
+
var version = "1.0.0-beta.7-commit.e117288";
|
|
2855
2865
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2856
2866
|
|
|
2857
2867
|
//#endregion
|
|
@@ -12,28 +12,29 @@ export type ModuleTypeFilter = ModuleType[] | FormalModuleTypeFilter;
|
|
|
12
12
|
export interface HookFilter {
|
|
13
13
|
/**
|
|
14
14
|
* This filter is used to do a pre-test to determine whether the hook should be called.
|
|
15
|
+
*
|
|
15
16
|
* @example
|
|
16
|
-
*
|
|
17
|
+
* Include all `id`s that contain `node_modules` in the path.
|
|
17
18
|
* ```js
|
|
18
19
|
* { id: 'node_modules' }
|
|
19
20
|
* ```
|
|
20
21
|
* @example
|
|
21
|
-
*
|
|
22
|
+
* Include all `id`s that contain `node_modules` or `src` in the path.
|
|
22
23
|
* ```js
|
|
23
24
|
* { id: ['node_modules', 'src'] }
|
|
24
25
|
* ```
|
|
25
26
|
* @example
|
|
26
|
-
*
|
|
27
|
+
* Include all `id`s that start with `http`
|
|
27
28
|
* ```js
|
|
28
29
|
* { id: /^http/ }
|
|
29
30
|
* ```
|
|
30
31
|
* @example
|
|
31
|
-
*
|
|
32
|
+
* Exclude all `id`s that contain `node_modules` in the path.
|
|
32
33
|
* ```js
|
|
33
34
|
* { id: { exclude: 'node_modules' } }
|
|
34
35
|
* ```
|
|
35
36
|
* @example
|
|
36
|
-
*
|
|
37
|
+
* Formal pattern to define includes and excludes.
|
|
37
38
|
* ```
|
|
38
39
|
* { id : {
|
|
39
40
|
* include: ["foo", /bar/],
|
|
@@ -53,6 +53,9 @@ export interface PrivateResolveIdExtraOptions extends ResolveIdExtraOptions {
|
|
|
53
53
|
export type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
54
54
|
export type LoadResult = NullValue | string | SourceDescription;
|
|
55
55
|
export type TransformResult = NullValue | string | Partial<SourceDescription>;
|
|
56
|
+
export type RenderedChunkMeta = {
|
|
57
|
+
chunks: Record<string, RenderedChunk>;
|
|
58
|
+
};
|
|
56
59
|
export interface FunctionPluginHooks {
|
|
57
60
|
[DEFINED_HOOK_NAMES.onLog]: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => NullValue | boolean;
|
|
58
61
|
[DEFINED_HOOK_NAMES.options]: (this: MinimalPluginContext, options: InputOptions) => NullValue | InputOptions;
|
|
@@ -71,9 +74,7 @@ export interface FunctionPluginHooks {
|
|
|
71
74
|
[DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
|
|
72
75
|
[DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
|
|
73
76
|
[DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
|
|
74
|
-
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: {
|
|
75
|
-
chunks: Record<string, RenderedChunk>;
|
|
76
|
-
}) => NullValue | string | {
|
|
77
|
+
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | {
|
|
77
78
|
code: string;
|
|
78
79
|
map?: SourceMapInput;
|
|
79
80
|
};
|
|
@@ -2,10 +2,12 @@ import { BindingPluginContext } from '../binding';
|
|
|
2
2
|
import { ModuleOptions } from '..';
|
|
3
3
|
import { PluginContextResolveOptions } from './plugin-context';
|
|
4
4
|
import type { ModuleInfo } from '../types/module-info';
|
|
5
|
+
import { RenderedChunkMeta } from '.';
|
|
5
6
|
export declare class PluginContextData {
|
|
6
7
|
moduleOptionMap: Map<string, ModuleOptions>;
|
|
7
8
|
resolveOptionsMap: Map<number, PluginContextResolveOptions>;
|
|
8
9
|
loadModulePromiseMap: Map<string, Promise<void>>;
|
|
10
|
+
meta: RenderedChunkMeta | null;
|
|
9
11
|
updateModuleOption(id: string, option: ModuleOptions): ModuleOptions;
|
|
10
12
|
getModuleOption(id: string): ModuleOptions;
|
|
11
13
|
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null;
|
|
@@ -14,4 +16,6 @@ export declare class PluginContextData {
|
|
|
14
16
|
saveResolveOptions(options: PluginContextResolveOptions): number;
|
|
15
17
|
getSavedResolveOptions(receipt: number): PluginContextResolveOptions | undefined;
|
|
16
18
|
removeSavedResolveOptions(receipt: number): void;
|
|
19
|
+
setRenderChunkMeta(meta: RenderedChunkMeta): void;
|
|
20
|
+
getRenderChunkMeta(): RenderedChunkMeta | null;
|
|
17
21
|
}
|
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.e117288",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -123,21 +123,21 @@
|
|
|
123
123
|
"unbuild": "^3.0.0",
|
|
124
124
|
"why-is-node-running": "^3.0.0",
|
|
125
125
|
"@rolldown/testing": "0.0.1",
|
|
126
|
-
"rolldown": "1.0.0-beta.7-commit.
|
|
126
|
+
"rolldown": "1.0.0-beta.7-commit.e117288"
|
|
127
127
|
},
|
|
128
128
|
"optionalDependencies": {
|
|
129
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.7-commit.
|
|
130
|
-
"@rolldown/binding-
|
|
131
|
-
"@rolldown/binding-
|
|
132
|
-
"@rolldown/binding-
|
|
133
|
-
"@rolldown/binding-linux-
|
|
134
|
-
"@rolldown/binding-linux-
|
|
135
|
-
"@rolldown/binding-linux-
|
|
136
|
-
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.7-commit.
|
|
137
|
-
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.7-commit.
|
|
138
|
-
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.7-commit.
|
|
139
|
-
"@rolldown/binding-win32-
|
|
140
|
-
"@rolldown/binding-win32-
|
|
129
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.7-commit.e117288",
|
|
130
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.7-commit.e117288",
|
|
131
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.7-commit.e117288",
|
|
132
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.7-commit.e117288",
|
|
133
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.7-commit.e117288",
|
|
134
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.7-commit.e117288",
|
|
135
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.7-commit.e117288",
|
|
136
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.7-commit.e117288",
|
|
137
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.7-commit.e117288",
|
|
138
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.7-commit.e117288",
|
|
139
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.7-commit.e117288",
|
|
140
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.7-commit.e117288"
|
|
141
141
|
},
|
|
142
142
|
"scripts": {
|
|
143
143
|
"# Scrips for binding #": "_",
|