@powerlines/plugin-oxc-transform 0.5.19 → 0.5.20
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/{index-DlIdbx60.d.cts → index-D6LfVDQr.d.cts} +64 -64
- package/dist/{index-DlIdbx60.d.ts → index-D6LfVDQr.d.ts} +64 -64
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/types/index.d.cts +1 -3
- package/dist/types/index.d.ts +1 -3
- package/dist/types/plugin.d.cts +1 -3
- package/dist/types/plugin.d.ts +1 -3
- package/package.json +5 -5
|
@@ -15,9 +15,7 @@ import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult
|
|
|
15
15
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
16
16
|
import ts from 'typescript';
|
|
17
17
|
import { PrimitiveJsonValue } from '@stryke/json/types';
|
|
18
|
-
import { Volume } from 'memfs';
|
|
19
18
|
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
20
|
-
import { IUnionFs } from 'unionfs';
|
|
21
19
|
import { ArrayValues } from '@stryke/types/array';
|
|
22
20
|
|
|
23
21
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
@@ -28,6 +26,20 @@ interface BuildConfig {
|
|
|
28
26
|
* @defaultValue "neutral"
|
|
29
27
|
*/
|
|
30
28
|
platform?: "node" | "browser" | "neutral";
|
|
29
|
+
/**
|
|
30
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* {
|
|
38
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
polyfill?: string[];
|
|
31
43
|
/**
|
|
32
44
|
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
33
45
|
*
|
|
@@ -113,7 +125,10 @@ interface BuildConfig {
|
|
|
113
125
|
*
|
|
114
126
|
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
115
127
|
*/
|
|
116
|
-
alias?: Record<string, string
|
|
128
|
+
alias?: Record<string, string> | Array<{
|
|
129
|
+
find: string | RegExp;
|
|
130
|
+
replacement: string;
|
|
131
|
+
}>;
|
|
117
132
|
/**
|
|
118
133
|
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
119
134
|
*
|
|
@@ -203,11 +218,8 @@ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
|
203
218
|
tsconfigFilePath: string;
|
|
204
219
|
};
|
|
205
220
|
|
|
206
|
-
declare const
|
|
207
|
-
declare const __VFS_REVERT__
|
|
208
|
-
declare const __VFS_CACHE__ = "__VFS_CACHE__";
|
|
209
|
-
declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
210
|
-
declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
221
|
+
declare const __VFS_PATCH__: unique symbol;
|
|
222
|
+
declare const __VFS_REVERT__: unique symbol;
|
|
211
223
|
type OutputModeType = "fs" | "virtual";
|
|
212
224
|
interface VirtualFile {
|
|
213
225
|
/**
|
|
@@ -247,7 +259,24 @@ interface VirtualFile {
|
|
|
247
259
|
*/
|
|
248
260
|
code: string | NodeJS.ArrayBufferView;
|
|
249
261
|
}
|
|
250
|
-
|
|
262
|
+
interface VirtualFileMetadata {
|
|
263
|
+
/**
|
|
264
|
+
* The identifier for the file data.
|
|
265
|
+
*/
|
|
266
|
+
id: string;
|
|
267
|
+
/**
|
|
268
|
+
* The variant of the file.
|
|
269
|
+
*/
|
|
270
|
+
variant: string;
|
|
271
|
+
/**
|
|
272
|
+
* The output mode of the file.
|
|
273
|
+
*/
|
|
274
|
+
mode: string;
|
|
275
|
+
/**
|
|
276
|
+
* Additional metadata associated with the file.
|
|
277
|
+
*/
|
|
278
|
+
properties: Record<string, string>;
|
|
279
|
+
}
|
|
251
280
|
interface ResolveFSOptions {
|
|
252
281
|
mode?: OutputModeType;
|
|
253
282
|
}
|
|
@@ -276,12 +305,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
276
305
|
type?: "file" | "directory";
|
|
277
306
|
}
|
|
278
307
|
interface VirtualFileSystemInterface {
|
|
279
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Patches the File System to include the virtual file system (VFS) contents.
|
|
310
|
+
*/
|
|
311
|
+
[__VFS_PATCH__]: () => void;
|
|
312
|
+
/**
|
|
313
|
+
* Reverts the virtual file system (VFS) to its previous state.
|
|
314
|
+
*/
|
|
280
315
|
[__VFS_REVERT__]: () => void;
|
|
281
316
|
/**
|
|
282
317
|
* The underlying file metadata.
|
|
283
318
|
*/
|
|
284
|
-
|
|
319
|
+
metadata: Record<string, VirtualFileMetadata | undefined>;
|
|
285
320
|
/**
|
|
286
321
|
* A map of module ids to their file paths.
|
|
287
322
|
*/
|
|
@@ -301,7 +336,7 @@ interface VirtualFileSystemInterface {
|
|
|
301
336
|
* @param options - Optional parameters for resolving the path.
|
|
302
337
|
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
303
338
|
*/
|
|
304
|
-
|
|
339
|
+
isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
|
|
305
340
|
/**
|
|
306
341
|
* Checks if a file exists in the virtual file system (VFS).
|
|
307
342
|
*
|
|
@@ -316,15 +351,6 @@ interface VirtualFileSystemInterface {
|
|
|
316
351
|
* @returns `true` if the directory exists, otherwise `false`.
|
|
317
352
|
*/
|
|
318
353
|
isDirectory: (path: string) => boolean;
|
|
319
|
-
/**
|
|
320
|
-
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
321
|
-
*
|
|
322
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
323
|
-
*
|
|
324
|
-
* @param pathOrId - The path or id to check.
|
|
325
|
-
* @returns Whether the path or id corresponds to a virtual file.
|
|
326
|
-
*/
|
|
327
|
-
isTsconfigPath: (pathOrId: string) => boolean;
|
|
328
354
|
/**
|
|
329
355
|
* Checks if a file exists in the virtual file system (VFS).
|
|
330
356
|
*
|
|
@@ -338,7 +364,7 @@ interface VirtualFileSystemInterface {
|
|
|
338
364
|
* @param pathOrId - The path or id of the file.
|
|
339
365
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
340
366
|
*/
|
|
341
|
-
getMetadata: (pathOrId: PathLike) =>
|
|
367
|
+
getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
|
|
342
368
|
/**
|
|
343
369
|
* Gets the stats of a file in the virtual file system (VFS).
|
|
344
370
|
*
|
|
@@ -546,23 +572,12 @@ interface VirtualFileSystemInterface {
|
|
|
546
572
|
*/
|
|
547
573
|
resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
|
|
548
574
|
/**
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
575
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
552
576
|
*
|
|
553
|
-
* @param path - The path to
|
|
554
|
-
* @returns The
|
|
577
|
+
* @param path - The path to format.
|
|
578
|
+
* @returns The formatted path.
|
|
555
579
|
*/
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* Resolves a package name based on TypeScript's `tsconfig.json` paths.
|
|
559
|
-
*
|
|
560
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
561
|
-
*
|
|
562
|
-
* @param path - The path to check.
|
|
563
|
-
* @returns The resolved package name if it exists, otherwise undefined.
|
|
564
|
-
*/
|
|
565
|
-
resolveTsconfigPathPackage: (path: string) => string | false;
|
|
580
|
+
formatPath: (path: string) => string;
|
|
566
581
|
/**
|
|
567
582
|
* Resolves a path or id to a file path in the virtual file system.
|
|
568
583
|
*
|
|
@@ -571,23 +586,9 @@ interface VirtualFileSystemInterface {
|
|
|
571
586
|
*/
|
|
572
587
|
realpathSync: (pathOrId: string) => string;
|
|
573
588
|
/**
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
* @returns A record mapping file paths to their partial metadata.
|
|
577
|
-
*/
|
|
578
|
-
getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
|
|
579
|
-
/**
|
|
580
|
-
* A map of cached file paths to their underlying file content.
|
|
581
|
-
*/
|
|
582
|
-
[__VFS_CACHE__]: Map<string, string>;
|
|
583
|
-
/**
|
|
584
|
-
* A reference to the underlying virtual file system.
|
|
589
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
585
590
|
*/
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* A reference to the underlying unified file system.
|
|
589
|
-
*/
|
|
590
|
-
[__VFS_UNIFIED__]: IUnionFs;
|
|
591
|
+
dispose: () => Promise<void>;
|
|
591
592
|
}
|
|
592
593
|
|
|
593
594
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -749,6 +750,13 @@ interface BaseConfig {
|
|
|
749
750
|
* This configuration will be used by the documentation generation plugins during the `docs` command.
|
|
750
751
|
*/
|
|
751
752
|
docs?: Record<string, any>;
|
|
753
|
+
/**
|
|
754
|
+
* Configuration for deploying the source code
|
|
755
|
+
*
|
|
756
|
+
* @remarks
|
|
757
|
+
* If set to `false`, the deployment will be disabled.
|
|
758
|
+
*/
|
|
759
|
+
deploy?: Record<string, any> | false;
|
|
752
760
|
/**
|
|
753
761
|
* The path to the tsconfig file to be used by the compiler
|
|
754
762
|
*
|
|
@@ -862,7 +870,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
|
|
|
862
870
|
override?: Partial<TBuildResolvedConfig>;
|
|
863
871
|
};
|
|
864
872
|
};
|
|
865
|
-
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "
|
|
873
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
866
874
|
/**
|
|
867
875
|
* The configuration provided while executing Powerlines commands.
|
|
868
876
|
*/
|
|
@@ -900,7 +908,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
900
908
|
/**
|
|
901
909
|
* The resolved options for the Powerlines project configuration.
|
|
902
910
|
*/
|
|
903
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
|
|
911
|
+
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework">> & {
|
|
904
912
|
/**
|
|
905
913
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
906
914
|
*/
|
|
@@ -971,14 +979,6 @@ interface MetaInfo {
|
|
|
971
979
|
* A hash that represents the path to the project root directory
|
|
972
980
|
*/
|
|
973
981
|
configHash: string;
|
|
974
|
-
/**
|
|
975
|
-
* A mapping of runtime ids to their corresponding file paths
|
|
976
|
-
*/
|
|
977
|
-
builtinIdMap: Record<string, string>;
|
|
978
|
-
/**
|
|
979
|
-
* A mapping of virtual file paths to their corresponding file contents
|
|
980
|
-
*/
|
|
981
|
-
virtualFiles: Record<string, string | null>;
|
|
982
982
|
}
|
|
983
983
|
interface Resolver extends Jiti {
|
|
984
984
|
plugin: Jiti;
|
|
@@ -1186,7 +1186,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1186
1186
|
}
|
|
1187
1187
|
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
|
|
1188
1188
|
|
|
1189
|
-
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "
|
|
1189
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
1190
1190
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
1191
1191
|
|
|
1192
1192
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
|
@@ -15,9 +15,7 @@ import { UnpluginMessage, UnpluginContext, UnpluginBuildContext, TransformResult
|
|
|
15
15
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
16
16
|
import ts from 'typescript';
|
|
17
17
|
import { PrimitiveJsonValue } from '@stryke/json/types';
|
|
18
|
-
import { Volume } from 'memfs';
|
|
19
18
|
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
20
|
-
import { IUnionFs } from 'unionfs';
|
|
21
19
|
import { ArrayValues } from '@stryke/types/array';
|
|
22
20
|
|
|
23
21
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
@@ -28,6 +26,20 @@ interface BuildConfig {
|
|
|
28
26
|
* @defaultValue "neutral"
|
|
29
27
|
*/
|
|
30
28
|
platform?: "node" | "browser" | "neutral";
|
|
29
|
+
/**
|
|
30
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* {
|
|
38
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
polyfill?: string[];
|
|
31
43
|
/**
|
|
32
44
|
* Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
|
|
33
45
|
*
|
|
@@ -113,7 +125,10 @@ interface BuildConfig {
|
|
|
113
125
|
*
|
|
114
126
|
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
115
127
|
*/
|
|
116
|
-
alias?: Record<string, string
|
|
128
|
+
alias?: Record<string, string> | Array<{
|
|
129
|
+
find: string | RegExp;
|
|
130
|
+
replacement: string;
|
|
131
|
+
}>;
|
|
117
132
|
/**
|
|
118
133
|
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
119
134
|
*
|
|
@@ -203,11 +218,8 @@ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
|
203
218
|
tsconfigFilePath: string;
|
|
204
219
|
};
|
|
205
220
|
|
|
206
|
-
declare const
|
|
207
|
-
declare const __VFS_REVERT__
|
|
208
|
-
declare const __VFS_CACHE__ = "__VFS_CACHE__";
|
|
209
|
-
declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
210
|
-
declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
221
|
+
declare const __VFS_PATCH__: unique symbol;
|
|
222
|
+
declare const __VFS_REVERT__: unique symbol;
|
|
211
223
|
type OutputModeType = "fs" | "virtual";
|
|
212
224
|
interface VirtualFile {
|
|
213
225
|
/**
|
|
@@ -247,7 +259,24 @@ interface VirtualFile {
|
|
|
247
259
|
*/
|
|
248
260
|
code: string | NodeJS.ArrayBufferView;
|
|
249
261
|
}
|
|
250
|
-
|
|
262
|
+
interface VirtualFileMetadata {
|
|
263
|
+
/**
|
|
264
|
+
* The identifier for the file data.
|
|
265
|
+
*/
|
|
266
|
+
id: string;
|
|
267
|
+
/**
|
|
268
|
+
* The variant of the file.
|
|
269
|
+
*/
|
|
270
|
+
variant: string;
|
|
271
|
+
/**
|
|
272
|
+
* The output mode of the file.
|
|
273
|
+
*/
|
|
274
|
+
mode: string;
|
|
275
|
+
/**
|
|
276
|
+
* Additional metadata associated with the file.
|
|
277
|
+
*/
|
|
278
|
+
properties: Record<string, string>;
|
|
279
|
+
}
|
|
251
280
|
interface ResolveFSOptions {
|
|
252
281
|
mode?: OutputModeType;
|
|
253
282
|
}
|
|
@@ -276,12 +305,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
276
305
|
type?: "file" | "directory";
|
|
277
306
|
}
|
|
278
307
|
interface VirtualFileSystemInterface {
|
|
279
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Patches the File System to include the virtual file system (VFS) contents.
|
|
310
|
+
*/
|
|
311
|
+
[__VFS_PATCH__]: () => void;
|
|
312
|
+
/**
|
|
313
|
+
* Reverts the virtual file system (VFS) to its previous state.
|
|
314
|
+
*/
|
|
280
315
|
[__VFS_REVERT__]: () => void;
|
|
281
316
|
/**
|
|
282
317
|
* The underlying file metadata.
|
|
283
318
|
*/
|
|
284
|
-
|
|
319
|
+
metadata: Record<string, VirtualFileMetadata | undefined>;
|
|
285
320
|
/**
|
|
286
321
|
* A map of module ids to their file paths.
|
|
287
322
|
*/
|
|
@@ -301,7 +336,7 @@ interface VirtualFileSystemInterface {
|
|
|
301
336
|
* @param options - Optional parameters for resolving the path.
|
|
302
337
|
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
303
338
|
*/
|
|
304
|
-
|
|
339
|
+
isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
|
|
305
340
|
/**
|
|
306
341
|
* Checks if a file exists in the virtual file system (VFS).
|
|
307
342
|
*
|
|
@@ -316,15 +351,6 @@ interface VirtualFileSystemInterface {
|
|
|
316
351
|
* @returns `true` if the directory exists, otherwise `false`.
|
|
317
352
|
*/
|
|
318
353
|
isDirectory: (path: string) => boolean;
|
|
319
|
-
/**
|
|
320
|
-
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
321
|
-
*
|
|
322
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
323
|
-
*
|
|
324
|
-
* @param pathOrId - The path or id to check.
|
|
325
|
-
* @returns Whether the path or id corresponds to a virtual file.
|
|
326
|
-
*/
|
|
327
|
-
isTsconfigPath: (pathOrId: string) => boolean;
|
|
328
354
|
/**
|
|
329
355
|
* Checks if a file exists in the virtual file system (VFS).
|
|
330
356
|
*
|
|
@@ -338,7 +364,7 @@ interface VirtualFileSystemInterface {
|
|
|
338
364
|
* @param pathOrId - The path or id of the file.
|
|
339
365
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
340
366
|
*/
|
|
341
|
-
getMetadata: (pathOrId: PathLike) =>
|
|
367
|
+
getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
|
|
342
368
|
/**
|
|
343
369
|
* Gets the stats of a file in the virtual file system (VFS).
|
|
344
370
|
*
|
|
@@ -546,23 +572,12 @@ interface VirtualFileSystemInterface {
|
|
|
546
572
|
*/
|
|
547
573
|
resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
|
|
548
574
|
/**
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
575
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
552
576
|
*
|
|
553
|
-
* @param path - The path to
|
|
554
|
-
* @returns The
|
|
577
|
+
* @param path - The path to format.
|
|
578
|
+
* @returns The formatted path.
|
|
555
579
|
*/
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* Resolves a package name based on TypeScript's `tsconfig.json` paths.
|
|
559
|
-
*
|
|
560
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
561
|
-
*
|
|
562
|
-
* @param path - The path to check.
|
|
563
|
-
* @returns The resolved package name if it exists, otherwise undefined.
|
|
564
|
-
*/
|
|
565
|
-
resolveTsconfigPathPackage: (path: string) => string | false;
|
|
580
|
+
formatPath: (path: string) => string;
|
|
566
581
|
/**
|
|
567
582
|
* Resolves a path or id to a file path in the virtual file system.
|
|
568
583
|
*
|
|
@@ -571,23 +586,9 @@ interface VirtualFileSystemInterface {
|
|
|
571
586
|
*/
|
|
572
587
|
realpathSync: (pathOrId: string) => string;
|
|
573
588
|
/**
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
* @returns A record mapping file paths to their partial metadata.
|
|
577
|
-
*/
|
|
578
|
-
getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
|
|
579
|
-
/**
|
|
580
|
-
* A map of cached file paths to their underlying file content.
|
|
581
|
-
*/
|
|
582
|
-
[__VFS_CACHE__]: Map<string, string>;
|
|
583
|
-
/**
|
|
584
|
-
* A reference to the underlying virtual file system.
|
|
589
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
585
590
|
*/
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* A reference to the underlying unified file system.
|
|
589
|
-
*/
|
|
590
|
-
[__VFS_UNIFIED__]: IUnionFs;
|
|
591
|
+
dispose: () => Promise<void>;
|
|
591
592
|
}
|
|
592
593
|
|
|
593
594
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -749,6 +750,13 @@ interface BaseConfig {
|
|
|
749
750
|
* This configuration will be used by the documentation generation plugins during the `docs` command.
|
|
750
751
|
*/
|
|
751
752
|
docs?: Record<string, any>;
|
|
753
|
+
/**
|
|
754
|
+
* Configuration for deploying the source code
|
|
755
|
+
*
|
|
756
|
+
* @remarks
|
|
757
|
+
* If set to `false`, the deployment will be disabled.
|
|
758
|
+
*/
|
|
759
|
+
deploy?: Record<string, any> | false;
|
|
752
760
|
/**
|
|
753
761
|
* The path to the tsconfig file to be used by the compiler
|
|
754
762
|
*
|
|
@@ -862,7 +870,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
|
|
|
862
870
|
override?: Partial<TBuildResolvedConfig>;
|
|
863
871
|
};
|
|
864
872
|
};
|
|
865
|
-
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "
|
|
873
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
866
874
|
/**
|
|
867
875
|
* The configuration provided while executing Powerlines commands.
|
|
868
876
|
*/
|
|
@@ -900,7 +908,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
900
908
|
/**
|
|
901
909
|
* The resolved options for the Powerlines project configuration.
|
|
902
910
|
*/
|
|
903
|
-
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
|
|
911
|
+
type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "deploy" | "framework">> & {
|
|
904
912
|
/**
|
|
905
913
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
906
914
|
*/
|
|
@@ -971,14 +979,6 @@ interface MetaInfo {
|
|
|
971
979
|
* A hash that represents the path to the project root directory
|
|
972
980
|
*/
|
|
973
981
|
configHash: string;
|
|
974
|
-
/**
|
|
975
|
-
* A mapping of runtime ids to their corresponding file paths
|
|
976
|
-
*/
|
|
977
|
-
builtinIdMap: Record<string, string>;
|
|
978
|
-
/**
|
|
979
|
-
* A mapping of virtual file paths to their corresponding file contents
|
|
980
|
-
*/
|
|
981
|
-
virtualFiles: Record<string, string | null>;
|
|
982
982
|
}
|
|
983
983
|
interface Resolver extends Jiti {
|
|
984
984
|
plugin: Jiti;
|
|
@@ -1186,7 +1186,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1186
1186
|
}
|
|
1187
1187
|
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
|
|
1188
1188
|
|
|
1189
|
-
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "
|
|
1189
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
1190
1190
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
1191
1191
|
|
|
1192
1192
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, P as Plugin } from './index-
|
|
2
|
-
export { c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from './index-
|
|
1
|
+
import { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, P as Plugin } from './index-D6LfVDQr.cjs';
|
|
2
|
+
export { c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from './index-D6LfVDQr.cjs';
|
|
3
3
|
import 'oxc-transform';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
|
@@ -17,9 +17,7 @@ import 'unplugin';
|
|
|
17
17
|
import '@stryke/types/tsconfig';
|
|
18
18
|
import 'typescript';
|
|
19
19
|
import '@stryke/json/types';
|
|
20
|
-
import 'memfs';
|
|
21
20
|
import 'node:fs';
|
|
22
|
-
import 'unionfs';
|
|
23
21
|
import '@stryke/types/array';
|
|
24
22
|
|
|
25
23
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, P as Plugin } from './index-
|
|
2
|
-
export { c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from './index-
|
|
1
|
+
import { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, P as Plugin } from './index-D6LfVDQr.js';
|
|
2
|
+
export { c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from './index-D6LfVDQr.js';
|
|
3
3
|
import 'oxc-transform';
|
|
4
4
|
import '@storm-software/build-tools/types';
|
|
5
5
|
import '@storm-software/config-tools/types';
|
|
@@ -17,9 +17,7 @@ import 'unplugin';
|
|
|
17
17
|
import '@stryke/types/tsconfig';
|
|
18
18
|
import 'typescript';
|
|
19
19
|
import '@stryke/json/types';
|
|
20
|
-
import 'memfs';
|
|
21
20
|
import 'node:fs';
|
|
22
|
-
import 'unionfs';
|
|
23
21
|
import '@stryke/types/array';
|
|
24
22
|
|
|
25
23
|
/**
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-
|
|
1
|
+
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-D6LfVDQr.cjs';
|
|
2
2
|
import 'oxc-transform';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
@@ -16,7 +16,5 @@ import 'unplugin';
|
|
|
16
16
|
import '@stryke/types/tsconfig';
|
|
17
17
|
import 'typescript';
|
|
18
18
|
import '@stryke/json/types';
|
|
19
|
-
import 'memfs';
|
|
20
19
|
import 'node:fs';
|
|
21
|
-
import 'unionfs';
|
|
22
20
|
import '@stryke/types/array';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-
|
|
1
|
+
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-D6LfVDQr.js';
|
|
2
2
|
import 'oxc-transform';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
@@ -16,7 +16,5 @@ import 'unplugin';
|
|
|
16
16
|
import '@stryke/types/tsconfig';
|
|
17
17
|
import 'typescript';
|
|
18
18
|
import '@stryke/json/types';
|
|
19
|
-
import 'memfs';
|
|
20
19
|
import 'node:fs';
|
|
21
|
-
import 'unionfs';
|
|
22
20
|
import '@stryke/types/array';
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'oxc-transform';
|
|
2
|
-
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-
|
|
2
|
+
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-D6LfVDQr.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -16,7 +16,5 @@ import 'unplugin';
|
|
|
16
16
|
import '@stryke/types/tsconfig';
|
|
17
17
|
import 'typescript';
|
|
18
18
|
import '@stryke/json/types';
|
|
19
|
-
import 'memfs';
|
|
20
19
|
import 'node:fs';
|
|
21
|
-
import 'unionfs';
|
|
22
20
|
import '@stryke/types/array';
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'oxc-transform';
|
|
2
|
-
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-
|
|
2
|
+
export { O as OxcTransformPluginContext, a as OxcTransformPluginOptions, c as OxcTransformPluginResolvedConfig, b as OxcTransformPluginUserConfig } from '../index-D6LfVDQr.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -16,7 +16,5 @@ import 'unplugin';
|
|
|
16
16
|
import '@stryke/types/tsconfig';
|
|
17
17
|
import 'typescript';
|
|
18
18
|
import '@stryke/json/types';
|
|
19
|
-
import 'memfs';
|
|
20
19
|
import 'node:fs';
|
|
21
|
-
import 'unionfs';
|
|
22
20
|
import '@stryke/types/array';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-oxc-transform",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to transform project code with Oxc Transformer.",
|
|
6
6
|
"repository": {
|
|
@@ -107,13 +107,13 @@
|
|
|
107
107
|
"@stryke/path": "^0.19.2",
|
|
108
108
|
"defu": "^6.1.4",
|
|
109
109
|
"oxc-transform": "^0.95.0",
|
|
110
|
-
"powerlines": "^0.
|
|
110
|
+
"powerlines": "^0.21.0"
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
|
-
"@powerlines/nx": "^0.10.
|
|
114
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
113
|
+
"@powerlines/nx": "^0.10.11",
|
|
114
|
+
"@powerlines/plugin-plugin": "^0.11.19",
|
|
115
115
|
"@types/node": "^22.19.1"
|
|
116
116
|
},
|
|
117
117
|
"publishConfig": { "access": "public" },
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "c6ed2ca745c8f340a55758b3102933dc41e83428"
|
|
119
119
|
}
|