@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.
Files changed (46) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +11 -1
  3. package/bin/cli.mjs +3 -0
  4. package/dist/cli-setup.d.mts +1 -0
  5. package/dist/cli-setup.mjs +17 -0
  6. package/dist/cli.d.mts +1 -0
  7. package/dist/cli.mjs +1588 -0
  8. package/dist/config.d.mts +10 -0
  9. package/dist/config.mjs +14 -0
  10. package/dist/experimental-index.d.mts +181 -0
  11. package/dist/experimental-index.mjs +266 -0
  12. package/dist/experimental-runtime-types.d.ts +103 -0
  13. package/dist/filter-index.d.mts +197 -0
  14. package/dist/filter-index.mjs +369 -0
  15. package/dist/get-log-filter.d.mts +7 -0
  16. package/dist/get-log-filter.mjs +48 -0
  17. package/dist/index.d.mts +4 -0
  18. package/dist/index.mjs +57 -0
  19. package/dist/parallel-plugin-worker.d.mts +1 -0
  20. package/dist/parallel-plugin-worker.mjs +32 -0
  21. package/dist/parallel-plugin.d.mts +14 -0
  22. package/dist/parallel-plugin.mjs +7 -0
  23. package/dist/parse-ast-index.d.mts +8 -0
  24. package/dist/parse-ast-index.mjs +4 -0
  25. package/dist/plugins-index.d.mts +30 -0
  26. package/dist/plugins-index.mjs +40 -0
  27. package/dist/shared/binding-B92Lq__Q.d.mts +1687 -0
  28. package/dist/shared/binding-tNJoEqAa.mjs +585 -0
  29. package/dist/shared/bindingify-input-options-CfhrNd_y.mjs +2233 -0
  30. package/dist/shared/constructors--k1uxZrh.d.mts +28 -0
  31. package/dist/shared/constructors-414MPkgB.mjs +61 -0
  32. package/dist/shared/define-config-BVG4QvnP.mjs +7 -0
  33. package/dist/shared/define-config-D8xP5iyL.d.mts +3463 -0
  34. package/dist/shared/load-config-Qtd9pHJ5.mjs +114 -0
  35. package/dist/shared/logging-wIy4zY9I.d.mts +50 -0
  36. package/dist/shared/logs-NH298mHo.mjs +183 -0
  37. package/dist/shared/misc-CCZIsXVO.mjs +22 -0
  38. package/dist/shared/normalize-string-or-regex-DeB7vQ75.mjs +61 -0
  39. package/dist/shared/parse-ast-index-BcP4Ts_P.mjs +99 -0
  40. package/dist/shared/prompt-tlfjalEt.mjs +847 -0
  41. package/dist/shared/rolldown-BMzJcmQ7.mjs +42 -0
  42. package/dist/shared/rolldown-build-DWeKtJOy.mjs +2371 -0
  43. package/dist/shared/watch-HmN4U4B9.mjs +379 -0
  44. package/package.json +128 -2
  45. package/.editorconfig +0 -10
  46. 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,7 @@
1
+ //#region src/plugin/parallel-plugin-implementation.ts
2
+ function defineParallelPluginImplementation(plugin) {
3
+ return plugin;
4
+ }
5
+
6
+ //#endregion
7
+ export { 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,4 @@
1
+ import "./shared/binding-tNJoEqAa.mjs";
2
+ import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-BcP4Ts_P.mjs";
3
+
4
+ export { 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 };