@rolldown/browser 1.0.0-beta.7-commit.a0a7d95

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 (121) hide show
  1. package/LICENSE +25 -0
  2. package/bin/cli.mjs +2 -0
  3. package/dist/browser-bundler.mjs +3514 -0
  4. package/dist/browser.js +4626 -0
  5. package/dist/cli.cjs +1759 -0
  6. package/dist/cli.mjs +1828 -0
  7. package/dist/experimental-index.cjs +87 -0
  8. package/dist/experimental-index.mjs +67 -0
  9. package/dist/index.cjs +9 -0
  10. package/dist/index.mjs +5 -0
  11. package/dist/parallel-plugin-worker.cjs +43 -0
  12. package/dist/parallel-plugin-worker.mjs +48 -0
  13. package/dist/parallel-plugin.cjs +9 -0
  14. package/dist/parallel-plugin.mjs +8 -0
  15. package/dist/parse-ast-index.cjs +4 -0
  16. package/dist/parse-ast-index.mjs +4 -0
  17. package/dist/rolldown-binding.wasi-browser.js +102 -0
  18. package/dist/rolldown-binding.wasi.cjs +127 -0
  19. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  20. package/dist/shared/chunk-BuCFLigr.mjs +12 -0
  21. package/dist/shared/chunk-Dc32QXFI.cjs +31 -0
  22. package/dist/shared/parse-ast-index-C29iO6Jv.cjs +316 -0
  23. package/dist/shared/parse-ast-index-GcZLh6_d.mjs +273 -0
  24. package/dist/shared/prompt-B3VJLbs9.mjs +854 -0
  25. package/dist/shared/prompt-wpCBKCzA.cjs +855 -0
  26. package/dist/shared/src-6_rb-jCl.cjs +3147 -0
  27. package/dist/shared/src-QrPvO0Ec.mjs +4375 -0
  28. package/dist/types/api/build.d.ts +18 -0
  29. package/dist/types/api/experimental.d.ts +7 -0
  30. package/dist/types/api/rolldown/index.d.ts +3 -0
  31. package/dist/types/api/rolldown/rolldown-build.d.ts +15 -0
  32. package/dist/types/api/watch/index.d.ts +3 -0
  33. package/dist/types/api/watch/watch-emitter.d.ts +31 -0
  34. package/dist/types/api/watch/watcher.d.ts +13 -0
  35. package/dist/types/binding.d.ts +1504 -0
  36. package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
  37. package/dist/types/builtin-plugin/constructors.d.ts +22 -0
  38. package/dist/types/builtin-plugin/replace-plugin.d.ts +27 -0
  39. package/dist/types/builtin-plugin/transform-plugin.d.ts +9 -0
  40. package/dist/types/builtin-plugin/utils.d.ts +8 -0
  41. package/dist/types/cli/arguments/alias.d.ts +16 -0
  42. package/dist/types/cli/arguments/index.d.ts +15 -0
  43. package/dist/types/cli/arguments/normalize.d.ts +16 -0
  44. package/dist/types/cli/arguments/utils.d.ts +8 -0
  45. package/dist/types/cli/commands/bundle.d.ts +3 -0
  46. package/dist/types/cli/commands/help.d.ts +1 -0
  47. package/dist/types/cli/index.d.ts +1 -0
  48. package/dist/types/cli/load-config.d.ts +5 -0
  49. package/dist/types/cli/logger.d.ts +5 -0
  50. package/dist/types/constants/plugin-context.d.ts +7 -0
  51. package/dist/types/constants/plugin.d.ts +45 -0
  52. package/dist/types/experimental-index.d.ts +9 -0
  53. package/dist/types/index.d.ts +31 -0
  54. package/dist/types/log/log-handler.d.ts +4 -0
  55. package/dist/types/log/logger.d.ts +6 -0
  56. package/dist/types/log/logging.d.ts +12 -0
  57. package/dist/types/log/logs.d.ts +18 -0
  58. package/dist/types/options/generated/checks-options.d.ts +57 -0
  59. package/dist/types/options/input-options.d.ts +185 -0
  60. package/dist/types/options/normalized-input-options.d.ts +18 -0
  61. package/dist/types/options/normalized-output-options.d.ts +70 -0
  62. package/dist/types/options/output-options.d.ts +182 -0
  63. package/dist/types/options/watch-options.d.ts +5 -0
  64. package/dist/types/parallel-plugin-worker.d.ts +1 -0
  65. package/dist/types/parallel-plugin.d.ts +1 -0
  66. package/dist/types/parse-ast-index.d.ts +5 -0
  67. package/dist/types/plugin/bindingify-build-hooks.d.ts +10 -0
  68. package/dist/types/plugin/bindingify-hook-filter.d.ts +7 -0
  69. package/dist/types/plugin/bindingify-output-hooks.d.ts +14 -0
  70. package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +8 -0
  71. package/dist/types/plugin/bindingify-plugin.d.ts +17 -0
  72. package/dist/types/plugin/bindingify-watch-hooks.d.ts +5 -0
  73. package/dist/types/plugin/hook-filter.d.ts +49 -0
  74. package/dist/types/plugin/index.d.ts +141 -0
  75. package/dist/types/plugin/minimal-plugin-context.d.ts +24 -0
  76. package/dist/types/plugin/parallel-plugin-implementation.d.ts +10 -0
  77. package/dist/types/plugin/parallel-plugin.d.ts +9 -0
  78. package/dist/types/plugin/plugin-context-data.d.ts +21 -0
  79. package/dist/types/plugin/plugin-context.d.ts +67 -0
  80. package/dist/types/plugin/plugin-driver.d.ts +10 -0
  81. package/dist/types/plugin/transform-plugin-context.d.ts +28 -0
  82. package/dist/types/plugin/with-filter.d.ts +10 -0
  83. package/dist/types/types/assert.d.ts +14 -0
  84. package/dist/types/types/config-export.d.ts +5 -0
  85. package/dist/types/types/misc.d.ts +40 -0
  86. package/dist/types/types/module-info.d.ts +15 -0
  87. package/dist/types/types/module-side-effects.d.ts +12 -0
  88. package/dist/types/types/output-bundle.d.ts +4 -0
  89. package/dist/types/types/rolldown-options.d.ts +5 -0
  90. package/dist/types/types/rolldown-output.d.ts +66 -0
  91. package/dist/types/types/schema.d.ts +33 -0
  92. package/dist/types/types/sourcemap.d.ts +14 -0
  93. package/dist/types/types/utils.d.ts +13 -0
  94. package/dist/types/types.d.ts +7 -0
  95. package/dist/types/utils/asset-source.d.ts +4 -0
  96. package/dist/types/utils/async-flatten.d.ts +1 -0
  97. package/dist/types/utils/bindingify-input-options.d.ts +7 -0
  98. package/dist/types/utils/bindingify-output-options.d.ts +5 -0
  99. package/dist/types/utils/code-frame.d.ts +1 -0
  100. package/dist/types/utils/compose-js-plugins.d.ts +2 -0
  101. package/dist/types/utils/create-bundler-option.d.ts +11 -0
  102. package/dist/types/utils/create-bundler.d.ts +9 -0
  103. package/dist/types/utils/define-config.d.ts +5 -0
  104. package/dist/types/utils/error.d.ts +2 -0
  105. package/dist/types/utils/initialize-parallel-plugins.d.ts +17 -0
  106. package/dist/types/utils/misc.d.ts +7 -0
  107. package/dist/types/utils/normalize-hook.d.ts +7 -0
  108. package/dist/types/utils/normalize-plugin-option.d.ts +13 -0
  109. package/dist/types/utils/normalize-string-or-regex.d.ts +2 -0
  110. package/dist/types/utils/plugin/index.d.ts +2 -0
  111. package/dist/types/utils/resolved-external.d.ts +4 -0
  112. package/dist/types/utils/transform-module-info.d.ts +4 -0
  113. package/dist/types/utils/transform-rendered-chunk.d.ts +4 -0
  114. package/dist/types/utils/transform-rendered-module.d.ts +3 -0
  115. package/dist/types/utils/transform-side-effects.d.ts +3 -0
  116. package/dist/types/utils/transform-sourcemap.d.ts +3 -0
  117. package/dist/types/utils/transform-to-rollup-output.d.ts +11 -0
  118. package/dist/types/utils/validator.d.ts +6 -0
  119. package/dist/wasi-worker-browser.mjs +39 -0
  120. package/dist/wasi-worker.mjs +63 -0
  121. package/package.json +85 -0
