rolldown 0.14.0-snapshot-12d7e71-20241201004055 → 0.14.0-snapshot-d42ea8a-20241202003632
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 +1 -1
- 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/{consola_36c0034f--b2gQiI0.cjs → consola_36c0034f-_8_dG1Nr.cjs} +3 -1
- package/dist/shared/prompt-RFvZMmjc.cjs +1 -1
- package/dist/shared/{src-DrLPqkUf.cjs → src-CfQyqNSn.cjs} +37 -27
- package/dist/shared/{src-Bx1l8mKg.mjs → src-DhHfkqAC.mjs} +37 -27
- package/dist/types/binding.d.ts +3 -8
- package/dist/types/index.d.ts +4 -4
- package/dist/types/options/output-options-schema.d.ts +6 -5
- package/dist/types/options/output-options.d.ts +3 -2
- package/dist/types/plugin/index.d.ts +5 -4
- package/dist/types/rollup-types.d.ts +1 -1
- package/dist/types/types/rolldown-output.d.ts +11 -2
- package/dist/types/utils/normalize-string-or-regex.d.ts +1 -1
- package/dist/types/utils/transform-rendered-chunk.d.ts +4 -0
- package/dist/types/utils/transform-rendered-module.d.ts +3 -2
- package/package.json +15 -15
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
4
|
-
const require_consola_36c0034f = require('../shared/consola_36c0034f
|
|
3
|
+
const require_src = require('../shared/src-CfQyqNSn.cjs');
|
|
4
|
+
const require_consola_36c0034f = require('../shared/consola_36c0034f-_8_dG1Nr.cjs');
|
|
5
5
|
const zod = require_chunk.__toESM(require("zod"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
7
7
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-CfQyqNSn.cjs');
|
|
4
4
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-CfQyqNSn.cjs');
|
|
4
4
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-
|
|
1
|
+
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src-DhHfkqAC.mjs";
|
|
2
2
|
import { createConsola } from "../shared/consola_36c0034f-DWsVjwtA.mjs";
|
|
3
3
|
import { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$2, z, z as z$1, z as z$2, z as z$3 } from "zod";
|
|
4
4
|
import nodePath, { default as path } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
1
|
+
import { BuiltinPlugin, __toESM, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, require_binding, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-DhHfkqAC.mjs";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-
|
|
1
|
+
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src-DhHfkqAC.mjs";
|
|
2
2
|
import { parentPort, workerData } from "node:worker_threads";
|
|
3
3
|
|
|
4
4
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -817,7 +817,9 @@ function createConsola(options = {}) {
|
|
|
817
817
|
defaults: { level },
|
|
818
818
|
stdout: process.stdout,
|
|
819
819
|
stderr: process.stderr,
|
|
820
|
-
prompt: (...args) =>
|
|
820
|
+
prompt: (...args) => Promise.resolve().then(function() {
|
|
821
|
+
return require("./prompt-RFvZMmjc.cjs");
|
|
822
|
+
}).then((m) => m.prompt(...args)),
|
|
821
823
|
reporters: options.reporters || [options.fancy ?? !(isCI || isTest) ? new FancyReporter() : new BasicReporter()],
|
|
822
824
|
...options
|
|
823
825
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-BK2Ye-xa.cjs');
|
|
3
|
-
const require_consola_36c0034f = require('./consola_36c0034f
|
|
3
|
+
const require_consola_36c0034f = require('./consola_36c0034f-_8_dG1Nr.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
6
6
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
@@ -32,19 +32,6 @@ function bindingifySourcemap$1(map) {
|
|
|
32
32
|
} };
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/utils/transform-rendered-module.ts
|
|
37
|
-
function transformToRenderedModule(bindingRenderedModule) {
|
|
38
|
-
return {
|
|
39
|
-
get code() {
|
|
40
|
-
return bindingRenderedModule.code;
|
|
41
|
-
},
|
|
42
|
-
get renderedLength() {
|
|
43
|
-
return bindingRenderedModule.code?.length || 0;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
35
|
//#endregion
|
|
49
36
|
//#region src/utils/error.ts
|
|
50
37
|
function normalizeErrors(rawErrors) {
|
|
@@ -89,6 +76,35 @@ function joinNewLine(s1, s2) {
|
|
|
89
76
|
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
90
77
|
}
|
|
91
78
|
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/utils/transform-rendered-module.ts
|
|
81
|
+
function transformToRenderedModule(bindingRenderedModule) {
|
|
82
|
+
return {
|
|
83
|
+
get code() {
|
|
84
|
+
return bindingRenderedModule.code;
|
|
85
|
+
},
|
|
86
|
+
get renderedLength() {
|
|
87
|
+
return bindingRenderedModule.code?.length || 0;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/utils/transform-rendered-chunk.ts
|
|
94
|
+
function transformRenderedChunk(chunk) {
|
|
95
|
+
return {
|
|
96
|
+
...chunk,
|
|
97
|
+
get modules() {
|
|
98
|
+
return transformChunkModules(chunk.modules);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function transformChunkModules(modules) {
|
|
103
|
+
const result = {};
|
|
104
|
+
for (const [id, mod] of Object.entries(modules)) result[id] = transformToRenderedModule(mod);
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
|
|
92
108
|
//#endregion
|
|
93
109
|
//#region src/utils/transform-to-rollup-output.ts
|
|
94
110
|
function transformToRollupOutputChunk(bindingChunk, changed) {
|
|
@@ -100,7 +116,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
|
|
|
100
116
|
fileName: bindingChunk.fileName,
|
|
101
117
|
name: bindingChunk.name,
|
|
102
118
|
get modules() {
|
|
103
|
-
return
|
|
119
|
+
return transformChunkModules(bindingChunk.modules);
|
|
104
120
|
},
|
|
105
121
|
get imports() {
|
|
106
122
|
return bindingChunk.imports;
|
|
@@ -1586,10 +1602,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1586
1602
|
const { handler, meta } = normalizeHook(hook);
|
|
1587
1603
|
return {
|
|
1588
1604
|
plugin: async (ctx, code, chunk, opts) => {
|
|
1589
|
-
|
|
1590
|
-
chunk.modules[key] = transformToRenderedModule(module$1);
|
|
1591
|
-
});
|
|
1592
|
-
const ret = await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, chunk, new NormalizedOutputOptionsImpl(opts));
|
|
1605
|
+
const ret = await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts));
|
|
1593
1606
|
if (ret == null) return;
|
|
1594
1607
|
if (typeof ret === "string") return { code: ret };
|
|
1595
1608
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1607,10 +1620,7 @@ function bindingifyAugmentChunkHash(args) {
|
|
|
1607
1620
|
const { handler, meta } = normalizeHook(hook);
|
|
1608
1621
|
return {
|
|
1609
1622
|
plugin: async (ctx, chunk) => {
|
|
1610
|
-
|
|
1611
|
-
chunk.modules[key] = transformToRenderedModule(module$1);
|
|
1612
|
-
});
|
|
1613
|
-
return await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1623
|
+
return await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1614
1624
|
},
|
|
1615
1625
|
meta: bindingifyPluginHookMeta(meta)
|
|
1616
1626
|
};
|
|
@@ -1678,7 +1688,7 @@ function bindingifyBanner(args) {
|
|
|
1678
1688
|
return {
|
|
1679
1689
|
plugin: async (ctx, chunk) => {
|
|
1680
1690
|
if (typeof handler === "string") return handler;
|
|
1681
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1691
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1682
1692
|
},
|
|
1683
1693
|
meta: bindingifyPluginHookMeta(meta)
|
|
1684
1694
|
};
|
|
@@ -1690,7 +1700,7 @@ function bindingifyFooter(args) {
|
|
|
1690
1700
|
return {
|
|
1691
1701
|
plugin: async (ctx, chunk) => {
|
|
1692
1702
|
if (typeof handler === "string") return handler;
|
|
1693
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1703
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1694
1704
|
},
|
|
1695
1705
|
meta: bindingifyPluginHookMeta(meta)
|
|
1696
1706
|
};
|
|
@@ -1702,7 +1712,7 @@ function bindingifyIntro(args) {
|
|
|
1702
1712
|
return {
|
|
1703
1713
|
plugin: async (ctx, chunk) => {
|
|
1704
1714
|
if (typeof handler === "string") return handler;
|
|
1705
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1715
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1706
1716
|
},
|
|
1707
1717
|
meta: bindingifyPluginHookMeta(meta)
|
|
1708
1718
|
};
|
|
@@ -1714,7 +1724,7 @@ function bindingifyOutro(args) {
|
|
|
1714
1724
|
return {
|
|
1715
1725
|
plugin: async (ctx, chunk) => {
|
|
1716
1726
|
if (typeof handler === "string") return handler;
|
|
1717
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1727
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1718
1728
|
},
|
|
1719
1729
|
meta: bindingifyPluginHookMeta(meta)
|
|
1720
1730
|
};
|
|
@@ -2112,7 +2122,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
2112
2122
|
}
|
|
2113
2123
|
function bindingifyAddon(configAddon) {
|
|
2114
2124
|
return async (chunk) => {
|
|
2115
|
-
if (typeof configAddon === "function") return configAddon(chunk);
|
|
2125
|
+
if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
|
|
2116
2126
|
return configAddon || "";
|
|
2117
2127
|
};
|
|
2118
2128
|
}
|
|
@@ -65,19 +65,6 @@ function bindingifySourcemap$1(map) {
|
|
|
65
65
|
} };
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/utils/transform-rendered-module.ts
|
|
70
|
-
function transformToRenderedModule(bindingRenderedModule) {
|
|
71
|
-
return {
|
|
72
|
-
get code() {
|
|
73
|
-
return bindingRenderedModule.code;
|
|
74
|
-
},
|
|
75
|
-
get renderedLength() {
|
|
76
|
-
return bindingRenderedModule.code?.length || 0;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
68
|
//#endregion
|
|
82
69
|
//#region src/utils/error.ts
|
|
83
70
|
function normalizeErrors(rawErrors) {
|
|
@@ -122,6 +109,35 @@ function joinNewLine(s1, s2) {
|
|
|
122
109
|
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
123
110
|
}
|
|
124
111
|
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/utils/transform-rendered-module.ts
|
|
114
|
+
function transformToRenderedModule(bindingRenderedModule) {
|
|
115
|
+
return {
|
|
116
|
+
get code() {
|
|
117
|
+
return bindingRenderedModule.code;
|
|
118
|
+
},
|
|
119
|
+
get renderedLength() {
|
|
120
|
+
return bindingRenderedModule.code?.length || 0;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/utils/transform-rendered-chunk.ts
|
|
127
|
+
function transformRenderedChunk(chunk) {
|
|
128
|
+
return {
|
|
129
|
+
...chunk,
|
|
130
|
+
get modules() {
|
|
131
|
+
return transformChunkModules(chunk.modules);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function transformChunkModules(modules) {
|
|
136
|
+
const result = {};
|
|
137
|
+
for (const [id, mod] of Object.entries(modules)) result[id] = transformToRenderedModule(mod);
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
|
|
125
141
|
//#endregion
|
|
126
142
|
//#region src/utils/transform-to-rollup-output.ts
|
|
127
143
|
function transformToRollupOutputChunk(bindingChunk, changed) {
|
|
@@ -133,7 +149,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
|
|
|
133
149
|
fileName: bindingChunk.fileName,
|
|
134
150
|
name: bindingChunk.name,
|
|
135
151
|
get modules() {
|
|
136
|
-
return
|
|
152
|
+
return transformChunkModules(bindingChunk.modules);
|
|
137
153
|
},
|
|
138
154
|
get imports() {
|
|
139
155
|
return bindingChunk.imports;
|
|
@@ -1618,10 +1634,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1618
1634
|
const { handler, meta } = normalizeHook(hook);
|
|
1619
1635
|
return {
|
|
1620
1636
|
plugin: async (ctx, code, chunk, opts) => {
|
|
1621
|
-
|
|
1622
|
-
chunk.modules[key] = transformToRenderedModule(module$1);
|
|
1623
|
-
});
|
|
1624
|
-
const ret = await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, chunk, new NormalizedOutputOptionsImpl(opts));
|
|
1637
|
+
const ret = await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts));
|
|
1625
1638
|
if (ret == null) return;
|
|
1626
1639
|
if (typeof ret === "string") return { code: ret };
|
|
1627
1640
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1639,10 +1652,7 @@ function bindingifyAugmentChunkHash(args) {
|
|
|
1639
1652
|
const { handler, meta } = normalizeHook(hook);
|
|
1640
1653
|
return {
|
|
1641
1654
|
plugin: async (ctx, chunk) => {
|
|
1642
|
-
|
|
1643
|
-
chunk.modules[key] = transformToRenderedModule(module$1);
|
|
1644
|
-
});
|
|
1645
|
-
return await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1655
|
+
return await handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1646
1656
|
},
|
|
1647
1657
|
meta: bindingifyPluginHookMeta(meta)
|
|
1648
1658
|
};
|
|
@@ -1710,7 +1720,7 @@ function bindingifyBanner(args) {
|
|
|
1710
1720
|
return {
|
|
1711
1721
|
plugin: async (ctx, chunk) => {
|
|
1712
1722
|
if (typeof handler === "string") return handler;
|
|
1713
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1723
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1714
1724
|
},
|
|
1715
1725
|
meta: bindingifyPluginHookMeta(meta)
|
|
1716
1726
|
};
|
|
@@ -1722,7 +1732,7 @@ function bindingifyFooter(args) {
|
|
|
1722
1732
|
return {
|
|
1723
1733
|
plugin: async (ctx, chunk) => {
|
|
1724
1734
|
if (typeof handler === "string") return handler;
|
|
1725
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1735
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1726
1736
|
},
|
|
1727
1737
|
meta: bindingifyPluginHookMeta(meta)
|
|
1728
1738
|
};
|
|
@@ -1734,7 +1744,7 @@ function bindingifyIntro(args) {
|
|
|
1734
1744
|
return {
|
|
1735
1745
|
plugin: async (ctx, chunk) => {
|
|
1736
1746
|
if (typeof handler === "string") return handler;
|
|
1737
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1747
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1738
1748
|
},
|
|
1739
1749
|
meta: bindingifyPluginHookMeta(meta)
|
|
1740
1750
|
};
|
|
@@ -1746,7 +1756,7 @@ function bindingifyOutro(args) {
|
|
|
1746
1756
|
return {
|
|
1747
1757
|
plugin: async (ctx, chunk) => {
|
|
1748
1758
|
if (typeof handler === "string") return handler;
|
|
1749
|
-
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), chunk);
|
|
1759
|
+
return handler.call(new PluginContext(ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1750
1760
|
},
|
|
1751
1761
|
meta: bindingifyPluginHookMeta(meta)
|
|
1752
1762
|
};
|
|
@@ -2144,7 +2154,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
2144
2154
|
}
|
|
2145
2155
|
function bindingifyAddon(configAddon) {
|
|
2146
2156
|
return async (chunk) => {
|
|
2147
|
-
if (typeof configAddon === "function") return configAddon(chunk);
|
|
2157
|
+
if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
|
|
2148
2158
|
return configAddon || "";
|
|
2149
2159
|
};
|
|
2150
2160
|
}
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -3,11 +3,6 @@ type Nullable<T> = T | null | undefined
|
|
|
3
3
|
type VoidNullable<T = void> = T | null | undefined | void
|
|
4
4
|
export type BindingStringOrRegex = string | RegExp
|
|
5
5
|
|
|
6
|
-
export interface RenderedModule {
|
|
7
|
-
readonly code: string | null
|
|
8
|
-
renderedLength: number
|
|
9
|
-
}
|
|
10
|
-
|
|
11
6
|
export declare class BindingBundleEndEventData {
|
|
12
7
|
output: string
|
|
13
8
|
duration: number
|
|
@@ -80,7 +75,7 @@ export declare class BindingOutputChunk {
|
|
|
80
75
|
get moduleIds(): Array<string>
|
|
81
76
|
get exports(): Array<string>
|
|
82
77
|
get fileName(): string
|
|
83
|
-
get modules(): Record<string,
|
|
78
|
+
get modules(): Record<string, BindingRenderedModule>
|
|
84
79
|
get imports(): Array<string>
|
|
85
80
|
get dynamicImports(): Array<string>
|
|
86
81
|
get code(): string
|
|
@@ -621,7 +616,7 @@ export interface JsOutputChunk {
|
|
|
621
616
|
moduleIds: Array<string>
|
|
622
617
|
exports: Array<string>
|
|
623
618
|
filename: string
|
|
624
|
-
modules: Record<string,
|
|
619
|
+
modules: Record<string, BindingRenderedModule>
|
|
625
620
|
imports: Array<string>
|
|
626
621
|
dynamicImports: Array<string>
|
|
627
622
|
code: string
|
|
@@ -760,7 +755,7 @@ export interface RenderedChunk {
|
|
|
760
755
|
moduleIds: Array<string>
|
|
761
756
|
exports: Array<string>
|
|
762
757
|
fileName: string
|
|
763
|
-
modules: Record<string,
|
|
758
|
+
modules: Record<string, BindingRenderedModule>
|
|
764
759
|
imports: Array<string>
|
|
765
760
|
dynamicImports: Array<string>
|
|
766
761
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output';
|
|
1
|
+
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, RolldownRenderedChunk, SourceMap } from './types/rolldown-output';
|
|
2
2
|
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options';
|
|
3
3
|
import type { ModuleFormat, OutputOptions } from './options/output-options';
|
|
4
4
|
import type { RolldownOptions } from './types/rolldown-options';
|
|
@@ -11,7 +11,7 @@ import { RolldownBuild } from './rolldown-build';
|
|
|
11
11
|
import { EmittedAsset, EmittedFile, PluginContext } from './plugin/plugin-context';
|
|
12
12
|
import { TransformPluginContext } from './plugin/transform-plugin-context';
|
|
13
13
|
import { InternalModuleFormat, NormalizedOutputOptions } from './options/normalized-output-options';
|
|
14
|
-
import {
|
|
14
|
+
import { PreRenderedChunk } from './binding';
|
|
15
15
|
import { PartialNull } from './types/utils';
|
|
16
16
|
import { NormalizedInputOptions } from './options/normalized-input-options';
|
|
17
17
|
import { ModuleInfo } from './types/module-info';
|
|
@@ -22,6 +22,6 @@ import { WatchOptions } from './options/watch-options';
|
|
|
22
22
|
import { Watcher } from './watcher';
|
|
23
23
|
export { defineConfig, rolldown, watch };
|
|
24
24
|
export declare const VERSION: string;
|
|
25
|
-
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook,
|
|
26
|
-
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, };
|
|
25
|
+
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, Watcher, };
|
|
26
|
+
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, };
|
|
27
27
|
export type { RollupError, RollupLog, LoggingFunction } from './rollup';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PreRenderedChunk } from '../binding';
|
|
3
3
|
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
|
|
4
|
+
import { RolldownRenderedChunk } from '../types/rolldown-output';
|
|
4
5
|
export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
5
6
|
dir: z.ZodOptional<z.ZodString>;
|
|
6
7
|
file: z.ZodOptional<z.ZodString>;
|
|
@@ -10,10 +11,10 @@ export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.exten
|
|
|
10
11
|
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>;
|
|
11
12
|
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<SourcemapIgnoreListOption, z.ZodTypeDef, SourcemapIgnoreListOption>]>>;
|
|
12
13
|
sourcemapPathTransform: z.ZodOptional<z.ZodType<SourcemapPathTransformOption, z.ZodTypeDef, SourcemapPathTransformOption>>;
|
|
13
|
-
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<
|
|
14
|
-
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<
|
|
15
|
-
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<
|
|
16
|
-
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<
|
|
14
|
+
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
15
|
+
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
16
|
+
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
17
|
+
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RolldownRenderedChunk, z.ZodTypeDef, RolldownRenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
|
|
17
18
|
extend: z.ZodOptional<z.ZodBoolean>;
|
|
18
19
|
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>;
|
|
19
20
|
assetFileNames: z.ZodOptional<z.ZodString>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { StringOrRegExp } from '../types/utils';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PreRenderedChunk } from '../binding';
|
|
3
3
|
import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
|
|
4
4
|
import { RolldownOutputPluginOption } from '../plugin';
|
|
5
|
+
import { RolldownRenderedChunk } from '../types/rolldown-output';
|
|
5
6
|
export type ModuleFormat = 'es' | 'cjs' | 'esm' | 'module' | 'commonjs' | 'iife' | 'umd' | 'experimental-app';
|
|
6
|
-
export type AddonFunction = (chunk:
|
|
7
|
+
export type AddonFunction = (chunk: RolldownRenderedChunk) => string | Promise<string>;
|
|
7
8
|
export type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string;
|
|
8
9
|
export type GlobalsFunction = (name: string) => string;
|
|
9
10
|
export interface OutputOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs
|
|
1
|
+
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs } from '../binding';
|
|
2
2
|
import type { NormalizedInputOptions } from '../options/normalized-input-options';
|
|
3
3
|
import type { NullValue, MaybePromise, PartialNull, MakeAsync } from '../types/utils';
|
|
4
4
|
import type { SourceMapInput } from '../types/sourcemap';
|
|
@@ -17,6 +17,7 @@ import type { DefinedHookNames } from '../constants/plugin';
|
|
|
17
17
|
import type { DEFINED_HOOK_NAMES } from '../constants/plugin';
|
|
18
18
|
import type { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context';
|
|
19
19
|
import type { HookFilter } from './hook-filter';
|
|
20
|
+
import { RolldownRenderedChunk } from '../types/rolldown-output';
|
|
20
21
|
export type ModuleSideEffects = boolean | 'no-treeshake' | null;
|
|
21
22
|
export type ModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
22
23
|
export type ImportKind = BindingHookResolveIdExtraArgs['kind'];
|
|
@@ -69,11 +70,11 @@ export interface FunctionPluginHooks {
|
|
|
69
70
|
[DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
|
|
70
71
|
[DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
|
|
71
72
|
[DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
|
|
72
|
-
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk:
|
|
73
|
+
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RolldownRenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | {
|
|
73
74
|
code: string;
|
|
74
75
|
map?: SourceMapInput;
|
|
75
76
|
};
|
|
76
|
-
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk:
|
|
77
|
+
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RolldownRenderedChunk) => string | void;
|
|
77
78
|
[DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void;
|
|
78
79
|
[DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
|
|
79
80
|
[DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
|
|
@@ -106,7 +107,7 @@ export type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends
|
|
|
106
107
|
export type PluginHooks = {
|
|
107
108
|
[K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K>>;
|
|
108
109
|
};
|
|
109
|
-
export type AddonHookFunction = (this: PluginContext, chunk:
|
|
110
|
+
export type AddonHookFunction = (this: PluginContext, chunk: RolldownRenderedChunk) => string | Promise<string>;
|
|
110
111
|
export type AddonHook = string | AddonHookFunction;
|
|
111
112
|
export interface OutputPlugin extends Partial<{
|
|
112
113
|
[K in OutputPluginHooks]: PluginHooks[K];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, } from './rollup';
|
|
1
|
+
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, RenderedChunk, } from './rollup';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AssetSource } from '../utils/asset-source';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RenderedChunk } from '../binding';
|
|
3
3
|
export interface RolldownOutputAsset {
|
|
4
4
|
type: 'asset';
|
|
5
5
|
fileName: string;
|
|
@@ -15,6 +15,15 @@ export interface SourceMap {
|
|
|
15
15
|
sourcesContent: string[];
|
|
16
16
|
version: number;
|
|
17
17
|
}
|
|
18
|
+
export interface RolldownRenderedModule {
|
|
19
|
+
readonly code: string | null;
|
|
20
|
+
renderedLength: number;
|
|
21
|
+
}
|
|
22
|
+
export interface RolldownRenderedChunk extends Omit<RenderedChunk, 'modules'> {
|
|
23
|
+
modules: {
|
|
24
|
+
[id: string]: RolldownRenderedModule;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
18
27
|
export interface RolldownOutputChunk {
|
|
19
28
|
type: 'chunk';
|
|
20
29
|
code: string;
|
|
@@ -23,7 +32,7 @@ export interface RolldownOutputChunk {
|
|
|
23
32
|
exports: string[];
|
|
24
33
|
fileName: string;
|
|
25
34
|
modules: {
|
|
26
|
-
[id: string]:
|
|
35
|
+
[id: string]: RolldownRenderedModule;
|
|
27
36
|
};
|
|
28
37
|
imports: string[];
|
|
29
38
|
dynamicImports: string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BindingStringOrRegex } from '../binding
|
|
1
|
+
import type { BindingStringOrRegex } from '../binding';
|
|
2
2
|
export declare function normalizedStringOrRegex(pattern?: Array<string | RegExp> | (string | RegExp)): BindingStringOrRegex[] | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RenderedChunk } from '../binding';
|
|
2
|
+
import { RolldownRenderedChunk } from '../types/rolldown-output';
|
|
3
|
+
export declare function transformRenderedChunk(chunk: RenderedChunk): RolldownRenderedChunk;
|
|
4
|
+
export declare function transformChunkModules(modules: RenderedChunk['modules']): RolldownRenderedChunk['modules'];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BindingRenderedModule } from '../binding';
|
|
2
|
+
import { RolldownRenderedModule } from '../types/rolldown-output';
|
|
3
|
+
export declare function transformToRenderedModule(bindingRenderedModule: BindingRenderedModule): RolldownRenderedModule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "0.14.0-snapshot-
|
|
3
|
+
"version": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"fs": true
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\
|
|
79
|
+
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"zod": "^3.23.8"
|
|
@@ -113,21 +113,21 @@
|
|
|
113
113
|
"why-is-node-running": "^3.0.0",
|
|
114
114
|
"zod-to-json-schema": "^3.23.2",
|
|
115
115
|
"@rolldown/testing": "0.0.1",
|
|
116
|
-
"rolldown": "0.14.0-snapshot-
|
|
116
|
+
"rolldown": "0.14.0-snapshot-d42ea8a-20241202003632"
|
|
117
117
|
},
|
|
118
118
|
"optionalDependencies": {
|
|
119
|
-
"@rolldown/binding-darwin-
|
|
120
|
-
"@rolldown/binding-darwin-
|
|
121
|
-
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-
|
|
122
|
-
"@rolldown/binding-linux-
|
|
123
|
-
"@rolldown/binding-linux-
|
|
124
|
-
"@rolldown/binding-linux-arm64-
|
|
125
|
-
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-
|
|
126
|
-
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-
|
|
127
|
-
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-
|
|
128
|
-
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-
|
|
129
|
-
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-
|
|
130
|
-
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-
|
|
119
|
+
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
120
|
+
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
121
|
+
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
122
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
123
|
+
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
124
|
+
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
125
|
+
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
126
|
+
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
127
|
+
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
128
|
+
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
129
|
+
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632",
|
|
130
|
+
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {
|
|
133
133
|
"# Scrips for binding #": "_",
|