@powerlines/plugin-crypto 0.10.11 → 0.10.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/components/crypto.d.cts +1 -2
- package/dist/components/crypto.d.ts +1 -2
- package/dist/components/index.d.cts +1 -2
- package/dist/components/index.d.ts +1 -2
- package/dist/{index-CKLwxWIp.d.cts → index-BnXQUy7e.d.cts} +186 -229
- package/dist/{index-CKLwxWIp.d.ts → index-BnXQUy7e.d.ts} +186 -229
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.ts +1 -2
- package/dist/types/plugin.d.cts +1 -2
- package/dist/types/plugin.d.ts +1 -2
- package/package.json +6 -6
|
@@ -18,7 +18,6 @@ import { Range } from 'semver';
|
|
|
18
18
|
import { Project } from 'ts-morph';
|
|
19
19
|
import { UnpluginContext, UnpluginMessage, ExternalIdResult, UnpluginBuildContext, TransformResult as TransformResult$1, HookFilter, UnpluginOptions } from 'unplugin';
|
|
20
20
|
import { ResolveOptions as ResolveOptions$1 } from '@stryke/fs/resolve';
|
|
21
|
-
import { StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
22
21
|
import { TsConfigJson, CompilerOptions } from '@stryke/types/tsconfig';
|
|
23
22
|
import ts from 'typescript';
|
|
24
23
|
import { ArrayValues } from '@stryke/types/array';
|
|
@@ -178,9 +177,107 @@ type BabelTransformPluginOptions<TContext extends Context = Context, TOptions ex
|
|
|
178
177
|
BabelTransformPluginFilter
|
|
179
178
|
];
|
|
180
179
|
|
|
181
|
-
declare
|
|
182
|
-
|
|
183
|
-
|
|
180
|
+
declare enum StoragePreset {
|
|
181
|
+
VIRTUAL = "virtual",
|
|
182
|
+
FS = "fs"
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Interface defining the methods and properties for a storage adapter.
|
|
186
|
+
*/
|
|
187
|
+
interface StorageAdapter {
|
|
188
|
+
/**
|
|
189
|
+
* A name identifying the storage adapter type.
|
|
190
|
+
*/
|
|
191
|
+
name: string;
|
|
192
|
+
/**
|
|
193
|
+
* Checks if a key exists in the storage.
|
|
194
|
+
*
|
|
195
|
+
* @param key - The key to check for existence.
|
|
196
|
+
* @returns A promise that resolves to `true` if the key exists, otherwise `false`.
|
|
197
|
+
*/
|
|
198
|
+
exists: (key: string) => Promise<boolean>;
|
|
199
|
+
/**
|
|
200
|
+
* Synchronously checks if a key exists in the storage.
|
|
201
|
+
*
|
|
202
|
+
* @param key - The key to check for existence.
|
|
203
|
+
* @returns Returns `true` if the key exists, otherwise `false`.
|
|
204
|
+
*/
|
|
205
|
+
existsSync: (key: string) => boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Read a value associated with a key from the storage.
|
|
208
|
+
*
|
|
209
|
+
* @param key - The key to read the value for.
|
|
210
|
+
* @returns A promise that resolves to the value if found, otherwise `null`.
|
|
211
|
+
*/
|
|
212
|
+
get: (key: string) => Promise<string | null>;
|
|
213
|
+
/**
|
|
214
|
+
* Synchronously reads the value associated with a key from the storage.
|
|
215
|
+
*
|
|
216
|
+
* @param key - The key to read the value for.
|
|
217
|
+
* @returns The value if found, otherwise `null`.
|
|
218
|
+
*/
|
|
219
|
+
getSync: (key: string) => string | null;
|
|
220
|
+
/**
|
|
221
|
+
* Writes a value to the storage for the given key.
|
|
222
|
+
*
|
|
223
|
+
* @param key - The key to associate the value with.
|
|
224
|
+
* @param value - The value to store.
|
|
225
|
+
*/
|
|
226
|
+
set: (key: string, value: string) => Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Synchronously writes a value to the storage for the given key.
|
|
229
|
+
*
|
|
230
|
+
* @param key - The key to associate the value with.
|
|
231
|
+
* @param value - The value to store.
|
|
232
|
+
*/
|
|
233
|
+
setSync: (key: string, value: string) => void;
|
|
234
|
+
/**
|
|
235
|
+
* Removes a value from the storage.
|
|
236
|
+
*
|
|
237
|
+
* @param key - The key whose value should be removed.
|
|
238
|
+
*/
|
|
239
|
+
remove: (key: string) => Promise<void>;
|
|
240
|
+
/**
|
|
241
|
+
* Synchronously removes a value from the storage.
|
|
242
|
+
*
|
|
243
|
+
* @param key - The key whose value should be removed.
|
|
244
|
+
*/
|
|
245
|
+
removeSync: (key: string) => void;
|
|
246
|
+
/**
|
|
247
|
+
* Remove all entries from the storage that match the provided base path.
|
|
248
|
+
*
|
|
249
|
+
* @param base - The base path or prefix to clear entries from.
|
|
250
|
+
*/
|
|
251
|
+
clear: (base?: string) => Promise<void>;
|
|
252
|
+
/**
|
|
253
|
+
* Synchronously remove all entries from the storage that match the provided base path.
|
|
254
|
+
*
|
|
255
|
+
* @param base - The base path or prefix to clear entries from.
|
|
256
|
+
*/
|
|
257
|
+
clearSync: (base?: string) => void;
|
|
258
|
+
/**
|
|
259
|
+
* Lists all keys under the provided base path.
|
|
260
|
+
*
|
|
261
|
+
* @param base - The base path or prefix to list keys from.
|
|
262
|
+
* @returns A promise resolving to the list of keys.
|
|
263
|
+
*/
|
|
264
|
+
list: (base?: string) => Promise<string[]>;
|
|
265
|
+
/**
|
|
266
|
+
* Synchronously lists all keys under the provided base path.
|
|
267
|
+
*
|
|
268
|
+
* @param base - The base path or prefix to list keys from.
|
|
269
|
+
* @returns The list of keys.
|
|
270
|
+
*/
|
|
271
|
+
listSync: (base?: string) => string[];
|
|
272
|
+
/**
|
|
273
|
+
* Releases any resources held by the storage adapter.
|
|
274
|
+
*/
|
|
275
|
+
dispose: () => MaybePromise<void>;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* A mapping of file paths to storage adapter names and their corresponding {@link StorageAdapter} instances.
|
|
279
|
+
*/
|
|
280
|
+
type StoragePort = Record<string, StorageAdapter>;
|
|
184
281
|
interface VirtualFileMetadata {
|
|
185
282
|
/**
|
|
186
283
|
* The identifier for the file data.
|
|
@@ -200,10 +297,6 @@ interface VirtualFileMetadata {
|
|
|
200
297
|
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
201
298
|
*/
|
|
202
299
|
type: string;
|
|
203
|
-
/**
|
|
204
|
-
* The output mode of the file.
|
|
205
|
-
*/
|
|
206
|
-
mode: string;
|
|
207
300
|
/**
|
|
208
301
|
* Additional metadata associated with the file.
|
|
209
302
|
*/
|
|
@@ -225,16 +318,9 @@ interface VirtualFileData {
|
|
|
225
318
|
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
226
319
|
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
227
320
|
* - `entry`: Indicates that the file is an entry point for execution.
|
|
228
|
-
* - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
|
|
229
|
-
* - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
|
|
230
|
-
* - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
|
|
231
321
|
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
232
322
|
*/
|
|
233
323
|
type?: string;
|
|
234
|
-
/**
|
|
235
|
-
* The output mode of the file.
|
|
236
|
-
*/
|
|
237
|
-
mode?: string;
|
|
238
324
|
/**
|
|
239
325
|
* Additional metadata associated with the file.
|
|
240
326
|
*/
|
|
@@ -250,21 +336,18 @@ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
|
|
|
250
336
|
*/
|
|
251
337
|
timestamp: number;
|
|
252
338
|
}
|
|
253
|
-
interface
|
|
254
|
-
mode?: OutputModeType;
|
|
255
|
-
}
|
|
256
|
-
type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
|
|
257
|
-
interface PowerlinesWriteFileOptions extends ResolveFSOptions {
|
|
339
|
+
interface WriteOptions {
|
|
258
340
|
/**
|
|
259
341
|
* Should the file skip formatting before being written?
|
|
260
342
|
*
|
|
261
343
|
* @defaultValue false
|
|
262
344
|
*/
|
|
263
345
|
skipFormat?: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Additional metadata for the file.
|
|
348
|
+
*/
|
|
349
|
+
meta?: VirtualFileMetadata;
|
|
264
350
|
}
|
|
265
|
-
type NodeWriteFileOptions = WriteFileOptions$1;
|
|
266
|
-
type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
|
|
267
|
-
type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
|
|
268
351
|
interface ResolveOptions extends ResolveOptions$1 {
|
|
269
352
|
/**
|
|
270
353
|
* If true, the module is being resolved as an entry point.
|
|
@@ -288,14 +371,6 @@ interface ResolveOptions extends ResolveOptions$1 {
|
|
|
288
371
|
skipNodeModulesBundle?: boolean;
|
|
289
372
|
}
|
|
290
373
|
interface VirtualFileSystemInterface {
|
|
291
|
-
/**
|
|
292
|
-
* Patches the File System to include the virtual file system (VFS) contents.
|
|
293
|
-
*/
|
|
294
|
-
[__VFS_PATCH__]: () => void;
|
|
295
|
-
/**
|
|
296
|
-
* Reverts the virtual file system (VFS) to its previous state.
|
|
297
|
-
*/
|
|
298
|
-
[__VFS_REVERT__]: () => void;
|
|
299
374
|
/**
|
|
300
375
|
* The underlying file metadata.
|
|
301
376
|
*/
|
|
@@ -308,208 +383,92 @@ interface VirtualFileSystemInterface {
|
|
|
308
383
|
* A map of module ids to their file paths.
|
|
309
384
|
*/
|
|
310
385
|
paths: Readonly<Record<string, string>>;
|
|
311
|
-
/**
|
|
312
|
-
* Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
313
|
-
*
|
|
314
|
-
* @param pathOrId - The path or id to check.
|
|
315
|
-
* @param importer - The importer path, if any.
|
|
316
|
-
* @param options - Optional parameters for resolving the path.
|
|
317
|
-
* @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
318
|
-
*/
|
|
319
|
-
isVirtual: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
|
|
320
|
-
/**
|
|
321
|
-
* Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
322
|
-
*
|
|
323
|
-
* @param pathOrId - The path or id to check.
|
|
324
|
-
* @param importer - The importer path, if any.
|
|
325
|
-
* @param options - Optional parameters for resolving the path.
|
|
326
|
-
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
327
|
-
*/
|
|
328
|
-
isPhysical: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
|
|
329
386
|
/**
|
|
330
387
|
* Checks if a file exists in the virtual file system (VFS).
|
|
331
388
|
*
|
|
332
|
-
* @param path - The path of the file
|
|
389
|
+
* @param path - The path or id of the file.
|
|
333
390
|
* @returns `true` if the file exists, otherwise `false`.
|
|
334
391
|
*/
|
|
335
|
-
|
|
392
|
+
exists: (path: string) => Promise<boolean>;
|
|
336
393
|
/**
|
|
337
|
-
* Checks if a
|
|
394
|
+
* Synchronously Checks if a file exists in the virtual file system (VFS).
|
|
338
395
|
*
|
|
339
|
-
* @param path - The path of the
|
|
340
|
-
* @returns `true` if the
|
|
396
|
+
* @param path - The path or id of the file.
|
|
397
|
+
* @returns `true` if the file exists, otherwise `false`.
|
|
341
398
|
*/
|
|
342
|
-
|
|
399
|
+
existsSync: (path: string) => boolean;
|
|
343
400
|
/**
|
|
344
|
-
* Checks if a file
|
|
401
|
+
* Checks if a file is virtual in the virtual file system (VFS).
|
|
345
402
|
*
|
|
346
|
-
* @param
|
|
347
|
-
* @returns `true` if the file
|
|
403
|
+
* @param path - The path or id of the file.
|
|
404
|
+
* @returns `true` if the file is virtual, otherwise `false`.
|
|
348
405
|
*/
|
|
349
|
-
|
|
406
|
+
isVirtual: (path: string) => boolean;
|
|
350
407
|
/**
|
|
351
408
|
* Gets the metadata of a file in the virtual file system (VFS).
|
|
352
409
|
*
|
|
353
|
-
* @param
|
|
410
|
+
* @param path - The path or id of the file.
|
|
354
411
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
355
412
|
*/
|
|
356
|
-
getMetadata: (
|
|
357
|
-
/**
|
|
358
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
359
|
-
*
|
|
360
|
-
* @param pathOrId - The path or id of the file.
|
|
361
|
-
* @param options - Optional parameters for getting the stats.
|
|
362
|
-
* @returns The stats of the file if it exists, otherwise undefined.
|
|
363
|
-
*/
|
|
364
|
-
lstat: (pathOrId: string, options?: StatSyncOptions & {
|
|
365
|
-
bigint?: false | undefined;
|
|
366
|
-
throwIfNoEntry: false;
|
|
367
|
-
}) => Promise<Stats>;
|
|
368
|
-
/**
|
|
369
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
370
|
-
*
|
|
371
|
-
* @param pathOrId - The path or id of the file.
|
|
372
|
-
* @param options - Optional parameters for getting the stats.
|
|
373
|
-
* @returns The stats of the file if it exists, otherwise undefined.
|
|
374
|
-
*/
|
|
375
|
-
lstatSync: (pathOrId: string, options?: StatSyncOptions & {
|
|
376
|
-
bigint?: false | undefined;
|
|
377
|
-
throwIfNoEntry: false;
|
|
378
|
-
}) => Stats | undefined;
|
|
379
|
-
/**
|
|
380
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
381
|
-
*
|
|
382
|
-
* @param pathOrId - The path or id of the file.
|
|
383
|
-
* @returns The stats of the file if it exists, otherwise false.
|
|
384
|
-
*/
|
|
385
|
-
stat: (pathOrId: string, options?: StatSyncOptions & {
|
|
386
|
-
bigint?: false | undefined;
|
|
387
|
-
throwIfNoEntry: false;
|
|
388
|
-
}) => Promise<Stats>;
|
|
389
|
-
/**
|
|
390
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
391
|
-
*
|
|
392
|
-
* @param pathOrId - The path or id of the file.
|
|
393
|
-
* @returns The stats of the file if it exists, otherwise false.
|
|
394
|
-
*/
|
|
395
|
-
statSync: (pathOrId: string, options?: StatSyncOptions & {
|
|
396
|
-
bigint?: false | undefined;
|
|
397
|
-
throwIfNoEntry: false;
|
|
398
|
-
}) => Stats | undefined;
|
|
413
|
+
getMetadata: (path: string) => VirtualFileMetadata | undefined;
|
|
399
414
|
/**
|
|
400
415
|
* Lists files in a given path.
|
|
401
416
|
*
|
|
402
417
|
* @param path - The path to list files from.
|
|
403
|
-
* @param options - Options for listing files, such as encoding and recursion.
|
|
404
418
|
* @returns An array of file names in the specified path.
|
|
405
419
|
*/
|
|
406
|
-
|
|
407
|
-
encoding: BufferEncoding | null;
|
|
408
|
-
withFileTypes?: false | undefined;
|
|
409
|
-
recursive?: boolean | undefined;
|
|
410
|
-
} | BufferEncoding) => string[];
|
|
420
|
+
listSync: (path: string) => string[];
|
|
411
421
|
/**
|
|
412
422
|
* Lists files in a given path.
|
|
413
423
|
*
|
|
414
424
|
* @param path - The path to list files from.
|
|
415
|
-
* @param options - Options for listing files, such as encoding and recursion.
|
|
416
425
|
* @returns An array of file names in the specified path.
|
|
417
426
|
*/
|
|
418
|
-
|
|
419
|
-
encoding: BufferEncoding | null;
|
|
420
|
-
withFileTypes?: false | undefined;
|
|
421
|
-
recursive?: boolean | undefined;
|
|
422
|
-
} | BufferEncoding) => Promise<string[]>;
|
|
427
|
+
list: (path: string) => Promise<string[]>;
|
|
423
428
|
/**
|
|
424
429
|
* Removes a file or symbolic link in the virtual file system (VFS).
|
|
425
430
|
*
|
|
426
431
|
* @param path - The path to the file to remove.
|
|
427
432
|
* @returns A promise that resolves when the file is removed.
|
|
428
433
|
*/
|
|
429
|
-
|
|
434
|
+
removeSync: (path: string) => void;
|
|
430
435
|
/**
|
|
431
436
|
* Asynchronously removes a file or symbolic link in the virtual file system (VFS).
|
|
432
437
|
*
|
|
433
438
|
* @param path - The path to the file to remove.
|
|
434
439
|
* @returns A promise that resolves when the file is removed.
|
|
435
440
|
*/
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Removes a directory in the virtual file system (VFS).
|
|
439
|
-
*
|
|
440
|
-
* @param path - The path to create the directory at.
|
|
441
|
-
* @param options - Options for creating the directory.
|
|
442
|
-
*/
|
|
443
|
-
rmdirSync: (path: string, options?: RmDirOptions & ResolveFSOptions) => any;
|
|
444
|
-
/**
|
|
445
|
-
* Removes a directory in the virtual file system (VFS).
|
|
446
|
-
*
|
|
447
|
-
* @param path - The path to create the directory at.
|
|
448
|
-
* @param options - Options for creating the directory.
|
|
449
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
450
|
-
*/
|
|
451
|
-
rmdir: (path: string, options?: RmDirOptions & ResolveFSOptions) => Promise<void>;
|
|
452
|
-
/**
|
|
453
|
-
* Removes a file or directory in the virtual file system (VFS).
|
|
454
|
-
*
|
|
455
|
-
* @param path - The path to the file or directory to remove.
|
|
456
|
-
* @param options - Options for removing the file or directory.
|
|
457
|
-
* @returns A promise that resolves when the file or directory is removed.
|
|
458
|
-
*/
|
|
459
|
-
rm: (path: string, options?: RmOptions & ResolveFSOptions) => Promise<void>;
|
|
460
|
-
/**
|
|
461
|
-
* Synchronously removes a file or directory in the virtual file system (VFS).
|
|
462
|
-
*
|
|
463
|
-
* @param path - The path to the file or directory to remove.
|
|
464
|
-
* @param options - Options for removing the file or directory.
|
|
465
|
-
*/
|
|
466
|
-
rmSync: (path: string, options?: RmOptions & ResolveFSOptions) => void;
|
|
467
|
-
/**
|
|
468
|
-
* Creates a directory in the virtual file system (VFS).
|
|
469
|
-
*
|
|
470
|
-
* @param path - The path to create the directory at.
|
|
471
|
-
* @param options - Options for creating the directory.
|
|
472
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
473
|
-
*/
|
|
474
|
-
mkdirSync: (path: string, options?: MakeDirectoryOptions) => string | undefined;
|
|
475
|
-
/**
|
|
476
|
-
* Creates a directory in the virtual file system (VFS).
|
|
477
|
-
*
|
|
478
|
-
* @param path - The path to create the directory at.
|
|
479
|
-
* @param options - Options for creating the directory.
|
|
480
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
481
|
-
*/
|
|
482
|
-
mkdir: (path: string, options?: MakeDirectoryOptions) => Promise<string | undefined>;
|
|
441
|
+
remove: (path: string) => Promise<void>;
|
|
483
442
|
/**
|
|
484
443
|
* Reads a file from the virtual file system (VFS).
|
|
485
444
|
*
|
|
486
|
-
* @param
|
|
445
|
+
* @param path - The path or id of the file.
|
|
487
446
|
* @returns The contents of the file if it exists, otherwise undefined.
|
|
488
447
|
*/
|
|
489
|
-
|
|
448
|
+
read: (path: string) => Promise<string | undefined>;
|
|
490
449
|
/**
|
|
491
450
|
* Reads a file from the virtual file system (VFS).
|
|
492
451
|
*
|
|
493
|
-
* @param
|
|
452
|
+
* @param path - The path or id of the file.
|
|
494
453
|
*/
|
|
495
|
-
|
|
454
|
+
readSync: (path: string) => string | undefined;
|
|
496
455
|
/**
|
|
497
456
|
* Writes a file to the virtual file system (VFS).
|
|
498
457
|
*
|
|
499
458
|
* @param path - The path to the file.
|
|
500
459
|
* @param data - The contents of the file.
|
|
501
|
-
* @param options -
|
|
460
|
+
* @param options - Options for writing the file.
|
|
502
461
|
* @returns A promise that resolves when the file is written.
|
|
503
462
|
*/
|
|
504
|
-
|
|
463
|
+
write: (path: string, data: string, options?: WriteOptions) => Promise<void>;
|
|
505
464
|
/**
|
|
506
465
|
* Writes a file to the virtual file system (VFS).
|
|
507
466
|
*
|
|
508
467
|
* @param path - The path to the file.
|
|
509
468
|
* @param data - The contents of the file.
|
|
510
|
-
* @param options -
|
|
469
|
+
* @param options - Options for writing the file.
|
|
511
470
|
*/
|
|
512
|
-
|
|
471
|
+
writeSync: (path: string, data: string, options?: WriteOptions) => void;
|
|
513
472
|
/**
|
|
514
473
|
* Moves a file from one path to another in the virtual file system (VFS).
|
|
515
474
|
*
|
|
@@ -552,13 +511,6 @@ interface VirtualFileSystemInterface {
|
|
|
552
511
|
* @returns An array of file paths matching the provided pattern(s)
|
|
553
512
|
*/
|
|
554
513
|
globSync: (pattern: string | string[]) => string[];
|
|
555
|
-
/**
|
|
556
|
-
* Resolves a path or id to a file path in the virtual file system.
|
|
557
|
-
*
|
|
558
|
-
* @param pathOrId - The path or id of the file to resolve.
|
|
559
|
-
* @returns The resolved path of the file if it exists, otherwise false.
|
|
560
|
-
*/
|
|
561
|
-
realpathSync: (pathOrId: string) => string;
|
|
562
514
|
/**
|
|
563
515
|
* A helper function to resolve modules using the Jiti resolver
|
|
564
516
|
*
|
|
@@ -718,13 +670,16 @@ interface OutputConfig {
|
|
|
718
670
|
*
|
|
719
671
|
* @defaultValue "\{projectRoot\}/dist"
|
|
720
672
|
*/
|
|
721
|
-
|
|
673
|
+
buildPath?: string;
|
|
722
674
|
/**
|
|
723
|
-
* The
|
|
675
|
+
* The folder where the generated runtime artifacts will be located
|
|
724
676
|
*
|
|
725
|
-
* @
|
|
677
|
+
* @remarks
|
|
678
|
+
* This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
|
|
679
|
+
*
|
|
680
|
+
* @defaultValue "\{projectRoot\}/.powerlines"
|
|
726
681
|
*/
|
|
727
|
-
|
|
682
|
+
artifactsPath?: string;
|
|
728
683
|
/**
|
|
729
684
|
* The path of the generated runtime declaration file relative to the workspace root.
|
|
730
685
|
*
|
|
@@ -740,15 +695,6 @@ interface OutputConfig {
|
|
|
740
695
|
* @defaultValue "powerlines"
|
|
741
696
|
*/
|
|
742
697
|
builtinPrefix?: string;
|
|
743
|
-
/**
|
|
744
|
-
* The folder where the generated runtime artifacts will be located
|
|
745
|
-
*
|
|
746
|
-
* @remarks
|
|
747
|
-
* This folder will contain all runtime artifacts and builtins generated during the "prepare" phase.
|
|
748
|
-
*
|
|
749
|
-
* @defaultValue "\{projectRoot\}/.powerlines"
|
|
750
|
-
*/
|
|
751
|
-
artifactsFolder?: string;
|
|
752
698
|
/**
|
|
753
699
|
* The module format of the output files
|
|
754
700
|
*
|
|
@@ -765,42 +711,21 @@ interface OutputConfig {
|
|
|
765
711
|
* 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.
|
|
766
712
|
*/
|
|
767
713
|
assets?: Array<string | AssetGlob>;
|
|
768
|
-
}
|
|
769
|
-
interface BaseConfig {
|
|
770
|
-
/**
|
|
771
|
-
* The name of the project
|
|
772
|
-
*/
|
|
773
|
-
name?: string;
|
|
774
|
-
/**
|
|
775
|
-
* The project display title
|
|
776
|
-
*
|
|
777
|
-
* @remarks
|
|
778
|
-
* This option is used in documentation generation and other places where a human-readable title is needed.
|
|
779
|
-
*/
|
|
780
|
-
title?: string;
|
|
781
714
|
/**
|
|
782
|
-
* A
|
|
715
|
+
* A string preset or a custom {@link StoragePort} to provide fine-grained control over generated/output file storage.
|
|
783
716
|
*
|
|
784
717
|
* @remarks
|
|
785
|
-
* If
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* The log level to use for the Powerlines processes.
|
|
718
|
+
* If a string preset is provided, it must be one of the following values:
|
|
719
|
+
* - `"virtual"`: Uses the local file system for storage.
|
|
720
|
+
* - `"fs"`: Uses an in-memory virtual file system for storage.
|
|
790
721
|
*
|
|
791
|
-
* @
|
|
792
|
-
*/
|
|
793
|
-
logLevel?: LogLevelLabel | null;
|
|
794
|
-
/**
|
|
795
|
-
* A custom logger function to use for logging messages
|
|
796
|
-
*/
|
|
797
|
-
customLogger?: LogFn;
|
|
798
|
-
/**
|
|
799
|
-
* 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.
|
|
722
|
+
* If a custom {@link StoragePort} is provided, it will be used for all file storage operations during the build process.
|
|
800
723
|
*
|
|
801
|
-
* @defaultValue "
|
|
724
|
+
* @defaultValue "virtual"
|
|
802
725
|
*/
|
|
803
|
-
|
|
726
|
+
storage?: StoragePort | StoragePreset;
|
|
727
|
+
}
|
|
728
|
+
interface BaseConfig {
|
|
804
729
|
/**
|
|
805
730
|
* The entry point(s) for the application
|
|
806
731
|
*/
|
|
@@ -884,6 +809,40 @@ interface EnvironmentConfig extends BaseConfig {
|
|
|
884
809
|
consumer?: "client" | "server";
|
|
885
810
|
}
|
|
886
811
|
interface CommonUserConfig extends BaseConfig {
|
|
812
|
+
/**
|
|
813
|
+
* The name of the project
|
|
814
|
+
*/
|
|
815
|
+
name?: string;
|
|
816
|
+
/**
|
|
817
|
+
* The project display title
|
|
818
|
+
*
|
|
819
|
+
* @remarks
|
|
820
|
+
* This option is used in documentation generation and other places where a human-readable title is needed.
|
|
821
|
+
*/
|
|
822
|
+
title?: string;
|
|
823
|
+
/**
|
|
824
|
+
* A description of the project
|
|
825
|
+
*
|
|
826
|
+
* @remarks
|
|
827
|
+
* If this option is not provided, the build process will try to use the \`description\` value from the `\package.json\` file.
|
|
828
|
+
*/
|
|
829
|
+
description?: string;
|
|
830
|
+
/**
|
|
831
|
+
* The log level to use for the Powerlines processes.
|
|
832
|
+
*
|
|
833
|
+
* @defaultValue "info"
|
|
834
|
+
*/
|
|
835
|
+
logLevel?: LogLevelLabel | null;
|
|
836
|
+
/**
|
|
837
|
+
* A custom logger function to use for logging messages
|
|
838
|
+
*/
|
|
839
|
+
customLogger?: LogFn;
|
|
840
|
+
/**
|
|
841
|
+
* 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.
|
|
842
|
+
*
|
|
843
|
+
* @defaultValue "production"
|
|
844
|
+
*/
|
|
845
|
+
mode?: "development" | "test" | "production";
|
|
887
846
|
/**
|
|
888
847
|
* The type of project being built
|
|
889
848
|
*
|
|
@@ -934,7 +893,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
934
893
|
* A string identifier that allows a child framework or tool to identify itself when using Powerlines.
|
|
935
894
|
*
|
|
936
895
|
* @remarks
|
|
937
|
-
* If no values are provided for {@link OutputConfig.dts | output.dts}, {@link OutputConfig.builtinPrefix | output.builtinPrefix}, or {@link OutputConfig.
|
|
896
|
+
* 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.
|
|
938
897
|
*
|
|
939
898
|
* @defaultValue "powerlines"
|
|
940
899
|
*/
|
|
@@ -983,7 +942,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
|
|
|
983
942
|
output?: string;
|
|
984
943
|
}
|
|
985
944
|
type BabelResolvedConfig = Omit<BabelUserConfig, "plugins" | "presets"> & Required<Pick<BabelUserConfig, "plugins" | "presets">>;
|
|
986
|
-
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "
|
|
945
|
+
type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "ssr">> & {
|
|
987
946
|
/**
|
|
988
947
|
* The name of the environment
|
|
989
948
|
*/
|
|
@@ -994,9 +953,9 @@ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "
|
|
|
994
953
|
preview?: ResolvedPreviewOptions;
|
|
995
954
|
};
|
|
996
955
|
type ResolvedAssetGlob = AssetGlob & Required<Pick<AssetGlob, "input">>;
|
|
997
|
-
type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
|
|
956
|
+
type OutputResolvedConfig = Required<Omit<OutputConfig, "assets" | "storage"> & {
|
|
998
957
|
assets: ResolvedAssetGlob[];
|
|
999
|
-
}>;
|
|
958
|
+
}> & Pick<OutputConfig, "storage">;
|
|
1000
959
|
/**
|
|
1001
960
|
* The resolved options for the Powerlines project configuration.
|
|
1002
961
|
*/
|
|
@@ -1275,17 +1234,15 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1275
1234
|
* @param code - The source code of the builtin file
|
|
1276
1235
|
* @param id - The unique identifier of the builtin file
|
|
1277
1236
|
* @param path - An optional path to write the builtin file to
|
|
1278
|
-
* @param options - Options for writing the file
|
|
1279
1237
|
*/
|
|
1280
|
-
emitBuiltin: (code: string, id: string, path?: string
|
|
1238
|
+
emitBuiltin: (code: string, id: string, path?: string) => Promise<void>;
|
|
1281
1239
|
/**
|
|
1282
1240
|
* Resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
1283
1241
|
*
|
|
1284
1242
|
* @param code - The source code of the entry file
|
|
1285
1243
|
* @param path - An optional path to write the entry file to
|
|
1286
|
-
* @param options - Options for writing the file
|
|
1287
1244
|
*/
|
|
1288
|
-
emitEntry: (code: string, path: string
|
|
1245
|
+
emitEntry: (code: string, path: string) => Promise<void>;
|
|
1289
1246
|
/**
|
|
1290
1247
|
* A function to update the context fields using a new user configuration options
|
|
1291
1248
|
*/
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CryptoPluginOptions, P as Plugin, a as CryptoPluginContext } from './index-
|
|
2
|
-
export { c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from './index-
|
|
1
|
+
import { C as CryptoPluginOptions, P as Plugin, a as CryptoPluginContext } from './index-BnXQUy7e.cjs';
|
|
2
|
+
export { c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from './index-BnXQUy7e.cjs';
|
|
3
3
|
export { cryptoModule } from './components/crypto.cjs';
|
|
4
4
|
import '@alloy-js/core/jsx-runtime';
|
|
5
5
|
import '@deepkit/type';
|
|
@@ -21,7 +21,6 @@ import 'semver';
|
|
|
21
21
|
import 'ts-morph';
|
|
22
22
|
import 'unplugin';
|
|
23
23
|
import '@stryke/fs/resolve';
|
|
24
|
-
import 'node:fs';
|
|
25
24
|
import '@stryke/types/tsconfig';
|
|
26
25
|
import 'typescript';
|
|
27
26
|
import '@stryke/types/array';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CryptoPluginOptions, P as Plugin, a as CryptoPluginContext } from './index-
|
|
2
|
-
export { c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from './index-
|
|
1
|
+
import { C as CryptoPluginOptions, P as Plugin, a as CryptoPluginContext } from './index-BnXQUy7e.js';
|
|
2
|
+
export { c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from './index-BnXQUy7e.js';
|
|
3
3
|
export { cryptoModule } from './components/crypto.js';
|
|
4
4
|
import '@alloy-js/core/jsx-runtime';
|
|
5
5
|
import '@deepkit/type';
|
|
@@ -21,7 +21,6 @@ import 'semver';
|
|
|
21
21
|
import 'ts-morph';
|
|
22
22
|
import 'unplugin';
|
|
23
23
|
import '@stryke/fs/resolve';
|
|
24
|
-
import 'node:fs';
|
|
25
24
|
import '@stryke/types/tsconfig';
|
|
26
25
|
import 'typescript';
|
|
27
26
|
import '@stryke/types/array';
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as CryptoPluginContext, C as CryptoPluginOptions, c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from '../index-
|
|
1
|
+
export { a as CryptoPluginContext, C as CryptoPluginOptions, c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from '../index-BnXQUy7e.cjs';
|
|
2
2
|
import '@alloy-js/core/jsx-runtime';
|
|
3
3
|
import '@deepkit/type';
|
|
4
4
|
import '@stryke/capnp';
|
|
@@ -19,7 +19,6 @@ import 'semver';
|
|
|
19
19
|
import 'ts-morph';
|
|
20
20
|
import 'unplugin';
|
|
21
21
|
import '@stryke/fs/resolve';
|
|
22
|
-
import 'node:fs';
|
|
23
22
|
import '@stryke/types/tsconfig';
|
|
24
23
|
import 'typescript';
|
|
25
24
|
import '@stryke/types/array';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as CryptoPluginContext, C as CryptoPluginOptions, c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from '../index-
|
|
1
|
+
export { a as CryptoPluginContext, C as CryptoPluginOptions, c as CryptoPluginResolvedConfig, b as CryptoPluginUserConfig, f as __ΩCryptoPluginContext, _ as __ΩCryptoPluginOptions, e as __ΩCryptoPluginResolvedConfig, d as __ΩCryptoPluginUserConfig } from '../index-BnXQUy7e.js';
|
|
2
2
|
import '@alloy-js/core/jsx-runtime';
|
|
3
3
|
import '@deepkit/type';
|
|
4
4
|
import '@stryke/capnp';
|
|
@@ -19,7 +19,6 @@ import 'semver';
|
|
|
19
19
|
import 'ts-morph';
|
|
20
20
|
import 'unplugin';
|
|
21
21
|
import '@stryke/fs/resolve';
|
|
22
|
-
import 'node:fs';
|
|
23
22
|
import '@stryke/types/tsconfig';
|
|
24
23
|
import 'typescript';
|
|
25
24
|
import '@stryke/types/array';
|