@powerlines/plugin-babel 0.12.130 → 0.12.132

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 (97) hide show
  1. package/dist/ast-utils-BcmWaIan.cjs +45 -0
  2. package/dist/ast-utils-Bs6DBkKg.d.mts +19 -0
  3. package/dist/ast-utils-DU1foCxH.mjs +32 -0
  4. package/dist/ast-utils-DeuXcuqs.d.cts +19 -0
  5. package/dist/babel-BBpAODp3.d.cts +1812 -0
  6. package/dist/babel-Cbfq7l5M.d.mts +1812 -0
  7. package/dist/{_virtual/rolldown_runtime.cjs → chunk-CbDLau6x.cjs} +6 -1
  8. package/dist/create-plugin-BPSvsem_.mjs +73 -0
  9. package/dist/create-plugin-Bovo30sw.d.cts +14 -0
  10. package/dist/create-plugin-C9ijark9.d.mts +14 -0
  11. package/dist/create-plugin-Cs1zZrvI.cjs +80 -0
  12. package/dist/filters-BKYGMZeC.d.cts +41 -0
  13. package/dist/filters-BjswEAwZ.d.mts +44 -0
  14. package/dist/filters-C04cfcQR.mjs +55 -0
  15. package/dist/filters-Dl2RKvrm.cjs +79 -0
  16. package/dist/helpers/ast-utils.cjs +3 -34
  17. package/dist/helpers/ast-utils.d.cts +2 -19
  18. package/dist/helpers/ast-utils.d.mts +2 -19
  19. package/dist/helpers/ast-utils.mjs +1 -30
  20. package/dist/helpers/create-plugin.cjs +2 -40
  21. package/dist/helpers/create-plugin.d.cts +2 -14
  22. package/dist/helpers/create-plugin.d.mts +2 -14
  23. package/dist/helpers/create-plugin.mjs +1 -37
  24. package/dist/helpers/filters.cjs +5 -58
  25. package/dist/helpers/filters.d.cts +2 -41
  26. package/dist/helpers/filters.d.mts +2 -42
  27. package/dist/helpers/filters.mjs +1 -53
  28. package/dist/helpers/index.cjs +22 -21
  29. package/dist/helpers/index.d.cts +7 -5
  30. package/dist/helpers/index.d.mts +7 -5
  31. package/dist/helpers/index.mjs +6 -5
  32. package/dist/helpers/module-helpers.cjs +9 -102
  33. package/dist/helpers/module-helpers.d.cts +2 -48
  34. package/dist/helpers/module-helpers.d.mts +2 -48
  35. package/dist/helpers/module-helpers.mjs +2 -93
  36. package/dist/helpers/options.cjs +4 -49
  37. package/dist/helpers/options.d.cts +2 -17
  38. package/dist/helpers/options.d.mts +2 -17
  39. package/dist/helpers/options.mjs +2 -45
  40. package/dist/helpers-BnW_4z5h.mjs +1 -0
  41. package/dist/helpers-Bx2yBrpn.cjs +0 -0
  42. package/dist/index-ClXLQ1fw.d.mts +1 -0
  43. package/dist/index-DeEmP3Jc.d.cts +1 -0
  44. package/dist/index-QbUkWSLh.d.mts +1 -0
  45. package/dist/index-zO0Ly4bS.d.cts +1 -0
  46. package/dist/index.cjs +29 -27
  47. package/dist/index.d.cts +9 -8
  48. package/dist/index.d.mts +9 -9
  49. package/dist/index.mjs +8 -6
  50. package/dist/module-helpers-Ckq8sc4l.mjs +95 -0
  51. package/dist/module-helpers-CrrcOmWC.d.cts +49 -0
  52. package/dist/module-helpers-Non-jHMu.cjs +138 -0
  53. package/dist/module-helpers-R1r-1jnQ.d.mts +49 -0
  54. package/dist/options-BQhc80ih.mjs +47 -0
  55. package/dist/options-BR6Dzmpl.d.mts +17 -0
  56. package/dist/options-jLnSoEkN.d.cts +17 -0
  57. package/dist/options-u2MhTIFH.cjs +60 -0
  58. package/dist/plugin-BL8TLixo.mjs +1 -0
  59. package/dist/plugin-BSBH78mm.cjs +0 -0
  60. package/dist/plugin-CctoTNv_.d.mts +17 -0
  61. package/dist/plugin-DzY_qzHo.d.cts +17 -0
  62. package/dist/types/index.cjs +2 -0
  63. package/dist/types/index.d.cts +3 -1
  64. package/dist/types/index.d.mts +3 -1
  65. package/dist/types/index.mjs +3 -0
  66. package/dist/types/plugin.cjs +1 -0
  67. package/dist/types/plugin.d.cts +2 -18
  68. package/dist/types/plugin.d.mts +2 -18
  69. package/dist/types/plugin.mjs +2 -0
  70. package/dist/types-CKPddlfS.cjs +0 -0
  71. package/dist/types-CvhspRRt.mjs +1 -0
  72. package/package.json +5 -5
  73. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
  74. package/dist/powerlines/src/lib/logger.cjs +0 -41
  75. package/dist/powerlines/src/lib/logger.mjs +0 -39
  76. package/dist/powerlines/src/types/api.d.mts +0 -5
  77. package/dist/powerlines/src/types/babel.d.cts +0 -50
  78. package/dist/powerlines/src/types/babel.d.mts +0 -50
  79. package/dist/powerlines/src/types/build.d.cts +0 -145
  80. package/dist/powerlines/src/types/build.d.mts +0 -145
  81. package/dist/powerlines/src/types/commands.d.cts +0 -8
  82. package/dist/powerlines/src/types/commands.d.mts +0 -9
  83. package/dist/powerlines/src/types/config.d.cts +0 -380
  84. package/dist/powerlines/src/types/config.d.mts +0 -380
  85. package/dist/powerlines/src/types/context.d.cts +0 -403
  86. package/dist/powerlines/src/types/context.d.mts +0 -405
  87. package/dist/powerlines/src/types/fs.d.cts +0 -486
  88. package/dist/powerlines/src/types/fs.d.mts +0 -486
  89. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  90. package/dist/powerlines/src/types/index.d.mts +0 -12
  91. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  92. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  93. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  94. package/dist/powerlines/src/types/resolved.d.mts +0 -82
  95. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  96. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  97. package/dist/powerlines/src/types/unplugin.d.mts +0 -6
