@powerlines/plugin-react 0.1.36 → 0.1.38

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.
@@ -1,9 +1,107 @@
1
1
  import { ResolveOptions as ResolveOptions$1 } from '@stryke/fs/resolve';
2
- import { StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
2
+ import { MaybePromise } from '@stryke/types/base';
3
3
 
4
- declare const __VFS_PATCH__ = "__VFS_PATCH__";
5
- declare const __VFS_REVERT__ = "__VFS_REVERT__";
6
- type OutputModeType = "fs" | "virtual";
4
+ declare enum StoragePreset {
5
+ VIRTUAL = "virtual",
6
+ FS = "fs"
7
+ }
8
+ /**
9
+ * Interface defining the methods and properties for a storage adapter.
10
+ */
11
+ interface StorageAdapter {
12
+ /**
13
+ * A name identifying the storage adapter type.
14
+ */
15
+ name: string;
16
+ /**
17
+ * Checks if a key exists in the storage.
18
+ *
19
+ * @param key - The key to check for existence.
20
+ * @returns A promise that resolves to `true` if the key exists, otherwise `false`.
21
+ */
22
+ exists: (key: string) => Promise<boolean>;
23
+ /**
24
+ * Synchronously checks if a key exists in the storage.
25
+ *
26
+ * @param key - The key to check for existence.
27
+ * @returns Returns `true` if the key exists, otherwise `false`.
28
+ */
29
+ existsSync: (key: string) => boolean;
30
+ /**
31
+ * Read a value associated with a key from the storage.
32
+ *
33
+ * @param key - The key to read the value for.
34
+ * @returns A promise that resolves to the value if found, otherwise `null`.
35
+ */
36
+ get: (key: string) => Promise<string | null>;
37
+ /**
38
+ * Synchronously reads the value associated with a key from the storage.
39
+ *
40
+ * @param key - The key to read the value for.
41
+ * @returns The value if found, otherwise `null`.
42
+ */
43
+ getSync: (key: string) => string | null;
44
+ /**
45
+ * Writes a value to the storage for the given key.
46
+ *
47
+ * @param key - The key to associate the value with.
48
+ * @param value - The value to store.
49
+ */
50
+ set: (key: string, value: string) => Promise<void>;
51
+ /**
52
+ * Synchronously writes a value to the storage for the given key.
53
+ *
54
+ * @param key - The key to associate the value with.
55
+ * @param value - The value to store.
56
+ */
57
+ setSync: (key: string, value: string) => void;
58
+ /**
59
+ * Removes a value from the storage.
60
+ *
61
+ * @param key - The key whose value should be removed.
62
+ */
63
+ remove: (key: string) => Promise<void>;
64
+ /**
65
+ * Synchronously removes a value from the storage.
66
+ *
67
+ * @param key - The key whose value should be removed.
68
+ */
69
+ removeSync: (key: string) => void;
70
+ /**
71
+ * Remove all entries from the storage that match the provided base path.
72
+ *
73
+ * @param base - The base path or prefix to clear entries from.
74
+ */
75
+ clear: (base?: string) => Promise<void>;
76
+ /**
77
+ * Synchronously remove all entries from the storage that match the provided base path.
78
+ *
79
+ * @param base - The base path or prefix to clear entries from.
80
+ */
81
+ clearSync: (base?: string) => void;
82
+ /**
83
+ * Lists all keys under the provided base path.
84
+ *
85
+ * @param base - The base path or prefix to list keys from.
86
+ * @returns A promise resolving to the list of keys.
87
+ */
88
+ list: (base?: string) => Promise<string[]>;
89
+ /**
90
+ * Synchronously lists all keys under the provided base path.
91
+ *
92
+ * @param base - The base path or prefix to list keys from.
93
+ * @returns The list of keys.
94
+ */
95
+ listSync: (base?: string) => string[];
96
+ /**
97
+ * Releases any resources held by the storage adapter.
98
+ */
99
+ dispose: () => MaybePromise<void>;
100
+ }
101
+ /**
102
+ * A mapping of file paths to storage adapter names and their corresponding {@link StorageAdapter} instances.
103
+ */
104
+ type StoragePort = Record<string, StorageAdapter>;
7
105
  interface VirtualFileMetadata {
8
106
  /**
9
107
  * The identifier for the file data.
@@ -23,10 +121,6 @@ interface VirtualFileMetadata {
23
121
  * - `normal`: Indicates that the file is a standard file without any special role.
24
122
  */
25
123
  type: string;
26
- /**
27
- * The output mode of the file.
28
- */
29
- mode: string;
30
124
  /**
31
125
  * Additional metadata associated with the file.
32
126
  */
@@ -48,16 +142,9 @@ interface VirtualFileData {
48
142
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
49
143
  * - `builtin`: Indicates that the file is a built-in module provided by the system.
50
144
  * - `entry`: Indicates that the file is an entry point for execution.
51
- * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
52
- * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
53
- * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
54
145
  * - `normal`: Indicates that the file is a standard file without any special role.
55
146
  */
56
147
  type?: string;
57
- /**
58
- * The output mode of the file.
59
- */
60
- mode?: string;
61
148
  /**
62
149
  * Additional metadata associated with the file.
63
150
  */
@@ -73,21 +160,18 @@ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
73
160
  */
74
161
  timestamp: number;
75
162
  }
76
- interface ResolveFSOptions {
77
- mode?: OutputModeType;
78
- }
79
- type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
80
- interface PowerlinesWriteFileOptions extends ResolveFSOptions {
163
+ interface WriteOptions {
81
164
  /**
82
165
  * Should the file skip formatting before being written?
83
166
  *
84
167
  * @defaultValue false
85
168
  */
86
169
  skipFormat?: boolean;
170
+ /**
171
+ * Additional metadata for the file.
172
+ */
173
+ meta?: VirtualFileMetadata;
87
174
  }
88
- type NodeWriteFileOptions = WriteFileOptions$1;
89
- type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
90
- type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
91
175
  interface ResolveOptions extends ResolveOptions$1 {
92
176
  /**
93
177
  * If true, the module is being resolved as an entry point.
@@ -111,14 +195,6 @@ interface ResolveOptions extends ResolveOptions$1 {
111
195
  skipNodeModulesBundle?: boolean;
112
196
  }
113
197
  interface VirtualFileSystemInterface {
114
- /**
115
- * Patches the File System to include the virtual file system (VFS) contents.
116
- */
117
- [__VFS_PATCH__]: () => void;
118
- /**
119
- * Reverts the virtual file system (VFS) to its previous state.
120
- */
121
- [__VFS_REVERT__]: () => void;
122
198
  /**
123
199
  * The underlying file metadata.
124
200
  */
@@ -131,208 +207,92 @@ interface VirtualFileSystemInterface {
131
207
  * A map of module ids to their file paths.
132
208
  */
133
209
  paths: Readonly<Record<string, string>>;
134
- /**
135
- * Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.
136
- *
137
- * @param pathOrId - The path or id to check.
138
- * @param importer - The importer path, if any.
139
- * @param options - Optional parameters for resolving the path.
140
- * @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.
141
- */
142
- isVirtual: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
143
- /**
144
- * Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.
145
- *
146
- * @param pathOrId - The path or id to check.
147
- * @param importer - The importer path, if any.
148
- * @param options - Optional parameters for resolving the path.
149
- * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
150
- */
151
- isPhysical: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
152
210
  /**
153
211
  * Checks if a file exists in the virtual file system (VFS).
154
212
  *
155
- * @param path - The path of the file to check.
213
+ * @param path - The path or id of the file.
156
214
  * @returns `true` if the file exists, otherwise `false`.
157
215
  */
158
- isFile: (path: string) => boolean;
216
+ exists: (path: string) => Promise<boolean>;
159
217
  /**
160
- * Checks if a directory exists in the virtual file system (VFS).
218
+ * Synchronously Checks if a file exists in the virtual file system (VFS).
161
219
  *
162
- * @param path - The path of the directory to check.
163
- * @returns `true` if the directory exists, otherwise `false`.
220
+ * @param path - The path or id of the file.
221
+ * @returns `true` if the file exists, otherwise `false`.
164
222
  */
165
- isDirectory: (path: string) => boolean;
223
+ existsSync: (path: string) => boolean;
166
224
  /**
167
- * Checks if a file exists in the virtual file system (VFS).
225
+ * Checks if a file is virtual in the virtual file system (VFS).
168
226
  *
169
- * @param pathOrId - The path or id of the file.
170
- * @returns `true` if the file exists, otherwise `false`.
227
+ * @param path - The path or id of the file.
228
+ * @returns `true` if the file is virtual, otherwise `false`.
171
229
  */
172
- existsSync: (pathOrId: string) => boolean;
230
+ isVirtual: (path: string) => boolean;
173
231
  /**
174
232
  * Gets the metadata of a file in the virtual file system (VFS).
175
233
  *
176
- * @param pathOrId - The path or id of the file.
234
+ * @param path - The path or id of the file.
177
235
  * @returns The metadata of the file if it exists, otherwise undefined.
178
236
  */
179
- getMetadata: (pathOrId: string) => VirtualFileMetadata | undefined;
180
- /**
181
- * Gets the stats of a file in the virtual file system (VFS).
182
- *
183
- * @param pathOrId - The path or id of the file.
184
- * @param options - Optional parameters for getting the stats.
185
- * @returns The stats of the file if it exists, otherwise undefined.
186
- */
187
- lstat: (pathOrId: string, options?: StatSyncOptions & {
188
- bigint?: false | undefined;
189
- throwIfNoEntry: false;
190
- }) => Promise<Stats>;
191
- /**
192
- * Gets the stats of a file in the virtual file system (VFS).
193
- *
194
- * @param pathOrId - The path or id of the file.
195
- * @param options - Optional parameters for getting the stats.
196
- * @returns The stats of the file if it exists, otherwise undefined.
197
- */
198
- lstatSync: (pathOrId: string, options?: StatSyncOptions & {
199
- bigint?: false | undefined;
200
- throwIfNoEntry: false;
201
- }) => Stats | undefined;
202
- /**
203
- * Gets the stats of a file in the virtual file system (VFS).
204
- *
205
- * @param pathOrId - The path or id of the file.
206
- * @returns The stats of the file if it exists, otherwise false.
207
- */
208
- stat: (pathOrId: string, options?: StatSyncOptions & {
209
- bigint?: false | undefined;
210
- throwIfNoEntry: false;
211
- }) => Promise<Stats>;
212
- /**
213
- * Gets the stats of a file in the virtual file system (VFS).
214
- *
215
- * @param pathOrId - The path or id of the file.
216
- * @returns The stats of the file if it exists, otherwise false.
217
- */
218
- statSync: (pathOrId: string, options?: StatSyncOptions & {
219
- bigint?: false | undefined;
220
- throwIfNoEntry: false;
221
- }) => Stats | undefined;
237
+ getMetadata: (path: string) => VirtualFileMetadata | undefined;
222
238
  /**
223
239
  * Lists files in a given path.
224
240
  *
225
241
  * @param path - The path to list files from.
226
- * @param options - Options for listing files, such as encoding and recursion.
227
242
  * @returns An array of file names in the specified path.
228
243
  */
229
- readdirSync: (path: string, options?: {
230
- encoding: BufferEncoding | null;
231
- withFileTypes?: false | undefined;
232
- recursive?: boolean | undefined;
233
- } | BufferEncoding) => string[];
244
+ listSync: (path: string) => string[];
234
245
  /**
235
246
  * Lists files in a given path.
236
247
  *
237
248
  * @param path - The path to list files from.
238
- * @param options - Options for listing files, such as encoding and recursion.
239
249
  * @returns An array of file names in the specified path.
240
250
  */
241
- readdir: (path: string, options?: {
242
- encoding: BufferEncoding | null;
243
- withFileTypes?: false | undefined;
244
- recursive?: boolean | undefined;
245
- } | BufferEncoding) => Promise<string[]>;
251
+ list: (path: string) => Promise<string[]>;
246
252
  /**
247
253
  * Removes a file or symbolic link in the virtual file system (VFS).
248
254
  *
249
255
  * @param path - The path to the file to remove.
250
256
  * @returns A promise that resolves when the file is removed.
251
257
  */
252
- unlinkSync: (path: string, options?: ResolveFSOptions) => void;
258
+ removeSync: (path: string) => void;
253
259
  /**
254
260
  * Asynchronously removes a file or symbolic link in the virtual file system (VFS).
255
261
  *
256
262
  * @param path - The path to the file to remove.
257
263
  * @returns A promise that resolves when the file is removed.
258
264
  */
259
- unlink: (path: string, options?: ResolveFSOptions) => Promise<void>;
260
- /**
261
- * Removes a directory in the virtual file system (VFS).
262
- *
263
- * @param path - The path to create the directory at.
264
- * @param options - Options for creating the directory.
265
- */
266
- rmdirSync: (path: string, options?: RmDirOptions & ResolveFSOptions) => any;
267
- /**
268
- * Removes a directory in the virtual file system (VFS).
269
- *
270
- * @param path - The path to create the directory at.
271
- * @param options - Options for creating the directory.
272
- * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
273
- */
274
- rmdir: (path: string, options?: RmDirOptions & ResolveFSOptions) => Promise<void>;
275
- /**
276
- * Removes a file or directory in the virtual file system (VFS).
277
- *
278
- * @param path - The path to the file or directory to remove.
279
- * @param options - Options for removing the file or directory.
280
- * @returns A promise that resolves when the file or directory is removed.
281
- */
282
- rm: (path: string, options?: RmOptions & ResolveFSOptions) => Promise<void>;
283
- /**
284
- * Synchronously removes a file or directory in the virtual file system (VFS).
285
- *
286
- * @param path - The path to the file or directory to remove.
287
- * @param options - Options for removing the file or directory.
288
- */
289
- rmSync: (path: string, options?: RmOptions & ResolveFSOptions) => void;
290
- /**
291
- * Creates a directory in the virtual file system (VFS).
292
- *
293
- * @param path - The path to create the directory at.
294
- * @param options - Options for creating the directory.
295
- * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
296
- */
297
- mkdirSync: (path: string, options?: MakeDirectoryOptions) => string | undefined;
298
- /**
299
- * Creates a directory in the virtual file system (VFS).
300
- *
301
- * @param path - The path to create the directory at.
302
- * @param options - Options for creating the directory.
303
- * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
304
- */
305
- mkdir: (path: string, options?: MakeDirectoryOptions) => Promise<string | undefined>;
265
+ remove: (path: string) => Promise<void>;
306
266
  /**
307
267
  * Reads a file from the virtual file system (VFS).
308
268
  *
309
- * @param pathOrId - The path or id of the file.
269
+ * @param path - The path or id of the file.
310
270
  * @returns The contents of the file if it exists, otherwise undefined.
311
271
  */
312
- readFile: (pathOrId: string) => Promise<string | undefined>;
272
+ read: (path: string) => Promise<string | undefined>;
313
273
  /**
314
274
  * Reads a file from the virtual file system (VFS).
315
275
  *
316
- * @param pathOrId - The path or id of the file.
276
+ * @param path - The path or id of the file.
317
277
  */
318
- readFileSync: (pathOrId: string) => string | undefined;
278
+ readSync: (path: string) => string | undefined;
319
279
  /**
320
280
  * Writes a file to the virtual file system (VFS).
321
281
  *
322
282
  * @param path - The path to the file.
323
283
  * @param data - The contents of the file.
324
- * @param options - Optional parameters for writing the file.
284
+ * @param options - Options for writing the file.
325
285
  * @returns A promise that resolves when the file is written.
326
286
  */
327
- writeFile: (path: string, data?: WriteFileData, options?: WriteFileOptions) => Promise<void>;
287
+ write: (path: string, data: string, options?: WriteOptions) => Promise<void>;
328
288
  /**
329
289
  * Writes a file to the virtual file system (VFS).
330
290
  *
331
291
  * @param path - The path to the file.
332
292
  * @param data - The contents of the file.
333
- * @param options - Optional parameters for writing the file.
293
+ * @param options - Options for writing the file.
334
294
  */
335
- writeFileSync: (path: string, data?: WriteFileData, options?: WriteFileOptions) => void;
295
+ writeSync: (path: string, data: string, options?: WriteOptions) => void;
336
296
  /**
337
297
  * Moves a file from one path to another in the virtual file system (VFS).
338
298
  *
@@ -375,13 +335,6 @@ interface VirtualFileSystemInterface {
375
335
  * @returns An array of file paths matching the provided pattern(s)
376
336
  */
377
337
  globSync: (pattern: string | string[]) => string[];
378
- /**
379
- * Resolves a path or id to a file path in the virtual file system.
380
- *
381
- * @param pathOrId - The path or id of the file to resolve.
382
- * @returns The resolved path of the file if it exists, otherwise false.
383
- */
384
- realpathSync: (pathOrId: string) => string;
385
338
  /**
386
339
  * A helper function to resolve modules using the Jiti resolver
387
340
  *
@@ -422,4 +375,4 @@ interface VirtualFileSystemInterface {
422
375
  dispose: () => Promise<void>;
423
376
  }
424
377
 
425
- export type { OutputModeType as O, PowerlinesWriteFileOptions as P, ResolveOptions as R, VirtualFileSystemInterface as V, VirtualFile as a };
378
+ export { type ResolveOptions as R, type StoragePort as S, type VirtualFileSystemInterface as V, StoragePreset as a, type VirtualFile as b };
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as PluginContext, a as Plugin } from './runtime-Djft1hbQ.cjs';
1
+ import { P as PluginContext, a as Plugin } from './runtime-DDbKrrxM.cjs';
2
2
  import { Children } from '@alloy-js/core/jsx-runtime';
3
3
  import { PrintTreeOptions } from '@alloy-js/core';
4
4
  import { ReactPluginContext } from './types/plugin.cjs';
@@ -21,9 +21,8 @@ import '@stryke/types/configuration';
21
21
  import '@stryke/types/file';
22
22
  import 'vite';
23
23
  import '@babel/helper-plugin-utils';
24
- import './fs-Y3B84fcf.cjs';
24
+ import './fs-ECFlqnPg.cjs';
25
25
  import '@stryke/fs/resolve';
26
- import 'node:fs';
27
26
  import '@stryke/types/array';
28
27
  import '@stryke/types/tsconfig';
29
28
  import 'typescript';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as PluginContext, a as Plugin } from './runtime-Bcl8KoqS.js';
1
+ import { P as PluginContext, a as Plugin } from './runtime-hDetUSX2.js';
2
2
  import { Children } from '@alloy-js/core/jsx-runtime';
3
3
  import { PrintTreeOptions } from '@alloy-js/core';
4
4
  import { ReactPluginContext } from './types/plugin.js';
@@ -21,9 +21,8 @@ import '@stryke/types/configuration';
21
21
  import '@stryke/types/file';
22
22
  import 'vite';
23
23
  import '@babel/helper-plugin-utils';
24
- import './fs-Y3B84fcf.js';
24
+ import './fs-ECFlqnPg.js';
25
25
  import '@stryke/fs/resolve';
26
- import 'node:fs';
27
26
  import '@stryke/types/array';
28
27
  import '@stryke/types/tsconfig';
29
28
  import 'typescript';
@@ -14,7 +14,7 @@ import { TypeDefinition, TypeDefinitionParameter } from '@stryke/types/configura
14
14
  import { AssetGlob } from '@stryke/types/file';
15
15
  import { ResolvedPreviewOptions, PreviewOptions } from 'vite';
16
16
  import { BabelAPI } from '@babel/helper-plugin-utils';
17
- import { O as OutputModeType, V as VirtualFileSystemInterface, R as ResolveOptions, a as VirtualFile, P as PowerlinesWriteFileOptions } from './fs-Y3B84fcf.js';
17
+ import { S as StoragePort, a as StoragePreset, V as VirtualFileSystemInterface, R as ResolveOptions, b as VirtualFile } from './fs-ECFlqnPg.cjs';
18
18
  import { ArrayValues } from '@stryke/types/array';
19
19
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
20
20
  import ts from 'typescript';
@@ -187,7 +187,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
187
187
  output?: string;
188
188
  }
189
189
  type BabelResolvedConfig = Omit<BabelUserConfig, "plugins" | "presets"> & Required<Pick<BabelUserConfig, "plugins" | "presets">>;
190
- type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
190
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
191
191
  /**
192
192
  * The name of the environment
193
193
  */
@@ -198,9 +198,9 @@ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "
198
198
  preview?: ResolvedPreviewOptions;
199
199
  };
200
200
  type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
201
- type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
201
+ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
202
202
  assets: ResolvedAssetGlob[];
203
- }>;
203
+ }> & Pick<OutputConfig, "storage">;
204
204
  /**
205
205
  * The resolved options for the Powerlines project configuration.
206
206
  */
@@ -598,13 +598,16 @@ interface OutputConfig {
598
598
  *
599
599
  * @defaultValue "\{projectRoot\}/dist"
600
600
  */
601
- distPath?: string;
601
+ buildPath?: string;
602
602
  /**
603
- * The format of the output files
603
+ * The folder where the generated runtime artifacts will be located
604
604
  *
605
- * @defaultValue "virtual"
605
+ * @remarks
606
+ * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
607
+ *
608
+ * @defaultValue "\{projectRoot\}/.powerlines"
606
609
  */
607
- mode?: OutputModeType;
610
+ artifactsPath?: string;
608
611
  /**
609
612
  * The path of the generated runtime declaration file relative to the workspace root.
610
613
  *
@@ -620,15 +623,6 @@ interface OutputConfig {
620
623
  * @defaultValue "powerlines"
621
624
  */
622
625
  builtinPrefix?: string;
623
- /**
624
- * The folder where the generated runtime artifacts will be located
625
- *
626
- * @remarks
627
- * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
628
- *
629
- * @defaultValue "\{projectRoot\}/.powerlines"
630
- */
631
- artifactsFolder?: string;
632
626
  /**
633
627
  * The module format of the output files
634
628
  *
@@ -645,42 +639,21 @@ interface OutputConfig {
645
639
  * The assets can be specified as a string (path to the asset) or as an object with a `glob` property (to match multiple files). The paths are relative to the project root directory.
646
640
  */
647
641
  assets?: Array<string | AssetGlob>;
648
- }
649
- interface BaseConfig {
650
642
  /**
651
- * The name of the project
652
- */
653
- name?: string;
654
- /**
655
- * The project display title
643
+ * A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
656
644
  *
657
645
  * @remarks
658
- * This option is used in documentation generation and other places where a human-readable title is needed.
659
- */
660
- title?: string;
661
- /**
662
- * A description of the project
646
+ * If a string preset is provided, it must be one of the following values:
647
+ * - `"virtual"`: Uses the local file system for storage.
648
+ * - `"fs"`: Uses an in-memory virtual file system for storage.
663
649
  *
664
- * @remarks
665
- * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
666
- */
667
- description?: string;
668
- /**
669
- * The log level to use for the Powerlines processes.
650
+ * If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
670
651
  *
671
- * @defaultValue "info"
672
- */
673
- logLevel?: LogLevelLabel | null;
674
- /**
675
- * A custom logger function to use for logging messages
676
- */
677
- customLogger?: LogFn;
678
- /**
679
- * Explicitly set a mode to run in. This mode will be used at various points throughout the Powerlines processes, such as when compiling the source code.
680
- *
681
- * @defaultValue "production"
652
+ * @defaultValue "virtual"
682
653
  */
683
- mode?: "development" | "test" | "production";
654
+ storage?: StoragePort | StoragePreset;
655
+ }
656
+ interface BaseConfig {
684
657
  /**
685
658
  * The entry point(s) for the application
686
659
  */
@@ -764,6 +737,40 @@ interface EnvironmentConfig extends BaseConfig {
764
737
  consumer?: "client" | "server";
765
738
  }
766
739
  interface CommonUserConfig extends BaseConfig {
740
+ /**
741
+ * The name of the project
742
+ */
743
+ name?: string;
744
+ /**
745
+ * The project display title
746
+ *
747
+ * @remarks
748
+ * This option is used in documentation generation and other places where a human-readable title is needed.
749
+ */
750
+ title?: string;
751
+ /**
752
+ * A description of the project
753
+ *
754
+ * @remarks
755
+ * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
756
+ */
757
+ description?: string;
758
+ /**
759
+ * The log level to use for the Powerlines processes.
760
+ *
761
+ * @defaultValue "info"
762
+ */
763
+ logLevel?: LogLevelLabel | null;
764
+ /**
765
+ * A custom logger function to use for logging messages
766
+ */
767
+ customLogger?: LogFn;
768
+ /**
769
+ * Explicitly set a mode to run in. This mode will be used at various points throughout the Powerlines processes, such as when compiling the source code.
770
+ *
771
+ * @defaultValue "production"
772
+ */
773
+ mode?: "development" | "test" | "production";
767
774
  /**
768
775
  * The type of project being built
769
776
  *
@@ -814,7 +821,7 @@ interface CommonUserConfig extends BaseConfig {
814
821
  * A string identifier that allows a child framework or tool to identify itself when using Powerlines.
815
822
  *
816
823
  * @remarks
817
- * If no values are provided for {@link OutputConfig.dts | output.dts}, {@link OutputConfig.builtinPrefix | output.builtinPrefix}, or {@link OutputConfig.artifactsFolder | output.artifactsFolder}, this value will be used as the default.
824
+ * If no values are provided for {@link OutputConfig.dts | output.dts}, {@link OutputConfig.builtinPrefix | output.builtinPrefix}, or {@link OutputConfig.artifactsPath | output.artifactsFolder}, this value will be used as the default.
818
825
  *
819
826
  * @defaultValue "powerlines"
820
827
  */
@@ -1081,17 +1088,15 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1081
1088
  * @param code - The source code of the builtin file
1082
1089
  * @param id - The unique identifier of the builtin file
1083
1090
  * @param path - An optional path to write the builtin file to
1084
- * @param options - Options for writing the file
1085
1091
  */
1086
- emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1092
+ emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
1087
1093
  /**
1088
1094
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1089
1095
  *
1090
1096
  * @param code - The source code of the entry file
1091
1097
  * @param path - An optional path to write the entry file to
1092
- * @param options - Options for writing the file
1093
1098
  */
1094
- emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1099
+ emitEntry: (code: string, path: string) => Promise<void>;
1095
1100
  /**
1096
1101
  * A function to update the context fields using a new user configuration options
1097
1102
  */