@rolldown/browser 1.0.0-rc.1 → 1.0.0-rc.11

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 (59) hide show
  1. package/dist/cli.mjs +705 -1101
  2. package/dist/config.d.mts +9 -4
  3. package/dist/config.mjs +4 -13
  4. package/dist/{shared/constructors-BTW-c3jX.mjs → constructors-LtcP0f-6.js} +14 -7
  5. package/dist/error-nyELQq9T.js +157 -0
  6. package/dist/experimental-index.browser.mjs +74 -15
  7. package/dist/experimental-index.d.mts +128 -56
  8. package/dist/experimental-index.mjs +76 -17
  9. package/dist/filter-index.d.mts +1 -1
  10. package/dist/filter-index.mjs +25 -6
  11. package/dist/get-log-filter.d.mts +3 -7
  12. package/dist/get-log-filter.mjs +23 -3
  13. package/dist/index.browser.mjs +70 -75
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.mjs +6 -12
  16. package/dist/{normalize-string-or-regex-CL-PJZI7.js → normalize-string-or-regex-Db8ibFkp.js} +25 -23
  17. package/dist/parallel-plugin-worker.mjs +3 -7
  18. package/dist/parallel-plugin.d.mts +4 -4
  19. package/dist/parallel-plugin.mjs +1 -2
  20. package/dist/parse-ast-index.d.mts +27 -3
  21. package/dist/parse-ast-index.mjs +60 -3
  22. package/dist/plugins-index.browser.mjs +8 -7
  23. package/dist/plugins-index.d.mts +7 -4
  24. package/dist/plugins-index.mjs +8 -7
  25. package/dist/resolve-tsconfig-CkWJwi9L.js +112 -0
  26. package/dist/rolldown-binding.wasi-browser.js +6 -1
  27. package/dist/rolldown-binding.wasi.cjs +6 -1
  28. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  29. package/dist/{rolldown-build-C4tDS_XC.js → rolldown-build-BPQtF2AA.js} +1063 -745
  30. package/dist/shared/{bindingify-input-options-Bp2kpiI8.mjs → bindingify-input-options-CSSx7s5e.mjs} +124 -165
  31. package/dist/shared/{composable-filters-CIxSuZSM.mjs → composable-filters-B2ByPP8y.mjs} +1 -4
  32. package/dist/{constructors-B8gqcrFr.js → shared/constructors-BGLoUvKR.mjs} +14 -7
  33. package/dist/shared/{constructors-5bt5oBhE.d.mts → constructors-BVnf_fH1.d.mts} +13 -4
  34. package/dist/shared/define-config-Cr6054d_.d.mts +3869 -0
  35. package/dist/shared/{define-config-Dlptvz3X.mjs → define-config-DJOr6Iwt.mjs} +1 -2
  36. package/dist/shared/error-CQ6njWsV.mjs +86 -0
  37. package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
  38. package/dist/shared/{load-config-BBZgIUGN.mjs → load-config-CXtSVabV.mjs} +11 -5
  39. package/dist/shared/{logging-Nvu645a7.d.mts → logging-C6h4g8dA.d.mts} +6 -6
  40. package/dist/shared/{logs-B2CASPcx.mjs → logs-D80CXhvg.mjs} +6 -9
  41. package/dist/shared/{normalize-string-or-regex-DIwprzLy.mjs → normalize-string-or-regex-D0o84ejN.mjs} +21 -16
  42. package/dist/shared/parse-B_jvq8dU.mjs +73 -0
  43. package/dist/shared/{prompt-B6NrDD1-.mjs → prompt-BYQIwEjg.mjs} +4 -6
  44. package/dist/shared/resolve-tsconfig-Cwoo4h_o.mjs +112 -0
  45. package/dist/shared/{rolldown-C0_W0QdY.mjs → rolldown-D-bh1N9N.mjs} +2 -4
  46. package/dist/shared/rolldown-build-Bysdmf-9.mjs +3320 -0
  47. package/dist/shared/transform-DEgNAQOQ.d.mts +149 -0
  48. package/dist/shared/{types-CIYK49jr.d.mts → types-K2r0mx6Y.d.mts} +11 -9
  49. package/dist/shared/{watch-eIop0yN6.mjs → watch-V9eI6ua1.mjs} +71 -76
  50. package/dist/utils-index.browser.mjs +2414 -0
  51. package/dist/utils-index.d.mts +1673 -0
  52. package/dist/utils-index.mjs +2414 -0
  53. package/package.json +1 -1
  54. package/dist/cli-setup.d.mts +0 -1
  55. package/dist/cli-setup.mjs +0 -16
  56. package/dist/shared/define-config-CDlEOpr1.d.mts +0 -3531
  57. package/dist/shared/parse-ast-index-2ahkCVK6.mjs +0 -98
  58. package/dist/shared/rolldown-build-DLuUhuNw.mjs +0 -2368
  59. /package/dist/shared/{utils-CqMTwlsR.d.mts → utils-6wxe_LMG.d.mts} +0 -0
