rolldown 0.14.0 → 0.15.0-snapshot-b2570e7-20241204003545
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 +782 -854
- package/dist/cjs/experimental-index.cjs +68 -26
- package/dist/cjs/index.cjs +6 -8
- package/dist/cjs/parallel-plugin-worker.cjs +20 -14
- package/dist/cjs/parallel-plugin.cjs +1 -3
- package/dist/esm/cli.mjs +722 -796
- package/dist/esm/experimental-index.mjs +44 -7
- package/dist/esm/index.mjs +2 -4
- package/dist/esm/parallel-plugin-worker.mjs +15 -10
- package/dist/esm/parallel-plugin.mjs +1 -3
- package/dist/shared/{chunk-JoMxl5V2.cjs → chunk-BK2Ye-xa.cjs} +19 -6
- package/dist/shared/{consola.36c0034f-Xyw7SC_7.mjs → consola_36c0034f-DWsVjwtA.mjs} +218 -283
- package/dist/shared/{consola.36c0034f-HcmWcfPe.cjs → consola_36c0034f-_8_dG1Nr.cjs} +249 -295
- package/dist/shared/{prompt-hoPhcrA-.mjs → prompt-DGW8ZJmn.mjs} +125 -174
- package/dist/shared/{prompt-9Ij3R3TG.cjs → prompt-RFvZMmjc.cjs} +157 -204
- package/dist/shared/src-1jxF0vle.cjs +2917 -0
- package/dist/shared/src-Cm19F5A9.mjs +2789 -0
- package/dist/types/api/build.d.ts +16 -0
- package/dist/types/api/experimental.d.ts +7 -0
- package/dist/types/api/rolldown/index.d.ts +3 -0
- package/dist/types/api/rolldown/rolldown-build.d.ts +12 -0
- package/dist/types/api/watch/index.d.ts +3 -0
- package/dist/types/{watcher.d.ts → api/watch/watch-emitter.d.ts} +17 -17
- package/dist/types/api/watch/watcher.d.ts +13 -0
- package/dist/types/binding.d.ts +175 -40
- package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
- package/dist/types/builtin-plugin/constructors.d.ts +20 -0
- package/dist/types/builtin-plugin/replace-plugin.d.ts +28 -0
- package/dist/types/{options/normalized-ecma-transform-plugin-config.d.ts → builtin-plugin/transform-plugin.d.ts} +2 -1
- package/dist/types/builtin-plugin/utils.d.ts +8 -0
- package/dist/types/cli/arguments/normalize.d.ts +2 -6
- package/dist/types/cli/arguments/schema.d.ts +169 -81
- package/dist/types/constants/plugin.d.ts +3 -1
- package/dist/types/experimental-index.d.ts +5 -2
- package/dist/types/index.d.ts +13 -10
- package/dist/types/log/locate-character/index.d.ts +13 -0
- package/dist/types/log/logger.d.ts +2 -16
- package/dist/types/log/logging.d.ts +6 -3
- package/dist/types/log/logs.d.ts +2 -0
- package/dist/types/options/input-options-schema.d.ts +596 -0
- package/dist/types/options/input-options.d.ts +74 -430
- package/dist/types/options/normalized-input-options.d.ts +17 -11
- package/dist/types/options/normalized-output-options.d.ts +57 -21
- package/dist/types/options/output-options-schema.d.ts +147 -0
- package/dist/types/options/output-options.d.ts +72 -265
- package/dist/types/options/watch-options.d.ts +5 -0
- package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -11
- package/dist/types/plugin/bindingify-hook-filter.d.ts +5 -5
- package/dist/types/plugin/bindingify-output-hooks.d.ts +13 -16
- package/dist/types/plugin/bindingify-plugin.d.ts +12 -3
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +3 -5
- package/dist/types/plugin/hook-filter.d.ts +1 -1
- package/dist/types/plugin/index.d.ts +21 -18
- package/dist/types/plugin/minimal-plugin-context.d.ts +15 -0
- package/dist/types/plugin/plugin-context-data.d.ts +4 -5
- package/dist/types/plugin/plugin-context.d.ts +9 -4
- package/dist/types/plugin/plugin-driver.d.ts +4 -5
- package/dist/types/plugin/transform-plugin-context.d.ts +4 -3
- package/dist/types/rollup-types.d.ts +1 -1
- package/dist/types/treeshake/index.d.ts +0 -12
- package/dist/types/treeshake/module-side-effects.d.ts +111 -11
- package/dist/types/types/rolldown-output.d.ts +11 -2
- package/dist/types/types/utils.d.ts +1 -0
- package/dist/types/utils/bindingify-input-options.d.ts +7 -0
- package/dist/types/utils/bindingify-output-options.d.ts +3 -0
- package/dist/types/utils/define-config.d.ts +3 -0
- package/dist/types/utils/error.d.ts +1 -0
- package/dist/types/utils/normalize-hook.d.ts +1 -1
- package/dist/types/utils/normalize-plugin-option.d.ts +8 -3
- package/dist/types/{options/utils.d.ts → 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 -0
- package/dist/types/utils/transform-sourcemap.d.ts +2 -0
- package/dist/types/utils/transform-to-rollup-output.d.ts +1 -0
- package/package.json +30 -22
- package/dist/shared/rolldown-binding.wasi.cjs +0 -187
- package/dist/shared/src_index-3pqhEViJ.cjs +0 -2785
- package/dist/shared/src_index-ywYMd4vB.mjs +0 -2786
- package/dist/shared/wasi-worker-browser.mjs +0 -39
- package/dist/shared/wasi-worker.mjs +0 -63
- package/dist/shared/watcher-worker.js +0 -1
- package/dist/types/constants/types.d.ts +0 -1
- package/dist/types/options/bindingify-input-options.d.ts +0 -4
- package/dist/types/options/bindingify-output-options.d.ts +0 -3
- package/dist/types/options/normalized-alias-plugin-config.d.ts +0 -8
- package/dist/types/options/watch-option.d.ts +0 -5
- package/dist/types/plugin/builtin-plugin.d.ts +0 -81
- package/dist/types/rolldown-build.d.ts +0 -10
- package/dist/types/rolldown.d.ts +0 -12
- package/dist/types/types/rendered-module.d.ts +0 -2
- package/dist/types/utils/normalize-input-options.d.ts +0 -3
- package/dist/types/utils/normalize-output-options.d.ts +0 -3
- package/dist/types/utils/normalize-tree-shake.d.ts +0 -3
- /package/dist/types/{utils/type-assert.d.ts → types/assert.d.ts} +0 -0
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { instantiateNapiModuleSync, MessageHandler, WASI, createFsProxy } from '@napi-rs/wasm-runtime'
|
|
2
|
-
import { memfsExported as __memfsExported } from '@napi-rs/wasm-runtime/fs'
|
|
3
|
-
|
|
4
|
-
const fs = createFsProxy(__memfsExported)
|
|
5
|
-
|
|
6
|
-
const handler = new MessageHandler({
|
|
7
|
-
onLoad({ wasmModule, wasmMemory }) {
|
|
8
|
-
const wasi = new WASI({
|
|
9
|
-
fs,
|
|
10
|
-
preopens: {
|
|
11
|
-
'/': '/',
|
|
12
|
-
},
|
|
13
|
-
print: function () {
|
|
14
|
-
// eslint-disable-next-line no-console
|
|
15
|
-
console.log.apply(console, arguments)
|
|
16
|
-
},
|
|
17
|
-
printErr: function() {
|
|
18
|
-
// eslint-disable-next-line no-console
|
|
19
|
-
console.error.apply(console, arguments)
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
return instantiateNapiModuleSync(wasmModule, {
|
|
23
|
-
childThread: true,
|
|
24
|
-
wasi,
|
|
25
|
-
overwriteImports(importObject) {
|
|
26
|
-
importObject.env = {
|
|
27
|
-
...importObject.env,
|
|
28
|
-
...importObject.napi,
|
|
29
|
-
...importObject.emnapi,
|
|
30
|
-
memory: wasmMemory,
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
globalThis.onmessage = function (e) {
|
|
38
|
-
handler.handle(e)
|
|
39
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { parse } from "node:path";
|
|
4
|
-
import { WASI } from "node:wasi";
|
|
5
|
-
import { parentPort, Worker } from "node:worker_threads";
|
|
6
|
-
|
|
7
|
-
const require = createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
const { instantiateNapiModuleSync, MessageHandler, getDefaultContext } = require("@napi-rs/wasm-runtime");
|
|
10
|
-
|
|
11
|
-
if (parentPort) {
|
|
12
|
-
parentPort.on("message", (data) => {
|
|
13
|
-
globalThis.onmessage({ data });
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
Object.assign(globalThis, {
|
|
18
|
-
self: globalThis,
|
|
19
|
-
require,
|
|
20
|
-
Worker,
|
|
21
|
-
importScripts: function (f) {
|
|
22
|
-
;(0, eval)(fs.readFileSync(f, "utf8") + "//# sourceURL=" + f);
|
|
23
|
-
},
|
|
24
|
-
postMessage: function (msg) {
|
|
25
|
-
if (parentPort) {
|
|
26
|
-
parentPort.postMessage(msg);
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const emnapiContext = getDefaultContext();
|
|
32
|
-
|
|
33
|
-
const __rootDir = parse(process.cwd()).root;
|
|
34
|
-
|
|
35
|
-
const handler = new MessageHandler({
|
|
36
|
-
onLoad({ wasmModule, wasmMemory }) {
|
|
37
|
-
const wasi = new WASI({
|
|
38
|
-
version: 'preview1',
|
|
39
|
-
env: process.env,
|
|
40
|
-
preopens: {
|
|
41
|
-
[__rootDir]: __rootDir,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
return instantiateNapiModuleSync(wasmModule, {
|
|
46
|
-
childThread: true,
|
|
47
|
-
wasi,
|
|
48
|
-
context: emnapiContext,
|
|
49
|
-
overwriteImports(importObject) {
|
|
50
|
-
importObject.env = {
|
|
51
|
-
...importObject.env,
|
|
52
|
-
...importObject.napi,
|
|
53
|
-
...importObject.emnapi,
|
|
54
|
-
memory: wasmMemory
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
globalThis.onmessage = function (e) {
|
|
62
|
-
handler.handle(e);
|
|
63
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
while (true) {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type StringOrRegExp = string | RegExp;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { BindingInputOptions } from '../binding';
|
|
2
|
-
import type { NormalizedInputOptions } from './normalized-input-options';
|
|
3
|
-
import type { NormalizedOutputOptions } from './normalized-output-options';
|
|
4
|
-
export declare function bindingifyInputOptions(options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions): BindingInputOptions;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { TransformPluginConfig } from '../options/normalized-ecma-transform-plugin-config';
|
|
2
|
-
import { AliasPluginConfig } from '../options/normalized-alias-plugin-config';
|
|
3
|
-
import { BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingBuiltinPlugin, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingReplacePluginConfig } from '../binding';
|
|
4
|
-
export declare class BuiltinPlugin {
|
|
5
|
-
name: BindingBuiltinPluginName;
|
|
6
|
-
options?: unknown;
|
|
7
|
-
constructor(name: BindingBuiltinPluginName, options?: unknown);
|
|
8
|
-
}
|
|
9
|
-
export declare class ModulePreloadPolyfillPlugin extends BuiltinPlugin {
|
|
10
|
-
constructor(config?: BindingModulePreloadPolyfillPluginConfig);
|
|
11
|
-
}
|
|
12
|
-
export declare class DynamicImportVarsPlugin extends BuiltinPlugin {
|
|
13
|
-
constructor();
|
|
14
|
-
}
|
|
15
|
-
export declare class ImportGlobPlugin extends BuiltinPlugin {
|
|
16
|
-
constructor(config?: BindingGlobImportPluginConfig);
|
|
17
|
-
}
|
|
18
|
-
export declare class ManifestPlugin extends BuiltinPlugin {
|
|
19
|
-
constructor(config?: BindingManifestPluginConfig);
|
|
20
|
-
}
|
|
21
|
-
export declare class WasmHelperPlugin extends BuiltinPlugin {
|
|
22
|
-
constructor();
|
|
23
|
-
}
|
|
24
|
-
export declare class WasmFallbackPlugin extends BuiltinPlugin {
|
|
25
|
-
constructor();
|
|
26
|
-
}
|
|
27
|
-
export declare class LoadFallbackPlugin extends BuiltinPlugin {
|
|
28
|
-
constructor();
|
|
29
|
-
}
|
|
30
|
-
export declare class AliasPlugin extends BuiltinPlugin {
|
|
31
|
-
constructor(config?: AliasPluginConfig);
|
|
32
|
-
}
|
|
33
|
-
export declare class TransformPlugin extends BuiltinPlugin {
|
|
34
|
-
constructor(config?: TransformPluginConfig);
|
|
35
|
-
}
|
|
36
|
-
export declare class JsonPlugin extends BuiltinPlugin {
|
|
37
|
-
constructor(config?: BindingJsonPluginConfig);
|
|
38
|
-
}
|
|
39
|
-
export declare class BuildImportAnalysisPlugin extends BuiltinPlugin {
|
|
40
|
-
constructor(config?: BindingBuildImportAnalysisPluginConfig);
|
|
41
|
-
}
|
|
42
|
-
export declare class ReplacePlugin extends BuiltinPlugin {
|
|
43
|
-
constructor(config?: BindingReplacePluginConfig);
|
|
44
|
-
}
|
|
45
|
-
export declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): ModulePreloadPolyfillPlugin;
|
|
46
|
-
export declare function dynamicImportVarsPlugin(): DynamicImportVarsPlugin;
|
|
47
|
-
export declare function importGlobPlugin(config?: BindingGlobImportPluginConfig): ImportGlobPlugin;
|
|
48
|
-
export declare function manifestPlugin(config?: BindingManifestPluginConfig): ManifestPlugin;
|
|
49
|
-
export declare function wasmHelperPlugin(): WasmHelperPlugin;
|
|
50
|
-
export declare function wasmFallbackPlugin(): WasmFallbackPlugin;
|
|
51
|
-
export declare function transformPlugin(config?: TransformPluginConfig): TransformPlugin;
|
|
52
|
-
export declare function loadFallbackPlugin(): LoadFallbackPlugin;
|
|
53
|
-
export declare function aliasPlugin(config: AliasPluginConfig): AliasPlugin;
|
|
54
|
-
export declare function jsonPlugin(config?: BindingJsonPluginConfig): JsonPlugin;
|
|
55
|
-
export declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuildImportAnalysisPlugin;
|
|
56
|
-
/**
|
|
57
|
-
* ## Usage
|
|
58
|
-
*
|
|
59
|
-
* ```js
|
|
60
|
-
* replacePlugin({
|
|
61
|
-
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
62
|
-
* __buildDate__: () => JSON.stringify(new Date()),
|
|
63
|
-
* __buildVersion: 15
|
|
64
|
-
* })
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* ### With options
|
|
68
|
-
*
|
|
69
|
-
* ```js
|
|
70
|
-
* replacePlugin({
|
|
71
|
-
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
72
|
-
* __buildDate__: () => JSON.stringify(new Date()),
|
|
73
|
-
* __buildVersion: 15
|
|
74
|
-
* }, {
|
|
75
|
-
* preventAssignment: false,
|
|
76
|
-
* })
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
export declare function replacePlugin(values?: BindingReplacePluginConfig['values'], options?: Omit<BindingReplacePluginConfig, 'values'>): ReplacePlugin;
|
|
81
|
-
export declare function bindingifyBuiltInPlugin(plugin: BuiltinPlugin): BindingBuiltinPlugin;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { OutputOptions } from './options/output-options';
|
|
2
|
-
import type { RolldownOutput } from './types/rolldown-output';
|
|
3
|
-
import type { InputOptions } from './options/input-options';
|
|
4
|
-
export declare class RolldownBuild {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(inputOptions: InputOptions);
|
|
7
|
-
generate(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
8
|
-
write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
9
|
-
close(): Promise<void>;
|
|
10
|
-
}
|
package/dist/types/rolldown.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { InputOptions } from './options/input-options';
|
|
2
|
-
import { RolldownBuild } from './rolldown-build';
|
|
3
|
-
import { Watcher } from './watcher';
|
|
4
|
-
import { WatchOptions } from './options/watch-option';
|
|
5
|
-
export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
|
|
6
|
-
export declare const watch: (input: WatchOptions) => Promise<Watcher>;
|
|
7
|
-
/**
|
|
8
|
-
* @description
|
|
9
|
-
* This is an experimental API. It's behavior may change in the future.
|
|
10
|
-
* Calling this API will only execute the scan stage of rolldown.
|
|
11
|
-
*/
|
|
12
|
-
export declare const experimental_scan: (input: InputOptions) => Promise<void>;
|
|
File without changes
|