@powerlines/plugin-rollup 0.7.45 → 0.7.47

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,6 +1,6 @@
1
1
  export { createRollupPlugin } from './unplugin.cjs';
2
2
  import 'esbuild';
3
- import '../index-B8_17TWj.cjs';
3
+ import '../index-DctVDwrQ.cjs';
4
4
  import 'rollup';
5
5
  import '@stryke/env/get-env-paths';
6
6
  import '@stryke/types/base';
@@ -17,7 +17,6 @@ import '@stryke/types/configuration';
17
17
  import '@stryke/types/file';
18
18
  import 'vite';
19
19
  import '@stryke/fs/resolve';
20
- import 'node:fs';
21
20
  import '@stryke/types/array';
22
21
  import '@stryke/types/tsconfig';
23
22
  import 'typescript';
@@ -1,6 +1,6 @@
1
1
  export { createRollupPlugin } from './unplugin.js';
2
2
  import 'esbuild';
3
- import '../index-B8_17TWj.js';
3
+ import '../index-DctVDwrQ.js';
4
4
  import 'rollup';
5
5
  import '@stryke/env/get-env-paths';
6
6
  import '@stryke/types/base';
@@ -17,7 +17,6 @@ import '@stryke/types/configuration';
17
17
  import '@stryke/types/file';
18
18
  import 'vite';
19
19
  import '@stryke/fs/resolve';
20
- import 'node:fs';
21
20
  import '@stryke/types/array';
22
21
  import '@stryke/types/tsconfig';
23
22
  import 'typescript';
@@ -1,5 +1,5 @@
1
1
  import * as esbuild from 'esbuild';
2
- import { R as RollupPluginContext } from '../index-B8_17TWj.cjs';
2
+ import { R as RollupPluginContext } from '../index-DctVDwrQ.cjs';
3
3
  import 'rollup';
4
4
  import '@stryke/env/get-env-paths';
5
5
  import '@stryke/types/base';
@@ -16,7 +16,6 @@ import '@stryke/types/configuration';
16
16
  import '@stryke/types/file';
17
17
  import 'vite';
18
18
  import '@stryke/fs/resolve';
19
- import 'node:fs';
20
19
  import '@stryke/types/array';
21
20
  import '@stryke/types/tsconfig';
22
21
  import 'typescript';
@@ -1,5 +1,5 @@
1
1
  import * as esbuild from 'esbuild';
2
- import { R as RollupPluginContext } from '../index-B8_17TWj.js';
2
+ import { R as RollupPluginContext } from '../index-DctVDwrQ.js';
3
3
  import 'rollup';
4
4
  import '@stryke/env/get-env-paths';
5
5
  import '@stryke/types/base';
@@ -16,7 +16,6 @@ import '@stryke/types/configuration';
16
16
  import '@stryke/types/file';
17
17
  import 'vite';
18
18
  import '@stryke/fs/resolve';
19
- import 'node:fs';
20
19
  import '@stryke/types/array';
21
20
  import '@stryke/types/tsconfig';
22
21
  import 'typescript';
@@ -14,7 +14,6 @@ import { TypeDefinitionParameter, TypeDefinition } from '@stryke/types/configura
14
14
  import { AssetGlob } from '@stryke/types/file';
15
15
  import { PreviewOptions, ResolvedPreviewOptions } from 'vite';
16
16
  import { ResolveOptions as ResolveOptions$1 } from '@stryke/fs/resolve';
17
- import { StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
18
17
  import { ArrayValues } from '@stryke/types/array';
19
18
  import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
20
19
  import ts from 'typescript';
@@ -160,9 +159,107 @@ type RollupBuildConfig = Omit<RollupOptions, "entry" | "external" | "input" | "o
160
159
  } & BuildConfig;
161
160
  type RollupResolvedBuildConfig = RollupOptions & BuildResolvedConfig;
162
161
 