@@ -0,0 +1,45 @@
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
+ let __babel_generator = require("@babel/generator");
3
+ __babel_generator = require_chunk.__toESM(__babel_generator);
4
+ let __babel_parser = require("@babel/parser");
5
+
6
+ //#region src/helpers/ast-utils.ts
7
+ /**
8
+ * Parse the given code into an AST.
9
+ *
10
+ * @param code - The code to parse.
11
+ * @param opts - The options for parsing.
12
+ * @returns The parsed AST.
13
+ */
14
+ function parseAst(code, opts = {}) {
15
+ return (0, __babel_parser.parse)(code, {
16
+ plugins: ["typescript"],
17
+ sourceType: "module",
18
+ allowImportExportEverywhere: true,
19
+ allowAwaitOutsideFunction: true,
20
+ ...opts
21
+ });
22
+ }
23
+ let generate = __babel_generator.default;
24
+ if ("default" in generate) generate = generate.default;
25
+ function generateFromAst(ast, opts) {
26
+ return generate(ast, opts ? {
27
+ importAttributesKeyword: "with",
28
+ sourceMaps: true,
29
+ ...opts
30
+ } : void 0);
31
+ }
32
+
33
+ //#endregion
34
+ Object.defineProperty(exports, 'generateFromAst', {
35
+ enumerable: true,
36
+ get: function () {
37
+ return generateFromAst;
38
+ }
39
+ });
40
+ Object.defineProperty(exports, 'parseAst', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return parseAst;
44
+ }
45
+ });
@@ -0,0 +1,19 @@
1
+ import { GeneratorOptions, GeneratorResult, GeneratorResult as GeneratorResult$1 } from "@babel/generator";
2
+ import { ParseResult, ParserOptions } from "@babel/parser";
3
+ import * as t from "@babel/types";
4
+
5
+ //#region src/helpers/ast-utils.d.ts
6
+
7
+ /**
8
+ * Parse the given code into an AST.
9
+ *
10
+ * @param code - The code to parse.
11
+ * @param opts - The options for parsing.
12
+ * @returns The parsed AST.
13
+ */
14
+ declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
15
+ type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
16
+ declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
17
+ declare type __ΩGenerateFromAstOptions = any[];
18
+ //#endregion
19
+ export { parseAst as a, generateFromAst as i, GeneratorResult$1 as n, __ΩGenerateFromAstOptions as r, GenerateFromAstOptions as t };
@@ -0,0 +1,32 @@
1
+ import _generate from "@babel/generator";
2
+ import { parse } from "@babel/parser";
3
+
4
+ //#region src/helpers/ast-utils.ts
5
+ /**
6
+ * Parse the given code into an AST.
7
+ *
8
+ * @param code - The code to parse.
9
+ * @param opts - The options for parsing.
10
+ * @returns The parsed AST.
11
+ */
12
+ function parseAst(code, opts = {}) {
13
+ return parse(code, {
14
+ plugins: ["typescript"],
15
+ sourceType: "module",
16
+ allowImportExportEverywhere: true,
17
+ allowAwaitOutsideFunction: true,
18
+ ...opts
19
+ });
20
+ }
21
+ let generate = _generate;
22
+ if ("default" in generate) generate = generate.default;
23
+ function generateFromAst(ast, opts) {
24
+ return generate(ast, opts ? {
25
+ importAttributesKeyword: "with",
26
+ sourceMaps: true,
27
+ ...opts
28
+ } : void 0);
29
+ }
30
+
31
+ //#endregion
32
+ export { parseAst as n, generateFromAst as t };
@@ -0,0 +1,19 @@
1
+ import { GeneratorOptions, GeneratorResult, GeneratorResult as GeneratorResult$1 } from "@babel/generator";
2
+ import { ParseResult, ParserOptions } from "@babel/parser";
3
+ import * as t from "@babel/types";
4
+
5
+ //#region src/helpers/ast-utils.d.ts
6
+
7
+ /**
8
+ * Parse the given code into an AST.
9
+ *
10
+ * @param code - The code to parse.
11
+ * @param opts - The options for parsing.
12
+ * @returns The parsed AST.
13
+ */
14
+ declare function parseAst(code: string, opts?: ParserOptions): ParseResult<t.File>;
15
+ type GenerateFromAstOptions = GeneratorOptions & Required<Pick<GeneratorOptions, "sourceFileName" | "filename">>;
16
+ declare function generateFromAst(ast: t.Node, opts?: GenerateFromAstOptions): GeneratorResult;
17
+ declare type __ΩGenerateFromAstOptions = any[];
18
+ //#endregion
19
+ export { parseAst as a, generateFromAst as i, GeneratorResult$1 as n, __ΩGenerateFromAstOptions as r, GenerateFromAstOptions as t };