@powerlines/plugin-babel 0.12.29 → 0.12.30
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/helpers/create-plugin.d.cts +2 -4
- package/dist/helpers/create-plugin.d.ts +2 -4
- package/dist/helpers/filters.d.cts +2 -4
- package/dist/helpers/filters.d.ts +2 -4
- package/dist/helpers/index.d.cts +2 -4
- package/dist/helpers/index.d.ts +2 -4
- package/dist/helpers/module-helpers.d.cts +2 -4
- package/dist/helpers/module-helpers.d.ts +2 -4
- package/dist/helpers/options.d.cts +2 -4
- package/dist/helpers/options.d.ts +2 -4
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/{plugin-_LQpDkG4.d.cts → plugin-D74kMH3n.d.cts} +118 -101
- package/dist/{plugin-_LQpDkG4.d.ts → plugin-D74kMH3n.d.ts} +118 -101
- package/dist/types/index.d.cts +2 -4
- package/dist/types/index.d.ts +2 -4
- package/dist/types/plugin.d.cts +2 -4
- package/dist/types/plugin.d.ts +2 -4
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Context, c as BabelTransformPluginBuilder, D as DeclareBabelTransformPluginReturn } from '../plugin-
|
|
1
|
+
import { C as Context, c as BabelTransformPluginBuilder, D as DeclareBabelTransformPluginReturn } from '../plugin-D74kMH3n.cjs';
|
|
2
2
|
import '@stryke/types/base';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
/**
|
|
24
22
|
* Create a Babel plugin using the provided builder function.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Context, c as BabelTransformPluginBuilder, D as DeclareBabelTransformPluginReturn } from '../plugin-
|
|
1
|
+
import { C as Context, c as BabelTransformPluginBuilder, D as DeclareBabelTransformPluginReturn } from '../plugin-D74kMH3n.js';
|
|
2
2
|
import '@stryke/types/base';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
/**
|
|
24
22
|
* Create a Babel plugin using the provided builder function.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions, C as Context, a as BabelTransformPluginFilter, b as BabelTransformPlugin } from '../plugin-
|
|
1
|
+
import { B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions, C as Context, a as BabelTransformPluginFilter, b as BabelTransformPlugin } from '../plugin-D74kMH3n.cjs';
|
|
2
2
|
import '@stryke/types/base';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
declare function getPluginName(plugin: BabelTransformPluginOptions): string | undefined;
|
|
24
22
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions, C as Context, a as BabelTransformPluginFilter, b as BabelTransformPlugin } from '../plugin-
|
|
1
|
+
import { B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions, C as Context, a as BabelTransformPluginFilter, b as BabelTransformPlugin } from '../plugin-D74kMH3n.js';
|
|
2
2
|
import '@stryke/types/base';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
declare function getPluginName(plugin: BabelTransformPluginOptions): string | undefined;
|
|
24
22
|
/**
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ export { resolveBabelPlugin, resolvePluginFunction } from './options.cjs';
|
|
|
6
6
|
export { GeneratorResult } from '@babel/generator';
|
|
7
7
|
import '@babel/parser';
|
|
8
8
|
import '@babel/types';
|
|
9
|
-
import '../plugin-
|
|
9
|
+
import '../plugin-D74kMH3n.cjs';
|
|
10
10
|
import '@stryke/types/base';
|
|
11
11
|
import 'unplugin';
|
|
12
12
|
import '@stryke/types/array';
|
|
@@ -21,9 +21,7 @@ import '@babel/helper-plugin-utils';
|
|
|
21
21
|
import '@stryke/env/get-env-paths';
|
|
22
22
|
import '@stryke/types/package-json';
|
|
23
23
|
import 'jiti';
|
|
24
|
-
import 'oxc-parser';
|
|
25
24
|
import 'semver';
|
|
25
|
+
import 'node:fs';
|
|
26
26
|
import '@stryke/types/tsconfig';
|
|
27
27
|
import 'typescript';
|
|
28
|
-
import '@stryke/json/types';
|
|
29
|
-
import 'node:fs';
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { resolveBabelPlugin, resolvePluginFunction } from './options.js';
|
|
|
6
6
|
export { GeneratorResult } from '@babel/generator';
|
|
7
7
|
import '@babel/parser';
|
|
8
8
|
import '@babel/types';
|
|
9
|
-
import '../plugin-
|
|
9
|
+
import '../plugin-D74kMH3n.js';
|
|
10
10
|
import '@stryke/types/base';
|
|
11
11
|
import 'unplugin';
|
|
12
12
|
import '@stryke/types/array';
|
|
@@ -21,9 +21,7 @@ import '@babel/helper-plugin-utils';
|
|
|
21
21
|
import '@stryke/env/get-env-paths';
|
|
22
22
|
import '@stryke/types/package-json';
|
|
23
23
|
import 'jiti';
|
|
24
|
-
import 'oxc-parser';
|
|
25
24
|
import 'semver';
|
|
25
|
+
import 'node:fs';
|
|
26
26
|
import '@stryke/types/tsconfig';
|
|
27
27
|
import 'typescript';
|
|
28
|
-
import '@stryke/json/types';
|
|
29
|
-
import 'node:fs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodePath } from '@babel/core';
|
|
2
2
|
import { ParseResult } from '@babel/parser';
|
|
3
3
|
import * as t from '@babel/types';
|
|
4
|
-
import { I as ImportSpecifier } from '../plugin-
|
|
4
|
+
import { I as ImportSpecifier } from '../plugin-D74kMH3n.cjs';
|
|
5
5
|
import '@stryke/types/base';
|
|
6
6
|
import 'unplugin';
|
|
7
7
|
import '@stryke/types/array';
|
|
@@ -15,12 +15,10 @@ import '@babel/helper-plugin-utils';
|
|
|
15
15
|
import '@stryke/env/get-env-paths';
|
|
16
16
|
import '@stryke/types/package-json';
|
|
17
17
|
import 'jiti';
|
|
18
|
-
import 'oxc-parser';
|
|
19
18
|
import 'semver';
|
|
19
|
+
import 'node:fs';
|
|
20
20
|
import '@stryke/types/tsconfig';
|
|
21
21
|
import 'typescript';
|
|
22
|
-
import '@stryke/json/types';
|
|
23
|
-
import 'node:fs';
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* Finds an export in the given Babel AST program by its key.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodePath } from '@babel/core';
|
|
2
2
|
import { ParseResult } from '@babel/parser';
|
|
3
3
|
import * as t from '@babel/types';
|
|
4
|
-
import { I as ImportSpecifier } from '../plugin-
|
|
4
|
+
import { I as ImportSpecifier } from '../plugin-D74kMH3n.js';
|
|
5
5
|
import '@stryke/types/base';
|
|
6
6
|
import 'unplugin';
|
|
7
7
|
import '@stryke/types/array';
|
|
@@ -15,12 +15,10 @@ import '@babel/helper-plugin-utils';
|
|
|
15
15
|
import '@stryke/env/get-env-paths';
|
|
16
16
|
import '@stryke/types/package-json';
|
|
17
17
|
import 'jiti';
|
|
18
|
-
import 'oxc-parser';
|
|
19
18
|
import 'semver';
|
|
19
|
+
import 'node:fs';
|
|
20
20
|
import '@stryke/types/tsconfig';
|
|
21
21
|
import 'typescript';
|
|
22
|
-
import '@stryke/json/types';
|
|
23
|
-
import 'node:fs';
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* Finds an export in the given Babel AST program by its key.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginTarget, PluginOptions } from '@babel/core';
|
|
2
|
-
import { C as Context, B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions } from '../plugin-
|
|
2
|
+
import { C as Context, B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions } from '../plugin-D74kMH3n.cjs';
|
|
3
3
|
import '@stryke/types/base';
|
|
4
4
|
import 'unplugin';
|
|
5
5
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
24
22
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginTarget, PluginOptions } from '@babel/core';
|
|
2
|
-
import { C as Context, B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions } from '../plugin-
|
|
2
|
+
import { C as Context, B as BabelTransformPluginOptions, R as ResolvedBabelTransformPluginOptions } from '../plugin-D74kMH3n.js';
|
|
3
3
|
import '@stryke/types/base';
|
|
4
4
|
import 'unplugin';
|
|
5
5
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
declare function resolvePluginFunction(context: Context, plugin: any | PluginTarget | any[] | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]): BabelTransformPluginOptions;
|
|
24
22
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Plugin } from './plugin-
|
|
1
|
+
import { P as Plugin } from './plugin-D74kMH3n.cjs';
|
|
2
2
|
import { BabelPluginOptions, BabelPluginContext } from './types/plugin.cjs';
|
|
3
3
|
export { BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from './types/plugin.cjs';
|
|
4
4
|
export { GenerateFromAstOptions, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from './helpers/ast-utils.cjs';
|
|
@@ -21,12 +21,10 @@ import '@babel/helper-plugin-utils';
|
|
|
21
21
|
import '@stryke/env/get-env-paths';
|
|
22
22
|
import '@stryke/types/package-json';
|
|
23
23
|
import 'jiti';
|
|
24
|
-
import 'oxc-parser';
|
|
25
24
|
import 'semver';
|
|
25
|
+
import 'node:fs';
|
|
26
26
|
import '@stryke/types/tsconfig';
|
|
27
27
|
import 'typescript';
|
|
28
|
-
import '@stryke/json/types';
|
|
29
|
-
import 'node:fs';
|
|
30
28
|
import '@babel/parser';
|
|
31
29
|
import '@babel/types';
|
|
32
30
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Plugin } from './plugin-
|
|
1
|
+
import { P as Plugin } from './plugin-D74kMH3n.js';
|
|
2
2
|
import { BabelPluginOptions, BabelPluginContext } from './types/plugin.js';
|
|
3
3
|
export { BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from './types/plugin.js';
|
|
4
4
|
export { GenerateFromAstOptions, __ΩGenerateFromAstOptions, generateFromAst, parseAst } from './helpers/ast-utils.js';
|
|
@@ -21,12 +21,10 @@ import '@babel/helper-plugin-utils';
|
|
|
21
21
|
import '@stryke/env/get-env-paths';
|
|
22
22
|
import '@stryke/types/package-json';
|
|
23
23
|
import 'jiti';
|
|
24
|
-
import 'oxc-parser';
|
|
25
24
|
import 'semver';
|
|
25
|
+
import 'node:fs';
|
|
26
26
|
import '@stryke/types/tsconfig';
|
|
27
27
|
import 'typescript';
|
|
28
|
-
import '@stryke/json/types';
|
|
29
|
-
import 'node:fs';
|
|
30
28
|
import '@babel/parser';
|
|
31
29
|
import '@babel/types';
|
|
32
30
|
|
|
@@ -12,12 +12,10 @@ import { BabelAPI } from '@babel/helper-plugin-utils';
|
|
|
12
12
|
import { EnvPaths } from '@stryke/env/get-env-paths';
|
|
13
13
|
import { PackageJson } from '@stryke/types/package-json';
|
|
14
14
|
import { Jiti } from 'jiti';
|
|
15
|
-
import { ParserOptions, ParseResult } from 'oxc-parser';
|
|
16
15
|
import { Range } from 'semver';
|
|
16
|
+
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
17
17
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
18
18
|
import ts from 'typescript';
|
|
19
|
-
import { PrimitiveJsonValue } from '@stryke/json/types';
|
|
20
|
-
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
21
19
|
|
|
22
20
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
23
21
|
interface BuildConfig {
|
|
@@ -205,87 +203,20 @@ interface ImportSpecifier {
|
|
|
205
203
|
imported: string;
|
|
206
204
|
}
|
|
207
205
|
|
|
208
|
-
type ReflectionMode = "default" | "explicit" | "never";
|
|
209
|
-
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
210
|
-
/**
|
|
211
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
212
|
-
*
|
|
213
|
-
* @remarks
|
|
214
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
215
|
-
* - `minimal` - Only the essential type information is captured.
|
|
216
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
217
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
218
|
-
*/
|
|
219
|
-
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
220
|
-
interface DeepkitOptions {
|
|
221
|
-
/**
|
|
222
|
-
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
223
|
-
* or a list of globs/file paths relative to this tsconfig.json.
|
|
224
|
-
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
225
|
-
*/
|
|
226
|
-
reflection?: RawReflectionMode;
|
|
227
|
-
/**
|
|
228
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
229
|
-
*
|
|
230
|
-
* @remarks
|
|
231
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
232
|
-
* - `minimal` - Only the essential type information is captured.
|
|
233
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
234
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
235
|
-
*/
|
|
236
|
-
reflectionLevel?: ReflectionLevel;
|
|
237
|
-
}
|
|
238
|
-
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
239
|
-
/**
|
|
240
|
-
* The TypeScript compiler configuration.
|
|
241
|
-
*
|
|
242
|
-
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
243
|
-
*/
|
|
244
|
-
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
245
|
-
/**
|
|
246
|
-
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
247
|
-
* or a list of globs/file paths relative to this tsconfig.json.
|
|
248
|
-
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
249
|
-
*/
|
|
250
|
-
reflection?: RawReflectionMode;
|
|
251
|
-
/**
|
|
252
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
253
|
-
*
|
|
254
|
-
* @remarks
|
|
255
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
256
|
-
* - `minimal` - Only the essential type information is captured.
|
|
257
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
258
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
259
|
-
*/
|
|
260
|
-
reflectionLevel?: ReflectionLevel;
|
|
261
|
-
/**
|
|
262
|
-
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
263
|
-
*/
|
|
264
|
-
compilerOptions?: TSCompilerOptions;
|
|
265
|
-
}
|
|
266
|
-
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
267
|
-
originalTsconfigJson: TsConfigJson;
|
|
268
|
-
tsconfigJson: TSConfig;
|
|
269
|
-
tsconfigFilePath: string;
|
|
270
|
-
};
|
|
271
|
-
|
|
272
206
|
declare const __VFS_PATCH__ = "__VFS_PATCH__";
|
|
273
207
|
declare const __VFS_REVERT__ = "__VFS_REVERT__";
|
|
274
208
|
type OutputModeType = "fs" | "virtual";
|
|
275
|
-
interface
|
|
209
|
+
interface VirtualFileMetadata {
|
|
276
210
|
/**
|
|
277
|
-
* The
|
|
278
|
-
*
|
|
279
|
-
* @remarks
|
|
280
|
-
* If no specific id is provided, it defaults to the file's {@link path}.
|
|
211
|
+
* The identifier for the file data.
|
|
281
212
|
*/
|
|
282
213
|
id: string;
|
|
283
214
|
/**
|
|
284
|
-
*
|
|
215
|
+
* The timestamp of the virtual file.
|
|
285
216
|
*/
|
|
286
|
-
|
|
217
|
+
timestamp: number;
|
|
287
218
|
/**
|
|
288
|
-
* The
|
|
219
|
+
* The type of the file.
|
|
289
220
|
*
|
|
290
221
|
* @remarks
|
|
291
222
|
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
@@ -293,52 +224,72 @@ interface VirtualFile {
|
|
|
293
224
|
* - `entry`: Indicates that the file is an entry point for execution.
|
|
294
225
|
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
295
226
|
*/
|
|
296
|
-
|
|
227
|
+
type: string;
|
|
297
228
|
/**
|
|
298
229
|
* The output mode of the file.
|
|
299
|
-
*
|
|
300
|
-
* @remarks
|
|
301
|
-
* This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
|
|
302
230
|
*/
|
|
303
|
-
mode:
|
|
304
|
-
/**
|
|
305
|
-
* A virtual (or actual) path to the file in the file system.
|
|
306
|
-
*/
|
|
307
|
-
path: string;
|
|
231
|
+
mode: string;
|
|
308
232
|
/**
|
|
309
|
-
*
|
|
233
|
+
* Additional metadata associated with the file.
|
|
310
234
|
*/
|
|
311
|
-
|
|
235
|
+
properties: Record<string, string>;
|
|
312
236
|
}
|
|
313
|
-
interface
|
|
237
|
+
interface VirtualFileData {
|
|
314
238
|
/**
|
|
315
239
|
* The identifier for the file data.
|
|
316
240
|
*/
|
|
317
|
-
id
|
|
241
|
+
id?: string;
|
|
318
242
|
/**
|
|
319
|
-
* The
|
|
243
|
+
* The contents of the virtual file.
|
|
244
|
+
*/
|
|
245
|
+
code: string;
|
|
246
|
+
/**
|
|
247
|
+
* The type of the file.
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
251
|
+
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
252
|
+
* - `entry`: Indicates that the file is an entry point for execution.
|
|
253
|
+
* - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
|
|
254
|
+
* - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
|
|
255
|
+
* - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
|
|
256
|
+
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
320
257
|
*/
|
|
321
|
-
|
|
258
|
+
type?: string;
|
|
322
259
|
/**
|
|
323
260
|
* The output mode of the file.
|
|
324
261
|
*/
|
|
325
|
-
mode
|
|
262
|
+
mode?: string;
|
|
326
263
|
/**
|
|
327
264
|
* Additional metadata associated with the file.
|
|
328
265
|
*/
|
|
329
|
-
properties
|
|
266
|
+
properties?: Record<string, string>;
|
|
267
|
+
}
|
|
268
|
+
interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
|
|
269
|
+
/**
|
|
270
|
+
* An additional name for the file.
|
|
271
|
+
*/
|
|
272
|
+
path: string;
|
|
273
|
+
/**
|
|
274
|
+
* The timestamp of the virtual file.
|
|
275
|
+
*/
|
|
276
|
+
timestamp: number;
|
|
330
277
|
}
|
|
331
278
|
interface ResolveFSOptions {
|
|
332
279
|
mode?: OutputModeType;
|
|
333
280
|
}
|
|
334
281
|
type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
|
|
335
282
|
interface PowerlinesWriteFileOptions extends ResolveFSOptions {
|
|
283
|
+
/**
|
|
284
|
+
* Should the file skip formatting before being written?
|
|
285
|
+
*
|
|
286
|
+
* @defaultValue false
|
|
287
|
+
*/
|
|
336
288
|
skipFormat?: boolean;
|
|
337
289
|
}
|
|
338
290
|
type NodeWriteFileOptions = WriteFileOptions$1;
|
|
339
291
|
type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
|
|
340
|
-
type
|
|
341
|
-
type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
|
|
292
|
+
type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
|
|
342
293
|
interface ResolvePathOptions extends ResolveFSOptions {
|
|
343
294
|
/**
|
|
344
295
|
* Should the resolved path include the file extension?
|
|
@@ -353,7 +304,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
353
304
|
/**
|
|
354
305
|
* The type of the path to resolve.
|
|
355
306
|
*/
|
|
356
|
-
|
|
307
|
+
pathType?: "file" | "directory";
|
|
357
308
|
}
|
|
358
309
|
interface VirtualFileSystemInterface {
|
|
359
310
|
/**
|
|
@@ -642,6 +593,70 @@ interface VirtualFileSystemInterface {
|
|
|
642
593
|
dispose: () => Promise<void>;
|
|
643
594
|
}
|
|
644
595
|
|
|
596
|
+
type ReflectionMode = "default" | "explicit" | "never";
|
|
597
|
+
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
598
|
+
/**
|
|
599
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
600
|
+
*
|
|
601
|
+
* @remarks
|
|
602
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
603
|
+
* - `minimal` - Only the essential type information is captured.
|
|
604
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
605
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
606
|
+
*/
|
|
607
|
+
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
608
|
+
interface DeepkitOptions {
|
|
609
|
+
/**
|
|
610
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
611
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
612
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
613
|
+
*/
|
|
614
|
+
reflection?: RawReflectionMode;
|
|
615
|
+
/**
|
|
616
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
617
|
+
*
|
|
618
|
+
* @remarks
|
|
619
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
620
|
+
* - `minimal` - Only the essential type information is captured.
|
|
621
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
622
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
623
|
+
*/
|
|
624
|
+
reflectionLevel?: ReflectionLevel;
|
|
625
|
+
}
|
|
626
|
+
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
627
|
+
/**
|
|
628
|
+
* The TypeScript compiler configuration.
|
|
629
|
+
*
|
|
630
|
+
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
631
|
+
*/
|
|
632
|
+
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
633
|
+
/**
|
|
634
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
635
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
636
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
637
|
+
*/
|
|
638
|
+
reflection?: RawReflectionMode;
|
|
639
|
+
/**
|
|
640
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
641
|
+
*
|
|
642
|
+
* @remarks
|
|
643
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
644
|
+
* - `minimal` - Only the essential type information is captured.
|
|
645
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
646
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
647
|
+
*/
|
|
648
|
+
reflectionLevel?: ReflectionLevel;
|
|
649
|
+
/**
|
|
650
|
+
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
651
|
+
*/
|
|
652
|
+
compilerOptions?: TSCompilerOptions;
|
|
653
|
+
}
|
|
654
|
+
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
655
|
+
originalTsconfigJson: TsConfigJson;
|
|
656
|
+
tsconfigJson: TSConfig;
|
|
657
|
+
tsconfigFilePath: string;
|
|
658
|
+
};
|
|
659
|
+
|
|
645
660
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
646
661
|
/**
|
|
647
662
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
@@ -1200,7 +1215,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1200
1215
|
* @param path - An optional path to write the builtin file to
|
|
1201
1216
|
* @param options - Options for writing the file
|
|
1202
1217
|
*/
|
|
1203
|
-
|
|
1218
|
+
emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
|
|
1204
1219
|
/**
|
|
1205
1220
|
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1206
1221
|
*
|
|
@@ -1208,11 +1223,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1208
1223
|
* @param path - An optional path to write the entry file to
|
|
1209
1224
|
* @param options - Options for writing the file
|
|
1210
1225
|
*/
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* Parses the source code and returns a {@link ParseResult} object.
|
|
1214
|
-
*/
|
|
1215
|
-
parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
|
|
1226
|
+
emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
|
|
1216
1227
|
/**
|
|
1217
1228
|
* A function to update the context fields using a new user configuration options
|
|
1218
1229
|
*/
|
|
@@ -1434,6 +1445,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
|
|
|
1434
1445
|
resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
|
|
1435
1446
|
isEntry: boolean;
|
|
1436
1447
|
}) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
|
|
1448
|
+
/**
|
|
1449
|
+
* An API object that can be used for inter-plugin communication.
|
|
1450
|
+
*
|
|
1451
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
1452
|
+
*/
|
|
1453
|
+
api?: Record<string, any>;
|
|
1437
1454
|
};
|
|
1438
1455
|
type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
|
|
1439
1456
|
[TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
|
|
@@ -12,12 +12,10 @@ import { BabelAPI } from '@babel/helper-plugin-utils';
|
|
|
12
12
|
import { EnvPaths } from '@stryke/env/get-env-paths';
|
|
13
13
|
import { PackageJson } from '@stryke/types/package-json';
|
|
14
14
|
import { Jiti } from 'jiti';
|
|
15
|
-
import { ParserOptions, ParseResult } from 'oxc-parser';
|
|
16
15
|
import { Range } from 'semver';
|
|
16
|
+
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
17
17
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
18
18
|
import ts from 'typescript';
|
|
19
|
-
import { PrimitiveJsonValue } from '@stryke/json/types';
|
|
20
|
-
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
21
19
|
|
|
22
20
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
23
21
|
interface BuildConfig {
|
|
@@ -205,87 +203,20 @@ interface ImportSpecifier {
|
|
|
205
203
|
imported: string;
|
|
206
204
|
}
|
|
207
205
|
|
|
208
|
-
type ReflectionMode = "default" | "explicit" | "never";
|
|
209
|
-
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
210
|
-
/**
|
|
211
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
212
|
-
*
|
|
213
|
-
* @remarks
|
|
214
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
215
|
-
* - `minimal` - Only the essential type information is captured.
|
|
216
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
217
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
218
|
-
*/
|
|
219
|
-
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
220
|
-
interface DeepkitOptions {
|
|
221
|
-
/**
|
|
222
|
-
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
223
|
-
* or a list of globs/file paths relative to this tsconfig.json.
|
|
224
|
-
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
225
|
-
*/
|
|
226
|
-
reflection?: RawReflectionMode;
|
|
227
|
-
/**
|
|
228
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
229
|
-
*
|
|
230
|
-
* @remarks
|
|
231
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
232
|
-
* - `minimal` - Only the essential type information is captured.
|
|
233
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
234
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
235
|
-
*/
|
|
236
|
-
reflectionLevel?: ReflectionLevel;
|
|
237
|
-
}
|
|
238
|
-
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
239
|
-
/**
|
|
240
|
-
* The TypeScript compiler configuration.
|
|
241
|
-
*
|
|
242
|
-
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
243
|
-
*/
|
|
244
|
-
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
245
|
-
/**
|
|
246
|
-
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
247
|
-
* or a list of globs/file paths relative to this tsconfig.json.
|
|
248
|
-
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
249
|
-
*/
|
|
250
|
-
reflection?: RawReflectionMode;
|
|
251
|
-
/**
|
|
252
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
253
|
-
*
|
|
254
|
-
* @remarks
|
|
255
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
256
|
-
* - `minimal` - Only the essential type information is captured.
|
|
257
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
258
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
259
|
-
*/
|
|
260
|
-
reflectionLevel?: ReflectionLevel;
|
|
261
|
-
/**
|
|
262
|
-
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
263
|
-
*/
|
|
264
|
-
compilerOptions?: TSCompilerOptions;
|
|
265
|
-
}
|
|
266
|
-
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
267
|
-
originalTsconfigJson: TsConfigJson;
|
|
268
|
-
tsconfigJson: TSConfig;
|
|
269
|
-
tsconfigFilePath: string;
|
|
270
|
-
};
|
|
271
|
-
|
|
272
206
|
declare const __VFS_PATCH__ = "__VFS_PATCH__";
|
|
273
207
|
declare const __VFS_REVERT__ = "__VFS_REVERT__";
|
|
274
208
|
type OutputModeType = "fs" | "virtual";
|
|
275
|
-
interface
|
|
209
|
+
interface VirtualFileMetadata {
|
|
276
210
|
/**
|
|
277
|
-
* The
|
|
278
|
-
*
|
|
279
|
-
* @remarks
|
|
280
|
-
* If no specific id is provided, it defaults to the file's {@link path}.
|
|
211
|
+
* The identifier for the file data.
|
|
281
212
|
*/
|
|
282
213
|
id: string;
|
|
283
214
|
/**
|
|
284
|
-
*
|
|
215
|
+
* The timestamp of the virtual file.
|
|
285
216
|
*/
|
|
286
|
-
|
|
217
|
+
timestamp: number;
|
|
287
218
|
/**
|
|
288
|
-
* The
|
|
219
|
+
* The type of the file.
|
|
289
220
|
*
|
|
290
221
|
* @remarks
|
|
291
222
|
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
@@ -293,52 +224,72 @@ interface VirtualFile {
|
|
|
293
224
|
* - `entry`: Indicates that the file is an entry point for execution.
|
|
294
225
|
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
295
226
|
*/
|
|
296
|
-
|
|
227
|
+
type: string;
|
|
297
228
|
/**
|
|
298
229
|
* The output mode of the file.
|
|
299
|
-
*
|
|
300
|
-
* @remarks
|
|
301
|
-
* This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
|
|
302
230
|
*/
|
|
303
|
-
mode:
|
|
304
|
-
/**
|
|
305
|
-
* A virtual (or actual) path to the file in the file system.
|
|
306
|
-
*/
|
|
307
|
-
path: string;
|
|
231
|
+
mode: string;
|
|
308
232
|
/**
|
|
309
|
-
*
|
|
233
|
+
* Additional metadata associated with the file.
|
|
310
234
|
*/
|
|
311
|
-
|
|
235
|
+
properties: Record<string, string>;
|
|
312
236
|
}
|
|
313
|
-
interface
|
|
237
|
+
interface VirtualFileData {
|
|
314
238
|
/**
|
|
315
239
|
* The identifier for the file data.
|
|
316
240
|
*/
|
|
317
|
-
id
|
|
241
|
+
id?: string;
|
|
318
242
|
/**
|
|
319
|
-
* The
|
|
243
|
+
* The contents of the virtual file.
|
|
244
|
+
*/
|
|
245
|
+
code: string;
|
|
246
|
+
/**
|
|
247
|
+
* The type of the file.
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
251
|
+
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
252
|
+
* - `entry`: Indicates that the file is an entry point for execution.
|
|
253
|
+
* - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
|
|
254
|
+
* - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
|
|
255
|
+
* - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
|
|
256
|
+
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
320
257
|
*/
|
|
321
|
-
|
|
258
|
+
type?: string;
|
|
322
259
|
/**
|
|
323
260
|
* The output mode of the file.
|
|
324
261
|
*/
|
|
325
|
-
mode
|
|
262
|
+
mode?: string;
|
|
326
263
|
/**
|
|
327
264
|
* Additional metadata associated with the file.
|
|
328
265
|
*/
|
|
329
|
-
properties
|
|
266
|
+
properties?: Record<string, string>;
|
|
267
|
+
}
|
|
268
|
+
interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
|
|
269
|
+
/**
|
|
270
|
+
* An additional name for the file.
|
|
271
|
+
*/
|
|
272
|
+
path: string;
|
|
273
|
+
/**
|
|
274
|
+
* The timestamp of the virtual file.
|
|
275
|
+
*/
|
|
276
|
+
timestamp: number;
|
|
330
277
|
}
|
|
331
278
|
interface ResolveFSOptions {
|
|
332
279
|
mode?: OutputModeType;
|
|
333
280
|
}
|
|
334
281
|
type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
|
|
335
282
|
interface PowerlinesWriteFileOptions extends ResolveFSOptions {
|
|
283
|
+
/**
|
|
284
|
+
* Should the file skip formatting before being written?
|
|
285
|
+
*
|
|
286
|
+
* @defaultValue false
|
|
287
|
+
*/
|
|
336
288
|
skipFormat?: boolean;
|
|
337
289
|
}
|
|
338
290
|
type NodeWriteFileOptions = WriteFileOptions$1;
|
|
339
291
|
type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
|
|
340
|
-
type
|
|
341
|
-
type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
|
|
292
|
+
type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
|
|
342
293
|
interface ResolvePathOptions extends ResolveFSOptions {
|
|
343
294
|
/**
|
|
344
295
|
* Should the resolved path include the file extension?
|
|
@@ -353,7 +304,7 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
353
304
|
/**
|
|
354
305
|
* The type of the path to resolve.
|
|
355
306
|
*/
|
|
356
|
-
|
|
307
|
+
pathType?: "file" | "directory";
|
|
357
308
|
}
|
|
358
309
|
interface VirtualFileSystemInterface {
|
|
359
310
|
/**
|
|
@@ -642,6 +593,70 @@ interface VirtualFileSystemInterface {
|
|
|
642
593
|
dispose: () => Promise<void>;
|
|
643
594
|
}
|
|
644
595
|
|
|
596
|
+
type ReflectionMode = "default" | "explicit" | "never";
|
|
597
|
+
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
598
|
+
/**
|
|
599
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
600
|
+
*
|
|
601
|
+
* @remarks
|
|
602
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
603
|
+
* - `minimal` - Only the essential type information is captured.
|
|
604
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
605
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
606
|
+
*/
|
|
607
|
+
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
608
|
+
interface DeepkitOptions {
|
|
609
|
+
/**
|
|
610
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
611
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
612
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
613
|
+
*/
|
|
614
|
+
reflection?: RawReflectionMode;
|
|
615
|
+
/**
|
|
616
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
617
|
+
*
|
|
618
|
+
* @remarks
|
|
619
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
620
|
+
* - `minimal` - Only the essential type information is captured.
|
|
621
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
622
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
623
|
+
*/
|
|
624
|
+
reflectionLevel?: ReflectionLevel;
|
|
625
|
+
}
|
|
626
|
+
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
627
|
+
/**
|
|
628
|
+
* The TypeScript compiler configuration.
|
|
629
|
+
*
|
|
630
|
+
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
631
|
+
*/
|
|
632
|
+
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
633
|
+
/**
|
|
634
|
+
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
635
|
+
* or a list of globs/file paths relative to this tsconfig.json.
|
|
636
|
+
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
637
|
+
*/
|
|
638
|
+
reflection?: RawReflectionMode;
|
|
639
|
+
/**
|
|
640
|
+
* Defines the level of reflection to be used during the transpilation process.
|
|
641
|
+
*
|
|
642
|
+
* @remarks
|
|
643
|
+
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
644
|
+
* - `minimal` - Only the essential type information is captured.
|
|
645
|
+
* - `normal` - Additional type information is captured, including some contextual data.
|
|
646
|
+
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
647
|
+
*/
|
|
648
|
+
reflectionLevel?: ReflectionLevel;
|
|
649
|
+
/**
|
|
650
|
+
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
651
|
+
*/
|
|
652
|
+
compilerOptions?: TSCompilerOptions;
|
|
653
|
+
}
|
|
654
|
+
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
655
|
+
originalTsconfigJson: TsConfigJson;
|
|
656
|
+
tsconfigJson: TSConfig;
|
|
657
|
+
tsconfigFilePath: string;
|
|
658
|
+
};
|
|
659
|
+
|
|
645
660
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
646
661
|
/**
|
|
647
662
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
@@ -1200,7 +1215,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1200
1215
|
* @param path - An optional path to write the builtin file to
|
|
1201
1216
|
* @param options - Options for writing the file
|
|
1202
1217
|
*/
|
|
1203
|
-
|
|
1218
|
+
emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
|
|
1204
1219
|
/**
|
|
1205
1220
|
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1206
1221
|
*
|
|
@@ -1208,11 +1223,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1208
1223
|
* @param path - An optional path to write the entry file to
|
|
1209
1224
|
* @param options - Options for writing the file
|
|
1210
1225
|
*/
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* Parses the source code and returns a {@link ParseResult} object.
|
|
1214
|
-
*/
|
|
1215
|
-
parse: (code: string, id: string, options?: ParserOptions | null) => Promise<ParseResult>;
|
|
1226
|
+
emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
|
|
1216
1227
|
/**
|
|
1217
1228
|
* A function to update the context fields using a new user configuration options
|
|
1218
1229
|
*/
|
|
@@ -1434,6 +1445,12 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
|
|
|
1434
1445
|
resolveId: PluginHook<(this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
|
|
1435
1446
|
isEntry: boolean;
|
|
1436
1447
|
}) => MaybePromise<string | ExternalIdResult | null | undefined>, "id">;
|
|
1448
|
+
/**
|
|
1449
|
+
* An API object that can be used for inter-plugin communication.
|
|
1450
|
+
*
|
|
1451
|
+
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
1452
|
+
*/
|
|
1453
|
+
api?: Record<string, any>;
|
|
1437
1454
|
};
|
|
1438
1455
|
type PluginBuildPlugins<TContext extends PluginContext = PluginContext> = {
|
|
1439
1456
|
[TBuildVariant in UnpluginBuildVariant]?: BuildPlugin<TContext, TBuildVariant>;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from './plugin.cjs';
|
|
2
|
-
import '../plugin-
|
|
2
|
+
import '../plugin-D74kMH3n.cjs';
|
|
3
3
|
import '@stryke/types/base';
|
|
4
4
|
import 'unplugin';
|
|
5
5
|
import '@stryke/types/array';
|
|
@@ -14,9 +14,7 @@ import '@babel/helper-plugin-utils';
|
|
|
14
14
|
import '@stryke/env/get-env-paths';
|
|
15
15
|
import '@stryke/types/package-json';
|
|
16
16
|
import 'jiti';
|
|
17
|
-
import 'oxc-parser';
|
|
18
17
|
import 'semver';
|
|
18
|
+
import 'node:fs';
|
|
19
19
|
import '@stryke/types/tsconfig';
|
|
20
20
|
import 'typescript';
|
|
21
|
-
import '@stryke/json/types';
|
|
22
|
-
import 'node:fs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig, __ΩBabelPluginContext, __ΩBabelPluginOptions, __ΩBabelPluginResolvedConfig, __ΩBabelPluginUserConfig } from './plugin.js';
|
|
2
|
-
import '../plugin-
|
|
2
|
+
import '../plugin-D74kMH3n.js';
|
|
3
3
|
import '@stryke/types/base';
|
|
4
4
|
import 'unplugin';
|
|
5
5
|
import '@stryke/types/array';
|
|
@@ -14,9 +14,7 @@ import '@babel/helper-plugin-utils';
|
|
|
14
14
|
import '@stryke/env/get-env-paths';
|
|
15
15
|
import '@stryke/types/package-json';
|
|
16
16
|
import 'jiti';
|
|
17
|
-
import 'oxc-parser';
|
|
18
17
|
import 'semver';
|
|
18
|
+
import 'node:fs';
|
|
19
19
|
import '@stryke/types/tsconfig';
|
|
20
20
|
import 'typescript';
|
|
21
|
-
import '@stryke/json/types';
|
|
22
|
-
import 'node:fs';
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as BabelUserConfig, e as ResolvedConfig, f as BabelResolvedConfig, g as PluginContext, U as UserConfig } from '../plugin-
|
|
1
|
+
import { d as BabelUserConfig, e as ResolvedConfig, f as BabelResolvedConfig, g as PluginContext, U as UserConfig } from '../plugin-D74kMH3n.cjs';
|
|
2
2
|
import '@stryke/types/base';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
24
22
|
type BabelPluginUserConfig = UserConfig;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as BabelUserConfig, e as ResolvedConfig, f as BabelResolvedConfig, g as PluginContext, U as UserConfig } from '../plugin-
|
|
1
|
+
import { d as BabelUserConfig, e as ResolvedConfig, f as BabelResolvedConfig, g as PluginContext, U as UserConfig } from '../plugin-D74kMH3n.js';
|
|
2
2
|
import '@stryke/types/base';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import '@stryke/types/array';
|
|
@@ -13,12 +13,10 @@ import '@babel/helper-plugin-utils';
|
|
|
13
13
|
import '@stryke/env/get-env-paths';
|
|
14
14
|
import '@stryke/types/package-json';
|
|
15
15
|
import 'jiti';
|
|
16
|
-
import 'oxc-parser';
|
|
17
16
|
import 'semver';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
|
-
import '@stryke/json/types';
|
|
21
|
-
import 'node:fs';
|
|
22
20
|
|
|
23
21
|
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
24
22
|
type BabelPluginUserConfig = UserConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-babel",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"@babel/helper-plugin-utils": "^7.27.1",
|
|
137
137
|
"@babel/parser": "^7.28.5",
|
|
138
138
|
"@babel/types": "^7.28.5",
|
|
139
|
-
"@storm-software/config-tools": "^1.188.
|
|
139
|
+
"@storm-software/config-tools": "^1.188.47",
|
|
140
140
|
"@stryke/fs": "^0.32.13",
|
|
141
141
|
"@stryke/path": "^0.19.2",
|
|
142
142
|
"@stryke/type-checks": "^0.3.12",
|
|
@@ -144,15 +144,15 @@
|
|
|
144
144
|
"chalk": "5.6.2",
|
|
145
145
|
"defu": "^6.1.4",
|
|
146
146
|
"jiti": "^2.6.1",
|
|
147
|
-
"powerlines": "^0.23.
|
|
147
|
+
"powerlines": "^0.23.4",
|
|
148
148
|
"unplugin": "^2.3.10"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
151
|
"@babel/plugin-syntax-typescript": "^7.27.1",
|
|
152
|
-
"@powerlines/nx": "^0.10.
|
|
153
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
152
|
+
"@powerlines/nx": "^0.10.21",
|
|
153
|
+
"@powerlines/plugin-plugin": "^0.11.29",
|
|
154
154
|
"@types/node": "^24.10.1"
|
|
155
155
|
},
|
|
156
156
|
"publishConfig": { "access": "public" },
|
|
157
|
-
"gitHead": "
|
|
157
|
+
"gitHead": "3075c08893a66a4e8d359e37f8d0344b0a80322b"
|
|
158
158
|
}
|