@@ -1,98 +0,0 @@
1
- import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-B2CASPcx.mjs";
2
- import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
3
-
4
- //#region ../../node_modules/.pnpm/oxc-parser@0.110.0/node_modules/oxc-parser/src-js/wrap.js
5
- function wrap$1(result) {
6
- let program, module, comments, errors;
7
- return {
8
- get program() {
9
- if (!program) program = jsonParseAst(result.program);
10
- return program;
11
- },
12
- get module() {
13
- if (!module) module = result.module;
14
- return module;
15
- },
16
- get comments() {
17
- if (!comments) comments = result.comments;
18
- return comments;
19
- },
20
- get errors() {
21
- if (!errors) errors = result.errors;
22
- return errors;
23
- }
24
- };
25
- }
26
- function jsonParseAst(programJson) {
27
- const { node: program, fixes } = JSON.parse(programJson);
28
- for (const fixPath of fixes) applyFix(program, fixPath);
29
- return program;
30
- }
31
- function applyFix(program, fixPath) {
32
- let node = program;
33
- for (const key of fixPath) node = node[key];
34
- if (node.bigint) node.value = BigInt(node.bigint);
35
- else try {
36
- node.value = RegExp(node.regex.pattern, node.regex.flags);
37
- } catch {}
38
- }
39
-
40
- //#endregion
41
- //#region src/utils/parse.ts
42
- /**
43
- * Parse asynchronously.
44
- *
45
- * Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
46
- */
47
- async function parse$1(filename, sourceText, options) {
48
- return wrap$1(await parse(filename, sourceText, options));
49
- }
50
- /** Parse synchronously. */
51
- function parseSync$1(filename, sourceText, options) {
52
- return wrap$1(parseSync(filename, sourceText, options));
53
- }
54
-
55
- //#endregion
56
- //#region src/parse-ast-index.ts
57
- function wrap(result, filename, sourceText) {
58
- if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
59
- return result.program;
60
- }
61
- function normalizeParseError(filename, sourceText, errors) {
62
- let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
63
- const pos = errors[0]?.labels?.[0]?.start;
64
- for (let i = 0; i < errors.length; i++) {
65
- if (i >= 5) {
66
- message += "\n...";
67
- break;
68
- }
69
- const e = errors[i];
70
- message += e.message + "\n" + e.labels.map((label) => {
71
- const location = locate(sourceText, label.start, { offsetLine: 1 });
72
- if (!location) return;
73
- return getCodeFrame(sourceText, location.line, location.column);
74
- }).filter(Boolean).join("\n");
75
- }
76
- const log = logParseError(message, filename, pos);
77
- if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
78
- return error(log);
79
- }
80
- const defaultParserOptions = {
81
- lang: "js",
82
- preserveParens: false
83
- };
84
- function parseAst(sourceText, options, filename) {
85
- return wrap(parseSync$1(filename ?? "file.js", sourceText, {
86
- ...defaultParserOptions,
87
- ...options
88
- }), filename, sourceText);
89
- }
90
- async function parseAstAsync(sourceText, options, filename) {
91
- return wrap(await parse$1(filename ?? "file.js", sourceText, {
92
- ...defaultParserOptions,
93
- ...options
94
- }), filename, sourceText);
95
- }
96
-
97
- //#endregion
98
- export { parseSync$1 as i, parseAstAsync as n, parse$1 as r, parseAst as t };