@powerlines/plugin-env 0.13.4 → 0.13.6

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.
Files changed (63) hide show
  1. package/dist/babel/index.cjs +1 -0
  2. package/dist/babel/index.d.cts +30 -0
  3. package/dist/babel/index.d.ts +30 -0
  4. package/dist/babel/index.js +1 -0
  5. package/dist/babel/plugin.cjs +19 -0
  6. package/dist/babel/plugin.d.cts +33 -0
  7. package/dist/babel/plugin.d.ts +33 -0
  8. package/dist/babel/plugin.js +19 -0
  9. package/dist/chunk-FBBMZ4NC.cjs +7 -0
  10. package/dist/chunk-UCUR73HG.js +7 -0
  11. package/dist/components/env.cjs +40 -0
  12. package/dist/components/env.d.cts +106 -0
  13. package/dist/components/env.d.ts +106 -0
  14. package/dist/components/env.js +40 -0
  15. package/dist/components/index.cjs +1 -0
  16. package/dist/components/index.d.cts +10 -0
  17. package/dist/components/index.d.ts +10 -0
  18. package/dist/components/index.js +1 -0
  19. package/dist/helpers/index.cjs +1 -0
  20. package/dist/helpers/index.d.cts +34 -0
  21. package/dist/helpers/index.d.ts +34 -0
  22. package/dist/helpers/index.js +1 -0
  23. package/dist/helpers/load.cjs +7 -0
  24. package/dist/helpers/load.d.cts +59 -0
  25. package/dist/helpers/load.d.ts +59 -0
  26. package/dist/helpers/load.js +7 -0
  27. package/dist/helpers/persistence.cjs +7 -0
  28. package/dist/helpers/persistence.d.cts +107 -0
  29. package/dist/helpers/persistence.d.ts +107 -0
  30. package/dist/helpers/persistence.js +7 -0
  31. package/dist/helpers/reflect.cjs +7 -0
  32. package/dist/helpers/reflect.d.cts +71 -0
  33. package/dist/helpers/reflect.d.ts +71 -0
  34. package/dist/helpers/reflect.js +7 -0
  35. package/dist/helpers/source-file-env.cjs +7 -0
  36. package/dist/helpers/source-file-env.d.cts +7 -0
  37. package/dist/helpers/source-file-env.d.ts +7 -0
  38. package/dist/helpers/source-file-env.js +7 -0
  39. package/dist/helpers/template-helpers.cjs +7 -0
  40. package/dist/helpers/template-helpers.d.cts +40 -0
  41. package/dist/helpers/template-helpers.d.ts +40 -0
  42. package/dist/helpers/template-helpers.js +7 -0
  43. package/dist/index.cjs +22 -0
  44. package/dist/index.d.cts +70 -0
  45. package/dist/index.d.ts +70 -0
  46. package/dist/index.js +22 -0
  47. package/dist/runtime-CUeIsMV9.d.ts +1753 -0
  48. package/dist/runtime-DEhb6gxi.d.cts +1753 -0
  49. package/dist/types/index.cjs +1 -0
  50. package/dist/types/index.d.cts +29 -0
  51. package/dist/types/index.d.ts +29 -0
  52. package/dist/types/index.js +1 -0
  53. package/dist/types/plugin.cjs +1 -0
  54. package/dist/types/plugin.d.cts +1727 -0
  55. package/dist/types/plugin.d.ts +1727 -0
  56. package/dist/types/plugin.js +0 -0
  57. package/dist/types/runtime.cjs +1 -0
  58. package/dist/types/runtime.d.cts +24 -0
  59. package/dist/types/runtime.d.ts +24 -0
  60. package/dist/types/runtime.js +0 -0
  61. package/dist/vfs-Bl84Hw2V.d.cts +393 -0
  62. package/dist/vfs-Bl84Hw2V.d.ts +393 -0
  63. package/package.json +75 -81
