@powerlines/plugin-vite 0.14.10 → 0.14.12
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/index.d.cts +1 -3
- package/dist/helpers/index.d.ts +1 -3
- package/dist/helpers/unplugin.d.cts +1 -3
- package/dist/helpers/unplugin.d.ts +1 -3
- package/dist/{index-DHzRz0ZN.d.cts → index-BMkoiiHF.d.cts} +64 -64
- package/dist/{index-DHzRz0ZN.d.ts → index-BMkoiiHF.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
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createVitePlugin } from './unplugin.cjs';
|
|
2
2
|
import 'vite';
|
|
3
|
-
import '../index-
|
|
3
|
+
import '../index-BMkoiiHF.cjs';
|
|
4
4
|
import '@stryke/env/get-env-paths';
|
|
5
5
|
import '@stryke/types/base';
|
|
6
6
|
import '@stryke/types/package-json';
|
|
@@ -17,6 +17,4 @@ import '@stryke/types/array';
|
|
|
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';
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createVitePlugin } from './unplugin.js';
|
|
2
2
|
import 'vite';
|
|
3
|
-
import '../index-
|
|
3
|
+
import '../index-BMkoiiHF.js';
|
|
4
4
|
import '@stryke/env/get-env-paths';
|
|
5
5
|
import '@stryke/types/base';
|
|
6
6
|
import '@stryke/types/package-json';
|
|
@@ -17,6 +17,4 @@ import '@stryke/types/array';
|
|
|
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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { V as VitePluginContext } from '../index-
|
|
2
|
+
import { V as VitePluginContext } from '../index-BMkoiiHF.cjs';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
5
5
|
import '@stryke/types/package-json';
|
|
@@ -16,9 +16,7 @@ import '@stryke/types/array';
|
|
|
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
|
|
|
23
21
|
declare function createVitePlugin(context: VitePluginContext): vite.Plugin<any> | vite.Plugin<any>[];
|
|
24
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { V as VitePluginContext } from '../index-
|
|
2
|
+
import { V as VitePluginContext } from '../index-BMkoiiHF.js';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
5
5
|
import '@stryke/types/package-json';
|
|
@@ -16,9 +16,7 @@ import '@stryke/types/array';
|
|
|
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
|
|
|
23
21
|
declare function createVitePlugin(context: VitePluginContext): vite.Plugin<any> | vite.Plugin<any>[];
|
|
24
22
|
|
|
@@ -15,9 +15,7 @@ import { ArrayValues } from '@stryke/types/array';
|
|
|
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
|
|
|
22
20
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
23
21
|
interface BuildConfig {
|
|
@@ -27,6 +25,20 @@ interface BuildConfig {
|
|
|
27
25
|
* @defaultValue "neutral"
|
|
28
26
|
*/
|
|
29
27
|
platform?: "node" | "browser" | "neutral";
|
|
28
|
+
/**
|
|
29
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* 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).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* {
|
|
37
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
polyfill?: string[];
|
|
30
42
|
/**
|
|
31
43
|
* 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.
|
|
32
44
|
*
|
|
@@ -112,7 +124,10 @@ interface BuildConfig {
|
|
|
112
124
|
*
|
|
113
125
|
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
114
126
|
*/
|
|
115
|
-
alias?: Record<string, string
|
|
127
|
+
alias?: Record<string, string> | Array<{
|
|
128
|
+
find: string | RegExp;
|
|
129
|
+
replacement: string;
|
|
130
|
+
}>;
|
|
116
131
|
/**
|
|
117
132
|
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
118
133
|
*
|
|
@@ -204,11 +219,8 @@ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
|
204
219
|
tsconfigFilePath: string;
|
|
205
220
|
};
|
|
206
221
|
|
|
207
|
-
declare const
|
|
208
|
-
declare const __VFS_REVERT__
|
|
209
|
-
declare const __VFS_CACHE__ = "__VFS_CACHE__";
|
|
210
|
-
declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
211
|
-
declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
222
|
+
declare const __VFS_PATCH__: unique symbol;
|
|
223
|
+
declare const __VFS_REVERT__: unique symbol;
|
|
212
224
|
type OutputModeType = "fs" | "virtual";
|
|
213
225
|
interface VirtualFile {
|
|
214
226
|
/**
|
|
@@ -248,7 +260,24 @@ interface VirtualFile {
|
|
|
248
260
|
*/
|
|
249
261
|
code: string | NodeJS.ArrayBufferView;
|
|
250
262
|
}
|
|
251
|
-
|
|
263
|
+
interface VirtualFileMetadata {
|
|
264
|
+
/**
|
|
265
|
+
* The identifier for the file data.
|
|
266
|
+
*/
|
|
267
|
+
id: string;
|
|
268
|
+
/**
|
|
269
|
+
* The variant of the file.
|
|
270
|
+
*/
|
|
271
|
+
variant: string;
|
|
272
|
+
/**
|
|
273
|
+
* The output mode of the file.
|
|
274
|
+
*/
|
|
275
|
+
mode: string;
|
|
276
|
+
/**
|
|
277
|
+
* Additional metadata associated with the file.
|
|
278
|
+
*/
|
|
279
|
+
properties: Record<string, string>;
|
|
280
|
+
}
|
|
252
281
|
interface ResolveFSOptions {
|
|
253
282
|
mode?: OutputModeType;
|
|
254
283
|
}
|
|
@@ -277,12 +306,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
277
306
|
type?: "file" | "directory";
|
|
278
307
|
}
|
|
279
308
|
interface VirtualFileSystemInterface {
|
|
280
|
-
|
|
309
|
+
/**
|
|
310
|
+
* Patches the File System to include the virtual file system (VFS) contents.
|
|
311
|
+
*/
|
|
312
|
+
[__VFS_PATCH__]: () => void;
|
|
313
|
+
/**
|
|
314
|
+
* Reverts the virtual file system (VFS) to its previous state.
|
|
315
|
+
*/
|
|
281
316
|
[__VFS_REVERT__]: () => void;
|
|
282
317
|
/**
|
|
283
318
|
* The underlying file metadata.
|
|
284
319
|
*/
|
|
285
|
-
|
|
320
|
+
metadata: Record<string, VirtualFileMetadata | undefined>;
|
|
286
321
|
/**
|
|
287
322
|
* A map of module ids to their file paths.
|
|
288
323
|
*/
|
|
@@ -302,7 +337,7 @@ interface VirtualFileSystemInterface {
|
|
|
302
337
|
* @param options - Optional parameters for resolving the path.
|
|
303
338
|
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
304
339
|
*/
|
|
305
|
-
|
|
340
|
+
isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
|
|
306
341
|
/**
|
|
307
342
|
* Checks if a file exists in the virtual file system (VFS).
|
|
308
343
|
*
|
|
@@ -317,15 +352,6 @@ interface VirtualFileSystemInterface {
|
|
|
317
352
|
* @returns `true` if the directory exists, otherwise `false`.
|
|
318
353
|
*/
|
|
319
354
|
isDirectory: (path: string) => boolean;
|
|
320
|
-
/**
|
|
321
|
-
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
322
|
-
*
|
|
323
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
324
|
-
*
|
|
325
|
-
* @param pathOrId - The path or id to check.
|
|
326
|
-
* @returns Whether the path or id corresponds to a virtual file.
|
|
327
|
-
*/
|
|
328
|
-
isTsconfigPath: (pathOrId: string) => boolean;
|
|
329
355
|
/**
|
|
330
356
|
* Checks if a file exists in the virtual file system (VFS).
|
|
331
357
|
*
|
|
@@ -339,7 +365,7 @@ interface VirtualFileSystemInterface {
|
|
|
339
365
|
* @param pathOrId - The path or id of the file.
|
|
340
366
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
341
367
|
*/
|
|
342
|
-
getMetadata: (pathOrId: PathLike) =>
|
|
368
|
+
getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
|
|
343
369
|
/**
|
|
344
370
|
* Gets the stats of a file in the virtual file system (VFS).
|
|
345
371
|
*
|
|
@@ -547,23 +573,12 @@ interface VirtualFileSystemInterface {
|
|
|
547
573
|
*/
|
|
548
574
|
resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
|
|
549
575
|
/**
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
576
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
553
577
|
*
|
|
554
|
-
* @param path - The path to
|
|
555
|
-
* @returns The
|
|
578
|
+
* @param path - The path to format.
|
|
579
|
+
* @returns The formatted path.
|
|
556
580
|
*/
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Resolves a package name based on TypeScript's `tsconfig.json` paths.
|
|
560
|
-
*
|
|
561
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
562
|
-
*
|
|
563
|
-
* @param path - The path to check.
|
|
564
|
-
* @returns The resolved package name if it exists, otherwise undefined.
|
|
565
|
-
*/
|
|
566
|
-
resolveTsconfigPathPackage: (path: string) => string | false;
|
|
581
|
+
formatPath: (path: string) => string;
|
|
567
582
|
/**
|
|
568
583
|
* Resolves a path or id to a file path in the virtual file system.
|
|
569
584
|
*
|
|
@@ -572,23 +587,9 @@ interface VirtualFileSystemInterface {
|
|
|
572
587
|
*/
|
|
573
588
|
realpathSync: (pathOrId: string) => string;
|
|
574
589
|
/**
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
* @returns A record mapping file paths to their partial metadata.
|
|
578
|
-
*/
|
|
579
|
-
getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
|
|
580
|
-
/**
|
|
581
|
-
* A map of cached file paths to their underlying file content.
|
|
582
|
-
*/
|
|
583
|
-
[__VFS_CACHE__]: Map<string, string>;
|
|
584
|
-
/**
|
|
585
|
-
* A reference to the underlying virtual file system.
|
|
590
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
586
591
|
*/
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* A reference to the underlying unified file system.
|
|
590
|
-
*/
|
|
591
|
-
[__VFS_UNIFIED__]: IUnionFs;
|
|
592
|
+
dispose: () => Promise<void>;
|
|
592
593
|
}
|
|
593
594
|
|
|
594
595
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -750,6 +751,13 @@ interface BaseConfig {
|
|
|
750
751
|
* This configuration will be used by the documentation generation plugins during the `docs` command.
|
|
751
752
|
*/
|
|
752
753
|
docs?: Record<string, any>;
|
|
754
|
+
/**
|
|
755
|
+
* Configuration for deploying the source code
|
|
756
|
+
*
|
|
757
|
+
* @remarks
|
|
758
|
+
* If set to `false`, the deployment will be disabled.
|
|
759
|
+
*/
|
|
760
|
+
deploy?: Record<string, any> | false;
|
|
753
761
|
/**
|
|
754
762
|
* The path to the tsconfig file to be used by the compiler
|
|
755
763
|
*
|
|
@@ -864,7 +872,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
|
|
|
864
872
|
};
|
|
865
873
|
};
|
|
866
874
|
type ViteUserConfig = UserConfig<ViteBuildConfig, ViteResolvedBuildConfig, "vite">;
|
|
867
|
-
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "
|
|
875
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
868
876
|
/**
|
|
869
877
|
* The configuration provided while executing Powerlines commands.
|
|
870
878
|
*/
|
|
@@ -902,7 +910,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
902
910
|
/**
|
|
903
911
|
* The resolved options for the Powerlines project configuration.
|
|
904
912
|
*/
|
|
905
|
-
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">> & {
|
|
913
|
+
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">> & {
|
|
906
914
|
/**
|
|
907
915
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
908
916
|
*/
|
|
@@ -974,14 +982,6 @@ interface MetaInfo {
|
|
|
974
982
|
* A hash that represents the path to the project root directory
|
|
975
983
|
*/
|
|
976
984
|
configHash: string;
|
|
977
|
-
/**
|
|
978
|
-
* A mapping of runtime ids to their corresponding file paths
|
|
979
|
-
*/
|
|
980
|
-
builtinIdMap: Record<string, string>;
|
|
981
|
-
/**
|
|
982
|
-
* A mapping of virtual file paths to their corresponding file contents
|
|
983
|
-
*/
|
|
984
|
-
virtualFiles: Record<string, string | null>;
|
|
985
985
|
}
|
|
986
986
|
interface Resolver extends Jiti {
|
|
987
987
|
plugin: Jiti;
|
|
@@ -1189,7 +1189,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1189
1189
|
}
|
|
1190
1190
|
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
|
|
1191
1191
|
|
|
1192
|
-
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "
|
|
1192
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
1193
1193
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
1194
1194
|
|
|
1195
1195
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
|
@@ -15,9 +15,7 @@ import { ArrayValues } from '@stryke/types/array';
|
|
|
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
|
|
|
22
20
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
23
21
|
interface BuildConfig {
|
|
@@ -27,6 +25,20 @@ interface BuildConfig {
|
|
|
27
25
|
* @defaultValue "neutral"
|
|
28
26
|
*/
|
|
29
27
|
platform?: "node" | "browser" | "neutral";
|
|
28
|
+
/**
|
|
29
|
+
* Array of strings indicating the polyfills to include for the build.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* 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).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* {
|
|
37
|
+
* polyfill: ['{projectRoot}/custom-polyfill.ts']
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
polyfill?: string[];
|
|
30
42
|
/**
|
|
31
43
|
* 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.
|
|
32
44
|
*
|
|
@@ -112,7 +124,10 @@ interface BuildConfig {
|
|
|
112
124
|
*
|
|
113
125
|
* @see https://github.com/rollup/plugins/tree/master/packages/alias
|
|
114
126
|
*/
|
|
115
|
-
alias?: Record<string, string
|
|
127
|
+
alias?: Record<string, string> | Array<{
|
|
128
|
+
find: string | RegExp;
|
|
129
|
+
replacement: string;
|
|
130
|
+
}>;
|
|
116
131
|
/**
|
|
117
132
|
* A list of modules that should not be bundled, even if they are external dependencies.
|
|
118
133
|
*
|
|
@@ -204,11 +219,8 @@ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
|
204
219
|
tsconfigFilePath: string;
|
|
205
220
|
};
|
|
206
221
|
|
|
207
|
-
declare const
|
|
208
|
-
declare const __VFS_REVERT__
|
|
209
|
-
declare const __VFS_CACHE__ = "__VFS_CACHE__";
|
|
210
|
-
declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
211
|
-
declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
222
|
+
declare const __VFS_PATCH__: unique symbol;
|
|
223
|
+
declare const __VFS_REVERT__: unique symbol;
|
|
212
224
|
type OutputModeType = "fs" | "virtual";
|
|
213
225
|
interface VirtualFile {
|
|
214
226
|
/**
|
|
@@ -248,7 +260,24 @@ interface VirtualFile {
|
|
|
248
260
|
*/
|
|
249
261
|
code: string | NodeJS.ArrayBufferView;
|
|
250
262
|
}
|
|
251
|
-
|
|
263
|
+
interface VirtualFileMetadata {
|
|
264
|
+
/**
|
|
265
|
+
* The identifier for the file data.
|
|
266
|
+
*/
|
|
267
|
+
id: string;
|
|
268
|
+
/**
|
|
269
|
+
* The variant of the file.
|
|
270
|
+
*/
|
|
271
|
+
variant: string;
|
|
272
|
+
/**
|
|
273
|
+
* The output mode of the file.
|
|
274
|
+
*/
|
|
275
|
+
mode: string;
|
|
276
|
+
/**
|
|
277
|
+
* Additional metadata associated with the file.
|
|
278
|
+
*/
|
|
279
|
+
properties: Record<string, string>;
|
|
280
|
+
}
|
|
252
281
|
interface ResolveFSOptions {
|
|
253
282
|
mode?: OutputModeType;
|
|
254
283
|
}
|
|
@@ -277,12 +306,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
277
306
|
type?: "file" | "directory";
|
|
278
307
|
}
|
|
279
308
|
interface VirtualFileSystemInterface {
|
|
280
|
-
|
|
309
|
+
/**
|
|
310
|
+
* Patches the File System to include the virtual file system (VFS) contents.
|
|
311
|
+
*/
|
|
312
|
+
[__VFS_PATCH__]: () => void;
|
|
313
|
+
/**
|
|
314
|
+
* Reverts the virtual file system (VFS) to its previous state.
|
|
315
|
+
*/
|
|
281
316
|
[__VFS_REVERT__]: () => void;
|
|
282
317
|
/**
|
|
283
318
|
* The underlying file metadata.
|
|
284
319
|
*/
|
|
285
|
-
|
|
320
|
+
metadata: Record<string, VirtualFileMetadata | undefined>;
|
|
286
321
|
/**
|
|
287
322
|
* A map of module ids to their file paths.
|
|
288
323
|
*/
|
|
@@ -302,7 +337,7 @@ interface VirtualFileSystemInterface {
|
|
|
302
337
|
* @param options - Optional parameters for resolving the path.
|
|
303
338
|
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
304
339
|
*/
|
|
305
|
-
|
|
340
|
+
isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
|
|
306
341
|
/**
|
|
307
342
|
* Checks if a file exists in the virtual file system (VFS).
|
|
308
343
|
*
|
|
@@ -317,15 +352,6 @@ interface VirtualFileSystemInterface {
|
|
|
317
352
|
* @returns `true` if the directory exists, otherwise `false`.
|
|
318
353
|
*/
|
|
319
354
|
isDirectory: (path: string) => boolean;
|
|
320
|
-
/**
|
|
321
|
-
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
322
|
-
*
|
|
323
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
324
|
-
*
|
|
325
|
-
* @param pathOrId - The path or id to check.
|
|
326
|
-
* @returns Whether the path or id corresponds to a virtual file.
|
|
327
|
-
*/
|
|
328
|
-
isTsconfigPath: (pathOrId: string) => boolean;
|
|
329
355
|
/**
|
|
330
356
|
* Checks if a file exists in the virtual file system (VFS).
|
|
331
357
|
*
|
|
@@ -339,7 +365,7 @@ interface VirtualFileSystemInterface {
|
|
|
339
365
|
* @param pathOrId - The path or id of the file.
|
|
340
366
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
341
367
|
*/
|
|
342
|
-
getMetadata: (pathOrId: PathLike) =>
|
|
368
|
+
getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
|
|
343
369
|
/**
|
|
344
370
|
* Gets the stats of a file in the virtual file system (VFS).
|
|
345
371
|
*
|
|
@@ -547,23 +573,12 @@ interface VirtualFileSystemInterface {
|
|
|
547
573
|
*/
|
|
548
574
|
resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
|
|
549
575
|
/**
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
576
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
553
577
|
*
|
|
554
|
-
* @param path - The path to
|
|
555
|
-
* @returns The
|
|
578
|
+
* @param path - The path to format.
|
|
579
|
+
* @returns The formatted path.
|
|
556
580
|
*/
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Resolves a package name based on TypeScript's `tsconfig.json` paths.
|
|
560
|
-
*
|
|
561
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
562
|
-
*
|
|
563
|
-
* @param path - The path to check.
|
|
564
|
-
* @returns The resolved package name if it exists, otherwise undefined.
|
|
565
|
-
*/
|
|
566
|
-
resolveTsconfigPathPackage: (path: string) => string | false;
|
|
581
|
+
formatPath: (path: string) => string;
|
|
567
582
|
/**
|
|
568
583
|
* Resolves a path or id to a file path in the virtual file system.
|
|
569
584
|
*
|
|
@@ -572,23 +587,9 @@ interface VirtualFileSystemInterface {
|
|
|
572
587
|
*/
|
|
573
588
|
realpathSync: (pathOrId: string) => string;
|
|
574
589
|
/**
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
* @returns A record mapping file paths to their partial metadata.
|
|
578
|
-
*/
|
|
579
|
-
getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
|
|
580
|
-
/**
|
|
581
|
-
* A map of cached file paths to their underlying file content.
|
|
582
|
-
*/
|
|
583
|
-
[__VFS_CACHE__]: Map<string, string>;
|
|
584
|
-
/**
|
|
585
|
-
* A reference to the underlying virtual file system.
|
|
590
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
586
591
|
*/
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* A reference to the underlying unified file system.
|
|
590
|
-
*/
|
|
591
|
-
[__VFS_UNIFIED__]: IUnionFs;
|
|
592
|
+
dispose: () => Promise<void>;
|
|
592
593
|
}
|
|
593
594
|
|
|
594
595
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -750,6 +751,13 @@ interface BaseConfig {
|
|
|
750
751
|
* This configuration will be used by the documentation generation plugins during the `docs` command.
|
|
751
752
|
*/
|
|
752
753
|
docs?: Record<string, any>;
|
|
754
|
+
/**
|
|
755
|
+
* Configuration for deploying the source code
|
|
756
|
+
*
|
|
757
|
+
* @remarks
|
|
758
|
+
* If set to `false`, the deployment will be disabled.
|
|
759
|
+
*/
|
|
760
|
+
deploy?: Record<string, any> | false;
|
|
753
761
|
/**
|
|
754
762
|
* The path to the tsconfig file to be used by the compiler
|
|
755
763
|
*
|
|
@@ -864,7 +872,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
|
|
|
864
872
|
};
|
|
865
873
|
};
|
|
866
874
|
type ViteUserConfig = UserConfig<ViteBuildConfig, ViteResolvedBuildConfig, "vite">;
|
|
867
|
-
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "
|
|
875
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
868
876
|
/**
|
|
869
877
|
* The configuration provided while executing Powerlines commands.
|
|
870
878
|
*/
|
|
@@ -902,7 +910,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
902
910
|
/**
|
|
903
911
|
* The resolved options for the Powerlines project configuration.
|
|
904
912
|
*/
|
|
905
|
-
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">> & {
|
|
913
|
+
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">> & {
|
|
906
914
|
/**
|
|
907
915
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
908
916
|
*/
|
|
@@ -974,14 +982,6 @@ interface MetaInfo {
|
|
|
974
982
|
* A hash that represents the path to the project root directory
|
|
975
983
|
*/
|
|
976
984
|
configHash: string;
|
|
977
|
-
/**
|
|
978
|
-
* A mapping of runtime ids to their corresponding file paths
|
|
979
|
-
*/
|
|
980
|
-
builtinIdMap: Record<string, string>;
|
|
981
|
-
/**
|
|
982
|
-
* A mapping of virtual file paths to their corresponding file contents
|
|
983
|
-
*/
|
|
984
|
-
virtualFiles: Record<string, string | null>;
|
|
985
985
|
}
|
|
986
986
|
interface Resolver extends Jiti {
|
|
987
987
|
plugin: Jiti;
|
|
@@ -1189,7 +1189,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1189
1189
|
}
|
|
1190
1190
|
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
|
|
1191
1191
|
|
|
1192
|
-
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "
|
|
1192
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
1193
1193
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
1194
1194
|
|
|
1195
1195
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VitePluginContext, a as VitePluginOptions, P as Plugin } from './index-
|
|
2
|
-
export { b as VitePluginResolvedConfig } from './index-
|
|
1
|
+
import { V as VitePluginContext, a as VitePluginOptions, P as Plugin } from './index-BMkoiiHF.cjs';
|
|
2
|
+
export { b as VitePluginResolvedConfig } from './index-BMkoiiHF.cjs';
|
|
3
3
|
export { createVitePlugin } from './helpers/unplugin.cjs';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import '@stryke/env/get-env-paths';
|
|
@@ -18,9 +18,7 @@ import '@stryke/types/array';
|
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
20
|
import '@stryke/json/types';
|
|
21
|
-
import 'memfs';
|
|
22
21
|
import 'node:fs';
|
|
23
|
-
import 'unionfs';
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VitePluginContext, a as VitePluginOptions, P as Plugin } from './index-
|
|
2
|
-
export { b as VitePluginResolvedConfig } from './index-
|
|
1
|
+
import { V as VitePluginContext, a as VitePluginOptions, P as Plugin } from './index-BMkoiiHF.js';
|
|
2
|
+
export { b as VitePluginResolvedConfig } from './index-BMkoiiHF.js';
|
|
3
3
|
export { createVitePlugin } from './helpers/unplugin.js';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import '@stryke/env/get-env-paths';
|
|
@@ -18,9 +18,7 @@ import '@stryke/types/array';
|
|
|
18
18
|
import '@stryke/types/tsconfig';
|
|
19
19
|
import 'typescript';
|
|
20
20
|
import '@stryke/json/types';
|
|
21
|
-
import 'memfs';
|
|
22
21
|
import 'node:fs';
|
|
23
|
-
import 'unionfs';
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-
|
|
1
|
+
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-BMkoiiHF.cjs';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -16,6 +16,4 @@ import '@stryke/types/array';
|
|
|
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';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-
|
|
1
|
+
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-BMkoiiHF.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -16,6 +16,4 @@ import '@stryke/types/array';
|
|
|
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';
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-
|
|
1
|
+
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-BMkoiiHF.cjs';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -16,6 +16,4 @@ import '@stryke/types/array';
|
|
|
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';
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-
|
|
1
|
+
export { V as VitePluginContext, a as VitePluginOptions, b as VitePluginResolvedConfig } from '../index-BMkoiiHF.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -16,6 +16,4 @@ import '@stryke/types/array';
|
|
|
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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-vite",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -138,15 +138,15 @@
|
|
|
138
138
|
"@stryke/types": "^0.10.2",
|
|
139
139
|
"defu": "^6.1.4",
|
|
140
140
|
"jiti": "^2.6.1",
|
|
141
|
-
"powerlines": "^0.
|
|
141
|
+
"powerlines": "^0.22.0"
|
|
142
142
|
},
|
|
143
143
|
"devDependencies": {
|
|
144
144
|
"vite": "^7.2.2",
|
|
145
145
|
"rolldown-vite": "^7.2.5",
|
|
146
|
-
"@powerlines/nx": "^0.10.
|
|
147
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
146
|
+
"@powerlines/nx": "^0.10.12",
|
|
147
|
+
"@powerlines/plugin-plugin": "^0.11.20",
|
|
148
148
|
"@types/node": "^22.19.1"
|
|
149
149
|
},
|
|
150
150
|
"publishConfig": { "access": "public" },
|
|
151
|
-
"gitHead": "
|
|
151
|
+
"gitHead": "30a4cf4f1c707fe159b55f65f1e87b14d679614d"
|
|
152
152
|
}
|