powerlines 0.42.41 → 0.43.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.
Files changed (125) hide show
  1. package/dist/{chunk-AIJqnxB6.cjs → _virtual/_rolldown/runtime.cjs} +1 -32
  2. package/dist/{chunk-CtajNgzt.mjs → _virtual/_rolldown/runtime.mjs} +1 -1
  3. package/dist/api.cjs +10 -0
  4. package/dist/api.d.cts +2 -0
  5. package/dist/api.d.mts +2 -0
  6. package/dist/api.mjs +3 -0
  7. package/dist/config.cjs +0 -12
  8. package/dist/config.mjs +1 -10
  9. package/dist/constants.cjs +0 -12
  10. package/dist/constants.mjs +1 -10
  11. package/dist/context.cjs +9 -0
  12. package/dist/context.d.cts +1 -0
  13. package/dist/context.d.mts +1 -0
  14. package/dist/context.mjs +3 -0
  15. package/dist/engine.cjs +30 -0
  16. package/dist/engine.d.cts +24 -0
  17. package/dist/engine.d.cts.map +1 -0
  18. package/dist/engine.d.mts +24 -0
  19. package/dist/engine.d.mts.map +1 -0
  20. package/dist/engine.mjs +29 -0
  21. package/dist/engine.mjs.map +1 -0
  22. package/dist/esbuild.cjs +2 -2
  23. package/dist/esbuild.mjs.map +1 -1
  24. package/dist/farm.cjs +1 -1
  25. package/dist/index.cjs +24 -16
  26. package/dist/index.d.cts +13 -260
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.mts +13 -260
  29. package/dist/index.d.mts.map +1 -1
  30. package/dist/index.mjs +14 -8
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/nuxt.cjs +4 -4
  33. package/dist/nuxt.d.cts +1 -1
  34. package/dist/nuxt.d.mts +1 -1
  35. package/dist/nuxt.mjs +1 -1
  36. package/dist/package.cjs +18 -0
  37. package/dist/package.mjs +7 -0
  38. package/dist/package.mjs.map +1 -0
  39. package/dist/plugin-utils.cjs +0 -12
  40. package/dist/plugin-utils.mjs +1 -10
  41. package/dist/rolldown.cjs +2 -2
  42. package/dist/rollup.cjs +2 -2
  43. package/dist/rspack.cjs +2 -2
  44. package/dist/schemas.cjs +9 -0
  45. package/dist/schemas.d.cts +1 -0
  46. package/dist/schemas.d.mts +1 -0
  47. package/dist/schemas.mjs +3 -0
  48. package/dist/storage.cjs +9 -0
  49. package/dist/storage.d.cts +1 -0
  50. package/dist/storage.d.mts +1 -0
  51. package/dist/storage.mjs +3 -0
  52. package/dist/tsdown.cjs +3 -3
  53. package/dist/tsdown.mjs +1 -1
  54. package/dist/tsup.cjs +2 -2
  55. package/dist/types.cjs +0 -0
  56. package/dist/types.d.cts +8 -0
  57. package/dist/types.d.cts.map +1 -0
  58. package/dist/types.d.mts +8 -0
  59. package/dist/types.d.mts.map +1 -0
  60. package/dist/types.mjs +1 -0
  61. package/dist/typescript.cjs +9 -0
  62. package/dist/typescript.d.cts +1 -0
  63. package/dist/typescript.d.mts +1 -0
  64. package/dist/typescript.mjs +3 -0
  65. package/dist/unbuild.cjs +17 -0
  66. package/dist/unbuild.d.cts +2 -0
  67. package/dist/unbuild.d.mts +2 -0
  68. package/dist/unbuild.mjs +3 -0
  69. package/dist/unloader.cjs +1 -1
  70. package/dist/unplugin.cjs +13 -14
  71. package/dist/unplugin.d.cts +3 -2
  72. package/dist/unplugin.d.cts.map +1 -1
  73. package/dist/unplugin.d.mts +3 -2
  74. package/dist/unplugin.d.mts.map +1 -1
  75. package/dist/unplugin.mjs +11 -13
  76. package/dist/unplugin.mjs.map +1 -1
  77. package/dist/utils.cjs +0 -14
  78. package/dist/utils.d.mts +1 -1
  79. package/dist/utils.mjs +2 -15
  80. package/dist/vite.cjs +4 -4
  81. package/dist/vite.mjs +1 -1
  82. package/dist/vite.mjs.map +1 -1
  83. package/dist/webpack.cjs +2 -2
  84. package/package.json +64 -53
  85. package/dist/api-CyXUks49.mjs +0 -1078
  86. package/dist/api-CyXUks49.mjs.map +0 -1
  87. package/dist/api-DITWluqG.cjs +0 -1098
  88. package/dist/api-context-BDFU_IC7.cjs +0 -3066
  89. package/dist/api-context-Cb99qIjE.mjs +0 -2986
  90. package/dist/api-context-Cb99qIjE.mjs.map +0 -1
  91. package/dist/config.mjs.map +0 -1
  92. package/dist/constants.mjs.map +0 -1
  93. package/dist/context/index.cjs +0 -7
  94. package/dist/context/index.d.cts +0 -600
  95. package/dist/context/index.d.cts.map +0 -1
  96. package/dist/context/index.d.mts +0 -600
  97. package/dist/context/index.d.mts.map +0 -1
  98. package/dist/context/index.mjs +0 -3
  99. package/dist/plugin-utils.mjs.map +0 -1
  100. package/dist/storage/index.cjs +0 -9
  101. package/dist/storage/index.d.cts +0 -419
  102. package/dist/storage/index.d.cts.map +0 -1
  103. package/dist/storage/index.d.mts +0 -419
  104. package/dist/storage/index.d.mts.map +0 -1
  105. package/dist/storage/index.mjs +0 -3
  106. package/dist/ts-morph-B85ZbV1Q.mjs +0 -102
  107. package/dist/ts-morph-B85ZbV1Q.mjs.map +0 -1
  108. package/dist/ts-morph-BvE8TMhv.cjs +0 -114
  109. package/dist/tsconfig-BjkktvB9.cjs +0 -198
  110. package/dist/tsconfig-DoV1dUYg.mjs +0 -155
  111. package/dist/tsconfig-DoV1dUYg.mjs.map +0 -1
  112. package/dist/types-9O-s0Fpu.d.mts +0 -4
  113. package/dist/types-9O-s0Fpu.d.mts.map +0 -1
  114. package/dist/types-DerAvFjs.d.cts +0 -4
  115. package/dist/types-DerAvFjs.d.cts.map +0 -1
  116. package/dist/typescript/index.cjs +0 -13
  117. package/dist/typescript/index.d.cts +0 -106
  118. package/dist/typescript/index.d.cts.map +0 -1
  119. package/dist/typescript/index.d.mts +0 -106
  120. package/dist/typescript/index.d.mts.map +0 -1
  121. package/dist/typescript/index.mjs +0 -4
  122. package/dist/utils.mjs.map +0 -1
  123. package/dist/virtual-BNy8T32w.cjs +0 -548
  124. package/dist/virtual-PaZGNIrj.mjs +0 -513
  125. package/dist/virtual-PaZGNIrj.mjs.map +0 -1