File without changes
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1,24 @@
1
+ export { E as EnvInterface, S as SecretsInterface } from '../runtime-DEhb6gxi.cjs';
2
+ import '@stryke/env/get-env-paths';
3
+ import '@stryke/types/package-json';
4
+ import 'jiti';
5
+ import 'oxc-parser';
6
+ import 'semver';
7
+ import 'unplugin';
8
+ import '@babel/core';
9
+ import '@storm-software/build-tools/types';
10
+ import '@storm-software/config-tools/types';
11
+ import '@storm-software/config/types';
12
+ import '@stryke/types/base';
13
+ import '@stryke/types/configuration';
14
+ import '@stryke/types/file';
15
+ import 'vite';
16
+ import '@babel/helper-plugin-utils';
17
+ import '@stryke/types/array';
18
+ import '@stryke/types/tsconfig';
19
+ import 'typescript';
20
+ import '../vfs-Bl84Hw2V.cjs';
21
+ import '@stryke/json/types';
22
+ import 'memfs';
23
+ import 'node:fs';
24
+ import 'unionfs';
@@ -0,0 +1,24 @@
1
+ export { E as EnvInterface, S as SecretsInterface } from '../runtime-CUeIsMV9.js';
2
+ import '@stryke/env/get-env-paths';
3
+ import '@stryke/types/package-json';
4
+ import 'jiti';
5
+ import 'oxc-parser';
6
+ import 'semver';
7
+ import 'unplugin';
8
+ import '@babel/core';
9
+ import '@storm-software/build-tools/types';
10
+ import '@storm-software/config-tools/types';
11
+ import '@storm-software/config/types';
12
+ import '@stryke/types/base';
13
+ import '@stryke/types/configuration';
14
+ import '@stryke/types/file';
15
+ import 'vite';
16
+ import '@babel/helper-plugin-utils';
17
+ import '@stryke/types/array';
18
+ import '@stryke/types/tsconfig';
19
+ import 'typescript';
20
+ import '../vfs-Bl84Hw2V.js';
21
+ import '@stryke/json/types';
22
+ import 'memfs';
23
+ import 'node:fs';
24
+ import 'unionfs';
File without changes
@@ -0,0 +1,393 @@
1
+ import { PrimitiveJsonValue } from '@stryke/json/types';
2
+ import { Volume } from 'memfs';
3
+ import { PathLike, StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
4
+ import { IUnionFs } from 'unionfs';
5
+
6
+ declare const __VFS_INIT__ = "__VFS_INIT__";
7
+ declare const __VFS_REVERT__ = "__VFS_REVERT__";
8
+ declare const __VFS_CACHE__ = "__VFS_CACHE__";
9
+ declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
10
+ declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
11
+ type OutputModeType = "fs" | "virtual";
12
+ interface VirtualFile {
13
+ /**
14
+ * The unique identifier for the virtual file.
15
+ *
16
+ * @remarks
17
+ * If no specific id is provided, it defaults to the file's {@link path}.
18
+ */
19
+ id: string;
20
+ /**
21
+ * Additional metadata associated with the virtual file.
22
+ */
23
+ details: Record<string, PrimitiveJsonValue>;
24
+ /**
25
+ * The variant of the file.
26
+ *
27
+ * @remarks
28
+ * This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
29
+ * - `builtin`: Indicates that the file is a built-in module provided by the system.
30
+ * - `entry`: Indicates that the file is an entry point for execution.
31
+ * - `normal`: Indicates that the file is a standard file without any special role.
32
+ */
33
+ variant: string;
34
+ /**
35
+ * The output mode of the file.
36
+ *
37
+ * @remarks
38
+ * This indicates whether the file is intended to be written to the actual file system (`fs`) or kept in the virtual file system (`virtual`).
39
+ */
40
+ mode: OutputModeType;
41
+ /**
42
+ * A virtual (or actual) path to the file in the file system.
43
+ */
44
+ path: string;
45
+ /**
46
+ * The contents of the file.
47
+ */
48
+ code: string | NodeJS.ArrayBufferView;
49
+ }
50
+ type VirtualFileSystemMetadata = Pick<VirtualFile, "id" | "details" | "variant" | "mode">;
51
+ interface ResolveFSOptions {
52
+ mode?: OutputModeType;
53
+ }
54
+ type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
55
+ interface PowerlinesWriteFileOptions extends ResolveFSOptions {
56
+ skipFormat?: boolean;
57
+ }
58
+ type NodeWriteFileOptions = WriteFileOptions$1;
59
+ type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
60
+ type PowerLinesWriteFileData = Partial<Omit<VirtualFile, "path" | "mode" | "code">> & Pick<VirtualFile, "code">;
61
+ type WriteFileData = string | NodeJS.ArrayBufferView | PowerLinesWriteFileData;
62
+ interface ResolvePathOptions extends ResolveFSOptions {
63
+ /**
64
+ * Should the resolved path include the file extension?
65
+ *
66
+ * @defaultValue true
67
+ */
68
+ withExtension?: boolean;
69
+ /**
70
+ * The paths to search for the file.
71
+ */
72
+ paths?: string[];
73
+ /**
74
+ * The type of the path to resolve.
75
+ */
76
+ type?: "file" | "directory";
77
+ }
78
+ interface VirtualFileSystemInterface {
79
+ [__VFS_INIT__]: () => void;
80
+ [__VFS_REVERT__]: () => void;
81
+ /**
82
+ * The underlying file metadata.
83
+ */
84
+ meta: Record<string, VirtualFileSystemMetadata | undefined>;
85
+ /**
86
+ * A map of module ids to their file paths.
87
+ */
88
+ ids: Record<string, string>;
89
+ /**
90
+ * Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.
91
+ *
92
+ * @param pathOrId - The path or id to check.
93
+ * @param options - Optional parameters for resolving the path.
94
+ * @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.
95
+ */
96
+ isVirtual: (pathOrId: string, options?: ResolvePathOptions) => boolean;
97
+ /**
98
+ * Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.
99
+ *
100
+ * @param pathOrId - The path or id to check.
101
+ * @param options - Optional parameters for resolving the path.
102
+ * @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
103
+ */
104
+ isFs: (pathOrId: string, options?: ResolvePathOptions) => boolean;
105
+ /**
106
+ * Checks if a file exists in the virtual file system (VFS).
107
+ *
108
+ * @param path - The path of the file to check.
109
+ * @returns `true` if the file exists, otherwise `false`.
110
+ */
111
+ isFile: (path: string) => boolean;
112
+ /**
113
+ * Checks if a directory exists in the virtual file system (VFS).
114
+ *
115
+ * @param path - The path of the directory to check.
116
+ * @returns `true` if the directory exists, otherwise `false`.
117
+ */
118
+ isDirectory: (path: string) => boolean;
119
+ /**
120
+ * Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
121
+ *
122
+ * @see https://www.typescriptlang.org/tsconfig#paths
123
+ *
124
+ * @param pathOrId - The path or id to check.
125
+ * @returns Whether the path or id corresponds to a virtual file.
126
+ */
127
+ isTsconfigPath: (pathOrId: string) => boolean;
128
+ /**
129
+ * Checks if a file exists in the virtual file system (VFS).
130
+ *
131
+ * @param pathOrId - The path or id of the file.
132
+ * @returns `true` if the file exists, otherwise `false`.
133
+ */
134
+ existsSync: (pathOrId: string) => boolean;
135
+ /**
136
+ * Gets the metadata of a file in the virtual file system (VFS).
137
+ *
138
+ * @param pathOrId - The path or id of the file.
139
+ * @returns The metadata of the file if it exists, otherwise undefined.
140
+ */
141
+ getMetadata: (pathOrId: PathLike) => VirtualFileSystemMetadata | undefined;
142
+ /**
143
+ * Gets the stats of a file in the virtual file system (VFS).
144
+ *
145
+ * @param pathOrId - The path or id of the file.
146
+ * @param options - Optional parameters for getting the stats.
147
+ * @returns The stats of the file if it exists, otherwise undefined.
148
+ */
149
+ lstat: (pathOrId: string, options?: StatSyncOptions & {
150
+ bigint?: false | undefined;
151
+ throwIfNoEntry: false;
152
+ }) => Promise<Stats>;
153
+ /**
154
+ * Gets the stats of a file in the virtual file system (VFS).
155
+ *
156
+ * @param pathOrId - The path or id of the file.
157
+ * @param options - Optional parameters for getting the stats.
158
+ * @returns The stats of the file if it exists, otherwise undefined.
159
+ */
160
+ lstatSync: (pathOrId: string, options?: StatSyncOptions & {
161
+ bigint?: false | undefined;
162
+ throwIfNoEntry: false;
163
+ }) => Stats | undefined;
164
+ /**
165
+ * Gets the stats of a file in the virtual file system (VFS).
166
+ *
167
+ * @param pathOrId - The path or id of the file.
168
+ * @returns The stats of the file if it exists, otherwise false.
169
+ */
170
+ stat: (pathOrId: string, options?: StatSyncOptions & {
171
+ bigint?: false | undefined;
172
+ throwIfNoEntry: false;
173
+ }) => Promise<Stats>;
174
+ /**
175
+ * Gets the stats of a file in the virtual file system (VFS).
176
+ *
177
+ * @param pathOrId - The path or id of the file.
178
+ * @returns The stats of the file if it exists, otherwise false.
179
+ */
180
+ statSync: (pathOrId: string, options?: StatSyncOptions & {
181
+ bigint?: false | undefined;
182
+ throwIfNoEntry: false;
183
+ }) => Stats | undefined;
184
+ /**
185
+ * Lists files in a given path.
186
+ *
187
+ * @param path - The path to list files from.
188
+ * @param options - Options for listing files, such as encoding and recursion.
189
+ * @returns An array of file names in the specified path.
190
+ */
191
+ readdirSync: (path: string, options?: {
192
+ encoding: BufferEncoding | null;
193
+ withFileTypes?: false | undefined;
194
+ recursive?: boolean | undefined;
195
+ } | BufferEncoding) => string[];
196
+ /**
197
+ * Lists files in a given path.
198
+ *
199
+ * @param path - The path to list files from.
200
+ * @param options - Options for listing files, such as encoding and recursion.
201
+ * @returns An array of file names in the specified path.
202
+ */
203
+ readdir: (path: string, options?: {
204
+ encoding: BufferEncoding | null;
205
+ withFileTypes?: false | undefined;
206
+ recursive?: boolean | undefined;
207
+ } | BufferEncoding) => Promise<string[]>;
208
+ /**
209
+ * Removes a file or symbolic link in the virtual file system (VFS).
210
+ *
211
+ * @param path - The path to the file to remove.
212
+ * @returns A promise that resolves when the file is removed.
213
+ */
214
+ unlinkSync: (path: PathLike, options?: ResolveFSOptions) => void;
215
+ /**
216
+ * Asynchronously removes a file or symbolic link in the virtual file system (VFS).
217
+ *
218
+ * @param path - The path to the file to remove.
219
+ * @returns A promise that resolves when the file is removed.
220
+ */
221
+ unlink: (path: string, options?: ResolveFSOptions) => Promise<void>;
222
+ /**
223
+ * Removes a directory in the virtual file system (VFS).
224
+ *
225
+ * @param path - The path to create the directory at.
226
+ * @param options - Options for creating the directory.
227
+ */
228
+ rmdirSync: (path: PathLike, options?: RmDirOptions & ResolveFSOptions) => any;
229
+ /**
230
+ * Removes a directory in the virtual file system (VFS).
231
+ *
232
+ * @param path - The path to create the directory at.
233
+ * @param options - Options for creating the directory.
234
+ * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
235
+ */
236
+ rmdir: (path: PathLike, options?: RmDirOptions & ResolveFSOptions) => Promise<void>;
237
+ /**
238
+ * Removes a file or directory in the virtual file system (VFS).
239
+ *
240
+ * @param path - The path to the file or directory to remove.
241
+ * @param options - Options for removing the file or directory.
242
+ * @returns A promise that resolves when the file or directory is removed.
243
+ */
244
+ rm: (path: PathLike, options?: RmOptions & ResolveFSOptions) => Promise<void>;
245
+ /**
246
+ * Synchronously removes a file or directory in the virtual file system (VFS).
247
+ *
248
+ * @param path - The path to the file or directory to remove.
249
+ * @param options - Options for removing the file or directory.
250
+ */
251
+ rmSync: (path: PathLike, options?: RmOptions & ResolveFSOptions) => void;
252
+ /**
253
+ * Creates a directory in the virtual file system (VFS).
254
+ *
255
+ * @param path - The path to create the directory at.
256
+ * @param options - Options for creating the directory.
257
+ * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
258
+ */
259
+ mkdirSync: (path: PathLike, options?: MakeDirectoryOptions) => string | undefined;
260
+ /**
261
+ * Creates 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
+ * @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
266
+ */
267
+ mkdir: (path: PathLike, options?: MakeDirectoryOptions) => Promise<string | undefined>;
268
+ /**
269
+ * Reads a file from the virtual file system (VFS).
270
+ *
271
+ * @param pathOrId - The path or id of the file.
272
+ * @returns The contents of the file if it exists, otherwise undefined.
273
+ */
274
+ readFile: (pathOrId: string) => Promise<string | undefined>;
275
+ /**
276
+ * Reads a file from the virtual file system (VFS).
277
+ *
278
+ * @param pathOrId - The path or id of the file.
279
+ */
280
+ readFileSync: (pathOrId: string) => string | undefined;
281
+ /**
282
+ * Writes a file to the virtual file system (VFS).
283
+ *
284
+ * @param path - The path to the file.
285
+ * @param data - The contents of the file.
286
+ * @param options - Optional parameters for writing the file.
287
+ * @returns A promise that resolves when the file is written.
288
+ */
289
+ writeFile: (path: PathOrFileDescriptor, data?: WriteFileData, options?: WriteFileOptions) => Promise<void>;
290
+ /**
291
+ * Writes a file to the virtual file system (VFS).
292
+ *
293
+ * @param path - The path to the file.
294
+ * @param data - The contents of the file.
295
+ * @param options - Optional parameters for writing the file.
296
+ */
297
+ writeFileSync: (path: PathOrFileDescriptor, data?: WriteFileData, options?: WriteFileOptions) => void;
298
+ /**
299
+ * Moves a file from one path to another in the virtual file system (VFS).
300
+ *
301
+ * @param srcPath - The source path to move
302
+ * @param destPath - The destination path to move to
303
+ */
304
+ move: (srcPath: string, destPath: string) => Promise<void>;
305
+ /**
306
+ * Synchronously moves a file from one path to another in the virtual file system (VFS).
307
+ *
308
+ * @param srcPath - The source path to move
309
+ * @param destPath - The destination path to move to
310
+ */
311
+ moveSync: (srcPath: string, destPath: string) => void;
312
+ /**
313
+ * Copies a file from one path to another in the virtual file system (VFS).
314
+ *
315
+ * @param srcPath - The source path to copy
316
+ * @param destPath - The destination path to copy to
317
+ */
318
+ copy: (srcPath: string, destPath: string) => Promise<void>;
319
+ /**
320
+ * Synchronously copies a file from one path to another in the virtual file system (VFS).
321
+ *
322
+ * @param srcPath - The source path to copy
323
+ * @param destPath - The destination path to copy to
324
+ */
325
+ copySync: (srcPath: string, destPath: string) => void;
326
+ /**
327
+ * Glob files in the virtual file system (VFS) based on the provided pattern(s).
328
+ *
329
+ * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
330
+ * @returns An array of file paths matching the provided pattern(s)
331
+ */
332
+ glob: (pattern: string | string[]) => Promise<string[]>;
333
+ /**
334
+ * Synchronously glob files in the virtual file system (VFS) based on the provided pattern(s).
335
+ *
336
+ * @param pattern - A pattern (or multiple patterns) to use to determine the file paths to return
337
+ * @returns An array of file paths matching the provided pattern(s)
338
+ */
339
+ globSync: (pattern: string | string[]) => string[];
340
+ /**
341
+ * Resolves a path or id to a file path in the virtual file system.
342
+ *
343
+ * @param pathOrId - The path or id of the file to resolve.
344
+ * @param options - Optional parameters for resolving the path.
345
+ * @returns The resolved path of the file if it exists, otherwise false.
346
+ */
347
+ resolve: (pathOrId: string, options?: ResolvePathOptions) => string | false;
348
+ /**
349
+ * Resolves a path based on TypeScript's `tsconfig.json` paths.
350
+ *
351
+ * @see https://www.typescriptlang.org/tsconfig#paths
352
+ *
353
+ * @param path - The path to check.
354
+ * @returns The resolved file path if it exists, otherwise undefined.
355
+ */
356
+ resolveTsconfigPath: (path: string) => string | false;
357
+ /**
358
+ * Resolves a package name based on TypeScript's `tsconfig.json` paths.
359
+ *
360
+ * @see https://www.typescriptlang.org/tsconfig#paths
361
+ *
362
+ * @param path - The path to check.
363
+ * @returns The resolved package name if it exists, otherwise undefined.
364
+ */
365
+ resolveTsconfigPathPackage: (path: string) => string | false;
366
+ /**
367
+ * Resolves a path or id to a file path in the virtual file system.
368
+ *
369
+ * @param pathOrId - The path or id of the file to resolve.
370
+ * @returns The resolved path of the file if it exists, otherwise false.
371
+ */
372
+ realpathSync: (pathOrId: string) => string;
373
+ /**
374
+ * Retrieves a partial metadata mapping of all files in the virtual file system (VFS).
375
+ *
376
+ * @returns A record mapping file paths to their partial metadata.
377
+ */
378
+ getPartialMeta: () => Record<string, Partial<VirtualFileSystemMetadata>>;
379
+ /**
380
+ * A map of cached file paths to their underlying file content.
381
+ */
382
+ [__VFS_CACHE__]: Map<string, string>;
383
+ /**
384
+ * A reference to the underlying virtual file system.
385
+ */
386
+ [__VFS_VIRTUAL__]: Volume;
387
+ /**
388
+ * A reference to the underlying unified file system.
389
+ */
390
+ [__VFS_UNIFIED__]: IUnionFs;
391
+ }
392
+
393
+ export type { OutputModeType as O, PowerlinesWriteFileOptions as P, VirtualFileSystemInterface as V, VirtualFile as a };