@@ -0,0 +1,18 @@
1
+ import { InputOptions } from '../options/input-options';
2
+ import { OutputOptions } from '../options/output-options';
3
+ import type { RolldownOutput } from '../types/rolldown-output';
4
+ export interface BuildOptions extends InputOptions {
5
+ /**
6
+ * Write the output to the file system
7
+ *
8
+ * @default true
9
+ */
10
+ write?: boolean;
11
+ output?: OutputOptions;
12
+ }
13
+ declare function build(options: BuildOptions): Promise<RolldownOutput>;
14
+ /**
15
+ * Build multiple outputs __sequentially__.
16
+ */
17
+ declare function build(options: BuildOptions[]): Promise<RolldownOutput[]>;
18
+ export { build };
@@ -0,0 +1,7 @@
1
+ import type { InputOptions } from '../options/input-options';
2
+ /**
3
+ * This is an experimental API. It's behavior may change in the future.
4
+ *
5
+ * Calling this API will only execute the scan stage of rolldown.
6
+ */
7
+ export declare const experimental_scan: (input: InputOptions) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { InputOptions } from '../../options/input-options';
2
+ import { RolldownBuild } from './rolldown-build';
3
+ export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
@@ -0,0 +1,15 @@
1
+ import { BindingHmrOutput } from '../../binding';
2
+ import type { InputOptions } from '../../options/input-options';
3
+ import type { OutputOptions } from '../../options/output-options';
4
+ import type { RolldownOutput } from '../../types/rolldown-output';
5
+ export declare class RolldownBuild {
6
+ #private;
7
+ constructor(inputOptions: InputOptions);
8
+ get closed(): boolean;
9
+ generate(outputOptions?: OutputOptions): Promise<RolldownOutput>;
10
+ write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
11
+ close(): Promise<void>;
12
+ [Symbol.asyncDispose](): Promise<void>;
13
+ generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutput | undefined>;
14
+ get watchFiles(): string[];
15
+ }
@@ -0,0 +1,3 @@
1
+ import type { WatchOptions } from '../../options/watch-options';
2
+ import { RolldownWatcher } from './watch-emitter';
3
+ export declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
@@ -0,0 +1,31 @@
1
+ import { BindingWatcherEvent } from '../../binding';
2
+ import { MaybePromise } from '../../types/utils';
3
+ export type WatcherEvent = 'close' | 'event' | 'restart' | 'change';
4
+ export type ChangeEvent = 'create' | 'update' | 'delete';
5
+ export type RollupWatcherEvent = {
6
+ code: 'START';
7
+ } | {
8
+ code: 'BUNDLE_START';
9
+ } | {
10
+ code: 'BUNDLE_END';
11
+ duration: number;
12
+ output: readonly string[];
13
+ } | {
14
+ code: 'END';
15
+ } | {
16
+ code: 'ERROR';
17
+ error: Error;
18
+ };
19
+ export declare class WatcherEmitter {
20
+ listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
21
+ timer: any;
22
+ constructor();
23
+ on(event: 'change', listener: (id: string, change: {
24
+ event: ChangeEvent;
25
+ }) => MaybePromise<void>): this;
26
+ on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
27
+ on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this;
28
+ onEvent(event: BindingWatcherEvent): Promise<void>;
29
+ close(): Promise<void>;
30
+ }
31
+ export type RolldownWatcher = WatcherEmitter;
@@ -0,0 +1,13 @@
1
+ import { BindingWatcher } from '../../binding';
2
+ import { WatchOptions } from '../../options/watch-options';
3
+ import { WatcherEmitter } from './watch-emitter';
4
+ export declare class Watcher {
5
+ closed: boolean;
6
+ inner: BindingWatcher;
7
+ emitter: WatcherEmitter;
8
+ stopWorkers: ((() => Promise<void>) | undefined)[];
9
+ constructor(emitter: WatcherEmitter, inner: BindingWatcher, stopWorkers: ((() => Promise<void>) | undefined)[]);
10
+ close(): Promise<void>;
11
+ start(): void;
12
+ }
13
+ export declare function createWatcher(emitter: WatcherEmitter, input: WatchOptions | WatchOptions[]): Promise<void>;