@rollipop/rolldown 0.0.0-beta.0 → 0.0.0

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/.editorconfig +10 -0
  2. package/.gitattributes +4 -0
  3. package/README.md +1 -11
  4. package/package.json +2 -126
  5. package/LICENSE +0 -25
  6. package/bin/cli.mjs +0 -3
  7. package/dist/cli-setup.d.mts +0 -1
  8. package/dist/cli-setup.mjs +0 -17
  9. package/dist/cli.d.mts +0 -1
  10. package/dist/cli.mjs +0 -1581
  11. package/dist/config.d.mts +0 -10
  12. package/dist/config.mjs +0 -14
  13. package/dist/experimental-index.d.mts +0 -239
  14. package/dist/experimental-index.mjs +0 -299
  15. package/dist/experimental-runtime-types.d.ts +0 -92
  16. package/dist/filter-index.d.mts +0 -4
  17. package/dist/filter-index.mjs +0 -369
  18. package/dist/get-log-filter.d.mts +0 -7
  19. package/dist/get-log-filter.mjs +0 -48
  20. package/dist/index.d.mts +0 -4
  21. package/dist/index.mjs +0 -38
  22. package/dist/parallel-plugin-worker.d.mts +0 -1
  23. package/dist/parallel-plugin-worker.mjs +0 -32
  24. package/dist/parallel-plugin.d.mts +0 -14
  25. package/dist/parallel-plugin.mjs +0 -7
  26. package/dist/parse-ast-index.d.mts +0 -8
  27. package/dist/parse-ast-index.mjs +0 -4
  28. package/dist/plugins-index.d.mts +0 -31
  29. package/dist/plugins-index.mjs +0 -40
  30. package/dist/shared/binding-DmMMxMk0.mjs +0 -584
  31. package/dist/shared/binding-kAegJ1Bj.d.mts +0 -1775
  32. package/dist/shared/bindingify-input-options-D0BAGfk2.mjs +0 -1622
  33. package/dist/shared/constructors-F44lhsH3.d.mts +0 -30
  34. package/dist/shared/constructors-Rl_oLd2F.mjs +0 -67
  35. package/dist/shared/define-config-BF4P-Pum.mjs +0 -7
  36. package/dist/shared/define-config-DJ1-iIdx.d.mts +0 -2562
  37. package/dist/shared/load-config-BEpugZky.mjs +0 -114
  38. package/dist/shared/logging-DsnCZi19.d.mts +0 -42
  39. package/dist/shared/logs-cyjC0SDv.mjs +0 -183
  40. package/dist/shared/misc-DpjTMcQQ.mjs +0 -22
  41. package/dist/shared/normalize-string-or-regex-DbTZ9prS.mjs +0 -670
  42. package/dist/shared/parse-ast-index-BuuhACPk.mjs +0 -99
  43. package/dist/shared/prompt-5sWCM0jm.mjs +0 -847
  44. package/dist/shared/rolldown-build-viDZfkdI.mjs +0 -2292
  45. package/dist/shared/rolldown-il0-nWH9.mjs +0 -11
  46. package/dist/shared/watch-BSdMzY6q.mjs +0 -352
@@ -1,99 +0,0 @@
1
- import { n as __toESM, t as require_binding } from "./binding-DmMMxMk0.mjs";
2
- import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-cyjC0SDv.mjs";
3
-
4
- //#region ../../node_modules/.pnpm/oxc-parser@0.108.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
- var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
43
- /**
44
- * Parse asynchronously.
45
- *
46
- * Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
47
- */
48
- async function parse(filename, sourceText, options) {
49
- return wrap$1(await (0, import_binding.parse)(filename, sourceText, options));
50
- }
51
- /** Parse synchronously. */
52
- function parseSync(filename, sourceText, options) {
53
- return wrap$1((0, import_binding.parseSync)(filename, sourceText, options));
54
- }
55
-
56
- //#endregion
57
- //#region src/parse-ast-index.ts
58
- function wrap(result, filename, sourceText) {
59
- if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
60
- return result.program;
61
- }
62
- function normalizeParseError(filename, sourceText, errors) {
63
- let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
64
- const pos = errors[0]?.labels?.[0]?.start;
65
- for (let i = 0; i < errors.length; i++) {
66
- if (i >= 5) {
67
- message += "\n...";
68
- break;
69
- }
70
- const e = errors[i];
71
- message += e.message + "\n" + e.labels.map((label) => {
72
- const location = locate(sourceText, label.start, { offsetLine: 1 });
73
- if (!location) return;
74
- return getCodeFrame(sourceText, location.line, location.column);
75
- }).filter(Boolean).join("\n");
76
- }
77
- const log = logParseError(message, filename, pos);
78
- if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
79
- return error(log);
80
- }
81
- const defaultParserOptions = {
82
- lang: "js",
83
- preserveParens: false
84
- };
85
- function parseAst(sourceText, options, filename) {
86
- return wrap(parseSync(filename ?? "file.js", sourceText, {
87
- ...defaultParserOptions,
88
- ...options
89
- }), filename, sourceText);
90
- }
91
- async function parseAstAsync(sourceText, options, filename) {
92
- return wrap(await parse(filename ?? "file.js", sourceText, {
93
- ...defaultParserOptions,
94
- ...options
95
- }), filename, sourceText);
96
- }
97
-
98
- //#endregion
99
- export { parseSync as i, parseAstAsync as n, parse as r, parseAst as t };