@holo-js/cli 0.2.5 → 0.3.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/dist/{agent-skills-MSEMQUXT.mjs → agent-skills-CHAXS2YN.mjs} +13 -6
- package/dist/bin/holo.mjs +436 -109
- package/dist/{broadcast-5MJ3GJK7.mjs → broadcast-5VZM5SGQ.mjs} +13 -10
- package/dist/{broadcast-MRJGFCFH.mjs → broadcast-AABT52BK.mjs} +13 -10
- package/dist/cache-A42JSVYA.mjs +138 -0
- package/dist/cache-DUVBBOZU.mjs +138 -0
- package/dist/{cache-migrations-CPYQC7T6.mjs → cache-migrations-4WKSEN2Q.mjs} +12 -10
- package/dist/{cache-migrations-APDFSFEX.mjs → cache-migrations-PD2T5AV4.mjs} +14 -12
- package/dist/chunk-3RFRE7XG.mjs +491 -0
- package/dist/{chunk-PT72AMV7.mjs → chunk-6BHJLCAO.mjs} +256 -392
- package/dist/{chunk-KS5TWO75.mjs → chunk-EQUFFLRG.mjs} +7 -7
- package/dist/chunk-HX6MOYBO.mjs +2 -0
- package/dist/{chunk-YEFJBN56.mjs → chunk-JVLZ3SOW.mjs} +11 -8
- package/dist/{chunk-UPXQONEH.mjs → chunk-KRADH7PK.mjs} +55 -51
- package/dist/chunk-LALDNNPH.mjs +428 -0
- package/dist/chunk-LHK5YUR4.mjs +156 -0
- package/dist/{chunk-LBJAJLKU.mjs → chunk-M3IPUCTM.mjs} +1 -1
- package/dist/{chunk-TWITVSFZ.mjs → chunk-OI54DOHK.mjs} +256 -392
- package/dist/{chunk-LXGQCG56.mjs → chunk-OLZEMIDQ.mjs} +1 -1
- package/dist/{chunk-VP2E62DF.mjs → chunk-QSVMXMTQ.mjs} +49 -349
- package/dist/{chunk-J76GH2DR.mjs → chunk-R4ZYMEDU.mjs} +129 -86
- package/dist/{chunk-XDRCZ3Z5.mjs → chunk-TH5YCOZB.mjs} +57 -53
- package/dist/chunk-TRYHX5S4.mjs +360 -0
- package/dist/chunk-XBOVM6LO.mjs +41 -0
- package/dist/{chunk-ILU426CF.mjs → chunk-YACY2572.mjs} +482 -2
- package/dist/{config-MD27U4FM.mjs → config-BZHQK532.mjs} +3 -3
- package/dist/{dev-CT4DRTLN.mjs → dev-7KGRV56X.mjs} +10 -8
- package/dist/{dev-QDLR6C7K.mjs → dev-GQT37XJU.mjs} +10 -8
- package/dist/{discovery-GWTBF5RZ.mjs → discovery-HNH3BLDL.mjs} +8 -6
- package/dist/{generators-PUN5TFP5.mjs → generators-3FVW4AEJ.mjs} +18 -15
- package/dist/{generators-WQHI7DBW.mjs → generators-JWVNGUUE.mjs} +14 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +434 -107
- package/dist/{media-migrations-D3CDNMPT.mjs → media-migrations-EG34NYAG.mjs} +13 -11
- package/dist/{media-migrations-IWCSCKSA.mjs → media-migrations-LGI7R7AR.mjs} +11 -9
- package/dist/plugins-ZGLB6JO6.mjs +24 -0
- package/dist/{queue-O3OSLGOV.mjs → queue-BEZDCZCY.mjs} +54 -16
- package/dist/{queue-GRB2IH5M.mjs → queue-R54DUUYA.mjs} +54 -16
- package/dist/{queue-migrations-7T42S4FX.mjs → queue-migrations-AM3AKT76.mjs} +16 -11
- package/dist/{queue-migrations-HFZB64OG.mjs → queue-migrations-U477YSFD.mjs} +18 -13
- package/dist/{runtime-TTRP2DGL.mjs → runtime-4TJYZLQV.mjs} +10 -8
- package/dist/{runtime-M3G5OKQV.mjs → runtime-MSRQD5W5.mjs} +10 -8
- package/dist/{runtime-GSXF4NB3.mjs → runtime-VR5BDPYQ.mjs} +1 -1
- package/dist/runtime-worker.mjs +7 -1
- package/dist/{scaffold-5BOVJYF3.mjs → scaffold-ASEX5LEX.mjs} +8 -4
- package/dist/{scaffold-NY3MWUZF.mjs → scaffold-ZAD3XUSD.mjs} +8 -4
- package/dist/{security-ST6ED7EK.mjs → security-4QLV7QCH.mjs} +8 -6
- package/dist/{security-H7AGDFBX.mjs → security-KYTLP4DF.mjs} +8 -6
- package/package.json +35 -8
- package/dist/cache-KVRYC7FB.mjs +0 -66
- package/dist/cache-WWE4Q4YE.mjs +0 -66
- package/dist/chunk-D7O4SU6N.mjs +0 -2
- package/dist/chunk-FGQ2I2YH.mjs +0 -22
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
initializeProjectRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EQUFFLRG.mjs";
|
|
4
|
+
import "./chunk-M3IPUCTM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
writeLine
|
|
7
7
|
} from "./chunk-I7QBCEV7.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import
|
|
10
|
-
prepareProjectDiscovery
|
|
11
|
-
} from "./chunk-VP2E62DF.mjs";
|
|
12
|
-
import "./chunk-TWITVSFZ.mjs";
|
|
8
|
+
import "./chunk-HX6MOYBO.mjs";
|
|
9
|
+
import "./chunk-6BHJLCAO.mjs";
|
|
13
10
|
import {
|
|
14
11
|
loadProjectConfig
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JVLZ3SOW.mjs";
|
|
13
|
+
import {
|
|
14
|
+
prepareProjectDiscovery
|
|
15
|
+
} from "./chunk-QSVMXMTQ.mjs";
|
|
16
16
|
import {
|
|
17
17
|
loadGeneratedProjectRegistry
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-R4ZYMEDU.mjs";
|
|
19
|
+
import "./chunk-3RFRE7XG.mjs";
|
|
20
|
+
import "./chunk-TRYHX5S4.mjs";
|
|
19
21
|
import {
|
|
20
22
|
importProjectModule,
|
|
21
23
|
resolveProjectPackageImportSpecifier
|
|
22
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YACY2572.mjs";
|
|
23
25
|
|
|
24
26
|
// src/broadcast.ts
|
|
25
27
|
import { basename, extname, resolve } from "path";
|
|
@@ -146,6 +148,7 @@ async function createRealtimeWorkerBindings(projectRoot) {
|
|
|
146
148
|
return await withRealtimeRequest(options.context, async (authRequest) => {
|
|
147
149
|
return await realtime.subscribeRealtimeQuery(await resolveDefinition(name), args, {
|
|
148
150
|
onData: options.onData,
|
|
151
|
+
onPatch: options.onPatch,
|
|
149
152
|
onError: options.onError
|
|
150
153
|
}, { authRequest });
|
|
151
154
|
});
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
initializeProjectRuntime
|
|
3
|
+
} from "./chunk-LALDNNPH.mjs";
|
|
4
|
+
import "./chunk-M3IPUCTM.mjs";
|
|
1
5
|
import {
|
|
2
6
|
writeLine
|
|
3
7
|
} from "./chunk-I7QBCEV7.mjs";
|
|
4
|
-
import
|
|
5
|
-
initializeProjectRuntime
|
|
6
|
-
} from "./chunk-KS5TWO75.mjs";
|
|
7
|
-
import "./chunk-LBJAJLKU.mjs";
|
|
8
|
-
import "./chunk-D7O4SU6N.mjs";
|
|
8
|
+
import "./chunk-HX6MOYBO.mjs";
|
|
9
9
|
import {
|
|
10
10
|
prepareProjectDiscovery
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QSVMXMTQ.mjs";
|
|
12
|
+
import "./chunk-OI54DOHK.mjs";
|
|
13
13
|
import {
|
|
14
14
|
loadProjectConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JVLZ3SOW.mjs";
|
|
16
16
|
import {
|
|
17
17
|
loadGeneratedProjectRegistry
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-R4ZYMEDU.mjs";
|
|
19
|
+
import "./chunk-3RFRE7XG.mjs";
|
|
20
|
+
import "./chunk-TRYHX5S4.mjs";
|
|
19
21
|
import {
|
|
20
22
|
importProjectModule,
|
|
21
23
|
resolveProjectPackageImportSpecifier
|
|
22
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YACY2572.mjs";
|
|
23
25
|
|
|
24
26
|
// src/broadcast.ts
|
|
25
27
|
import { basename, extname, resolve } from "path";
|
|
@@ -146,6 +148,7 @@ async function createRealtimeWorkerBindings(projectRoot) {
|
|
|
146
148
|
return await withRealtimeRequest(options.context, async (authRequest) => {
|
|
147
149
|
return await realtime.subscribeRealtimeQuery(await resolveDefinition(name), args, {
|
|
148
150
|
onData: options.onData,
|
|
151
|
+
onPatch: options.onPatch,
|
|
149
152
|
onError: options.onError
|
|
150
153
|
}, { authRequest });
|
|
151
154
|
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadProjectDatabaseDrivers
|
|
3
|
+
} from "./chunk-XBOVM6LO.mjs";
|
|
4
|
+
import {
|
|
5
|
+
writeLine
|
|
6
|
+
} from "./chunk-I7QBCEV7.mjs";
|
|
7
|
+
import "./chunk-HX6MOYBO.mjs";
|
|
8
|
+
import "./chunk-QSVMXMTQ.mjs";
|
|
9
|
+
import "./chunk-OI54DOHK.mjs";
|
|
10
|
+
import "./chunk-JVLZ3SOW.mjs";
|
|
11
|
+
import "./chunk-R4ZYMEDU.mjs";
|
|
12
|
+
import "./chunk-3RFRE7XG.mjs";
|
|
13
|
+
import "./chunk-TRYHX5S4.mjs";
|
|
14
|
+
import {
|
|
15
|
+
resolveProjectPackageImportSpecifier
|
|
16
|
+
} from "./chunk-YACY2572.mjs";
|
|
17
|
+
|
|
18
|
+
// src/cache.ts
|
|
19
|
+
import { loadConfigDirectory } from "@holo-js/config";
|
|
20
|
+
import { unregisterDatabaseDriverFactory } from "@holo-js/db";
|
|
21
|
+
var BUILT_IN_CACHE_DRIVER_NAMES = /* @__PURE__ */ new Set(["database", "file", "memory", "redis"]);
|
|
22
|
+
var CONCRETE_CACHE_DRIVER_PACKAGES = {
|
|
23
|
+
database: "@holo-js/cache-db",
|
|
24
|
+
redis: "@holo-js/cache-redis"
|
|
25
|
+
};
|
|
26
|
+
async function loadConfiguredCacheDriverPackages(projectRoot, drivers, loadPackage = (specifier) => import(specifier)) {
|
|
27
|
+
const configuredDrivers = new Set(Object.values(drivers).map(resolveConfiguredCacheDriverName));
|
|
28
|
+
for (const driver of configuredDrivers) {
|
|
29
|
+
if (driver !== "database" && driver !== "redis") continue;
|
|
30
|
+
const packageName = CONCRETE_CACHE_DRIVER_PACKAGES[driver];
|
|
31
|
+
try {
|
|
32
|
+
await loadPackage(resolveProjectPackageImportSpecifier(projectRoot, packageName));
|
|
33
|
+
} catch (error) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`[Holo CLI] Cache driver "${driver}" requires ${packageName} to be installed.`,
|
|
36
|
+
{ cause: error }
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function resolveCacheFacade(cacheModule) {
|
|
42
|
+
const candidate = cacheModule.default;
|
|
43
|
+
if (candidate) {
|
|
44
|
+
return candidate;
|
|
45
|
+
}
|
|
46
|
+
return cacheModule;
|
|
47
|
+
}
|
|
48
|
+
function resolveConfiguredCacheDriverName(driverConfig) {
|
|
49
|
+
if (!driverConfig || typeof driverConfig !== "object" || Array.isArray(driverConfig)) {
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
const value = driverConfig.driver;
|
|
53
|
+
return typeof value === "string" ? value : void 0;
|
|
54
|
+
}
|
|
55
|
+
function resolveCachePluginDriverLoader(cacheModule, cache, drivers, requestedDriverName, defaultDriverName) {
|
|
56
|
+
const loadCachePluginDrivers = ("loadCachePluginDrivers" in cache ? cache.loadCachePluginDrivers?.bind(cache) : void 0) ?? ("loadCachePluginDrivers" in cacheModule ? cacheModule.loadCachePluginDrivers?.bind(cacheModule) : void 0);
|
|
57
|
+
const storeName = requestedDriverName?.trim() || defaultDriverName;
|
|
58
|
+
const driverName = resolveConfiguredCacheDriverName(drivers[storeName]);
|
|
59
|
+
if (!driverName || BUILT_IN_CACHE_DRIVER_NAMES.has(driverName)) {
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
if (loadCachePluginDrivers) {
|
|
63
|
+
return loadCachePluginDrivers;
|
|
64
|
+
}
|
|
65
|
+
throw new Error(
|
|
66
|
+
`[Holo CLI] Cache store "${storeName}" uses plugin driver "${driverName}", but the installed @holo-js/cache package does not support cache plugin drivers.`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
var cacheCommandInternals = {
|
|
70
|
+
loadConfiguredCacheDriverPackages,
|
|
71
|
+
resolveCachePluginDriverLoader
|
|
72
|
+
};
|
|
73
|
+
async function loadCacheCliModule(projectRoot) {
|
|
74
|
+
return await import(resolveProjectPackageImportSpecifier(projectRoot, "@holo-js/cache"));
|
|
75
|
+
}
|
|
76
|
+
async function initializeCacheMaintenanceEnvironment(projectRoot, driverName) {
|
|
77
|
+
const loadedConfig = await loadConfigDirectory(projectRoot);
|
|
78
|
+
const databaseDriverFactories = await loadProjectDatabaseDrivers(projectRoot, loadedConfig.database);
|
|
79
|
+
const cacheModule = await loadCacheCliModule(projectRoot);
|
|
80
|
+
const cache = resolveCacheFacade(cacheModule);
|
|
81
|
+
await loadConfiguredCacheDriverPackages(projectRoot, loadedConfig.cache.drivers);
|
|
82
|
+
const loadCachePluginDrivers = resolveCachePluginDriverLoader(
|
|
83
|
+
cacheModule,
|
|
84
|
+
cache,
|
|
85
|
+
loadedConfig.cache.drivers,
|
|
86
|
+
driverName,
|
|
87
|
+
loadedConfig.cache.default
|
|
88
|
+
);
|
|
89
|
+
cache.configureCacheRuntime({
|
|
90
|
+
config: loadedConfig.cache,
|
|
91
|
+
databaseConfig: loadedConfig.database,
|
|
92
|
+
redisConfig: loadedConfig.redis
|
|
93
|
+
});
|
|
94
|
+
if (loadCachePluginDrivers) {
|
|
95
|
+
try {
|
|
96
|
+
await loadCachePluginDrivers(projectRoot, loadedConfig.app.plugins);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
cache.resetCacheRuntime();
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
cache,
|
|
104
|
+
async cleanup() {
|
|
105
|
+
cache.resetCacheRuntime();
|
|
106
|
+
for (const factory of [...databaseDriverFactories].reverse()) {
|
|
107
|
+
unregisterDatabaseDriverFactory(factory);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
async function runCacheClearCommand(io, projectRoot, driverName, dependencies = {}) {
|
|
113
|
+
const environment = await (dependencies.initializeCache ?? initializeCacheMaintenanceEnvironment)(projectRoot, driverName);
|
|
114
|
+
try {
|
|
115
|
+
const repository = driverName?.trim() ? environment.cache.driver(driverName) : environment.cache;
|
|
116
|
+
await (dependencies.flush ?? (async (target) => await target.flush()))(repository);
|
|
117
|
+
writeLine(io.stdout, driverName?.trim() ? `[cache] Cleared cache store "${driverName}".` : "[cache] Cleared the default cache store.");
|
|
118
|
+
} finally {
|
|
119
|
+
await environment.cleanup();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function runCacheForgetCommand(io, projectRoot, key, driverName, dependencies = {}) {
|
|
123
|
+
const environment = await (dependencies.initializeCache ?? initializeCacheMaintenanceEnvironment)(projectRoot, driverName);
|
|
124
|
+
try {
|
|
125
|
+
const repository = driverName?.trim() ? environment.cache.driver(driverName) : environment.cache;
|
|
126
|
+
const forgotten = await (dependencies.forget ?? (async (target, targetKey) => await target.forget(targetKey)))(repository, key);
|
|
127
|
+
writeLine(io.stdout, forgotten ? `[cache] Forgot key "${key}".` : `[cache] Key "${key}" was not present.`);
|
|
128
|
+
} finally {
|
|
129
|
+
await environment.cleanup();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
cacheCommandInternals,
|
|
134
|
+
initializeCacheMaintenanceEnvironment,
|
|
135
|
+
loadCacheCliModule,
|
|
136
|
+
runCacheClearCommand,
|
|
137
|
+
runCacheForgetCommand
|
|
138
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadProjectDatabaseDrivers
|
|
3
|
+
} from "./chunk-XBOVM6LO.mjs";
|
|
4
|
+
import {
|
|
5
|
+
writeLine
|
|
6
|
+
} from "./chunk-I7QBCEV7.mjs";
|
|
7
|
+
import "./chunk-HX6MOYBO.mjs";
|
|
8
|
+
import "./chunk-6BHJLCAO.mjs";
|
|
9
|
+
import "./chunk-JVLZ3SOW.mjs";
|
|
10
|
+
import "./chunk-QSVMXMTQ.mjs";
|
|
11
|
+
import "./chunk-R4ZYMEDU.mjs";
|
|
12
|
+
import "./chunk-3RFRE7XG.mjs";
|
|
13
|
+
import "./chunk-TRYHX5S4.mjs";
|
|
14
|
+
import {
|
|
15
|
+
resolveProjectPackageImportSpecifier
|
|
16
|
+
} from "./chunk-YACY2572.mjs";
|
|
17
|
+
|
|
18
|
+
// src/cache.ts
|
|
19
|
+
import { loadConfigDirectory } from "@holo-js/config";
|
|
20
|
+
import { unregisterDatabaseDriverFactory } from "@holo-js/db";
|
|
21
|
+
var BUILT_IN_CACHE_DRIVER_NAMES = /* @__PURE__ */ new Set(["database", "file", "memory", "redis"]);
|
|
22
|
+
var CONCRETE_CACHE_DRIVER_PACKAGES = {
|
|
23
|
+
database: "@holo-js/cache-db",
|
|
24
|
+
redis: "@holo-js/cache-redis"
|
|
25
|
+
};
|
|
26
|
+
async function loadConfiguredCacheDriverPackages(projectRoot, drivers, loadPackage = (specifier) => import(specifier)) {
|
|
27
|
+
const configuredDrivers = new Set(Object.values(drivers).map(resolveConfiguredCacheDriverName));
|
|
28
|
+
for (const driver of configuredDrivers) {
|
|
29
|
+
if (driver !== "database" && driver !== "redis") continue;
|
|
30
|
+
const packageName = CONCRETE_CACHE_DRIVER_PACKAGES[driver];
|
|
31
|
+
try {
|
|
32
|
+
await loadPackage(resolveProjectPackageImportSpecifier(projectRoot, packageName));
|
|
33
|
+
} catch (error) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`[Holo CLI] Cache driver "${driver}" requires ${packageName} to be installed.`,
|
|
36
|
+
{ cause: error }
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function resolveCacheFacade(cacheModule) {
|
|
42
|
+
const candidate = cacheModule.default;
|
|
43
|
+
if (candidate) {
|
|
44
|
+
return candidate;
|
|
45
|
+
}
|
|
46
|
+
return cacheModule;
|
|
47
|
+
}
|
|
48
|
+
function resolveConfiguredCacheDriverName(driverConfig) {
|
|
49
|
+
if (!driverConfig || typeof driverConfig !== "object" || Array.isArray(driverConfig)) {
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
const value = driverConfig.driver;
|
|
53
|
+
return typeof value === "string" ? value : void 0;
|
|
54
|
+
}
|
|
55
|
+
function resolveCachePluginDriverLoader(cacheModule, cache, drivers, requestedDriverName, defaultDriverName) {
|
|
56
|
+
const loadCachePluginDrivers = ("loadCachePluginDrivers" in cache ? cache.loadCachePluginDrivers?.bind(cache) : void 0) ?? ("loadCachePluginDrivers" in cacheModule ? cacheModule.loadCachePluginDrivers?.bind(cacheModule) : void 0);
|
|
57
|
+
const storeName = requestedDriverName?.trim() || defaultDriverName;
|
|
58
|
+
const driverName = resolveConfiguredCacheDriverName(drivers[storeName]);
|
|
59
|
+
if (!driverName || BUILT_IN_CACHE_DRIVER_NAMES.has(driverName)) {
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
if (loadCachePluginDrivers) {
|
|
63
|
+
return loadCachePluginDrivers;
|
|
64
|
+
}
|
|
65
|
+
throw new Error(
|
|
66
|
+
`[Holo CLI] Cache store "${storeName}" uses plugin driver "${driverName}", but the installed @holo-js/cache package does not support cache plugin drivers.`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
var cacheCommandInternals = {
|
|
70
|
+
loadConfiguredCacheDriverPackages,
|
|
71
|
+
resolveCachePluginDriverLoader
|
|
72
|
+
};
|
|
73
|
+
async function loadCacheCliModule(projectRoot) {
|
|
74
|
+
return await import(resolveProjectPackageImportSpecifier(projectRoot, "@holo-js/cache"));
|
|
75
|
+
}
|
|
76
|
+
async function initializeCacheMaintenanceEnvironment(projectRoot, driverName) {
|
|
77
|
+
const loadedConfig = await loadConfigDirectory(projectRoot);
|
|
78
|
+
const databaseDriverFactories = await loadProjectDatabaseDrivers(projectRoot, loadedConfig.database);
|
|
79
|
+
const cacheModule = await loadCacheCliModule(projectRoot);
|
|
80
|
+
const cache = resolveCacheFacade(cacheModule);
|
|
81
|
+
await loadConfiguredCacheDriverPackages(projectRoot, loadedConfig.cache.drivers);
|
|
82
|
+
const loadCachePluginDrivers = resolveCachePluginDriverLoader(
|
|
83
|
+
cacheModule,
|
|
84
|
+
cache,
|
|
85
|
+
loadedConfig.cache.drivers,
|
|
86
|
+
driverName,
|
|
87
|
+
loadedConfig.cache.default
|
|
88
|
+
);
|
|
89
|
+
cache.configureCacheRuntime({
|
|
90
|
+
config: loadedConfig.cache,
|
|
91
|
+
databaseConfig: loadedConfig.database,
|
|
92
|
+
redisConfig: loadedConfig.redis
|
|
93
|
+
});
|
|
94
|
+
if (loadCachePluginDrivers) {
|
|
95
|
+
try {
|
|
96
|
+
await loadCachePluginDrivers(projectRoot, loadedConfig.app.plugins);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
cache.resetCacheRuntime();
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
cache,
|
|
104
|
+
async cleanup() {
|
|
105
|
+
cache.resetCacheRuntime();
|
|
106
|
+
for (const factory of [...databaseDriverFactories].reverse()) {
|
|
107
|
+
unregisterDatabaseDriverFactory(factory);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
async function runCacheClearCommand(io, projectRoot, driverName, dependencies = {}) {
|
|
113
|
+
const environment = await (dependencies.initializeCache ?? initializeCacheMaintenanceEnvironment)(projectRoot, driverName);
|
|
114
|
+
try {
|
|
115
|
+
const repository = driverName?.trim() ? environment.cache.driver(driverName) : environment.cache;
|
|
116
|
+
await (dependencies.flush ?? (async (target) => await target.flush()))(repository);
|
|
117
|
+
writeLine(io.stdout, driverName?.trim() ? `[cache] Cleared cache store "${driverName}".` : "[cache] Cleared the default cache store.");
|
|
118
|
+
} finally {
|
|
119
|
+
await environment.cleanup();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function runCacheForgetCommand(io, projectRoot, key, driverName, dependencies = {}) {
|
|
123
|
+
const environment = await (dependencies.initializeCache ?? initializeCacheMaintenanceEnvironment)(projectRoot, driverName);
|
|
124
|
+
try {
|
|
125
|
+
const repository = driverName?.trim() ? environment.cache.driver(driverName) : environment.cache;
|
|
126
|
+
const forgotten = await (dependencies.forget ?? (async (target, targetKey) => await target.forget(targetKey)))(repository, key);
|
|
127
|
+
writeLine(io.stdout, forgotten ? `[cache] Forgot key "${key}".` : `[cache] Key "${key}" was not present.`);
|
|
128
|
+
} finally {
|
|
129
|
+
await environment.cleanup();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
cacheCommandInternals,
|
|
134
|
+
initializeCacheMaintenanceEnvironment,
|
|
135
|
+
loadCacheCliModule,
|
|
136
|
+
runCacheClearCommand,
|
|
137
|
+
runCacheForgetCommand
|
|
138
|
+
};
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runProjectPrepare
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KRADH7PK.mjs";
|
|
4
|
+
import "./chunk-LHK5YUR4.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getRegistryMigrationSlug,
|
|
7
7
|
hasRegisteredCreateTableMigration,
|
|
8
8
|
hasRegisteredMigrationSlug,
|
|
9
9
|
nextMigrationTemplate
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OLZEMIDQ.mjs";
|
|
11
|
+
import "./chunk-M3IPUCTM.mjs";
|
|
11
12
|
import {
|
|
12
13
|
writeLine
|
|
13
14
|
} from "./chunk-I7QBCEV7.mjs";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-D7O4SU6N.mjs";
|
|
15
|
+
import "./chunk-HX6MOYBO.mjs";
|
|
16
16
|
import {
|
|
17
17
|
prepareProjectDiscovery
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-QSVMXMTQ.mjs";
|
|
19
|
+
import "./chunk-OI54DOHK.mjs";
|
|
20
20
|
import {
|
|
21
21
|
ensureProjectConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JVLZ3SOW.mjs";
|
|
23
23
|
import {
|
|
24
24
|
loadGeneratedProjectRegistry
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-R4ZYMEDU.mjs";
|
|
26
|
+
import "./chunk-3RFRE7XG.mjs";
|
|
27
|
+
import "./chunk-TRYHX5S4.mjs";
|
|
26
28
|
import {
|
|
27
29
|
makeProjectRelativePath,
|
|
28
30
|
resolveDefaultArtifactPath,
|
|
29
31
|
writeTextFile
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YACY2572.mjs";
|
|
31
33
|
|
|
32
34
|
// src/cache-migrations.ts
|
|
33
35
|
import { resolve } from "path";
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runProjectPrepare
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-TH5YCOZB.mjs";
|
|
4
|
+
import "./chunk-LHK5YUR4.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getRegistryMigrationSlug,
|
|
7
7
|
hasRegisteredCreateTableMigration,
|
|
8
8
|
hasRegisteredMigrationSlug,
|
|
9
9
|
nextMigrationTemplate
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-OLZEMIDQ.mjs";
|
|
11
|
+
import "./chunk-M3IPUCTM.mjs";
|
|
12
12
|
import {
|
|
13
13
|
writeLine
|
|
14
14
|
} from "./chunk-I7QBCEV7.mjs";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import
|
|
17
|
-
prepareProjectDiscovery
|
|
18
|
-
} from "./chunk-VP2E62DF.mjs";
|
|
19
|
-
import "./chunk-TWITVSFZ.mjs";
|
|
15
|
+
import "./chunk-HX6MOYBO.mjs";
|
|
16
|
+
import "./chunk-6BHJLCAO.mjs";
|
|
20
17
|
import {
|
|
21
18
|
ensureProjectConfig
|
|
22
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JVLZ3SOW.mjs";
|
|
20
|
+
import {
|
|
21
|
+
prepareProjectDiscovery
|
|
22
|
+
} from "./chunk-QSVMXMTQ.mjs";
|
|
23
23
|
import {
|
|
24
24
|
loadGeneratedProjectRegistry
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-R4ZYMEDU.mjs";
|
|
26
|
+
import "./chunk-3RFRE7XG.mjs";
|
|
27
|
+
import "./chunk-TRYHX5S4.mjs";
|
|
26
28
|
import {
|
|
27
29
|
makeProjectRelativePath,
|
|
28
30
|
resolveDefaultArtifactPath,
|
|
29
31
|
writeTextFile
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YACY2572.mjs";
|
|
31
33
|
|
|
32
34
|
// src/cache-migrations.ts
|
|
33
35
|
import { resolve } from "path";
|