@@ -1,513 +0,0 @@
1
- import { t as utils_exports } from "./utils.mjs";
2
- import { exists, existsSync } from "@stryke/fs/exists";
3
- import { createDirectory, createDirectorySync } from "@stryke/fs/helpers";
4
- import { listFiles, listFilesSync } from "@stryke/fs/list-files";
5
- import { appendPath } from "@stryke/path/append";
6
- import { isParentPath } from "@stryke/path/is-parent-path";
7
- import { isError } from "@stryke/type-checks/is-error";
8
- import { isSetString } from "@stryke/type-checks/is-set-string";
9
- import { joinPaths } from "@stryke/path/join";
10
- import { correctPath } from "@stryke/path/correct-path";
11
- import { isDirectory, isFile } from "@stryke/fs/is-file";
12
- import { readFile, readFileSync } from "@stryke/fs/read-file";
13
- import { writeFile, writeFileSync } from "@stryke/fs/write-file";
14
- import { unlinkSync } from "node:fs";
15
- import { unlink } from "node:fs/promises";
16
- import { resolve } from "node:path";
17
-
18
- //#region src/storage/base.ts
19
- /**
20
- * Abstract base class for storage adapters, providing a template for storage operations.
21
- */
22
- var BaseStorageAdapter = class {
23
- /**
24
- * Indicates whether the storage adapter has been disposed.
25
- */
26
- #isDisposed = false;
27
- /**
28
- * Configuration options for the storage adapter.
29
- */
30
- options;
31
- /**
32
- * The storage preset for the adapter.
33
- *
34
- * @remarks
35
- * This can be used as an alternate way to identify the type of storage being used.
36
- */
37
- preset = null;
38
- /**
39
- * Constructor for the BaseStorageAdapter.
40
- *
41
- * @param context - The Powerlines context.
42
- * @param options - Configuration options for the storage adapter.
43
- */
44
- constructor(context, options = { base: "/" }) {
45
- this.context = context;
46
- this.options = options;
47
- this.options.base = resolve(options.base);
48
- this.options.isReadOnly = !!options.isReadOnly;
49
- }
50
- /**
51
- * Asynchronously checks if a key exists in the storage.
52
- *
53
- * @param key - The key to check for existence.
54
- * @returns A promise that resolves to `true` if the key exists, otherwise `false`.
55
- */
56
- async exists(key) {
57
- return this.existsSync(key);
58
- }
59
- /**
60
- * Asynchronously retrieves the value associated with a given key.
61
- *
62
- * @param key - The key whose value is to be retrieved.
63
- * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.
64
- */
65
- async get(key) {
66
- return this.getSync(key);
67
- }
68
- /**
69
- * Asynchronously sets the value for a given key.
70
- *
71
- * @param key - The key to set the value for.
72
- * @param value - The value to set.
73
- */
74
- async set(key, value) {
75
- if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) this.setSync(key, value);
76
- }
77
- /**
78
- * Synchronously creates a directory at the specified path.
79
- *
80
- * @param _ - The path of the directory to create.
81
- */
82
- mkdirSync(_) {}
83
- /**
84
- * Creates a directory at the specified path.
85
- *
86
- * @param dirPath - The path of the directory to create.
87
- */
88
- async mkdir(dirPath) {
89
- return Promise.resolve(this.mkdirSync(dirPath));
90
- }
91
- /**
92
- * Asynchronously removes a key from the storage.
93
- *
94
- * @param key - The key to remove.
95
- */
96
- async remove(key) {
97
- if (!this.isReadOnly && this.overwrite) this.removeSync(key);
98
- }
99
- /**
100
- * Synchronously removes all entries from the storage that match the provided base path.
101
- *
102
- * @param base - The base path to clear keys from.
103
- */
104
- clearSync(base) {
105
- if (!this.isReadOnly && this.overwrite) {
106
- const keys = this.listSync(base || this.options.base);
107
- if (!keys.length) return;
108
- keys.map((key) => this.removeSync(base && !key.startsWith(base) ? joinPaths(base, key) : key));
109
- }
110
- }
111
- /**
112
- * Asynchronously removes all entries from the storage that match the provided base path.
113
- *
114
- * @param base - The base path to clear keys from.
115
- * @returns A promise that resolves when the operation is complete.
116
- */
117
- async clear(base) {
118
- if (!this.isReadOnly && this.overwrite) {
119
- const keys = await this.list(base || this.options.base);
120
- if (!keys.length) return;
121
- await Promise.all(keys.map(async (key) => this.remove(base && !key.startsWith(base) ? joinPaths(base, key) : key)));
122
- }
123
- }
124
- /**
125
- * Asynchronously lists all keys under a given base path.
126
- *
127
- * @param base - The base path to list keys from.
128
- * @returns A promise that resolves to an array of keys under the specified base path.
129
- */
130
- async list(base) {
131
- return this.listSync(base);
132
- }
133
- /**
134
- * Synchronously checks if the given key is a directory.
135
- *
136
- * @param _ - The key to check.
137
- * @returns `true` if the key is a directory, otherwise `false`.
138
- */
139
- isDirectorySync(_) {
140
- return false;
141
- }
142
- /**
143
- * Checks if the given key is a directory.
144
- *
145
- * @param key - The key to check.
146
- * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.
147
- */
148
- async isDirectory(key) {
149
- return Promise.resolve(this.isDirectorySync(key));
150
- }
151
- /**
152
- * Synchronously checks if the given key is a file.
153
- *
154
- * @param key - The key to check.
155
- * @returns `true` if the key is a file, otherwise `false`.
156
- */
157
- isFileSync(key) {
158
- return this.existsSync(key) && !this.isDirectorySync(key);
159
- }
160
- /**
161
- * Checks if the given key is a file.
162
- *
163
- * @param key - The key to check.
164
- * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.
165
- */
166
- async isFile(key) {
167
- return Promise.resolve(this.isFileSync(key));
168
- }
169
- /**
170
- * Disposes of the storage adapter, releasing any held resources.
171
- *
172
- * @returns A promise that resolves when the disposal is complete.
173
- */
174
- dispose() {
175
- return Promise.resolve();
176
- }
177
- /**
178
- * Async dispose method to clean up resources.
179
- *
180
- * @returns A promise that resolves when disposal is complete.
181
- */
182
- async [Symbol.asyncDispose]() {
183
- return this._dispose();
184
- }
185
- /**
186
- * Determines if the storage adapter is read-only based on the provided options.
187
- *
188
- * @returns `true` if the storage adapter is read-only, otherwise `false`.
189
- */
190
- get isReadOnly() {
191
- return !!this.options.isReadOnly;
192
- }
193
- /**
194
- * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.
195
- *
196
- * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.
197
- */
198
- get overwrite() {
199
- return !this.isReadOnly && this.context.config.output.overwrite !== false;
200
- }
201
- /**
202
- * Resolves a given key to its full path within the storage adapter.
203
- *
204
- * @param key - The key to resolve.
205
- * @returns The resolved full path for the key.
206
- */
207
- resolve(key) {
208
- if (!key) return this.options.base;
209
- if (/\.\.:|\.\.$/.test(key)) throw new Error(`[${this.name}]: Invalid key: ${JSON.stringify(key)} provided to storage adapter.`);
210
- return appendPath(correctPath(key).replace(/:/g, "/"), this.options.base);
211
- }
212
- /**
213
- * Disposes of the storage adapter, releasing any held resources.
214
- *
215
- * @returns A promise that resolves when the disposal is complete.
216
- */
217
- async _dispose() {
218
- if (!this.#isDisposed) {
219
- await Promise.resolve(this.dispose());
220
- this.#isDisposed = true;
221
- }
222
- }
223
- };
224
-
225
- //#endregion
226
- //#region src/storage/helpers.ts
227
- /**
228
- * Checks if an error is a file system error.
229
- *
230
- * @param err - The error to check.
231
- * @returns `true` if the error is a file system error, otherwise `false`.
232
- */
233
- function isFileError(err) {
234
- return isError(err) && "code" in err && err.code;
235
- }
236
- /**
237
- * Ignores file not found errors.
238
- *
239
- * @param err - The error to check.
240
- * @returns `null` if the error is a file not found error, otherwise returns the error.
241
- */
242
- function ignoreNotfound(err) {
243
- return isFileError(err) && (err.code === "ENOENT" || err.code === "EISDIR" ? null : err);
244
- }
245
- /**
246
- * Ignores file exists errors.
247
- *
248
- * @param err - The error to check.
249
- * @returns `null` if the error is a file exists error, otherwise returns the error.
250
- */
251
- function ignoreExists(err) {
252
- return isFileError(err) && err.code === "EEXIST" ? null : err;
253
- }
254
-
255
- //#endregion
256
- //#region src/storage/file-system.ts
257
- /**
258
- * File system storage adapter implementation.
259
- */
260
- var FileSystemStorageAdapter = class extends BaseStorageAdapter {
261
- /**
262
- * A name identifying the storage adapter type.
263
- */
264
- name = "file-system";
265
- /**
266
- * The storage preset for the adapter.
267
- *
268
- * @remarks
269
- * This can be used as an alternate way to identify the type of storage being used.
270
- */
271
- preset = "fs";
272
- /**
273
- * Constructor for the FileSystemStorageAdapter.
274
- *
275
- * @param context - The Powerlines context.
276
- * @param options - Configuration options for the storage adapter.
277
- */
278
- constructor(context, options) {
279
- super(context, options);
280
- }
281
- /**
282
- * Synchronously checks if a key exists in the storage.
283
- *
284
- * @param key - The key to check for existence.
285
- * @returns Returns `true` if the key exists, otherwise `false`.
286
- */
287
- existsSync(key) {
288
- return existsSync(this.resolve(key));
289
- }
290
- /**
291
- * Asynchronously checks if a key exists in the storage.
292
- *
293
- * @param key - The key to check for existence.
294
- * @returns A promise that resolves to `true` if the key exists, otherwise `false`.
295
- */
296
- async exists(key) {
297
- return exists(this.resolve(key));
298
- }
299
- /**
300
- * Synchronously retrieves the value associated with a given key.
301
- *
302
- * @param key - The key whose value is to be retrieved.
303
- * @returns The value associated with the key, or `null` if the key does not exist.
304
- */
305
- getSync(key) {
306
- return readFileSync(this.resolve(key));
307
- }
308
- /**
309
- * Asynchronously retrieves the value associated with a given key.
310
- *
311
- * @param key - The key whose value is to be retrieved.
312
- * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.
313
- */
314
- async get(key) {
315
- return readFile(this.resolve(key));
316
- }
317
- /**
318
- * Synchronously sets the value for a given key.
319
- *
320
- * @param key - The key to set the value for.
321
- * @param value - The value to set.
322
- */
323
- setSync(key, value) {
324
- if (!this.isReadOnly) if (this.existsSync(this.resolve(key)) && !this.overwrite) {
325
- const existingValue = this.getSync(this.resolve(key));
326
- if (isSetString(existingValue) && existingValue.includes((0, utils_exports.getFileHeaderWarningText)(true, this.context.config.framework))) return writeFileSync(this.resolve(key), existingValue.replace((0, utils_exports.getFileHeaderWarningText)(true, this.context.config.framework), (0, utils_exports.getFileHeaderWarningText)(false, this.context.config.framework)));
327
- } else return writeFileSync(this.resolve(key), value);
328
- }
329
- /**
330
- * Asynchronously sets the value for a given key.
331
- *
332
- * @param key - The key to set the value for.
333
- * @param value - The value to set.
334
- */
335
- async set(key, value) {
336
- if (!this.isReadOnly) if (this.existsSync(this.resolve(key)) && !this.overwrite) {
337
- const existingValue = await this.get(this.resolve(key));
338
- if (isSetString(existingValue) && existingValue.includes((0, utils_exports.getFileHeaderWarningText)(true, this.context.config.framework))) return writeFile(this.resolve(key), existingValue.replace((0, utils_exports.getFileHeaderWarningText)(true, this.context.config.framework), (0, utils_exports.getFileHeaderWarningText)(false, this.context.config.framework)));
339
- } else return writeFile(this.resolve(key), value);
340
- }
341
- /**
342
- * Synchronously removes a key from the storage.
343
- *
344
- * @param key - The key to remove.
345
- */
346
- removeSync(key) {
347
- if (!this.isReadOnly && this.overwrite) try {
348
- return unlinkSync(this.resolve(key));
349
- } catch (err) {
350
- return ignoreNotfound(err);
351
- }
352
- }
353
- /**
354
- * Asynchronously removes a key from the storage.
355
- *
356
- * @param key - The key to remove.
357
- */
358
- async remove(key) {
359
- if (!this.isReadOnly && this.overwrite) return unlink(this.resolve(key)).catch(ignoreNotfound);
360
- }
361
- /**
362
- * Synchronously creates a directory at the specified path.
363
- *
364
- * @param dirPath - The path of the directory to create.
365
- */
366
- mkdirSync(dirPath) {
367
- createDirectorySync(this.resolve(dirPath));
368
- }
369
- /**
370
- * Creates a directory at the specified path.
371
- *
372
- * @param dirPath - The path of the directory to create.
373
- */
374
- async mkdir(dirPath) {
375
- await createDirectory(this.resolve(dirPath));
376
- }
377
- /**
378
- * Lists all keys under a given base path synchronously.
379
- *
380
- * @param base - The base path to list keys from.
381
- * @returns An array of keys under the specified base path.
382
- */
383
- listSync(base) {
384
- try {
385
- return listFilesSync(this.resolve(base), { ignore: this.options.ignore });
386
- } catch (err) {
387
- return ignoreNotfound(err) ?? [];
388
- }
389
- }
390
- /**
391
- * Asynchronously lists all keys under a given base path.
392
- *
393
- * @param base - The base path to list keys from.
394
- * @returns A promise that resolves to an array of keys under the specified base path.
395
- */
396
- async list(base) {
397
- return listFiles(this.resolve(base), { ignore: this.options.ignore }).catch(ignoreNotfound).then((r) => r || []);
398
- }
399
- /**
400
- * Synchronously checks if the given key is a directory.
401
- *
402
- * @param key - The key to check.
403
- * @returns `true` if the key is a directory, otherwise `false`.
404
- */
405
- isDirectorySync(key) {
406
- return isDirectory(this.resolve(key));
407
- }
408
- /**
409
- * Synchronously checks if the given key is a file.
410
- *
411
- * @param key - The key to check.
412
- * @returns `true` if the key is a file, otherwise `false`.
413
- */
414
- isFileSync(key) {
415
- return isFile(this.resolve(key));
416
- }
417
- };
418
-
419
- //#endregion
420
- //#region src/storage/virtual.ts
421
- /**
422
- * Virtual/in-memory storage adapter implementation.
423
- */
424
- var VirtualStorageAdapter = class extends BaseStorageAdapter {
425
- /**
426
- * A name identifying the storage adapter type.
427
- */
428
- name = "virtual";
429
- /**
430
- * The storage preset for the adapter.
431
- *
432
- * @remarks
433
- * This can be used as an alternate way to identify the type of storage being used.
434
- */
435
- preset = "virtual";
436
- /**
437
- * In-memory data storage.
438
- */
439
- data = /* @__PURE__ */ new Map();
440
- /**
441
- * Constructor for the VirtualStorageAdapter.
442
- *
443
- * @param context - The Powerlines context.
444
- * @param options - Configuration options for the storage adapter.
445
- */
446
- constructor(context, options) {
447
- super(context, options);
448
- }
449
- /**
450
- * Synchronously checks if a key exists in the storage.
451
- *
452
- * @param key - The key to check for existence.
453
- * @returns Returns `true` if the key exists, otherwise `false`.
454
- */
455
- existsSync(key) {
456
- return this.data.has(this.resolve(key));
457
- }
458
- /**
459
- * Synchronously retrieves the value associated with a given key.
460
- *
461
- * @param key - The key whose value is to be retrieved.
462
- * @returns The value associated with the key, or `null` if the key does not exist.
463
- */
464
- getSync(key) {
465
- return this.data.get(this.resolve(key)) ?? null;
466
- }
467
- /**
468
- * Synchronously sets the value for a given key.
469
- *
470
- * @param key - The key to set the value for.
471
- * @param value - The value to set.
472
- */
473
- setSync(key, value) {
474
- if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) this.data.set(this.resolve(key), value);
475
- }
476
- /**
477
- * Synchronously removes a key from the storage.
478
- *
479
- * @param key - The key to remove.
480
- */
481
- removeSync(key) {
482
- if (!this.isReadOnly && this.overwrite) this.data.delete(this.resolve(key));
483
- }
484
- /**
485
- * Lists all keys under a given base path synchronously.
486
- *
487
- * @param base - The base path to list keys from.
488
- * @returns An array of keys under the specified base path.
489
- */
490
- listSync(base) {
491
- return [...this.data.keys().filter((key) => !base ? true : isParentPath(key, this.resolve(base)))];
492
- }
493
- /**
494
- * Disposes of the storage adapter, releasing any held resources.
495
- *
496
- * @returns A promise that resolves when the disposal is complete.
497
- */
498
- async dispose() {
499
- return this.clear();
500
- }
501
- /**
502
- * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.
503
- *
504
- * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.
505
- */
506
- get overwrite() {
507
- return !this.isReadOnly;
508
- }
509
- };
510
-
511
- //#endregion
512
- export { isFileError as a, ignoreNotfound as i, FileSystemStorageAdapter as n, BaseStorageAdapter as o, ignoreExists as r, VirtualStorageAdapter as t };
513
- //# sourceMappingURL=virtual-PaZGNIrj.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual-PaZGNIrj.mjs","names":["#isDisposed"],"sources":["../src/storage/base.ts","../src/storage/helpers.ts","../src/storage/file-system.ts","../src/storage/virtual.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { appendPath } from \"@stryke/path/append\";\nimport { correctPath } from \"@stryke/path/correct-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport { resolve } from \"node:path\";\nimport type { Context, StorageAdapter, StoragePreset } from \"../types\";\n\nexport interface StorageAdapterOptions {\n base: string;\n isReadOnly?: boolean;\n ignore?: string | string[];\n}\n\n/**\n * Abstract base class for storage adapters, providing a template for storage operations.\n */\nexport abstract class BaseStorageAdapter<\n TOptions extends StorageAdapterOptions = StorageAdapterOptions\n> implements StorageAdapter {\n /**\n * Indicates whether the storage adapter has been disposed.\n */\n #isDisposed = false;\n\n /**\n * A name identifying the storage adapter type.\n */\n public abstract name: string;\n\n /**\n * Configuration options for the storage adapter.\n */\n public options: TOptions;\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public readonly preset?: StoragePreset | null = null;\n\n /**\n * Constructor for the BaseStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(\n protected context: Context,\n options: TOptions = { base: \"/\" } as TOptions\n ) {\n this.options = options;\n this.options.base = resolve(options.base);\n this.options.isReadOnly = !!options.isReadOnly;\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public abstract existsSync(key: string): boolean;\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public async exists(key: string): Promise<boolean> {\n return this.existsSync(key);\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public abstract getSync(key: string): string | null;\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public async get(key: string): Promise<string | null> {\n return this.getSync(key);\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public abstract setSync(key: string, value: string): void;\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public async set(key: string, value: string): Promise<void> {\n if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) {\n this.setSync(key, value);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param _ - The path of the directory to create.\n */\n public mkdirSync(_: string) {}\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public async mkdir(dirPath: string): Promise<void> {\n return Promise.resolve(this.mkdirSync(dirPath));\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public abstract removeSync(key: string): void;\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public async remove(key: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n this.removeSync(key);\n }\n }\n\n /**\n * Synchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n */\n public clearSync(base?: string) {\n if (!this.isReadOnly && this.overwrite) {\n const keys = this.listSync(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n keys.map(key =>\n this.removeSync(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n );\n }\n }\n\n /**\n * Asynchronously removes all entries from the storage that match the provided base path.\n *\n * @param base - The base path to clear keys from.\n * @returns A promise that resolves when the operation is complete.\n */\n public async clear(base?: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n const keys = await this.list(base || this.options.base);\n if (!keys.length) {\n return;\n }\n\n await Promise.all(\n keys.map(async key =>\n this.remove(\n base && !key.startsWith(base) ? joinPaths(base, key) : key\n )\n )\n );\n }\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public abstract listSync(base?: string): string[];\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public async list(base?: string): Promise<string[]> {\n return this.listSync(base);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param _ - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public isDirectorySync(_: string): boolean {\n return false;\n }\n\n /**\n * Checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a directory, otherwise `false`.\n */\n public async isDirectory(key: string) {\n return Promise.resolve(this.isDirectorySync(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public isFileSync(key: string): boolean {\n return this.existsSync(key) && !this.isDirectorySync(key);\n }\n\n /**\n * Checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns A promise that resolves to `true` if the key is a file, otherwise `false`.\n */\n public async isFile(key: string) {\n return Promise.resolve(this.isFileSync(key));\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n public dispose(): MaybePromise<void> {\n return Promise.resolve();\n }\n\n /**\n * Async dispose method to clean up resources.\n *\n * @returns A promise that resolves when disposal is complete.\n */\n public async [Symbol.asyncDispose]() {\n return this._dispose();\n }\n\n /**\n * Determines if the storage adapter is read-only based on the provided options.\n *\n * @returns `true` if the storage adapter is read-only, otherwise `false`.\n */\n protected get isReadOnly() {\n return !!this.options.isReadOnly;\n }\n\n /**\n * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.\n *\n * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.\n */\n protected get overwrite() {\n return !this.isReadOnly && this.context.config.output.overwrite !== false;\n }\n\n /**\n * Resolves a given key to its full path within the storage adapter.\n *\n * @param key - The key to resolve.\n * @returns The resolved full path for the key.\n */\n protected resolve(key?: string) {\n if (!key) {\n return this.options.base;\n }\n\n if (/\\.\\.:|\\.\\.$/.test(key)) {\n throw new Error(\n `[${this.name}]: Invalid key: ${JSON.stringify(key)} provided to storage adapter.`\n );\n }\n\n return appendPath(correctPath(key).replace(/:/g, \"/\"), this.options.base);\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n protected async _dispose(): Promise<void> {\n if (!this.#isDisposed) {\n await Promise.resolve(this.dispose());\n this.#isDisposed = true;\n }\n }\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isError } from \"@stryke/type-checks/is-error\";\n\n/**\n * Checks if an error is a file system error.\n *\n * @param err - The error to check.\n * @returns `true` if the error is a file system error, otherwise `false`.\n */\nexport function isFileError(err: any) {\n return isError(err) && \"code\" in err && err.code;\n}\n\n/**\n * Ignores file not found errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file not found error, otherwise returns the error.\n */\nexport function ignoreNotfound(err: any) {\n return (\n isFileError(err) &&\n (err.code === \"ENOENT\" || err.code === \"EISDIR\" ? null : err)\n );\n}\n\n/**\n * Ignores file exists errors.\n *\n * @param err - The error to check.\n * @returns `null` if the error is a file exists error, otherwise returns the error.\n */\nexport function ignoreExists(err: any) {\n return isFileError(err) && err.code === \"EEXIST\" ? null : err;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { exists, existsSync } from \"@stryke/fs/exists\";\nimport { createDirectory, createDirectorySync } from \"@stryke/fs/helpers\";\nimport { isDirectory, isFile } from \"@stryke/fs/is-file\";\nimport { listFiles, listFilesSync } from \"@stryke/fs/list-files\";\nimport { readFile, readFileSync } from \"@stryke/fs/read-file\";\nimport { writeFile, writeFileSync } from \"@stryke/fs/write-file\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { unlinkSync } from \"node:fs\";\nimport { unlink } from \"node:fs/promises\";\nimport type { Context } from \"../types\";\nimport { getFileHeaderWarningText } from \"../utils\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\nimport { ignoreNotfound } from \"./helpers\";\n\nexport type SetSyncOptions = Parameters<typeof writeFileSync>[2];\nexport type SetOptions = Parameters<typeof writeFile>[2];\n\n/**\n * File system storage adapter implementation.\n */\nexport class FileSystemStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"file-system\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"fs\";\n\n /**\n * Constructor for the FileSystemStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(context: Context, options?: StorageAdapterOptions) {\n super(context, options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return existsSync(this.resolve(key));\n }\n\n /**\n * Asynchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns A promise that resolves to `true` if the key exists, otherwise `false`.\n */\n public override async exists(key: string): Promise<boolean> {\n return exists(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return readFileSync(this.resolve(key));\n }\n\n /**\n * Asynchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns A promise that resolves to the value associated with the key, or `null` if the key does not exist.\n */\n public override async get(key: string): Promise<string | null> {\n return readFile(this.resolve(key));\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.isReadOnly) {\n if (this.existsSync(this.resolve(key)) && !this.overwrite) {\n const existingValue = this.getSync(this.resolve(key));\n if (\n isSetString(existingValue) &&\n existingValue.includes(\n getFileHeaderWarningText(true, this.context.config.framework)\n )\n ) {\n return writeFileSync(\n this.resolve(key),\n existingValue.replace(\n getFileHeaderWarningText(true, this.context.config.framework),\n getFileHeaderWarningText(false, this.context.config.framework)\n )\n );\n }\n } else {\n return writeFileSync(this.resolve(key), value);\n }\n }\n }\n\n /**\n * Asynchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public override async set(key: string, value: string): Promise<void> {\n if (!this.isReadOnly) {\n if (this.existsSync(this.resolve(key)) && !this.overwrite) {\n const existingValue = await this.get(this.resolve(key));\n if (\n isSetString(existingValue) &&\n existingValue.includes(\n getFileHeaderWarningText(true, this.context.config.framework)\n )\n ) {\n return writeFile(\n this.resolve(key),\n existingValue.replace(\n getFileHeaderWarningText(true, this.context.config.framework),\n getFileHeaderWarningText(false, this.context.config.framework)\n )\n );\n }\n } else {\n return writeFile(this.resolve(key), value);\n }\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.isReadOnly && this.overwrite) {\n try {\n return unlinkSync(this.resolve(key));\n } catch (err) {\n return ignoreNotfound(err);\n }\n }\n }\n\n /**\n * Asynchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public override async remove(key: string): Promise<void> {\n if (!this.isReadOnly && this.overwrite) {\n return unlink(this.resolve(key)).catch(ignoreNotfound);\n }\n }\n\n /**\n * Synchronously creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override mkdirSync(dirPath: string) {\n createDirectorySync(this.resolve(dirPath));\n }\n\n /**\n * Creates a directory at the specified path.\n *\n * @param dirPath - The path of the directory to create.\n */\n public override async mkdir(dirPath: string): Promise<void> {\n await createDirectory(this.resolve(dirPath));\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n try {\n return listFilesSync(this.resolve(base), {\n ignore: this.options.ignore\n });\n } catch (err) {\n return ignoreNotfound(err) ?? [];\n }\n }\n\n /**\n * Asynchronously lists all keys under a given base path.\n *\n * @param base - The base path to list keys from.\n * @returns A promise that resolves to an array of keys under the specified base path.\n */\n public override async list(base?: string): Promise<string[]> {\n return listFiles(this.resolve(base), {\n ignore: this.options.ignore\n })\n .catch(ignoreNotfound)\n .then(r => r || []);\n }\n\n /**\n * Synchronously checks if the given key is a directory.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a directory, otherwise `false`.\n */\n public override isDirectorySync(key: string): boolean {\n return isDirectory(this.resolve(key));\n }\n\n /**\n * Synchronously checks if the given key is a file.\n *\n * @param key - The key to check.\n * @returns `true` if the key is a file, otherwise `false`.\n */\n public override isFileSync(key: string): boolean {\n return isFile(this.resolve(key));\n }\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport type { Context } from \"../types\";\nimport { BaseStorageAdapter, StorageAdapterOptions } from \"./base\";\n\n/**\n * Virtual/in-memory storage adapter implementation.\n */\nexport class VirtualStorageAdapter extends BaseStorageAdapter {\n /**\n * A name identifying the storage adapter type.\n */\n public name = \"virtual\";\n\n /**\n * The storage preset for the adapter.\n *\n * @remarks\n * This can be used as an alternate way to identify the type of storage being used.\n */\n public override readonly preset = \"virtual\";\n\n /**\n * In-memory data storage.\n */\n protected data = new Map<string, any>();\n\n /**\n * Constructor for the VirtualStorageAdapter.\n *\n * @param context - The Powerlines context.\n * @param options - Configuration options for the storage adapter.\n */\n public constructor(context: Context, options?: StorageAdapterOptions) {\n super(context, options);\n }\n\n /**\n * Synchronously checks if a key exists in the storage.\n *\n * @param key - The key to check for existence.\n * @returns Returns `true` if the key exists, otherwise `false`.\n */\n public existsSync(key: string): boolean {\n return this.data.has(this.resolve(key));\n }\n\n /**\n * Synchronously retrieves the value associated with a given key.\n *\n * @param key - The key whose value is to be retrieved.\n * @returns The value associated with the key, or `null` if the key does not exist.\n */\n public getSync(key: string): string | null {\n return this.data.get(this.resolve(key)) ?? null;\n }\n\n /**\n * Synchronously sets the value for a given key.\n *\n * @param key - The key to set the value for.\n * @param value - The value to set.\n */\n public setSync(key: string, value: string) {\n if (!this.isReadOnly && (!this.existsSync(key) || this.overwrite)) {\n this.data.set(this.resolve(key), value);\n }\n }\n\n /**\n * Synchronously removes a key from the storage.\n *\n * @param key - The key to remove.\n */\n public removeSync(key: string) {\n if (!this.isReadOnly && this.overwrite) {\n this.data.delete(this.resolve(key));\n }\n }\n\n /**\n * Lists all keys under a given base path synchronously.\n *\n * @param base - The base path to list keys from.\n * @returns An array of keys under the specified base path.\n */\n public listSync(base?: string): string[] {\n return [\n ...this.data\n .keys()\n .filter(key => (!base ? true : isParentPath(key, this.resolve(base))))\n ];\n }\n\n /**\n * Disposes of the storage adapter, releasing any held resources.\n *\n * @returns A promise that resolves when the disposal is complete.\n */\n public override async dispose(): Promise<void> {\n return this.clear();\n }\n\n /**\n * Determines if the storage adapter should overwrite existing keys based on the provided options and context configuration.\n *\n * @returns `true` if the storage adapter should overwrite existing keys, otherwise `false`.\n */\n protected override get overwrite() {\n return !this.isReadOnly;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,IAAsB,qBAAtB,MAE4B;;;;CAI1B,cAAc;;;;CAUd,AAAO;;;;;;;CAQP,AAAgB,SAA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