@powerlines/plugin-env 0.3.0 → 0.5.0
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/package.json +11 -11
- package/dist/babel/index.cjs +0 -1
- package/dist/babel/index.d.cts +0 -28
- package/dist/babel/index.d.ts +0 -28
- package/dist/babel/index.js +0 -1
- package/dist/babel/plugin.cjs +0 -19
- package/dist/babel/plugin.d.cts +0 -31
- package/dist/babel/plugin.d.ts +0 -31
- package/dist/babel/plugin.js +0 -19
- package/dist/chunk-FBBMZ4NC.cjs +0 -7
- package/dist/chunk-UCUR73HG.js +0 -7
- package/dist/components/env.cjs +0 -40
- package/dist/components/env.d.cts +0 -106
- package/dist/components/env.d.ts +0 -106
- package/dist/components/env.js +0 -40
- package/dist/components/index.cjs +0 -1
- package/dist/components/index.d.cts +0 -9
- package/dist/components/index.d.ts +0 -9
- package/dist/components/index.js +0 -1
- package/dist/helpers/index.cjs +0 -1
- package/dist/helpers/index.d.cts +0 -32
- package/dist/helpers/index.d.ts +0 -32
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/load.cjs +0 -7
- package/dist/helpers/load.d.cts +0 -57
- package/dist/helpers/load.d.ts +0 -57
- package/dist/helpers/load.js +0 -7
- package/dist/helpers/persistence.cjs +0 -7
- package/dist/helpers/persistence.d.cts +0 -98
- package/dist/helpers/persistence.d.ts +0 -98
- package/dist/helpers/persistence.js +0 -7
- package/dist/helpers/reflect.cjs +0 -7
- package/dist/helpers/reflect.d.cts +0 -70
- package/dist/helpers/reflect.d.ts +0 -70
- package/dist/helpers/reflect.js +0 -7
- package/dist/helpers/source-file-env.cjs +0 -7
- package/dist/helpers/source-file-env.d.cts +0 -7
- package/dist/helpers/source-file-env.d.ts +0 -7
- package/dist/helpers/source-file-env.js +0 -7
- package/dist/helpers/template-helpers.cjs +0 -7
- package/dist/helpers/template-helpers.d.cts +0 -38
- package/dist/helpers/template-helpers.d.ts +0 -38
- package/dist/helpers/template-helpers.js +0 -7
- package/dist/index.cjs +0 -22
- package/dist/index.d.cts +0 -76
- package/dist/index.d.ts +0 -76
- package/dist/index.js +0 -22
- package/dist/runtime-2DL8LKdD.d.cts +0 -3294
- package/dist/runtime-Cij6nHdf.d.ts +0 -3294
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +0 -27
- package/dist/types/index.d.ts +0 -27
- package/dist/types/index.js +0 -1
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +0 -169
- package/dist/types/plugin.d.ts +0 -169
- package/dist/types/plugin.js +0 -0
- package/dist/types/runtime.cjs +0 -1
- package/dist/types/runtime.d.cts +0 -24
- package/dist/types/runtime.d.ts +0 -24
- package/dist/types/runtime.js +0 -0
- package/dist/vfs-COoZkq8D.d.cts +0 -358
- package/dist/vfs-COoZkq8D.d.ts +0 -358
package/dist/vfs-COoZkq8D.d.cts
DELETED
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import { Volume } from 'memfs';
|
|
2
|
-
import { StatSyncOptions, Stats, PathLike, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, PathOrFileDescriptor, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
3
|
-
import { IUnionFs } from 'unionfs';
|
|
4
|
-
|
|
5
|
-
declare const __VFS_INIT__ = "__VFS_INIT__";
|
|
6
|
-
declare const __VFS_REVERT__ = "__VFS_REVERT__";
|
|
7
|
-
declare const __VFS_CACHE__ = "__VFS_CACHE__";
|
|
8
|
-
declare const __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
9
|
-
declare const __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
10
|
-
interface VirtualFile {
|
|
11
|
-
/**
|
|
12
|
-
* A virtual path to the file in the virtual file system.
|
|
13
|
-
*/
|
|
14
|
-
path: string;
|
|
15
|
-
/**
|
|
16
|
-
* The contents of the virtual file.
|
|
17
|
-
*/
|
|
18
|
-
contents: string;
|
|
19
|
-
}
|
|
20
|
-
interface VirtualBuiltinFile extends VirtualFile {
|
|
21
|
-
/**
|
|
22
|
-
* The unique identifier for the virtual file.
|
|
23
|
-
*
|
|
24
|
-
* @remarks
|
|
25
|
-
* This property is read-only and is set when the file is created.
|
|
26
|
-
*/
|
|
27
|
-
id: string;
|
|
28
|
-
}
|
|
29
|
-
type OutputModeType = "fs" | "virtual";
|
|
30
|
-
interface ResolveFSOptions {
|
|
31
|
-
mode?: OutputModeType;
|
|
32
|
-
}
|
|
33
|
-
type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
|
|
34
|
-
interface ResolvePathOptions extends ResolveFSOptions {
|
|
35
|
-
/**
|
|
36
|
-
* Should the resolved path include the file extension?
|
|
37
|
-
*
|
|
38
|
-
* @defaultValue true
|
|
39
|
-
*/
|
|
40
|
-
withExtension?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* The paths to search for the file.
|
|
43
|
-
*/
|
|
44
|
-
paths?: string[];
|
|
45
|
-
/**
|
|
46
|
-
* The type of the path to resolve.
|
|
47
|
-
*/
|
|
48
|
-
type?: "file" | "directory";
|
|
49
|
-
}
|
|
50
|
-
type WriteFileOptions = WriteFileOptions$1 & ResolveFSOptions;
|
|
51
|
-
interface WriteBuiltinFileOptions extends ResolveFSOptions {
|
|
52
|
-
skipFormat?: boolean;
|
|
53
|
-
}
|
|
54
|
-
interface VirtualFileSystemInterface {
|
|
55
|
-
[__VFS_INIT__]: () => void;
|
|
56
|
-
[__VFS_REVERT__]: () => void;
|
|
57
|
-
/**
|
|
58
|
-
* The underlying builtin module Ids.
|
|
59
|
-
*/
|
|
60
|
-
builtinIdMap: Map<string, string>;
|
|
61
|
-
/**
|
|
62
|
-
* Checks if a path or ID corresponds to a builtin file.
|
|
63
|
-
*
|
|
64
|
-
* @param id - The id of the builtin file to check against.
|
|
65
|
-
* @param pathOrId - The path or id of the file to check.
|
|
66
|
-
* @returns Whether the path or ID corresponds to a builtin file.
|
|
67
|
-
*/
|
|
68
|
-
isMatchingBuiltinId: (id: string, pathOrId: string) => boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Checks if a provided string is a valid builtin ID (does not need to already be created in the file system).
|
|
71
|
-
*
|
|
72
|
-
* @param id - The ID to check.
|
|
73
|
-
* @returns Whether the ID is a valid builtin ID.
|
|
74
|
-
*/
|
|
75
|
-
isValidBuiltinId: (id: string) => boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Check if a path or ID corresponds to a virtual file.
|
|
78
|
-
*
|
|
79
|
-
* @param pathOrId - The path or ID to check.
|
|
80
|
-
* @param options - Optional parameters for resolving the path.
|
|
81
|
-
* @returns Whether the path or ID corresponds to a virtual file.
|
|
82
|
-
*/
|
|
83
|
-
isVirtualFile: (pathOrId: string, options?: ResolvePathOptions) => boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Check if a path exists within one of the directories specified in the tsconfig.json's `path` field.
|
|
86
|
-
*
|
|
87
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
88
|
-
*
|
|
89
|
-
* @param pathOrId - The path or ID to check.
|
|
90
|
-
* @returns Whether the path or ID corresponds to a virtual file.
|
|
91
|
-
*/
|
|
92
|
-
isTsconfigPath: (pathOrId: string) => boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Checks if a given path or ID corresponds to a builtin module file.
|
|
95
|
-
*/
|
|
96
|
-
isBuiltinFile: (pathOrID: string, options?: ResolvePathOptions) => boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Returns a list of builtin module files in the virtual file system.
|
|
99
|
-
*/
|
|
100
|
-
listBuiltinFiles: () => Promise<VirtualBuiltinFile[]>;
|
|
101
|
-
/**
|
|
102
|
-
* Checks if a file exists in the virtual file system (VFS).
|
|
103
|
-
*/
|
|
104
|
-
existsSync: (pathOrId: string) => 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
|
-
fileExistsSync: (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
|
-
directoryExistsSync: (path: string) => boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Checks if a path exists in the virtual file system (VFS).
|
|
121
|
-
*
|
|
122
|
-
* @param path - The path to check.
|
|
123
|
-
* @returns `true` if the path exists, otherwise `false`.
|
|
124
|
-
*/
|
|
125
|
-
pathExistsSync: (path: string) => boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
128
|
-
*
|
|
129
|
-
* @param pathOrId - The path or id of the file.
|
|
130
|
-
* @param options - Optional parameters for getting the stats.
|
|
131
|
-
* @returns The stats of the file if it exists, otherwise undefined.
|
|
132
|
-
*/
|
|
133
|
-
lstat: (pathOrId: string, options?: StatSyncOptions & {
|
|
134
|
-
bigint?: false | undefined;
|
|
135
|
-
throwIfNoEntry: false;
|
|
136
|
-
}) => Promise<Stats>;
|
|
137
|
-
/**
|
|
138
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
139
|
-
*
|
|
140
|
-
* @param pathOrId - The path or id of the file.
|
|
141
|
-
* @param options - Optional parameters for getting the stats.
|
|
142
|
-
* @returns The stats of the file if it exists, otherwise undefined.
|
|
143
|
-
*/
|
|
144
|
-
lstatSync: (pathOrId: string, options?: StatSyncOptions & {
|
|
145
|
-
bigint?: false | undefined;
|
|
146
|
-
throwIfNoEntry: false;
|
|
147
|
-
}) => Stats | undefined;
|
|
148
|
-
/**
|
|
149
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
150
|
-
*
|
|
151
|
-
* @param pathOrId - The path or id of the file.
|
|
152
|
-
* @returns The stats of the file if it exists, otherwise false.
|
|
153
|
-
*/
|
|
154
|
-
stat: (pathOrId: string, options?: StatSyncOptions & {
|
|
155
|
-
bigint?: false | undefined;
|
|
156
|
-
throwIfNoEntry: false;
|
|
157
|
-
}) => Promise<Stats>;
|
|
158
|
-
/**
|
|
159
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
160
|
-
*
|
|
161
|
-
* @param pathOrId - The path or id of the file.
|
|
162
|
-
* @returns The stats of the file if it exists, otherwise false.
|
|
163
|
-
*/
|
|
164
|
-
statSync: (pathOrId: string, options?: StatSyncOptions & {
|
|
165
|
-
bigint?: false | undefined;
|
|
166
|
-
throwIfNoEntry: false;
|
|
167
|
-
}) => Stats | undefined;
|
|
168
|
-
/**
|
|
169
|
-
* Lists files in a given path.
|
|
170
|
-
*
|
|
171
|
-
* @param path - The path to list files from.
|
|
172
|
-
* @param options - Options for listing files, such as encoding and recursion.
|
|
173
|
-
* @returns An array of file names in the specified path.
|
|
174
|
-
*/
|
|
175
|
-
readdirSync: (path: string, options?: {
|
|
176
|
-
encoding: BufferEncoding | null;
|
|
177
|
-
withFileTypes?: false | undefined;
|
|
178
|
-
recursive?: boolean | undefined;
|
|
179
|
-
} | BufferEncoding) => string[];
|
|
180
|
-
/**
|
|
181
|
-
* Lists files in a given path.
|
|
182
|
-
*
|
|
183
|
-
* @param path - The path to list files from.
|
|
184
|
-
* @param options - Options for listing files, such as encoding and recursion.
|
|
185
|
-
* @returns An array of file names in the specified path.
|
|
186
|
-
*/
|
|
187
|
-
readdir: (path: string, options?: {
|
|
188
|
-
encoding: BufferEncoding | null;
|
|
189
|
-
withFileTypes?: false | undefined;
|
|
190
|
-
recursive?: boolean | undefined;
|
|
191
|
-
} | BufferEncoding) => Promise<string[]>;
|
|
192
|
-
/**
|
|
193
|
-
* Removes a file or symbolic link in the virtual file system (VFS).
|
|
194
|
-
*
|
|
195
|
-
* @param path - The path to the file to remove.
|
|
196
|
-
* @returns A promise that resolves when the file is removed.
|
|
197
|
-
*/
|
|
198
|
-
unlinkSync: (path: PathLike, options?: ResolveFSOptions) => void;
|
|
199
|
-
/**
|
|
200
|
-
* Asynchronously removes a file or symbolic link in the virtual file system (VFS).
|
|
201
|
-
*
|
|
202
|
-
* @param path - The path to the file to remove.
|
|
203
|
-
* @returns A promise that resolves when the file is removed.
|
|
204
|
-
*/
|
|
205
|
-
unlink: (path: string, options?: ResolveFSOptions) => Promise<void>;
|
|
206
|
-
/**
|
|
207
|
-
* Removes a directory in the virtual file system (VFS).
|
|
208
|
-
*
|
|
209
|
-
* @param path - The path to create the directory at.
|
|
210
|
-
* @param options - Options for creating the directory.
|
|
211
|
-
*/
|
|
212
|
-
rmdirSync: (path: PathLike, options?: RmDirOptions & ResolveFSOptions) => any;
|
|
213
|
-
/**
|
|
214
|
-
* Removes a directory in the virtual file system (VFS).
|
|
215
|
-
*
|
|
216
|
-
* @param path - The path to create the directory at.
|
|
217
|
-
* @param options - Options for creating the directory.
|
|
218
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
219
|
-
*/
|
|
220
|
-
rmdir: (path: PathLike, options?: RmDirOptions & ResolveFSOptions) => Promise<void>;
|
|
221
|
-
/**
|
|
222
|
-
* Removes a file in the virtual file system (VFS).
|
|
223
|
-
*
|
|
224
|
-
* @param path - The path to the file to remove.
|
|
225
|
-
* @param options - Options for removing the file.
|
|
226
|
-
* @returns A promise that resolves when the file is removed.
|
|
227
|
-
*/
|
|
228
|
-
rm: (path: PathLike, options?: RmOptions & ResolveFSOptions) => Promise<void>;
|
|
229
|
-
/**
|
|
230
|
-
* Creates 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
|
-
mkdirSync: (path: PathLike, options?: MakeDirectoryOptions) => string | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* Creates a directory in the virtual file system (VFS).
|
|
239
|
-
*
|
|
240
|
-
* @param path - The path to create the directory at.
|
|
241
|
-
* @param options - Options for creating the directory.
|
|
242
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
243
|
-
*/
|
|
244
|
-
mkdir: (path: PathLike, options?: MakeDirectoryOptions) => Promise<string | undefined>;
|
|
245
|
-
/**
|
|
246
|
-
* Reads a file from the virtual file system (VFS).
|
|
247
|
-
*
|
|
248
|
-
* @param pathOrId - The path or id of the file.
|
|
249
|
-
* @returns The contents of the file if it exists, otherwise undefined.
|
|
250
|
-
*/
|
|
251
|
-
readFile: (pathOrId: string) => Promise<string | undefined>;
|
|
252
|
-
/**
|
|
253
|
-
* Reads a file from the virtual file system (VFS).
|
|
254
|
-
*
|
|
255
|
-
* @param pathOrId - The path or id of the file.
|
|
256
|
-
*/
|
|
257
|
-
readFileSync: (pathOrId: string) => string | undefined;
|
|
258
|
-
/**
|
|
259
|
-
* Writes a file to the virtual file system (VFS).
|
|
260
|
-
*
|
|
261
|
-
* @param file - The path to the file.
|
|
262
|
-
* @param data - The contents of the file.
|
|
263
|
-
* @param options - Optional parameters for writing the file.
|
|
264
|
-
* @returns A promise that resolves when the file is written.
|
|
265
|
-
*/
|
|
266
|
-
writeFile: (file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions) => Promise<void>;
|
|
267
|
-
/**
|
|
268
|
-
* Writes a file to the virtual file system (VFS).
|
|
269
|
-
*
|
|
270
|
-
* @param file - The path to the file.
|
|
271
|
-
* @param data - The contents of the file.
|
|
272
|
-
* @param options - Optional parameters for writing the file.
|
|
273
|
-
*/
|
|
274
|
-
writeFileSync: (file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions) => void;
|
|
275
|
-
/**
|
|
276
|
-
* Adds a builtin module file to the virtual file system.
|
|
277
|
-
*
|
|
278
|
-
* @param id - The unique identifier for the builtin module file.
|
|
279
|
-
* @param path - The path to the builtin module file.
|
|
280
|
-
* @param contents - The contents of the builtin module file.
|
|
281
|
-
* @param options - Optional parameters for writing the builtin module file.
|
|
282
|
-
*/
|
|
283
|
-
writeBuiltinFile: (id: string, path: string, contents: string, options?: WriteBuiltinFileOptions) => Promise<void>;
|
|
284
|
-
/**
|
|
285
|
-
* Adds an entry file to the virtual file system.
|
|
286
|
-
*
|
|
287
|
-
* @param name - The unique identifier for the entry file.
|
|
288
|
-
* @param contents - The contents of the entry file.
|
|
289
|
-
* @param options - Optional parameters for writing the entry file.
|
|
290
|
-
*/
|
|
291
|
-
writeEntryFile: (name: string, contents: string, options?: WriteBuiltinFileOptions) => Promise<void>;
|
|
292
|
-
/**
|
|
293
|
-
* Writes a file to disk from the physical file system (on disk).
|
|
294
|
-
*
|
|
295
|
-
* @param path - The path to the file to write.
|
|
296
|
-
* @param contents - The contents of the file to write.
|
|
297
|
-
* @param options - Optional parameters for writing the file.
|
|
298
|
-
* @returns A promise that resolves when the file is written.
|
|
299
|
-
*/
|
|
300
|
-
writeFileToDisk: (path: string, contents: string, options?: {
|
|
301
|
-
skipFormat?: boolean;
|
|
302
|
-
}) => Promise<void>;
|
|
303
|
-
/**
|
|
304
|
-
* Resolves a path or ID to a file path in the virtual file system.
|
|
305
|
-
*
|
|
306
|
-
* @param pathOrId - The path or id of the file to resolve.
|
|
307
|
-
* @param options - Optional parameters for resolving the path.
|
|
308
|
-
* @returns The resolved path of the file if it exists, otherwise false.
|
|
309
|
-
*/
|
|
310
|
-
resolvePath: (pathOrId: string, options?: ResolvePathOptions) => string | false;
|
|
311
|
-
/**
|
|
312
|
-
* Resolves a path or ID to a file path in the virtual file system.
|
|
313
|
-
*
|
|
314
|
-
* @param pathOrId - The path or id of the file to resolve.
|
|
315
|
-
* @returns The resolved path of the file if it exists, otherwise false.
|
|
316
|
-
*/
|
|
317
|
-
realpathSync: (pathOrId: string) => string;
|
|
318
|
-
/**
|
|
319
|
-
* Resolves a path or ID to a builtin module file id in the virtual file system.
|
|
320
|
-
*
|
|
321
|
-
* @param pathOrId - The path or id of the file to resolve.
|
|
322
|
-
* @param paths - Optional array of paths to search for the file.
|
|
323
|
-
* @returns The resolved id of the builtin module file if it exists, otherwise false.
|
|
324
|
-
*/
|
|
325
|
-
resolveId: (pathOrId: string) => string | false;
|
|
326
|
-
/**
|
|
327
|
-
* Resolves a path based on TypeScript's `tsconfig.json` paths.
|
|
328
|
-
*
|
|
329
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
330
|
-
*
|
|
331
|
-
* @param path - The path to check.
|
|
332
|
-
* @returns The resolved file path if it exists, otherwise undefined.
|
|
333
|
-
*/
|
|
334
|
-
resolveTsconfigPath: (path: string) => string | false;
|
|
335
|
-
/**
|
|
336
|
-
* Resolves a package name based on TypeScript's `tsconfig.json` paths.
|
|
337
|
-
*
|
|
338
|
-
* @see https://www.typescriptlang.org/tsconfig#paths
|
|
339
|
-
*
|
|
340
|
-
* @param path - The path to check.
|
|
341
|
-
* @returns The resolved package name if it exists, otherwise undefined.
|
|
342
|
-
*/
|
|
343
|
-
resolveTsconfigPathPackage: (path: string) => string | false;
|
|
344
|
-
/**
|
|
345
|
-
* A map of cached file paths to their underlying file content.
|
|
346
|
-
*/
|
|
347
|
-
[__VFS_CACHE__]: Map<string, string>;
|
|
348
|
-
/**
|
|
349
|
-
* A reference to the underlying virtual file system.
|
|
350
|
-
*/
|
|
351
|
-
[__VFS_VIRTUAL__]: Volume;
|
|
352
|
-
/**
|
|
353
|
-
* A reference to the underlying unified file system.
|
|
354
|
-
*/
|
|
355
|
-
[__VFS_UNIFIED__]: IUnionFs;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
export type { OutputModeType as O, VirtualFileSystemInterface as V };
|