@powerlines/core 0.48.48 → 0.48.50
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/constants/log-level.d.cts +1 -1
- package/dist/constants/log-level.d.mts +1 -1
- package/dist/context/context.cjs +2 -2
- package/dist/context/context.mjs +2 -2
- package/dist/context/context.mjs.map +1 -1
- package/dist/lib/context-helpers.d.cts +4 -4
- package/dist/lib/context-helpers.d.mts +4 -4
- package/dist/lib/vfs.cjs +22 -8
- package/dist/lib/vfs.d.cts +7 -0
- package/dist/lib/vfs.d.cts.map +1 -1
- package/dist/lib/vfs.d.mts +7 -0
- package/dist/lib/vfs.d.mts.map +1 -1
- package/dist/lib/vfs.mjs +22 -8
- package/dist/lib/vfs.mjs.map +1 -1
- package/dist/types/config.d.cts +4 -0
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +4 -0
- package/dist/types/config.d.mts.map +1 -1
- package/package.json +6 -6
|
@@ -2,13 +2,13 @@ import { ExecutionContext } from "../types/context.mjs";
|
|
|
2
2
|
import { InferOverridableConfig, ResolvedConfig } from "../types/config.mjs";
|
|
3
3
|
//#region src/lib/context-helpers.d.ts
|
|
4
4
|
declare function getConfigProps<TResolvedConfig extends ResolvedConfig>(config?: TResolvedConfig["userConfig"] | TResolvedConfig["inlineConfig"] | TResolvedConfig["pluginConfig"] | InferOverridableConfig<TResolvedConfig>): ({
|
|
5
|
-
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "
|
|
5
|
+
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends infer T ? T extends Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] ? T extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T : { [K in keyof T]?: (T[K] extends object ? T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_1 : { [K_2 in keyof T_1]?: (T_1[K_2] extends object ? T_1[K_2] extends infer T_2 ? T_2 extends T_1[K_2] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_3 in keyof T_2]?: (T_2[K_3] extends object ? T_2[K_3] extends infer T_3 ? T_3 extends T_2[K_3] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_3]) | undefined } : never : never : T_1[K_2]) | undefined } : never : never : T[K]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"]) | undefined;
|
|
6
6
|
} & TResolvedConfig["userConfig"]) | ({
|
|
7
|
-
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "
|
|
7
|
+
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends infer T_1 ? T_1 extends Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] ? T_1 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_1 : { [K_1 in keyof T_1]?: (T_1[K_1] extends object ? T_1[K_1] extends infer T_2 ? T_2 extends T_1[K_1] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_3 in keyof T_2]?: (T_2[K_3] extends object ? T_2[K_3] extends infer T_3 ? T_3 extends T_2[K_3] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_3]) | undefined } : never : never : T_1[K_1]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"]) | undefined;
|
|
8
8
|
} & TResolvedConfig["inlineConfig"]) | ({
|
|
9
|
-
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "
|
|
9
|
+
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends infer T_2 ? T_2 extends Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] ? T_2 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_2 : { [K_2 in keyof T_2]?: (T_2[K_2] extends object ? T_2[K_2] extends infer T_3 ? T_3 extends T_2[K_2] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_4 in keyof T_3]?: (T_3[K_4] extends object ? T_3[K_4] extends infer T_4 ? T_4 extends T_3[K_4] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] extends infer T_10 ? T_10 extends T_9[K_10] ? T_10 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_10 : { [K_11 in keyof T_10]?: (T_10[K_11] extends object ? T_10[K_11] : T_10[K_11]) | undefined } : never : never : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_4]) | undefined } : never : never : T_2[K_2]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"]) | undefined;
|
|
10
10
|
} & TResolvedConfig["pluginConfig"]) | ({
|
|
11
|
-
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "
|
|
11
|
+
input: import("@stryke/types/configuration").FileReference | import("@stryke/types/configuration").FileReferenceInput[] | Record<string, import("@stryke/types/configuration").FileReferenceInput | import("@stryke/types/configuration").FileReferenceInput[]> | TResolvedConfig["input"] | (Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends object ? Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] extends infer T_3 ? T_3 extends Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"] ? T_3 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_3 : { [K_3 in keyof T_3]?: (T_3[K_3] extends object ? T_3[K_3] extends infer T_4 ? T_4 extends T_3[K_3] ? T_4 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_4 : { [K_5 in keyof T_4]?: (T_4[K_5] extends object ? T_4[K_5] extends infer T_5 ? T_5 extends T_4[K_5] ? T_5 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_5 : { [K_6 in keyof T_5]?: (T_5[K_6] extends object ? T_5[K_6] extends infer T_6 ? T_6 extends T_5[K_6] ? T_6 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_6 : { [K_7 in keyof T_6]?: (T_6[K_7] extends object ? T_6[K_7] extends infer T_7 ? T_7 extends T_6[K_7] ? T_7 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_7 : { [K_8 in keyof T_7]?: (T_7[K_8] extends object ? T_7[K_8] extends infer T_8 ? T_8 extends T_7[K_8] ? T_8 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_8 : { [K_9 in keyof T_8]?: (T_8[K_9] extends object ? T_8[K_9] extends infer T_9 ? T_9 extends T_8[K_9] ? T_9 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_9 : { [K_10 in keyof T_9]?: (T_9[K_10] extends object ? T_9[K_10] extends infer T_10 ? T_10 extends T_9[K_10] ? T_10 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_10 : { [K_11 in keyof T_10]?: (T_10[K_11] extends object ? T_10[K_11] extends infer T_11 ? T_11 extends T_10[K_11] ? T_11 extends import("@stryke/types/base").BrowserNativeObject | import("@stryke/types/base").NestedValue<object> ? T_11 : { [K_12 in keyof T_11]?: (T_11[K_12] extends object ? T_11[K_12] : T_11[K_12]) | undefined } : never : never : T_10[K_11]) | undefined } : never : never : T_9[K_10]) | undefined } : never : never : T_8[K_9]) | undefined } : never : never : T_7[K_8]) | undefined } : never : never : T_6[K_7]) | undefined } : never : never : T_5[K_6]) | undefined } : never : never : T_4[K_5]) | undefined } : never : never : T_3[K_3]) | undefined } : never : never : Omit<TResolvedConfig, "cwd" | "configFile" | "pluginConfig" | "command" | "userConfig" | "inlineConfig">["input"]) | undefined;
|
|
12
12
|
} & InferOverridableConfig<TResolvedConfig>);
|
|
13
13
|
declare function resolvePluginConfig<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown, TContext extends ExecutionContext<TResolvedConfig, TSystemContext> = ExecutionContext<TResolvedConfig, TSystemContext>>(context: TContext): Promise<void>;
|
|
14
14
|
//#endregion
|
package/dist/lib/vfs.cjs
CHANGED
|
@@ -95,6 +95,12 @@ function normalizeGlobPatterns(workspaceRoot, patterns) {
|
|
|
95
95
|
* This class provides methods to manage virtual files, check their existence, retrieve their content, and manipulate the virtual file system. It allows for efficient file management and retrieval without relying on the actual file system.
|
|
96
96
|
*/
|
|
97
97
|
var VirtualFileSystem = class VirtualFileSystem {
|
|
98
|
+
/**
|
|
99
|
+
* An unstable storage property that can be used for testing or debugging purposes. This property is not intended for production use and may be removed or changed without warning in future releases.
|
|
100
|
+
*
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
static unstable_storage = null;
|
|
98
104
|
/**
|
|
99
105
|
* A map of virtual file IDs to their associated metadata.
|
|
100
106
|
*/
|
|
@@ -319,11 +325,15 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
319
325
|
* @returns A promise that resolves to a new virtual file system instance.
|
|
320
326
|
*/
|
|
321
327
|
static async create(context) {
|
|
322
|
-
context.
|
|
328
|
+
context.trace("Starting virtual file system (VFS) initialization processes...");
|
|
323
329
|
let result;
|
|
324
330
|
if (!context.config.skipCache && (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"))) {
|
|
325
|
-
|
|
326
|
-
|
|
331
|
+
if (!VirtualFileSystem.unstable_storage) {
|
|
332
|
+
context.debug("Reading virtual file system (VFS) from local storage");
|
|
333
|
+
const buffer = await (0, _stryke_fs_buffer.readFileBuffer)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"));
|
|
334
|
+
VirtualFileSystem.unstable_storage = new _stryke_capnp.Message(buffer, false).getRoot(require_fs.FileSystem);
|
|
335
|
+
}
|
|
336
|
+
const fs = VirtualFileSystem.unstable_storage;
|
|
327
337
|
result = new VirtualFileSystem(context, fs);
|
|
328
338
|
if (fs._hasStorage() && fs.storage.length > 0) await Promise.all(fs.storage.values().map(async (file) => {
|
|
329
339
|
if (file.path && file.code) {
|
|
@@ -343,7 +353,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
343
353
|
}
|
|
344
354
|
}));
|
|
345
355
|
} else result = new VirtualFileSystem(context, new _stryke_capnp.Message().initRoot(require_fs.FileSystem));
|
|
346
|
-
result.#logger.
|
|
356
|
+
result.#logger.trace("Successfully completed virtual file system (VFS) initialization.");
|
|
347
357
|
return result;
|
|
348
358
|
}
|
|
349
359
|
/**
|
|
@@ -353,11 +363,15 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
353
363
|
* @returns A new virtual file system instance.
|
|
354
364
|
*/
|
|
355
365
|
static createSync(context) {
|
|
356
|
-
context.
|
|
366
|
+
context.trace("Starting virtual file system (VFS) initialization processes...");
|
|
357
367
|
let result;
|
|
358
368
|
if (!context.config.skipCache && (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"))) {
|
|
359
|
-
|
|
360
|
-
|
|
369
|
+
if (!VirtualFileSystem.unstable_storage) {
|
|
370
|
+
context.debug("Reading virtual file system (VFS) from local storage");
|
|
371
|
+
const buffer = (0, _stryke_fs_buffer.readFileBufferSync)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"));
|
|
372
|
+
VirtualFileSystem.unstable_storage = new _stryke_capnp.Message(buffer, false).getRoot(require_fs.FileSystem);
|
|
373
|
+
}
|
|
374
|
+
const fs = VirtualFileSystem.unstable_storage;
|
|
361
375
|
result = new VirtualFileSystem(context, fs);
|
|
362
376
|
if (fs._hasStorage() && fs.storage.length > 0) fs.storage.values().forEach((file) => {
|
|
363
377
|
if (file.path && file.code) {
|
|
@@ -377,7 +391,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
377
391
|
}
|
|
378
392
|
});
|
|
379
393
|
} else result = new VirtualFileSystem(context, new _stryke_capnp.Message().initRoot(require_fs.FileSystem));
|
|
380
|
-
result.#logger.
|
|
394
|
+
result.#logger.trace("Successfully completed virtual file system (VFS) initialization.");
|
|
381
395
|
return result;
|
|
382
396
|
}
|
|
383
397
|
/**
|
package/dist/lib/vfs.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ResolveOptions, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "../types/fs.cjs";
|
|
2
2
|
import { Context } from "../types/context.cjs";
|
|
3
|
+
import { FileSystem } from "../schemas/fs.cjs";
|
|
3
4
|
import { AssetGlob } from "@stryke/types/file";
|
|
4
5
|
import { FlatCache } from "flat-cache";
|
|
5
6
|
|
|
@@ -12,6 +13,12 @@ import { FlatCache } from "flat-cache";
|
|
|
12
13
|
*/
|
|
13
14
|
declare class VirtualFileSystem implements VirtualFileSystemInterface {
|
|
14
15
|
#private;
|
|
16
|
+
/**
|
|
17
|
+
* An unstable storage property that can be used for testing or debugging purposes. This property is not intended for production use and may be removed or changed without warning in future releases.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
static unstable_storage: FileSystem | null;
|
|
15
22
|
/**
|
|
16
23
|
* Creates a virtual file system (VFS) that is backed up to a Cap'n Proto message buffer.
|
|
17
24
|
*
|
package/dist/lib/vfs.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vfs.d.cts","names":[],"sources":["../../src/lib/vfs.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vfs.d.cts","names":[],"sources":["../../src/lib/vfs.ts"],"mappings":";;;;;;;;;AA4LA;;;;cAAa,iBAAA,YAA6B,0BAAA;EAAA;EAmcM;;;;;EAAA,OA7bvC,gBAAA,EAAkB,UAAA;EA4oBL;;;;;;EAAA,OA/MA,MAAA,CAAO,OAAA,EAAS,OAAA,GAAU,OAAA,CAAQ,iBAAA;EAihB1C;;;;;;EAAA,OAlcE,UAAA,CAAW,OAAA,EAAS,OAAA,GAAU,iBAAA;EAioBtC;;;EAAA,IAvjBK,QAAA,IAAY,MAAA,SAAe,mBAAA;EAymB3B;;;EAAA,IA9kBA,GAAA,IAAO,MAAA;EA8nBE;;;EAAA,IAnmBT,KAAA,IAAS,MAAA;EAomBI;;;EAAA,cAvkBV,aAAA,IAAiB,SAAA;EA4nBV;;;;;;EAAA,QA7jBd,WAAA;EAu0B+B;;;;;;EAptBzB,MAAA,CAAO,IAAA,WAAe,OAAA;EAj2BK;;;;;;EA62BjC,UAAA,CAAW,IAAA;EA1aE;;;;;;;;EAwbb,SAAA,CACL,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA;EAlSD;;;;;;;;EA+TJ,eAAA,CACL,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA;EAhLL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A,IAAA,WACA,OAAA,GAAS,YAAA;;;;;;EAsCJ,SAAA,CAAU,OAAA;;;;;;EASJ,KAAA,CAAM,IAAA,WAAe,OAAA;;;;;;;EAU3B,WAAA,CAAY,QAAA,WAAmB,mBAAA;;;;;;;;;;EAkB/B,YAAA,CAAa,EAAA;;;;;;;;;;EAsEb,OAAA,CAAQ,EAAA;;;;;;;;;;EAqCR,cAAA,CAAe,EAAA;;;;;;;;;;;;;;;;;EAwBT,OAAA,CACX,EAAA,UACA,QAAA,WACA,OAAA,GAAS,cAAA,GACR,OAAA;;;;;;;;;;;;;;;;;EA+CI,WAAA,CACL,EAAA,UACA,QAAA,WACA,OAAA,GAAS,cAAA;;;;EAmCE,OAAA,IAAO,OAAA;;;;;;;GA4EN,MAAA,CAAO,YAAA,KAAa,OAAA;AAAA"}
|
package/dist/lib/vfs.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ResolveOptions, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "../types/fs.mjs";
|
|
2
2
|
import { Context } from "../types/context.mjs";
|
|
3
|
+
import { FileSystem } from "../schemas/fs.mjs";
|
|
3
4
|
import { FlatCache } from "flat-cache";
|
|
4
5
|
import { AssetGlob } from "@stryke/types/file";
|
|
5
6
|
|
|
@@ -12,6 +13,12 @@ import { AssetGlob } from "@stryke/types/file";
|
|
|
12
13
|
*/
|
|
13
14
|
declare class VirtualFileSystem implements VirtualFileSystemInterface {
|
|
14
15
|
#private;
|
|
16
|
+
/**
|
|
17
|
+
* An unstable storage property that can be used for testing or debugging purposes. This property is not intended for production use and may be removed or changed without warning in future releases.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
static unstable_storage: FileSystem | null;
|
|
15
22
|
/**
|
|
16
23
|
* Creates a virtual file system (VFS) that is backed up to a Cap'n Proto message buffer.
|
|
17
24
|
*
|
package/dist/lib/vfs.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vfs.d.mts","names":[],"sources":["../../src/lib/vfs.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vfs.d.mts","names":[],"sources":["../../src/lib/vfs.ts"],"mappings":";;;;;;;;;AA4LA;;;;cAAa,iBAAA,YAA6B,0BAAA;EAAA;EAmcM;;;;;EAAA,OA7bvC,gBAAA,EAAkB,UAAA;EA4oBL;;;;;;EAAA,OA/MA,MAAA,CAAO,OAAA,EAAS,OAAA,GAAU,OAAA,CAAQ,iBAAA;EAihB1C;;;;;;EAAA,OAlcE,UAAA,CAAW,OAAA,EAAS,OAAA,GAAU,iBAAA;EAioBtC;;;EAAA,IAvjBK,QAAA,IAAY,MAAA,SAAe,mBAAA;EAymB3B;;;EAAA,IA9kBA,GAAA,IAAO,MAAA;EA8nBE;;;EAAA,IAnmBT,KAAA,IAAS,MAAA;EAomBI;;;EAAA,cAvkBV,aAAA,IAAiB,SAAA;EA4nBV;;;;;;EAAA,QA7jBd,WAAA;EAu0B+B;;;;;;EAptBzB,MAAA,CAAO,IAAA,WAAe,OAAA;EAj2BK;;;;;;EA62BjC,UAAA,CAAW,IAAA;EA1aE;;;;;;;;EAwbb,SAAA,CACL,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA;EAlSD;;;;;;;;EA+TJ,eAAA,CACL,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA;EAhLL;;;;;;;;EAwMM,WAAA,CACX,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA,GACT,OAAA;EA5DS;;;;;;;;EAmFL,UAAA,CACL,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA;EA5BV;;;;;;;;EAiDW,MAAA,CACX,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA,GACT,OAAA;EAJU;;;;;;;;;;;;;EA+BN,cAAA,CACL,IAAA,UACA,QAAA,uBACA,OAAA,GAAU,cAAA;EAiDM;;;;;;EA/BX,QAAA,CAAS,IAAA;EAmH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;;;;;;;EA+CI,WAAA,CACL,EAAA,UACA,QAAA,WACA,OAAA,GAAS,cAAA;;;;EAmCE,OAAA,IAAO,OAAA;;;;;;;GA4EN,MAAA,CAAO,YAAA,KAAa,OAAA;AAAA"}
|
package/dist/lib/vfs.mjs
CHANGED
|
@@ -92,6 +92,12 @@ function normalizeGlobPatterns(workspaceRoot, patterns) {
|
|
|
92
92
|
* This class provides methods to manage virtual files, check their existence, retrieve their content, and manipulate the virtual file system. It allows for efficient file management and retrieval without relying on the actual file system.
|
|
93
93
|
*/
|
|
94
94
|
var VirtualFileSystem = class VirtualFileSystem {
|
|
95
|
+
/**
|
|
96
|
+
* An unstable storage property that can be used for testing or debugging purposes. This property is not intended for production use and may be removed or changed without warning in future releases.
|
|
97
|
+
*
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
static unstable_storage = null;
|
|
95
101
|
/**
|
|
96
102
|
* A map of virtual file IDs to their associated metadata.
|
|
97
103
|
*/
|
|
@@ -316,11 +322,15 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
316
322
|
* @returns A promise that resolves to a new virtual file system instance.
|
|
317
323
|
*/
|
|
318
324
|
static async create(context) {
|
|
319
|
-
context.
|
|
325
|
+
context.trace("Starting virtual file system (VFS) initialization processes...");
|
|
320
326
|
let result;
|
|
321
327
|
if (!context.config.skipCache && existsSync(joinPaths(context.dataPath, "fs.bin"))) {
|
|
322
|
-
|
|
323
|
-
|
|
328
|
+
if (!VirtualFileSystem.unstable_storage) {
|
|
329
|
+
context.debug("Reading virtual file system (VFS) from local storage");
|
|
330
|
+
const buffer = await readFileBuffer(joinPaths(context.dataPath, "fs.bin"));
|
|
331
|
+
VirtualFileSystem.unstable_storage = new capnp.Message(buffer, false).getRoot(FileSystem);
|
|
332
|
+
}
|
|
333
|
+
const fs = VirtualFileSystem.unstable_storage;
|
|
324
334
|
result = new VirtualFileSystem(context, fs);
|
|
325
335
|
if (fs._hasStorage() && fs.storage.length > 0) await Promise.all(fs.storage.values().map(async (file) => {
|
|
326
336
|
if (file.path && file.code) {
|
|
@@ -340,7 +350,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
340
350
|
}
|
|
341
351
|
}));
|
|
342
352
|
} else result = new VirtualFileSystem(context, new capnp.Message().initRoot(FileSystem));
|
|
343
|
-
result.#logger.
|
|
353
|
+
result.#logger.trace("Successfully completed virtual file system (VFS) initialization.");
|
|
344
354
|
return result;
|
|
345
355
|
}
|
|
346
356
|
/**
|
|
@@ -350,11 +360,15 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
350
360
|
* @returns A new virtual file system instance.
|
|
351
361
|
*/
|
|
352
362
|
static createSync(context) {
|
|
353
|
-
context.
|
|
363
|
+
context.trace("Starting virtual file system (VFS) initialization processes...");
|
|
354
364
|
let result;
|
|
355
365
|
if (!context.config.skipCache && existsSync(joinPaths(context.dataPath, "fs.bin"))) {
|
|
356
|
-
|
|
357
|
-
|
|
366
|
+
if (!VirtualFileSystem.unstable_storage) {
|
|
367
|
+
context.debug("Reading virtual file system (VFS) from local storage");
|
|
368
|
+
const buffer = readFileBufferSync(joinPaths(context.dataPath, "fs.bin"));
|
|
369
|
+
VirtualFileSystem.unstable_storage = new capnp.Message(buffer, false).getRoot(FileSystem);
|
|
370
|
+
}
|
|
371
|
+
const fs = VirtualFileSystem.unstable_storage;
|
|
358
372
|
result = new VirtualFileSystem(context, fs);
|
|
359
373
|
if (fs._hasStorage() && fs.storage.length > 0) fs.storage.values().forEach((file) => {
|
|
360
374
|
if (file.path && file.code) {
|
|
@@ -374,7 +388,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
374
388
|
}
|
|
375
389
|
});
|
|
376
390
|
} else result = new VirtualFileSystem(context, new capnp.Message().initRoot(FileSystem));
|
|
377
|
-
result.#logger.
|
|
391
|
+
result.#logger.trace("Successfully completed virtual file system (VFS) initialization.");
|
|
378
392
|
return result;
|
|
379
393
|
}
|
|
380
394
|
/**
|