rolldown 1.0.0-beta.9-commit.0ec9e7d → 1.0.0-rc.10

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 (73) hide show
  1. package/README.md +11 -0
  2. package/dist/cli.mjs +962 -1551
  3. package/dist/config.d.mts +9 -7
  4. package/dist/config.mjs +10 -11
  5. package/dist/experimental-index.d.mts +225 -68
  6. package/dist/experimental-index.mjs +277 -57
  7. package/dist/experimental-runtime-types.d.ts +98 -0
  8. package/dist/filter-index.d.mts +195 -4
  9. package/dist/filter-index.mjs +347 -6
  10. package/dist/get-log-filter.d.mts +3 -0
  11. package/dist/get-log-filter.mjs +68 -0
  12. package/dist/index.d.mts +4 -4
  13. package/dist/index.mjs +54 -6
  14. package/dist/parallel-plugin-worker.mjs +28 -35
  15. package/dist/parallel-plugin.d.mts +6 -8
  16. package/dist/parallel-plugin.mjs +1 -2
  17. package/dist/parse-ast-index.d.mts +27 -4
  18. package/dist/parse-ast-index.mjs +61 -4
  19. package/dist/plugins-index.d.mts +33 -0
  20. package/dist/plugins-index.mjs +41 -0
  21. package/dist/shared/binding-BV_UWDF3.mjs +582 -0
  22. package/dist/shared/binding-Dsq9Azhm.d.mts +1851 -0
  23. package/dist/shared/bindingify-input-options-DoaqRULI.mjs +2170 -0
  24. package/dist/shared/constructors-DfpIbfMG.d.mts +37 -0
  25. package/dist/shared/constructors-DqC7XSXy.mjs +68 -0
  26. package/dist/shared/define-config-CV9D_Qea.d.mts +3781 -0
  27. package/dist/shared/define-config-DJOr6Iwt.mjs +6 -0
  28. package/dist/shared/error-BO4SlZV_.mjs +85 -0
  29. package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
  30. package/dist/shared/{load-config-Dll-92l5.mjs → load-config-ezHg7sBf.mjs} +32 -36
  31. package/dist/shared/logging-C6h4g8dA.d.mts +50 -0
  32. package/dist/shared/logs-D80CXhvg.mjs +180 -0
  33. package/dist/shared/{misc-DGAe2XOW.mjs → misc-DJYbNKZX.mjs} +1 -8
  34. package/dist/shared/normalize-string-or-regex-D7wlw16t.mjs +58 -0
  35. package/dist/shared/parse-nWsWXhOL.mjs +74 -0
  36. package/dist/shared/{prompt-CxjDC0Gn.cjs → prompt-BYQIwEjg.mjs} +301 -310
  37. package/dist/shared/resolve-tsconfig-C3OzszY-.mjs +113 -0
  38. package/dist/shared/rolldown-BOb3gBhW.mjs +40 -0
  39. package/dist/shared/rolldown-build-yQC7KN8K.mjs +3319 -0
  40. package/dist/shared/transform-B5D1aA1B.d.mts +149 -0
  41. package/dist/shared/watch-CzsahzPN.mjs +374 -0
  42. package/dist/utils-index.d.mts +376 -0
  43. package/dist/utils-index.mjs +2416 -0
  44. package/package.json +93 -99
  45. package/dist/cli.cjs +0 -1748
  46. package/dist/cli.d.cts +0 -1
  47. package/dist/config.cjs +0 -12
  48. package/dist/config.d.cts +0 -12
  49. package/dist/experimental-index.cjs +0 -132
  50. package/dist/experimental-index.d.cts +0 -96
  51. package/dist/filter-index.cjs +0 -105
  52. package/dist/filter-index.d.cts +0 -5
  53. package/dist/index.cjs +0 -9
  54. package/dist/index.d.cts +0 -4
  55. package/dist/parallel-plugin-worker.cjs +0 -33
  56. package/dist/parallel-plugin-worker.d.cts +0 -1
  57. package/dist/parallel-plugin.cjs +0 -8
  58. package/dist/parallel-plugin.d.cts +0 -15
  59. package/dist/parse-ast-index.cjs +0 -4
  60. package/dist/parse-ast-index.d.cts +0 -9
  61. package/dist/shared/binding.d-Dz3qQrbl.d.mts +0 -1682
  62. package/dist/shared/binding.d-QXzDcVmm.d.cts +0 -1682
  63. package/dist/shared/chunk--iN_1bjD.mjs +0 -33
  64. package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
  65. package/dist/shared/define-config.d-CUcDq_vm.d.cts +0 -1080
  66. package/dist/shared/define-config.d-qV1PzX_C.d.mts +0 -1080
  67. package/dist/shared/load-config-Bx9W9x2a.cjs +0 -125
  68. package/dist/shared/misc-BKp5iIef.cjs +0 -67
  69. package/dist/shared/parse-ast-index-0m6JgGc9.mjs +0 -655
  70. package/dist/shared/parse-ast-index-Cn_efzjO.cjs +0 -697
  71. package/dist/shared/prompt-uGrwvyp0.mjs +0 -854
  72. package/dist/shared/src-B4EklR3U.mjs +0 -4704
  73. package/dist/shared/src-BzFe16tX.cjs +0 -4654
