@powerlines/plugin-unbuild 0.5.19 → 0.5.21
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-U6GkKdiI.d.cts → index-Bs5vDVIA.d.cts} +64 -64
- package/dist/{index-U6GkKdiI.d.ts → index-Bs5vDVIA.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
|
@@ -16,9 +16,7 @@ import { ArrayValues } from '@stryke/types/array';
|
|
|
16
16
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
17
17
|
import ts from 'typescript';
|
|
18
18
|
import { PrimitiveJsonValue } from '@stryke/json/types';
|
|
19
|
-
import { Volume } from 'memfs';
|
|
20
19
|
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
21
|
-
import { IUnionFs } from 'unionfs';
|
|
22
20
|
|
|
23
21
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
24
22
|
interface BuildConfig {
|
|
@@ -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
|
*
|
|
@@ -205,11 +220,8 @@ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
|
205
220
|
tsconfigFilePath: string;
|
|
206
221
|
};
|
|
207
222
|
|
|
208
|
-
declare const
|
|
209
|
-
declare const __VFS_REVERT__
|
|
210
|
-
declare const __VFS_CACHE__ = "__VFS_CACHE__";
|
|
211
|
-
declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
212
|
-
declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
223
|
+
declare const __VFS_PATCH__: unique symbol;
|
|
224
|
+
declare const __VFS_REVERT__: unique symbol;
|
|
213
225
|
type OutputModeType = "fs" | "virtual";
|
|
214
226
|
interface VirtualFile {
|
|
215
227
|
/**
|
|
@@ -249,7 +261,24 @@ interface VirtualFile {
|
|
|
249
261
|
*/
|
|
250
262
|
code: string | NodeJS.ArrayBufferView;
|
|
251
263
|
}
|
|
252
|
-
|
|
264
|
+
interface VirtualFileMetadata {
|
|
265
|
+
/**
|
|
266
|
+
* The identifier for the file data.
|
|
267
|
+
*/
|
|
268
|
+
id: string;
|
|
269
|
+
/**
|
|
270
|
+
* The variant of the file.
|
|
271
|
+
*/
|
|
272
|
+
variant: string;
|
|
273
|
+
/**
|
|
274
|
+
* The output mode of the file.
|
|
275
|
+
*/
|
|
276
|
+
mode: string;
|
|
277
|
+
/**
|
|
278
|
+
* Additional metadata associated with the file.
|
|
279
|
+
*/
|
|
280
|
+
properties: Record<string, string>;
|
|
281
|
+
}
|
|
253
282
|
interface ResolveFSOptions {
|
|
254
283
|
mode?: OutputModeType;
|
|
255
284
|
}
|
|
@@ -278,12 +307,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
278
307
|
type?: "file" | "directory";
|
|
279
308
|
}
|
|
280
309
|
interface VirtualFileSystemInterface {
|
|
281
|
-
|
|
310
|
+
/**
|
|
311
|
+
* Patches the File System to include the virtual file system (VFS) contents.
|
|
312
|
+
*/
|
|
313
|
+
[__VFS_PATCH__]: () => void;
|
|
314
|
+
/**
|
|
315
|
+
* Reverts the virtual file system (VFS) to its previous state.
|
|
316
|
+
*/
|
|
282
317
|
[__VFS_REVERT__]: () => void;
|
|
283
318
|
/**
|
|
284
319
|
* The underlying file metadata.
|
|
285
320
|
*/
|
|
286
|
-
|
|
321
|
+
metadata: Record<string, VirtualFileMetadata | undefined>;
|
|
287
322
|
/**
|
|
288
323
|
* A map of module ids to their file paths.
|
|
289
324
|
*/
|
|
@@ -303,7 +338,7 @@ interface VirtualFileSystemInterface {
|
|
|
303
338
|
* @param options - Optional parameters for resolving the path.
|
|
304
339
|
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
305
340
|
*/
|
|
306
|
-
|
|
341
|
+
isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
|
|
307
342
|
/**
|
|
308
343
|
* Checks if a file exists in the virtual file system (VFS).
|
|
309
344
|
*
|
|
@@ -318,15 +353,6 @@ interface VirtualFileSystemInterface {
|
|
|
318
353
|
* @returns `true` if the directory exists, otherwise `false`.
|
|
319
354
|
*/
|
|
320
355
|
isDirectory: (path: string) => boolean;
|
|
321
|
-
/**
|
|
322
|
-
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
323
|
-
*
|
|
324
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
325
|
-
*
|
|
326
|
-
* @param pathOrId - The path or id to check.
|
|
327
|
-
* @returns Whether the path or id corresponds to a virtual file.
|
|
328
|
-
*/
|
|
329
|
-
isTsconfigPath: (pathOrId: string) => boolean;
|
|
330
356
|
/**
|
|
331
357
|
* Checks if a file exists in the virtual file system (VFS).
|
|
332
358
|
*
|
|
@@ -340,7 +366,7 @@ interface VirtualFileSystemInterface {
|
|
|
340
366
|
* @param pathOrId - The path or id of the file.
|
|
341
367
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
342
368
|
*/
|
|
343
|
-
getMetadata: (pathOrId: PathLike) =>
|
|
369
|
+
getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
|
|
344
370
|
/**
|
|
345
371
|
* Gets the stats of a file in the virtual file system (VFS).
|
|
346
372
|
*
|
|
@@ -548,23 +574,12 @@ interface VirtualFileSystemInterface {
|
|
|
548
574
|
*/
|
|
549
575
|
resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
|
|
550
576
|
/**
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
577
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
554
578
|
*
|
|
555
|
-
* @param path - The path to
|
|
556
|
-
* @returns The
|
|
579
|
+
* @param path - The path to format.
|
|
580
|
+
* @returns The formatted path.
|
|
557
581
|
*/
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Resolves a package name based on TypeScript's `tsconfig.json` paths.
|
|
561
|
-
*
|
|
562
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
563
|
-
*
|
|
564
|
-
* @param path - The path to check.
|
|
565
|
-
* @returns The resolved package name if it exists, otherwise undefined.
|
|
566
|
-
*/
|
|
567
|
-
resolveTsconfigPathPackage: (path: string) => string | false;
|
|
582
|
+
formatPath: (path: string) => string;
|
|
568
583
|
/**
|
|
569
584
|
* Resolves a path or id to a file path in the virtual file system.
|
|
570
585
|
*
|
|
@@ -573,23 +588,9 @@ interface VirtualFileSystemInterface {
|
|
|
573
588
|
*/
|
|
574
589
|
realpathSync: (pathOrId: string) => string;
|
|
575
590
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
* @returns A record mapping file paths to their partial metadata.
|
|
579
|
-
*/
|
|
580
|
-
getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
|
|
581
|
-
/**
|
|
582
|
-
* A map of cached file paths to their underlying file content.
|
|
583
|
-
*/
|
|
584
|
-
[__VFS_CACHE__]: Map<string, string>;
|
|
585
|
-
/**
|
|
586
|
-
* A reference to the underlying virtual file system.
|
|
591
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
587
592
|
*/
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* A reference to the underlying unified file system.
|
|
591
|
-
*/
|
|
592
|
-
[__VFS_UNIFIED__]: IUnionFs;
|
|
593
|
+
dispose: () => Promise<void>;
|
|
593
594
|
}
|
|
594
595
|
|
|
595
596
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -751,6 +752,13 @@ interface BaseConfig {
|
|
|
751
752
|
* This configuration will be used by the documentation generation plugins during the `docs` command.
|
|
752
753
|
*/
|
|
753
754
|
docs?: Record<string, any>;
|
|
755
|
+
/**
|
|
756
|
+
* Configuration for deploying the source code
|
|
757
|
+
*
|
|
758
|
+
* @remarks
|
|
759
|
+
* If set to `false`, the deployment will be disabled.
|
|
760
|
+
*/
|
|
761
|
+
deploy?: Record<string, any> | false;
|
|
754
762
|
/**
|
|
755
763
|
* The path to the tsconfig file to be used by the compiler
|
|
756
764
|
*
|
|
@@ -865,7 +873,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
|
|
|
865
873
|
};
|
|
866
874
|
};
|
|
867
875
|
type UnbuildUserConfig = UserConfig<UnbuildBuildConfig, UnbuildResolvedBuildConfig, "unbuild">;
|
|
868
|
-
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "
|
|
876
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
869
877
|
/**
|
|
870
878
|
* The configuration provided while executing Powerlines commands.
|
|
871
879
|
*/
|
|
@@ -903,7 +911,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
903
911
|
/**
|
|
904
912
|
* The resolved options for the Powerlines project configuration.
|
|
905
913
|
*/
|
|
906
|
-
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">> & {
|
|
914
|
+
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">> & {
|
|
907
915
|
/**
|
|
908
916
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
909
917
|
*/
|
|
@@ -975,14 +983,6 @@ interface MetaInfo {
|
|
|
975
983
|
* A hash that represents the path to the project root directory
|
|
976
984
|
*/
|
|
977
985
|
configHash: string;
|
|
978
|
-
/**
|
|
979
|
-
* A mapping of runtime ids to their corresponding file paths
|
|
980
|
-
*/
|
|
981
|
-
builtinIdMap: Record<string, string>;
|
|
982
|
-
/**
|
|
983
|
-
* A mapping of virtual file paths to their corresponding file contents
|
|
984
|
-
*/
|
|
985
|
-
virtualFiles: Record<string, string | null>;
|
|
986
986
|
}
|
|
987
987
|
interface Resolver extends Jiti {
|
|
988
988
|
plugin: Jiti;
|
|
@@ -1190,7 +1190,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1190
1190
|
}
|
|
1191
1191
|
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
|
|
1192
1192
|
|
|
1193
|
-
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "
|
|
1193
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
1194
1194
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
1195
1195
|
|
|
1196
1196
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
|
@@ -16,9 +16,7 @@ import { ArrayValues } from '@stryke/types/array';
|
|
|
16
16
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
17
17
|
import ts from 'typescript';
|
|
18
18
|
import { PrimitiveJsonValue } from '@stryke/json/types';
|
|
19
|
-
import { Volume } from 'memfs';
|
|
20
19
|
import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
21
|
-
import { IUnionFs } from 'unionfs';
|
|
22
20
|
|
|
23
21
|
type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
|
|
24
22
|
interface BuildConfig {
|
|
@@ -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
|
*
|
|
@@ -205,11 +220,8 @@ type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
|
205
220
|
tsconfigFilePath: string;
|
|
206
221
|
};
|
|
207
222
|
|
|
208
|
-
declare const
|
|
209
|
-
declare const __VFS_REVERT__
|
|
210
|
-
declare const __VFS_CACHE__ = "__VFS_CACHE__";
|
|
211
|
-
declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
212
|
-
declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
223
|
+
declare const __VFS_PATCH__: unique symbol;
|
|
224
|
+
declare const __VFS_REVERT__: unique symbol;
|
|
213
225
|
type OutputModeType = "fs" | "virtual";
|
|
214
226
|
interface VirtualFile {
|
|
215
227
|
/**
|
|
@@ -249,7 +261,24 @@ interface VirtualFile {
|
|
|
249
261
|
*/
|
|
250
262
|
code: string | NodeJS.ArrayBufferView;
|
|
251
263
|
}
|
|
252
|
-
|
|
264
|
+
interface VirtualFileMetadata {
|
|
265
|
+
/**
|
|
266
|
+
* The identifier for the file data.
|
|
267
|
+
*/
|
|
268
|
+
id: string;
|
|
269
|
+
/**
|
|
270
|
+
* The variant of the file.
|
|
271
|
+
*/
|
|
272
|
+
variant: string;
|
|
273
|
+
/**
|
|
274
|
+
* The output mode of the file.
|
|
275
|
+
*/
|
|
276
|
+
mode: string;
|
|
277
|
+
/**
|
|
278
|
+
* Additional metadata associated with the file.
|
|
279
|
+
*/
|
|
280
|
+
properties: Record<string, string>;
|
|
281
|
+
}
|
|
253
282
|
interface ResolveFSOptions {
|
|
254
283
|
mode?: OutputModeType;
|
|
255
284
|
}
|
|
@@ -278,12 +307,18 @@ interface ResolvePathOptions extends ResolveFSOptions {
|
|
|
278
307
|
type?: "file" | "directory";
|
|
279
308
|
}
|
|
280
309
|
interface VirtualFileSystemInterface {
|
|
281
|
-
|
|
310
|
+
/**
|
|
311
|
+
* Patches the File System to include the virtual file system (VFS) contents.
|
|
312
|
+
*/
|
|
313
|
+
[__VFS_PATCH__]: () => void;
|
|
314
|
+
/**
|
|
315
|
+
* Reverts the virtual file system (VFS) to its previous state.
|
|
316
|
+
*/
|
|
282
317
|
[__VFS_REVERT__]: () => void;
|
|
283
318
|
/**
|
|
284
319
|
* The underlying file metadata.
|
|
285
320
|
*/
|
|
286
|
-
|
|
321
|
+
metadata: Record<string, VirtualFileMetadata | undefined>;
|
|
287
322
|
/**
|
|
288
323
|
* A map of module ids to their file paths.
|
|
289
324
|
*/
|
|
@@ -303,7 +338,7 @@ interface VirtualFileSystemInterface {
|
|
|
303
338
|
* @param options - Optional parameters for resolving the path.
|
|
304
339
|
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
305
340
|
*/
|
|
306
|
-
|
|
341
|
+
isPhysical: (pathOrId: string, options?: ResolvePathOptions) => boolean;
|
|
307
342
|
/**
|
|
308
343
|
* Checks if a file exists in the virtual file system (VFS).
|
|
309
344
|
*
|
|
@@ -318,15 +353,6 @@ interface VirtualFileSystemInterface {
|
|
|
318
353
|
* @returns `true` if the directory exists, otherwise `false`.
|
|
319
354
|
*/
|
|
320
355
|
isDirectory: (path: string) => boolean;
|
|
321
|
-
/**
|
|
322
|
-
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
323
|
-
*
|
|
324
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
325
|
-
*
|
|
326
|
-
* @param pathOrId - The path or id to check.
|
|
327
|
-
* @returns Whether the path or id corresponds to a virtual file.
|
|
328
|
-
*/
|
|
329
|
-
isTsconfigPath: (pathOrId: string) => boolean;
|
|
330
356
|
/**
|
|
331
357
|
* Checks if a file exists in the virtual file system (VFS).
|
|
332
358
|
*
|
|
@@ -340,7 +366,7 @@ interface VirtualFileSystemInterface {
|
|
|
340
366
|
* @param pathOrId - The path or id of the file.
|
|
341
367
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
342
368
|
*/
|
|
343
|
-
getMetadata: (pathOrId: PathLike) =>
|
|
369
|
+
getMetadata: (pathOrId: PathLike) => VirtualFileMetadata | undefined;
|
|
344
370
|
/**
|
|
345
371
|
* Gets the stats of a file in the virtual file system (VFS).
|
|
346
372
|
*
|
|
@@ -548,23 +574,12 @@ interface VirtualFileSystemInterface {
|
|
|
548
574
|
*/
|
|
549
575
|
resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
|
|
550
576
|
/**
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
577
|
+
* Formats a path to match the virtual file system (VFS) structure.
|
|
554
578
|
*
|
|
555
|
-
* @param path - The path to
|
|
556
|
-
* @returns The
|
|
579
|
+
* @param path - The path to format.
|
|
580
|
+
* @returns The formatted path.
|
|
557
581
|
*/
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Resolves a package name based on TypeScript's `tsconfig.json` paths.
|
|
561
|
-
*
|
|
562
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
563
|
-
*
|
|
564
|
-
* @param path - The path to check.
|
|
565
|
-
* @returns The resolved package name if it exists, otherwise undefined.
|
|
566
|
-
*/
|
|
567
|
-
resolveTsconfigPathPackage: (path: string) => string | false;
|
|
582
|
+
formatPath: (path: string) => string;
|
|
568
583
|
/**
|
|
569
584
|
* Resolves a path or id to a file path in the virtual file system.
|
|
570
585
|
*
|
|
@@ -573,23 +588,9 @@ interface VirtualFileSystemInterface {
|
|
|
573
588
|
*/
|
|
574
589
|
realpathSync: (pathOrId: string) => string;
|
|
575
590
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
* @returns A record mapping file paths to their partial metadata.
|
|
579
|
-
*/
|
|
580
|
-
getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
|
|
581
|
-
/**
|
|
582
|
-
* A map of cached file paths to their underlying file content.
|
|
583
|
-
*/
|
|
584
|
-
[__VFS_CACHE__]: Map<string, string>;
|
|
585
|
-
/**
|
|
586
|
-
* A reference to the underlying virtual file system.
|
|
591
|
+
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
587
592
|
*/
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* A reference to the underlying unified file system.
|
|
591
|
-
*/
|
|
592
|
-
[__VFS_UNIFIED__]: IUnionFs;
|
|
593
|
+
dispose: () => Promise<void>;
|
|
593
594
|
}
|
|
594
595
|
|
|
595
596
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
@@ -751,6 +752,13 @@ interface BaseConfig {
|
|
|
751
752
|
* This configuration will be used by the documentation generation plugins during the `docs` command.
|
|
752
753
|
*/
|
|
753
754
|
docs?: Record<string, any>;
|
|
755
|
+
/**
|
|
756
|
+
* Configuration for deploying the source code
|
|
757
|
+
*
|
|
758
|
+
* @remarks
|
|
759
|
+
* If set to `false`, the deployment will be disabled.
|
|
760
|
+
*/
|
|
761
|
+
deploy?: Record<string, any> | false;
|
|
754
762
|
/**
|
|
755
763
|
* The path to the tsconfig file to be used by the compiler
|
|
756
764
|
*
|
|
@@ -865,7 +873,7 @@ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedCo
|
|
|
865
873
|
};
|
|
866
874
|
};
|
|
867
875
|
type UnbuildUserConfig = UserConfig<UnbuildBuildConfig, UnbuildResolvedBuildConfig, "unbuild">;
|
|
868
|
-
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "
|
|
876
|
+
type PowerlinesCommand = "new" | "prepare" | "build" | "lint" | "test" | "docs" | "deploy" | "clean";
|
|
869
877
|
/**
|
|
870
878
|
* The configuration provided while executing Powerlines commands.
|
|
871
879
|
*/
|
|
@@ -903,7 +911,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
|
903
911
|
/**
|
|
904
912
|
* The resolved options for the Powerlines project configuration.
|
|
905
913
|
*/
|
|
906
|
-
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">> & {
|
|
914
|
+
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">> & {
|
|
907
915
|
/**
|
|
908
916
|
* The configuration options that were provided inline to the Powerlines CLI.
|
|
909
917
|
*/
|
|
@@ -975,14 +983,6 @@ interface MetaInfo {
|
|
|
975
983
|
* A hash that represents the path to the project root directory
|
|
976
984
|
*/
|
|
977
985
|
configHash: string;
|
|
978
|
-
/**
|
|
979
|
-
* A mapping of runtime ids to their corresponding file paths
|
|
980
|
-
*/
|
|
981
|
-
builtinIdMap: Record<string, string>;
|
|
982
|
-
/**
|
|
983
|
-
* A mapping of virtual file paths to their corresponding file contents
|
|
984
|
-
*/
|
|
985
|
-
virtualFiles: Record<string, string | null>;
|
|
986
986
|
}
|
|
987
987
|
interface Resolver extends Jiti {
|
|
988
988
|
plugin: Jiti;
|
|
@@ -1190,7 +1190,7 @@ interface PluginContext<out TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1190
1190
|
}
|
|
1191
1191
|
type BuildPluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = PluginContext<TResolvedConfig> & Omit<UnpluginBuildContext, "parse">;
|
|
1192
1192
|
|
|
1193
|
-
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "
|
|
1193
|
+
declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
|
|
1194
1194
|
type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
|
|
1195
1195
|
|
|
1196
1196
|
interface PluginHookObject<THookFunction extends FunctionLike, TFilter extends keyof HookFilter = never> {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as UnbuildPluginContext, a as UnbuildPluginOptions, P as Plugin } from './index-
|
|
2
|
-
export { b as UnbuildPluginResolvedConfig } from './index-
|
|
1
|
+
import { U as UnbuildPluginContext, a as UnbuildPluginOptions, P as Plugin } from './index-Bs5vDVIA.cjs';
|
|
2
|
+
export { b as UnbuildPluginResolvedConfig } from './index-Bs5vDVIA.cjs';
|
|
3
3
|
import '@storm-software/unbuild/types';
|
|
4
4
|
import '@stryke/env/get-env-paths';
|
|
5
5
|
import '@stryke/types/base';
|
|
@@ -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 build projects using Unbuild.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as UnbuildPluginContext, a as UnbuildPluginOptions, P as Plugin } from './index-
|
|
2
|
-
export { b as UnbuildPluginResolvedConfig } from './index-
|
|
1
|
+
import { U as UnbuildPluginContext, a as UnbuildPluginOptions, P as Plugin } from './index-Bs5vDVIA.js';
|
|
2
|
+
export { b as UnbuildPluginResolvedConfig } from './index-Bs5vDVIA.js';
|
|
3
3
|
import '@storm-software/unbuild/types';
|
|
4
4
|
import '@stryke/env/get-env-paths';
|
|
5
5
|
import '@stryke/types/base';
|
|
@@ -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 build projects using Unbuild.
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-
|
|
1
|
+
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-Bs5vDVIA.cjs';
|
|
2
2
|
import '@storm-software/unbuild/types';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -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/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-
|
|
1
|
+
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-Bs5vDVIA.js';
|
|
2
2
|
import '@storm-software/unbuild/types';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -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/types/plugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-
|
|
1
|
+
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-Bs5vDVIA.cjs';
|
|
2
2
|
import '@storm-software/unbuild/types';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -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/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-
|
|
1
|
+
export { U as UnbuildPluginContext, a as UnbuildPluginOptions, b as UnbuildPluginResolvedConfig } from '../index-Bs5vDVIA.js';
|
|
2
2
|
import '@storm-software/unbuild/types';
|
|
3
3
|
import '@stryke/env/get-env-paths';
|
|
4
4
|
import '@stryke/types/base';
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-unbuild",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to build projects using Unbuild.",
|
|
6
6
|
"repository": {
|
|
@@ -134,14 +134,14 @@
|
|
|
134
134
|
"@stryke/types": "^0.10.2",
|
|
135
135
|
"defu": "^6.1.4",
|
|
136
136
|
"jiti": "^2.6.1",
|
|
137
|
-
"powerlines": "^0.
|
|
137
|
+
"powerlines": "^0.22.0",
|
|
138
138
|
"unplugin": "^2.3.10"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
|
-
"@powerlines/nx": "^0.10.
|
|
142
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
141
|
+
"@powerlines/nx": "^0.10.12",
|
|
142
|
+
"@powerlines/plugin-plugin": "^0.11.20",
|
|
143
143
|
"@types/node": "^22.19.1"
|
|
144
144
|
},
|
|
145
145
|
"publishConfig": { "access": "public" },
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "30a4cf4f1c707fe159b55f65f1e87b14d679614d"
|
|
147
147
|
}
|