@powerlines/plugin-babel 0.12.132 → 0.12.134
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.
- package/dist/{chunk-CbDLau6x.cjs → _virtual/rolldown_runtime.cjs} +1 -6
- package/dist/helpers/ast-utils.cjs +34 -3
- package/dist/helpers/ast-utils.d.cts +19 -2
- package/dist/helpers/ast-utils.d.mts +19 -2
- package/dist/helpers/ast-utils.mjs +30 -1
- package/dist/helpers/create-plugin.cjs +40 -2
- package/dist/helpers/create-plugin.d.cts +14 -2
- package/dist/helpers/create-plugin.d.mts +14 -2
- package/dist/helpers/create-plugin.mjs +37 -1
- package/dist/helpers/filters.cjs +58 -5
- package/dist/helpers/filters.d.cts +41 -2
- package/dist/helpers/filters.d.mts +42 -2
- package/dist/helpers/filters.mjs +53 -1
- package/dist/helpers/index.cjs +21 -22
- package/dist/helpers/index.d.cts +5 -7
- package/dist/helpers/index.d.mts +5 -7
- package/dist/helpers/index.mjs +5 -6
- package/dist/helpers/module-helpers.cjs +102 -9
- package/dist/helpers/module-helpers.d.cts +48 -2
- package/dist/helpers/module-helpers.d.mts +48 -2
- package/dist/helpers/module-helpers.mjs +93 -2
- package/dist/helpers/options.cjs +49 -4
- package/dist/helpers/options.d.cts +17 -2
- package/dist/helpers/options.d.mts +17 -2
- package/dist/helpers/options.mjs +45 -2
- package/dist/index.cjs +27 -29
- package/dist/index.d.cts +8 -9
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +6 -8
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +5 -0
- package/dist/powerlines/src/lib/logger.cjs +41 -0
- package/dist/powerlines/src/lib/logger.mjs +39 -0
- package/dist/powerlines/src/types/api.d.mts +5 -0
- package/dist/powerlines/src/types/babel.d.cts +50 -0
- package/dist/powerlines/src/types/babel.d.mts +50 -0
- package/dist/powerlines/src/types/build.d.cts +145 -0
- package/dist/powerlines/src/types/build.d.mts +145 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/config.d.cts +387 -0
- package/dist/powerlines/src/types/config.d.mts +387 -0
- package/dist/powerlines/src/types/context.d.cts +403 -0
- package/dist/powerlines/src/types/context.d.mts +405 -0
- package/dist/powerlines/src/types/fs.d.cts +486 -0
- package/dist/powerlines/src/types/fs.d.mts +486 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/index.d.mts +12 -0
- package/dist/powerlines/src/types/plugin.d.cts +231 -0
- package/dist/powerlines/src/types/plugin.d.mts +231 -0
- package/dist/powerlines/src/types/resolved.d.cts +82 -0
- package/dist/powerlines/src/types/resolved.d.mts +82 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/powerlines/src/types/unplugin.d.mts +6 -0
- package/dist/types/index.cjs +0 -2
- package/dist/types/index.d.cts +1 -3
- package/dist/types/index.d.mts +1 -3
- package/dist/types/index.mjs +0 -3
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +18 -2
- package/dist/types/plugin.d.mts +18 -2
- package/dist/types/plugin.mjs +0 -2
- package/package.json +5 -5
- package/dist/ast-utils-BcmWaIan.cjs +0 -45
- package/dist/ast-utils-Bs6DBkKg.d.mts +0 -19
- package/dist/ast-utils-DU1foCxH.mjs +0 -32
- package/dist/ast-utils-DeuXcuqs.d.cts +0 -19
- package/dist/babel-BBpAODp3.d.cts +0 -1812
- package/dist/babel-Cbfq7l5M.d.mts +0 -1812
- package/dist/create-plugin-BPSvsem_.mjs +0 -73
- package/dist/create-plugin-Bovo30sw.d.cts +0 -14
- package/dist/create-plugin-C9ijark9.d.mts +0 -14
- package/dist/create-plugin-Cs1zZrvI.cjs +0 -80
- package/dist/filters-BKYGMZeC.d.cts +0 -41
- package/dist/filters-BjswEAwZ.d.mts +0 -44
- package/dist/filters-C04cfcQR.mjs +0 -55
- package/dist/filters-Dl2RKvrm.cjs +0 -79
- package/dist/helpers-BnW_4z5h.mjs +0 -1
- package/dist/helpers-Bx2yBrpn.cjs +0 -0
- package/dist/index-ClXLQ1fw.d.mts +0 -1
- package/dist/index-DeEmP3Jc.d.cts +0 -1
- package/dist/index-QbUkWSLh.d.mts +0 -1
- package/dist/index-zO0Ly4bS.d.cts +0 -1
- package/dist/module-helpers-Ckq8sc4l.mjs +0 -95
- package/dist/module-helpers-CrrcOmWC.d.cts +0 -49
- package/dist/module-helpers-Non-jHMu.cjs +0 -138
- package/dist/module-helpers-R1r-1jnQ.d.mts +0 -49
- package/dist/options-BQhc80ih.mjs +0 -47
- package/dist/options-BR6Dzmpl.d.mts +0 -17
- package/dist/options-jLnSoEkN.d.cts +0 -17
- package/dist/options-u2MhTIFH.cjs +0 -60
- package/dist/plugin-BL8TLixo.mjs +0 -1
- package/dist/plugin-BSBH78mm.cjs +0 -0
- package/dist/plugin-CctoTNv_.d.mts +0 -17
- package/dist/plugin-DzY_qzHo.d.cts +0 -17
- package/dist/types-CKPddlfS.cjs +0 -0
- package/dist/types-CvhspRRt.mjs +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
//#region ../powerlines/src/types/tsconfig.d.ts
|
|
5
|
+
type ReflectionMode = "default" | "explicit" | "never";
|
|
6
|
+
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
12
|
+
* - `minimal` - Only the essential type information is captured.
|
|
13
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
14
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
15
|
+
*/
|
|
16
|
+
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
17
|
+
interface DeepkitOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
20
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
21
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
22
|
+
*/
|
|
23
|
+
reflection?: RawReflectionMode;
|
|
24
|
+
/**
|
|
25
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
29
|
+
* - `minimal` - Only the essential type information is captured.
|
|
30
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
31
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
32
|
+
*/
|
|
33
|
+
reflectionLevel?: ReflectionLevel;
|
|
34
|
+
}
|
|
35
|
+
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
36
|
+
/**
|
|
37
|
+
* The TypeScript compiler configuration.
|
|
38
|
+
*
|
|
39
|
+
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
40
|
+
*/
|
|
41
|
+
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
42
|
+
/**
|
|
43
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
44
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
45
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
46
|
+
*/
|
|
47
|
+
reflection?: RawReflectionMode;
|
|
48
|
+
/**
|
|
49
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
53
|
+
* - `minimal` - Only the essential type information is captured.
|
|
54
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
55
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
56
|
+
*/
|
|
57
|
+
reflectionLevel?: ReflectionLevel;
|
|
58
|
+
/**
|
|
59
|
+
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
60
|
+
*/
|
|
61
|
+
compilerOptions?: TSCompilerOptions;
|
|
62
|
+
}
|
|
63
|
+
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
64
|
+
originalTsconfigJson: TsConfigJson;
|
|
65
|
+
tsconfigJson: TSConfig;
|
|
66
|
+
tsconfigFilePath: string;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { ParsedTypeScriptConfig, TSConfig };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
//#region ../powerlines/src/types/tsconfig.d.ts
|
|
5
|
+
type ReflectionMode = "default" | "explicit" | "never";
|
|
6
|
+
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
12
|
+
* - `minimal` - Only the essential type information is captured.
|
|
13
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
14
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
15
|
+
*/
|
|
16
|
+
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
17
|
+
interface DeepkitOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
20
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
21
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
22
|
+
*/
|
|
23
|
+
reflection?: RawReflectionMode;
|
|
24
|
+
/**
|
|
25
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
29
|
+
* - `minimal` - Only the essential type information is captured.
|
|
30
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
31
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
32
|
+
*/
|
|
33
|
+
reflectionLevel?: ReflectionLevel;
|
|
34
|
+
}
|
|
35
|
+
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
36
|
+
/**
|
|
37
|
+
* The TypeScript compiler configuration.
|
|
38
|
+
*
|
|
39
|
+
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
40
|
+
*/
|
|
41
|
+
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
42
|
+
/**
|
|
43
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
44
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
45
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
46
|
+
*/
|
|
47
|
+
reflection?: RawReflectionMode;
|
|
48
|
+
/**
|
|
49
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
53
|
+
* - `minimal` - Only the essential type information is captured.
|
|
54
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
55
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
56
|
+
*/
|
|
57
|
+
reflectionLevel?: ReflectionLevel;
|
|
58
|
+
/**
|
|
59
|
+
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
60
|
+
*/
|
|
61
|
+
compilerOptions?: TSCompilerOptions;
|
|
62
|
+
}
|
|
63
|
+
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
64
|
+
originalTsconfigJson: TsConfigJson;
|
|
65
|
+
tsconfigJson: TSConfig;
|
|
66
|
+
tsconfigFilePath: string;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig };
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { a as __ΩBabelPluginContext, c as __ΩBabelPluginUserConfig, i as BabelPluginUserConfig, n as BabelPluginOptions, o as __ΩBabelPluginOptions, r as BabelPluginResolvedConfig, s as __ΩBabelPluginResolvedConfig, t as BabelPluginContext } from "../plugin-DzY_qzHo.cjs";
|
|
3
|
-
import "../index-zO0Ly4bS.cjs";
|
|
1
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./plugin.cjs";
|
|
4
2
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { a as __ΩBabelPluginContext, c as __ΩBabelPluginUserConfig, i as BabelPluginUserConfig, n as BabelPluginOptions, o as __ΩBabelPluginOptions, r as BabelPluginResolvedConfig, s as __ΩBabelPluginResolvedConfig, t as BabelPluginContext } from "../plugin-CctoTNv_.mjs";
|
|
3
|
-
import "../index-QbUkWSLh.mjs";
|
|
1
|
+
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from "./plugin.mjs";
|
|
4
2
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require('../plugin-BSBH78mm.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import {
|
|
1
|
+
import { BabelResolvedConfig, ResolvedConfig } from "../powerlines/src/types/resolved.cjs";
|
|
2
|
+
import { PluginContext } from "../powerlines/src/types/context.cjs";
|
|
3
|
+
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.cjs";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
+
type BabelPluginUserConfig = UserConfig;
|
|
8
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
+
transform: {
|
|
10
|
+
babel: BabelResolvedConfig;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
+
declare type __ΩBabelPluginOptions = any[];
|
|
15
|
+
declare type __ΩBabelPluginUserConfig = any[];
|
|
16
|
+
declare type __ΩBabelPluginResolvedConfig = any[];
|
|
17
|
+
declare type __ΩBabelPluginContext = any[];
|
|
18
|
+
//#endregion
|
|
3
19
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import {
|
|
1
|
+
import { BabelResolvedConfig, ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
2
|
+
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
3
|
+
import { BabelUserConfig, UserConfig } from "../powerlines/src/types/config.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
+
type BabelPluginUserConfig = UserConfig;
|
|
8
|
+
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
+
transform: {
|
|
10
|
+
babel: BabelResolvedConfig;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
+
declare type __ΩBabelPluginOptions = any[];
|
|
15
|
+
declare type __ΩBabelPluginUserConfig = any[];
|
|
16
|
+
declare type __ΩBabelPluginResolvedConfig = any[];
|
|
17
|
+
declare type __ΩBabelPluginContext = any[];
|
|
18
|
+
//#endregion
|
|
3
19
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-babel",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.134",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -162,15 +162,15 @@
|
|
|
162
162
|
"chalk": "5.6.2",
|
|
163
163
|
"defu": "^6.1.4",
|
|
164
164
|
"jiti": "^2.6.1",
|
|
165
|
-
"powerlines": "^0.36.
|
|
165
|
+
"powerlines": "^0.36.29",
|
|
166
166
|
"unplugin": "3.0.0-beta.3"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
169
|
"@babel/plugin-syntax-typescript": "^7.27.1",
|
|
170
|
-
"@powerlines/nx": "^0.11.
|
|
171
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
170
|
+
"@powerlines/nx": "^0.11.55",
|
|
171
|
+
"@powerlines/plugin-plugin": "^0.12.77",
|
|
172
172
|
"@types/node": "^24.10.4"
|
|
173
173
|
},
|
|
174
174
|
"publishConfig": { "access": "public" },
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "bfbde2cda62a5307013bf11d1ef6a8500bcbc4b1"
|
|
176
176
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
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 };
|
|
@@ -1,32 +0,0 @@
|
|
|
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 };
|
|
@@ -1,19 +0,0 @@
|
|
|
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 };
|