@@ -1,4 +1,61 @@
1
- import { init_parse_ast_index, parseAst, parseAstAsync } from "./shared/parse-ast-index-0m6JgGc9.mjs";
2
-
3
- init_parse_ast_index();
4
- export { parseAst, parseAstAsync };
1
+ import "./shared/binding-BV_UWDF3.mjs";
2
+ import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-D80CXhvg.mjs";
3
+ import { n as parseSync, t as parse } from "./shared/parse-nWsWXhOL.mjs";
4
+ //#region src/parse-ast-index.ts
5
+ function wrap(result, filename, sourceText) {
6
+ if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
7
+ return result.program;
8
+ }
9
+ function normalizeParseError(filename, sourceText, errors) {
10
+ let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
11
+ const pos = errors[0]?.labels?.[0]?.start;
12
+ for (let i = 0; i < errors.length; i++) {
13
+ if (i >= 5) {
14
+ message += "\n...";
15
+ break;
16
+ }
17
+ const e = errors[i];
18
+ message += e.message + "\n" + e.labels.map((label) => {
19
+ const location = locate(sourceText, label.start, { offsetLine: 1 });
20
+ if (!location) return;
21
+ return getCodeFrame(sourceText, location.line, location.column);
22
+ }).filter(Boolean).join("\n");
23
+ }
24
+ const log = logParseError(message, filename, pos);
25
+ if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
26
+ return error(log);
27
+ }
28
+ const defaultParserOptions = {
29
+ lang: "js",
30
+ preserveParens: false
31
+ };
32
+ /**
33
+ * Parse code synchronously and return the AST.
34
+ *
35
+ * This function is similar to Rollup's `parseAst` function.
36
+ * Prefer using {@linkcode parseSync} instead of this function as it has more information in the return value.
37
+ *
38
+ * @category Utilities
39
+ */
40
+ function parseAst(sourceText, options, filename) {
41
+ return wrap(parseSync(filename ?? "file.js", sourceText, {
42
+ ...defaultParserOptions,
43
+ ...options
44
+ }), filename, sourceText);
45
+ }
46
+ /**
47
+ * Parse code asynchronously and return the AST.
48
+ *
49
+ * This function is similar to Rollup's `parseAstAsync` function.
50
+ * Prefer using {@linkcode parseAsync} instead of this function as it has more information in the return value.
51
+ *
52
+ * @category Utilities
53
+ */
54
+ async function parseAstAsync(sourceText, options, filename) {
55
+ return wrap(await parse(filename ?? "file.js", sourceText, {
56
+ ...defaultParserOptions,
57
+ ...options
58
+ }), filename, sourceText);
59
+ }
60
+ //#endregion
61
+ export { parseAst, parseAstAsync };
@@ -0,0 +1,33 @@
1
+ import { m as BindingReplacePluginConfig } from "./shared/binding-Dsq9Azhm.mjs";
2
+ import { N as BuiltinPlugin } from "./shared/define-config-CV9D_Qea.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-DfpIbfMG.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
+ * @see https://rolldown.rs/builtin-plugins/replace
29
+ * @category Builtin Plugins
30
+ */
31
+ declare function replacePlugin(values?: BindingReplacePluginConfig["values"], options?: Omit<BindingReplacePluginConfig, "values">): BuiltinPlugin;
32
+ //#endregion
33
+ export { esmExternalRequirePlugin, replacePlugin };
@@ -0,0 +1,41 @@
1
+ import "./shared/binding-BV_UWDF3.mjs";
2
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-D7wlw16t.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-DqC7XSXy.mjs";
4
+ //#region src/builtin-plugin/replace-plugin.ts
5
+ /**
6
+ * Replaces targeted strings in files while bundling.
7
+ *
8
+ * @example
9
+ * **Basic usage**
10
+ * ```js
11
+ * replacePlugin({
12
+ * 'process.env.NODE_ENV': JSON.stringify('production'),
13
+ * __buildVersion: 15
14
+ * })
15
+ * ```
16
+ * @example
17
+ * **With options**
18
+ * ```js
19
+ * replacePlugin({
20
+ * 'process.env.NODE_ENV': JSON.stringify('production'),
21
+ * __buildVersion: 15
22
+ * }, {
23
+ * preventAssignment: false,
24
+ * })
25
+ * ```
26
+ *
27
+ * @see https://rolldown.rs/builtin-plugins/replace
28
+ * @category Builtin Plugins
29
+ */
30
+ function replacePlugin(values = {}, options = {}) {
31
+ Object.keys(values).forEach((key) => {
32
+ const value = values[key];
33
+ if (typeof value !== "string") values[key] = String(value);
34
+ });
35
+ return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
36
+ ...options,
37
+ values
38
+ }));
39
+ }
40
+ //#endregion
41
+ export { esmExternalRequirePlugin, replacePlugin };