@rollipop/rolldown 0.0.0 → 1.0.0-rc.1
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/LICENSE +25 -0
- package/README.md +11 -1
- package/bin/cli.mjs +3 -0
- package/dist/cli-setup.d.mts +1 -0
- package/dist/cli-setup.mjs +17 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1588 -0
- package/dist/config.d.mts +10 -0
- package/dist/config.mjs +14 -0
- package/dist/experimental-index.d.mts +181 -0
- package/dist/experimental-index.mjs +266 -0
- package/dist/experimental-runtime-types.d.ts +103 -0
- package/dist/filter-index.d.mts +197 -0
- package/dist/filter-index.mjs +369 -0
- package/dist/get-log-filter.d.mts +7 -0
- package/dist/get-log-filter.mjs +48 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +57 -0
- package/dist/parallel-plugin-worker.d.mts +1 -0
- package/dist/parallel-plugin-worker.mjs +32 -0
- package/dist/parallel-plugin.d.mts +14 -0
- package/dist/parallel-plugin.mjs +7 -0
- package/dist/parse-ast-index.d.mts +8 -0
- package/dist/parse-ast-index.mjs +4 -0
- package/dist/plugins-index.d.mts +30 -0
- package/dist/plugins-index.mjs +40 -0
- package/dist/shared/binding-B92Lq__Q.d.mts +1687 -0
- package/dist/shared/binding-tNJoEqAa.mjs +585 -0
- package/dist/shared/bindingify-input-options-CfhrNd_y.mjs +2233 -0
- package/dist/shared/constructors--k1uxZrh.d.mts +28 -0
- package/dist/shared/constructors-414MPkgB.mjs +61 -0
- package/dist/shared/define-config-BVG4QvnP.mjs +7 -0
- package/dist/shared/define-config-D8xP5iyL.d.mts +3463 -0
- package/dist/shared/load-config-Qtd9pHJ5.mjs +114 -0
- package/dist/shared/logging-wIy4zY9I.d.mts +50 -0
- package/dist/shared/logs-NH298mHo.mjs +183 -0
- package/dist/shared/misc-CCZIsXVO.mjs +22 -0
- package/dist/shared/normalize-string-or-regex-DeB7vQ75.mjs +61 -0
- package/dist/shared/parse-ast-index-BcP4Ts_P.mjs +99 -0
- package/dist/shared/prompt-tlfjalEt.mjs +847 -0
- package/dist/shared/rolldown-BMzJcmQ7.mjs +42 -0
- package/dist/shared/rolldown-build-DWeKtJOy.mjs +2371 -0
- package/dist/shared/watch-HmN4U4B9.mjs +379 -0
- package/package.json +128 -2
- package/.editorconfig +0 -10
- package/.gitattributes +0 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-tNJoEqAa.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
|
|
3
|
+
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
|
|
4
|
+
import "./shared/parse-ast-index-BcP4Ts_P.mjs";
|
|
5
|
+
import { parentPort, workerData } from "node:worker_threads";
|
|
6
|
+
|
|
7
|
+
//#region src/parallel-plugin-worker.ts
|
|
8
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
9
|
+
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
10
|
+
(async () => {
|
|
11
|
+
try {
|
|
12
|
+
(0, import_binding.registerPlugins)(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
13
|
+
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
14
|
+
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
15
|
+
return {
|
|
16
|
+
index: pluginInfo.index,
|
|
17
|
+
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, []), [], () => {}, "info", false)
|
|
18
|
+
};
|
|
19
|
+
})));
|
|
20
|
+
parentPort.postMessage({ type: "success" });
|
|
21
|
+
} catch (error) {
|
|
22
|
+
parentPort.postMessage({
|
|
23
|
+
type: "error",
|
|
24
|
+
error
|
|
25
|
+
});
|
|
26
|
+
} finally {
|
|
27
|
+
parentPort.unref();
|
|
28
|
+
}
|
|
29
|
+
})();
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./shared/binding-B92Lq__Q.mjs";
|
|
2
|
+
import { C as Plugin, Pt as MaybePromise } from "./shared/define-config-D8xP5iyL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
|
+
type ParallelPluginImplementation = Plugin;
|
|
6
|
+
type Context = {
|
|
7
|
+
/**
|
|
8
|
+
* Thread number
|
|
9
|
+
*/
|
|
10
|
+
threadNumber: number;
|
|
11
|
+
};
|
|
12
|
+
declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { type Context, type ParallelPluginImplementation, defineParallelPluginImplementation };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { M as ParseResult, N as ParserOptions } from "./shared/binding-B92Lq__Q.mjs";
|
|
2
|
+
import { Program } from "@oxc-project/types";
|
|
3
|
+
|
|
4
|
+
//#region src/parse-ast-index.d.ts
|
|
5
|
+
declare function parseAst(sourceText: string, options?: ParserOptions | null, filename?: string): Program;
|
|
6
|
+
declare function parseAstAsync(sourceText: string, options?: ParserOptions | null, filename?: string): Promise<Program>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { type ParseResult, type ParserOptions, parseAst, parseAstAsync };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { d as BindingReplacePluginConfig } from "./shared/binding-B92Lq__Q.mjs";
|
|
2
|
+
import { M as BuiltinPlugin } from "./shared/define-config-D8xP5iyL.mjs";
|
|
3
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors--k1uxZrh.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/builtin-plugin/replace-plugin.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Replaces targeted strings in files while bundling.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Basic usage
|
|
11
|
+
* ```js
|
|
12
|
+
* replacePlugin({
|
|
13
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
14
|
+
* __buildVersion: 15
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
* @example
|
|
18
|
+
* // With options
|
|
19
|
+
* ```js
|
|
20
|
+
* replacePlugin({
|
|
21
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
22
|
+
* __buildVersion: 15
|
|
23
|
+
* }, {
|
|
24
|
+
* preventAssignment: false,
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function replacePlugin(values?: BindingReplacePluginConfig["values"], options?: Omit<BindingReplacePluginConfig, "values">): BuiltinPlugin;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { esmExternalRequirePlugin, replacePlugin };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "./shared/binding-tNJoEqAa.mjs";
|
|
2
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
|
|
3
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-414MPkgB.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/builtin-plugin/replace-plugin.ts
|
|
6
|
+
/**
|
|
7
|
+
* Replaces targeted strings in files while bundling.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Basic usage
|
|
11
|
+
* ```js
|
|
12
|
+
* replacePlugin({
|
|
13
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
14
|
+
* __buildVersion: 15
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
* @example
|
|
18
|
+
* // With options
|
|
19
|
+
* ```js
|
|
20
|
+
* replacePlugin({
|
|
21
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
22
|
+
* __buildVersion: 15
|
|
23
|
+
* }, {
|
|
24
|
+
* preventAssignment: false,
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
function replacePlugin(values = {}, options = {}) {
|
|
29
|
+
Object.keys(values).forEach((key) => {
|
|
30
|
+
const value = values[key];
|
|
31
|
+
if (typeof value !== "string") values[key] = String(value);
|
|
32
|
+
});
|
|
33
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
|
|
34
|
+
...options,
|
|
35
|
+
values
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { esmExternalRequirePlugin, replacePlugin };
|