163
- declare const __VFS_PATCH__ = "__VFS_PATCH__";
164
- declare const __VFS_REVERT__ = "__VFS_REVERT__";
165
- type OutputModeType = "fs" | "virtual";
162
+ declare enum StoragePreset {
163
+ VIRTUAL = "virtual",
164
+ FS = "fs"
165
+ }
166
+ /**
167
+ * Interface defining the methods and properties for a storage adapter.
168
+ */
169
+ interface StorageAdapter {
170
+ /**
171
+ * A name identifying the storage adapter type.
172
+ */
173
+ name: string;
174
+ /**
175
+ * Checks if a key exists in the storage.
176
+ *
177
+ * @param key - The key to check for existence.
178
+ * @returns A promise that resolves to `true` if the key exists, otherwise `false`.
179
+ */
180
+ exists: (key: string) => Promise<boolean>;
181
+ /**
182
+ * Synchronously checks if a key exists in the storage.
183
+ *
184
+ * @param key - The key to check for existence.
185
+ * @returns Returns `true` if the key exists, otherwise `false`.
186
+ */
187
+ existsSync: (key: string) => boolean;
188
+ /**
189
+ * Read a value associated with a key from the storage.
190
+ *
191
+ * @param key - The key to read the value for.
192
+ * @returns A promise that resolves to the value if found, otherwise `null`.
193
+ */
194
+ get: (key: string) => Promise<string | null>;
195
+ /**
196
+ * Synchronously reads the value associated with a key from the storage.
197
+ *
198
+ * @param key - The key to read the value for.
199
+ * @returns The value if found, otherwise `null`.
200
+ */
201
+ getSync: (key: string) => string | null;
202
+ /**
203
+ * Writes a value to the storage for the given key.
204
+ *
205
+ * @param key - The key to associate the value with.
206
+ * @param value - The value to store.
207
+ */
208
+ set: (key: string, value: string) => Promise<void>;
209
+ /**
210
+ * Synchronously writes a value to the storage for the given key.
211
+ *
212
+ * @param key - The key to associate the value with.
213
+ * @param value - The value to store.
214
+ */
215
+ setSync: (key: string, value: string) => void;
216
+ /**
217
+ * Removes a value from the storage.
218
+ *
219
+ * @param key - The key whose value should be removed.
220
+ */
221
+ remove: (key: string) => Promise<void>;
222
+ /**
223
+ * Synchronously removes a value from the storage.
224
+ *
225
+ * @param key - The key whose value should be removed.
226
+ */
227
+ removeSync: (key: string) => void;
228
+ /**
229
+ * Remove all entries from the storage that match the provided base path.
230
+ *
231
+ * @param base - The base path or prefix to clear entries from.
232
+ */
233
+ clear: (base?: string) => Promise<void>;
234
+ /**
235
+ * Synchronously remove all entries from the storage that match the provided base path.
236
+ *
237
+ * @param base - The base path or prefix to clear entries from.
238
+ */
239
+ clearSync: (base?: string) => void;
240
+ /**
241
+ * Lists all keys under the provided base path.
242
+ *
243
+ * @param base - The base path or prefix to list keys from.
244
+ * @returns A promise resolving to the list of keys.
245
+ */
246
+ list: (base?: string) => Promise<string[]>;
247
+ /**
248
+ * Synchronously lists all keys under the provided base path.
249
+ *
250
+ * @param base - The base path or prefix to list keys from.
251
+ * @returns The list of keys.
252
+ */
253
+ listSync: (base?: string) => string[];
254
+ /**
255
+ * Releases any resources held by the storage adapter.
256
+ */
257
+ dispose: () => MaybePromise<void>;
258
+ }
259
+ /**
260
+ * A mapping of file paths to storage adapter names and their corresponding {@link StorageAdapter} instances.
261
+ */
262
+ type StoragePort = Record<string, StorageAdapter>;
166
263
  interface VirtualFileMetadata {
167
264
  /**
168
265
  * The identifier for the file data.
@@ -182,10 +279,6 @@ interface VirtualFileMetadata {
182
279
  * - `normal`: Indicates that the file is a standard file without any special role.
183
280
  */
184
281
  type: string;
185
- /**
186
- * The output mode of the file.
187
- */
188
- mode: string;
189
282
  /**
190
283
  * Additional metadata associated with the file.
191
284
  */
@@ -207,16 +300,9 @@ interface VirtualFileData {
207
300
  * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
208
301
  * - `builtin`: Indicates that the file is a built-in module provided by the system.
209
302
  * - `entry`: Indicates that the file is an entry point for execution.
210
- * - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
211
- * - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
212
- * - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
213
303
  * - `normal`: Indicates that the file is a standard file without any special role.
214
304
  */
215
305
  type?: string;
216
- /**
217
- * The output mode of the file.
218
- */
219
- mode?: string;
220
306
  /**
221
307
  * Additional metadata associated with the file.
222
308
  */
@@ -232,21 +318,18 @@ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
232
318
  */
233
319
  timestamp: number;
234
320
  }
235
- interface ResolveFSOptions {
236
- mode?: OutputModeType;
237
- }
238
- type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
239
- interface PowerlinesWriteFileOptions extends ResolveFSOptions {
321
+ interface WriteOptions {
240
322
  /**
241
323
  * Should the file skip formatting before being written?
242
324
  *
243
325
  * @defaultValue false
244
326
  */
245
327
  skipFormat?: boolean;
328
+ /**
329
+ * Additional metadata for the file.
330
+ */
331
+ meta?: VirtualFileMetadata;
246
332
  }
247
- type NodeWriteFileOptions = WriteFileOptions$1;
248
- type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
249
- type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
250
333
  interface ResolveOptions extends ResolveOptions$1 {
251
334
  /**
252
335
  * If true, the module is being resolved as an entry point.
@@ -270,14 +353,6 @@ interface ResolveOptions extends ResolveOptions$1 {
270
353
  skipNodeModulesBundle?: boolean;
271
354
  }
272
355
  interface VirtualFileSystemInterface {
273
- /**
274
- * Patches the File System to include the virtual file system (VFS) contents.
275
- */
276
- [__VFS_PATCH__]: () => void;
277
- /**
278
- * Reverts the virtual file system (VFS) to its previous state.
279
- */
280
- [__VFS_REVERT__]: () => void;
281
356
  /**
282
357
  * The underlying file metadata.
283
358
  */
@@ -290,208 +365,92 @@ interface VirtualFileSystemInterface {
290
365
  * A map of module ids to their file paths.
291
366
  */
292
367
  paths: Readonly<Record<string, string>>;
293
- /**
294
- * Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.
295
- *
296
- * @param pathOrId - The path or id to check.
297
- * @param importer - The importer path, if any.
298
- * @param options - Optional parameters for resolving the path.
299
- * @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.
300
- */
301
- isVirtual: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
302
- /**
303
- * Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.
304
- *
305
- * @param pathOrId - The path or id to check.
306
- * @param importer - The importer path, if any.
307
- * @param options - Optional parameters for resolving the path.
308
- * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
309
- */
310
- isPhysical: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
311
368
  /**
312
369
  * Checks if a file exists in the virtual file system (VFS).
313
370
  *
314
- * @param path - The path of the file to check.
371
+ * @param path - The path or id of the file.
315
372
  * @returns `true` if the file exists, otherwise `false`.
316
373
  */
317
- isFile: (path: string) => boolean;
374
+ exists: (path: string) => Promise<boolean>;
318
375
  /**
319
- * Checks if a directory exists in the virtual file system (VFS).
376
+ * Synchronously Checks if a file exists in the virtual file system (VFS).
320
377
  *
321
- * @param path - The path of the directory to check.
322
- * @returns `true` if the directory exists, otherwise `false`.
378
+ * @param path - The path or id of the file.
379
+ * @returns `true` if the file exists, otherwise `false`.
323
380
  */
324
- isDirectory: (path: string) => boolean;
381
+ existsSync: (path: string) => boolean;
325
382
  /**
326
- * Checks if a file exists in the virtual file system (VFS).
383
+ * Checks if a file is virtual in the virtual file system (VFS).
327
384
  *
328
- * @param pathOrId - The path or id of the file.
329
- * @returns `true` if the file exists, otherwise `false`.
385
+ * @param path - The path or id of the file.
386
+ * @returns `true` if the file is virtual, otherwise `false`.
330
387
  */
331
- existsSync: (pathOrId: string) => boolean;
388
+ isVirtual: (path: string) => boolean;
332
389
  /**
333
390
  * Gets the metadata of a file in the virtual file system (VFS).
334
391
  *
335
- * @param pathOrId - The path or id of the file.
392
+ * @param path - The path or id of the file.
336
393
  * @returns The metadata of the file if it exists, otherwise undefined.
337
394
  */
338
- getMetadata: (pathOrId: string) => VirtualFileMetadata | undefined;
339
- /**
340
- * Gets the stats of a file in the virtual file system (VFS).
341
- *
342
- * @param pathOrId - The path or id of the file.
343
- * @param options - Optional parameters for getting the stats.
344
- * @returns The stats of the file if it exists, otherwise undefined.
345
- */
346
- lstat: (pathOrId: string, options?: StatSyncOptions & {
347
- bigint?: false | undefined;
348
- throwIfNoEntry: false;
349
- }) => Promise<Stats>;
350
- /**
351
- * Gets the stats of a file in the virtual file system (VFS).
352
- *
353
- * @param pathOrId - The path or id of the file.
354
- * @param options - Optional parameters for getting the stats.
355
- * @returns The stats of the file if it exists, otherwise undefined.
356
- */
357
- lstatSync: (pathOrId: string, options?: StatSyncOptions & {
358
- bigint?: false | undefined;
359
- throwIfNoEntry: false;
360
- }) => Stats | undefined;
361
- /**
362
- * Gets the stats of a file in the virtual file system (VFS).
363
- *
364
- * @param pathOrId - The path or id of the file.
365
- * @returns The stats of the file if it exists, otherwise false.
366
- */
367
- stat: (pathOrId: string, options?: StatSyncOptions & {
368
- bigint?: false | undefined;
369
- throwIfNoEntry: false;
370
- }) => Promise<Stats>;
371
- /**
372
- * Gets the stats of a file in the virtual file system (VFS).
373
- *
374
- * @param pathOrId - The path or id of the file.
375
- * @returns The stats of the file if it exists, otherwise false.
376
- */
377
- statSync: (pathOrId: string, options?: StatSyncOptions & {
378
- bigint?: false | undefined;
379
- throwIfNoEntry: false;
380
- }) => Stats | undefined;
395
+ getMetadata: (path: string) => VirtualFileMetadata | undefined;
381
396
  /**
382
397
  * Lists files in a given path.
383
398
  *
384
399
  * @param path - The path to list files from.
385
- * @param options - Options for listing files, such as encoding and recursion.
386
400
  * @returns An array of file names in the specified path.
387
401
  */
388
- readdirSync: (path: string, options?: {
389
- encoding: BufferEncoding | null;
390
- withFileTypes?: false | undefined;
391
- recursive?: boolean | undefined;
392
- } | BufferEncoding) => string[];
402
+ listSync: (path: string) => string[];
393
403
  /**
394
404
  * Lists files in a given path.
395
405
  *
396
406
  * @param path - The path to list files from.
397
- * @param options - Options for listing files, such as encoding and recursion.
398
407
  * @returns An array of file names in the specified path.
399
408
  */
400
- readdir: (path: string, options?: {
401
- encoding: BufferEncoding | null;
402
- withFileTypes?: false | undefined;
403
- recursive?: boolean | undefined;
404
- } | BufferEncoding) => Promise<string[]>;
409
+ list: (path: string) => Promise<string[]>;
405
410
  /**
406
411
  * Removes a file or symbolic link in the virtual file system (VFS).
407
412
  *
408
413
  * @param path - The path to the file to remove.
409
414
  * @returns A promise that resolves when the file is removed.
410
415
  */
411
- unlinkSync: (path: string, options?: ResolveFSOptions) => void;
416
+ removeSync: (path: string) => void;
412
417
  /**
413
418
  * Asynchronously removes a file or symbolic link in the virtual file system (VFS).
414
419
  *
415
420
  * @param path - The path to the file to remove.
416
421
  * @returns A promise that resolves when the file is removed.
417
422
  */
418
- unlink: (path: string, options?: ResolveFSOptions) => Promise<void>;
419
- /**
420
- * Removes a directory in the virtual file system (VFS).
421
- *
422
- * @param path - The path to create the directory at.
423
- * @param options - Options for creating the directory.
424
- */
425
- rmdirSync: (path: string, options?: RmDirOptions & ResolveFSOptions) => any;
426
- /**
427
- * Removes a directory in the virtual file system (VFS).
428
- *
429
- * @param path - The path to create the directory at.
430
- * @param options - Options for creating the directory.
431
- * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
432
- */
433
- rmdir: (path: string, options?: RmDirOptions & ResolveFSOptions) => Promise<void>;
434
- /**
435
- * Removes a file or directory in the virtual file system (VFS).
436
- *
437
- * @param path - The path to the file or directory to remove.
438
- * @param options - Options for removing the file or directory.
439
- * @returns A promise that resolves when the file or directory is removed.
440
- */
441
- rm: (path: string, options?: RmOptions & ResolveFSOptions) => Promise<void>;
442
- /**
443
- * Synchronously removes a file or directory in the virtual file system (VFS).
444
- *
445
- * @param path - The path to the file or directory to remove.
446
- * @param options - Options for removing the file or directory.
447
- */
448
- rmSync: (path: string, options?: RmOptions & ResolveFSOptions) => void;
449
- /**
450
- * Creates a directory in the virtual file system (VFS).
451
- *
452
- * @param path - The path to create the directory at.
453
- * @param options - Options for creating the directory.
454
- * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
455
- */
456
- mkdirSync: (path: string, options?: MakeDirectoryOptions) => string | undefined;
457
- /**
458
- * Creates a directory in the virtual file system (VFS).
459
- *
460
- * @param path - The path to create the directory at.
461
- * @param options - Options for creating the directory.
462
- * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
463
- */
464
- mkdir: (path: string, options?: MakeDirectoryOptions) => Promise<string | undefined>;
423
+ remove: (path: string) => Promise<void>;
465
424
  /**
466
425
  * Reads a file from the virtual file system (VFS).
467
426
  *
468
- * @param pathOrId - The path or id of the file.
427
+ * @param path - The path or id of the file.
469
428
  * @returns The contents of the file if it exists, otherwise undefined.
470
429
  */
471
- readFile: (pathOrId: string) => Promise<string | undefined>;
430
+ read: (path: string) => Promise<string | undefined>;
472
431
  /**
473
432
  * Reads a file from the virtual file system (VFS).
474
433
  *
475
- * @param pathOrId - The path or id of the file.
434
+ * @param path - The path or id of the file.
476
435
  */
477
- readFileSync: (pathOrId: string) => string | undefined;
436
+ readSync: (path: string) => string | undefined;
478
437
  /**
479
438
  * Writes a file to the virtual file system (VFS).
480
439
  *
481
440
  * @param path - The path to the file.
482
441
  * @param data - The contents of the file.
483
- * @param options - Optional parameters for writing the file.
442
+ * @param options - Options for writing the file.
484
443
  * @returns A promise that resolves when the file is written.
485
444
  */
486
- writeFile: (path: string, data?: WriteFileData, options?: WriteFileOptions) => Promise<void>;
445
+ write: (path: string, data: string, options?: WriteOptions) => Promise<void>;
487
446
  /**
488
447
  * Writes a file to the virtual file system (VFS).
489
448
  *
490
449
  * @param path - The path to the file.
491
450
  * @param data - The contents of the file.
492
- * @param options - Optional parameters for writing the file.
451
+ * @param options - Options for writing the file.
493
452
  */
494
- writeFileSync: (path: string, data?: WriteFileData, options?: WriteFileOptions) => void;
453
+ writeSync: (path: string, data: string, options?: WriteOptions) => void;
495
454
  /**
496
455
  * Moves a file from one path to another in the virtual file system (VFS).
497
456
  *
@@ -534,13 +493,6 @@ interface VirtualFileSystemInterface {
534
493
  * @returns An array of file paths matching the provided pattern(s)
535
494
  */
536
495
  globSync: (pattern: string | string[]) => string[];
537
- /**
538
- * Resolves a path or id to a file path in the virtual file system.
539
- *
540
- * @param pathOrId - The path or id of the file to resolve.
541
- * @returns The resolved path of the file if it exists, otherwise false.
542
- */
543
- realpathSync: (pathOrId: string) => string;
544
496
  /**
545
497
  * A helper function to resolve modules using the Jiti resolver
546
498
  *
@@ -690,13 +642,16 @@ interface OutputConfig {
690
642
  *
691
643
  * @defaultValue "\{projectRoot\}/dist"
692
644
  */
693
- distPath?: string;
645
+ buildPath?: string;
694
646
  /**
695
- * The format of the output files
647
+ * The folder where the generated runtime artifacts will be located
696
648
  *
697
- * @defaultValue "virtual"
649
+ * @remarks
650
+ * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
651
+ *
652
+ * @defaultValue "\{projectRoot\}/.powerlines"
698
653
  */
699
- mode?: OutputModeType;
654
+ artifactsPath?: string;
700
655
  /**
701
656
  * The path of the generated runtime declaration file relative to the workspace root.
702
657
  *
@@ -712,15 +667,6 @@ interface OutputConfig {
712
667
  * @defaultValue "powerlines"
713
668
  */
714
669
  builtinPrefix?: string;
715
- /**
716
- * The folder where the generated runtime artifacts will be located
717
- *
718
- * @remarks
719
- * This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
720
- *
721
- * @defaultValue "\{projectRoot\}/.powerlines"
722
- */
723
- artifactsFolder?: string;
724
670
  /**
725
671
  * The module format of the output files
726
672
  *
@@ -737,42 +683,21 @@ interface OutputConfig {
737
683
  * 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.
738
684
  */
739
685
  assets?: Array<string | AssetGlob>;
740
- }
741
- interface BaseConfig {
742
- /**
743
- * The name of the project
744
- */
745
- name?: string;
746
- /**
747
- * The project display title
748
- *
749
- * @remarks
750
- * This option is used in documentation generation and other places where a human-readable title is needed.
751
- */
752
- title?: string;
753
686
  /**
754
- * A description of the project
687
+ * A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
755
688
  *
756
689
  * @remarks
757
- * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
758
- */
759
- description?: string;
760
- /**
761
- * The log level to use for the Powerlines processes.
690
+ * If a string preset is provided, it must be one of the following values:
691
+ * - `"virtual"`: Uses the local file system for storage.
692
+ * - `"fs"`: Uses an in-memory virtual file system for storage.
762
693
  *
763
- * @defaultValue "info"
764
- */
765
- logLevel?: LogLevelLabel | null;
766
- /**
767
- * A custom logger function to use for logging messages
768
- */
769
- customLogger?: LogFn;
770
- /**
771
- * 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.
694
+ * If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
772
695
  *
773
- * @defaultValue "production"
696
+ * @defaultValue "virtual"
774
697
  */
775
- mode?: "development" | "test" | "production";
698
+ storage?: StoragePort | StoragePreset;
699
+ }
700
+ interface BaseConfig {
776
701
  /**
777
702
  * The entry point(s) for the application
778
703
  */
@@ -856,6 +781,40 @@ interface EnvironmentConfig extends BaseConfig {
856
781
  consumer?: "client" | "server";
857
782
  }
858
783
  interface CommonUserConfig extends BaseConfig {
784
+ /**
785
+ * The name of the project
786
+ */
787
+ name?: string;
788
+ /**
789
+ * The project display title
790
+ *
791
+ * @remarks
792
+ * This option is used in documentation generation and other places where a human-readable title is needed.
793
+ */
794
+ title?: string;
795
+ /**
796
+ * A description of the project
797
+ *
798
+ * @remarks
799
+ * If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
800
+ */
801
+ description?: string;
802
+ /**
803
+ * The log level to use for the Powerlines processes.
804
+ *
805
+ * @defaultValue "info"
806
+ */
807
+ logLevel?: LogLevelLabel | null;
808
+ /**
809
+ * A custom logger function to use for logging messages
810
+ */
811
+ customLogger?: LogFn;
812
+ /**
813
+ * 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.
814
+ *
815
+ * @defaultValue "production"
816
+ */
817
+ mode?: "development" | "test" | "production";
859
818
  /**
860
819
  * The type of project being built
861
820
  *
@@ -906,7 +865,7 @@ interface CommonUserConfig extends BaseConfig {
906
865
  * A string identifier that allows a child framework or tool to identify itself when using Powerlines.
907
866
  *
908
867
  * @remarks
909
- * 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.
868
+ * 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.
910
869
  *
911
870
  * @defaultValue "powerlines"
912
871
  */
@@ -955,7 +914,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
955
914
  */
956
915
  output?: string;
957
916
  }
958
- type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
917
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
959
918
  /**
960
919
  * The name of the environment
961
920
  */
@@ -966,9 +925,9 @@ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "
966
925
  preview?: ResolvedPreviewOptions;
967
926
  };
968
927
  type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
969
- type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
928
+ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
970
929
  assets: ResolvedAssetGlob[];
971
- }>;
930
+ }> & Pick<OutputConfig, "storage">;
972
931
  /**
973
932
  * The resolved options for the Powerlines project configuration.
974
933
  */
@@ -1237,17 +1196,15 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
1237
1196
  * @param code - The source code of the builtin file
1238
1197
  * @param id - The unique identifier of the builtin file
1239
1198
  * @param path - An optional path to write the builtin file to
1240
- * @param options - Options for writing the file
1241
1199
  */
1242
- emitBuiltin: (code: string, id: string, path?: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1200
+ emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
1243
1201
  /**
1244
1202
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
1245
1203
  *
1246
1204
  * @param code - The source code of the entry file
1247
1205
  * @param path - An optional path to write the entry file to
1248
- * @param options - Options for writing the file
1249
1206
  */
1250
- emitEntry: (code: string, path: string, options?: PowerlinesWriteFileOptions) => Promise<void>;
1207
+ emitEntry: (code: string, path: string) => Promise<void>;
1251
1208
  /**
1252
1209
  * A function to update the context fields using a new user configuration options
1253
1210
  */