@holo-js/core 0.1.1 → 0.1.3
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/chunk-AD2ZYGLN.mjs +2741 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +29 -14
- package/dist/runtime/index.d.ts +805 -3
- package/dist/runtime/index.mjs +13 -1
- package/package.json +59 -7
- package/dist/chunk-SVCNZBIQ.mjs +0 -703
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { GeneratedProjectRegistry, HoloRuntime, CreateHoloOptions } from './runtime/index.js';
|
|
2
|
-
export { createHolo, ensureHolo, getHolo, holoRuntimeInternals, initializeHolo, loadGeneratedProjectRegistry, peekHolo, registryInternals, resetHoloRuntime, resolveGeneratedProjectRegistryPath } from './runtime/index.js';
|
|
1
|
+
import { GeneratedProjectRegistry, HoloRuntime, HoloSessionRuntimeBinding, HoloAuthRuntimeBinding, CreateHoloOptions } from './runtime/index.js';
|
|
2
|
+
export { HoloQueueRuntimeBinding, HoloServerViewRenderInput, HoloServerViewRenderer, configureHoloRenderingRuntime, createHolo, ensureHolo, getHolo, holoRuntimeInternals, initializeHolo, loadGeneratedBroadcastManifest, loadGeneratedProjectRegistry, peekHolo, reconfigureOptionalHoloSubsystems, registryInternals, resetHoloRenderingRuntime, resetHoloRuntime, resetOptionalHoloSubsystems, resolveGeneratedProjectRegistryPath } from './runtime/index.js';
|
|
3
3
|
import { HoloConfigMap, LoadedHoloConfig, DotPath, ValueAtPath } from '@holo-js/config';
|
|
4
4
|
export { createRuntimeConnectionOptions, resolveRuntimeConnectionManagerOptions } from '@holo-js/db';
|
|
5
|
-
import '@holo-js/queue';
|
|
6
5
|
|
|
7
6
|
declare function resolveStorageKeyPath(root: string, key: string): string;
|
|
8
7
|
|
|
@@ -22,6 +21,8 @@ interface ResolvedHoloFrameworkOptions {
|
|
|
22
21
|
interface HoloAdapterProjectAccessors<TCustom extends HoloConfigMap = HoloConfigMap> {
|
|
23
22
|
getApp(): Promise<HoloAdapterProject<TCustom>>;
|
|
24
23
|
getProject(): Promise<HoloAdapterProject<TCustom>>;
|
|
24
|
+
getSession(): Promise<HoloSessionRuntimeBinding | undefined>;
|
|
25
|
+
getAuth(): Promise<HoloAuthRuntimeBinding | undefined>;
|
|
25
26
|
useConfig<TKey extends Extract<keyof LoadedHoloConfig<TCustom>['all'], string>>(key: TKey): Promise<LoadedHoloConfig<TCustom>['all'][TKey]>;
|
|
26
27
|
useConfig<TPath extends DotPath<LoadedHoloConfig<TCustom>['all']>>(path: TPath): Promise<ValueAtPath<LoadedHoloConfig<TCustom>['all'], TPath>>;
|
|
27
28
|
config<TPath extends DotPath<LoadedHoloConfig<TCustom>['all']>>(path: TPath): Promise<ValueAtPath<LoadedHoloConfig<TCustom>['all'], TPath>>;
|
|
@@ -67,4 +68,4 @@ declare const adapterInternals: {
|
|
|
67
68
|
resolveStorageKeyPath: typeof resolveStorageKeyPath;
|
|
68
69
|
};
|
|
69
70
|
|
|
70
|
-
export { type CreateHoloFrameworkAdapterOptions, CreateHoloOptions, HOLO_MINIMUM_ADAPTER_CAPABILITIES, type HoloAdapterCapabilities, type HoloAdapterProject, type HoloAdapterProjectAccessors, type HoloFrameworkAdapterState, type HoloFrameworkOptions, HoloRuntime, type ResolvedHoloFrameworkOptions, adapterInternals, createHoloAdapterProject, createHoloFrameworkAdapter, createHoloProjectAccessors, defineHoloAdapterCapabilities, initializeHoloAdapterProject, resetSingletonFrameworkProject, resolveHoloFrameworkOptions };
|
|
71
|
+
export { type CreateHoloFrameworkAdapterOptions, CreateHoloOptions, HOLO_MINIMUM_ADAPTER_CAPABILITIES, type HoloAdapterCapabilities, type HoloAdapterProject, type HoloAdapterProjectAccessors, HoloAuthRuntimeBinding, type HoloFrameworkAdapterState, type HoloFrameworkOptions, HoloRuntime, HoloSessionRuntimeBinding, type ResolvedHoloFrameworkOptions, adapterInternals, createHoloAdapterProject, createHoloFrameworkAdapter, createHoloProjectAccessors, defineHoloAdapterCapabilities, initializeHoloAdapterProject, resetSingletonFrameworkProject, resolveHoloFrameworkOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
configureHoloRenderingRuntime,
|
|
3
3
|
createHolo,
|
|
4
4
|
createRuntimeConnectionOptions,
|
|
5
5
|
ensureHolo,
|
|
6
6
|
getHolo,
|
|
7
7
|
holoRuntimeInternals,
|
|
8
8
|
initializeHolo,
|
|
9
|
+
loadGeneratedBroadcastManifest,
|
|
9
10
|
loadGeneratedProjectRegistry,
|
|
10
11
|
peekHolo,
|
|
12
|
+
reconfigureOptionalHoloSubsystems,
|
|
11
13
|
registryInternals,
|
|
14
|
+
resetHoloRenderingRuntime,
|
|
12
15
|
resetHoloRuntime,
|
|
16
|
+
resetOptionalHoloSubsystems,
|
|
13
17
|
resolveGeneratedProjectRegistryPath,
|
|
14
18
|
resolveRuntimeConnectionManagerOptions,
|
|
15
19
|
resolveStorageKeyPath
|
|
16
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AD2ZYGLN.mjs";
|
|
17
21
|
|
|
18
22
|
// src/adapter.ts
|
|
19
23
|
import { readdir, stat } from "fs/promises";
|
|
20
24
|
import { extname, join, resolve } from "path";
|
|
21
25
|
import { configureConfigRuntime, resolveEnvironmentFileOrder } from "@holo-js/config";
|
|
22
26
|
import { configureDB } from "@holo-js/db";
|
|
23
|
-
import { configureQueueRuntime } from "@holo-js/queue";
|
|
24
|
-
import { createQueueDbRuntimeOptions } from "@holo-js/queue-db";
|
|
25
|
-
import {
|
|
26
|
-
resetStorageRuntime
|
|
27
|
-
} from "@holo-js/storage/runtime";
|
|
28
27
|
var HOLO_MINIMUM_ADAPTER_CAPABILITIES = Object.freeze({
|
|
29
28
|
config: "layered-env-and-cache",
|
|
30
29
|
discovery: "generated-registries",
|
|
@@ -69,7 +68,9 @@ async function resolveProjectSourceSignature(projectRoot, envName) {
|
|
|
69
68
|
const jobStamps = await Promise.all((registry?.jobs ?? []).map((entry) => resolveFileStamp(resolve(projectRoot, entry.sourcePath))));
|
|
70
69
|
const eventStamps = await Promise.all((registry?.events ?? []).map((entry) => resolveFileStamp(resolve(projectRoot, entry.sourcePath))));
|
|
71
70
|
const listenerStamps = await Promise.all((registry?.listeners ?? []).map((entry) => resolveFileStamp(resolve(projectRoot, entry.sourcePath))));
|
|
72
|
-
|
|
71
|
+
const authorizationPolicyStamps = await Promise.all((registry?.authorizationPolicies ?? []).map((entry) => resolveFileStamp(resolve(projectRoot, entry.sourcePath))));
|
|
72
|
+
const authorizationAbilityStamps = await Promise.all((registry?.authorizationAbilities ?? []).map((entry) => resolveFileStamp(resolve(projectRoot, entry.sourcePath))));
|
|
73
|
+
return [configStamp, registryStamp, ...envStamps, ...jobStamps, ...eventStamps, ...listenerStamps, ...authorizationPolicyStamps, ...authorizationAbilityStamps].join("||");
|
|
73
74
|
}
|
|
74
75
|
function resolveHoloFrameworkOptions(options = {}) {
|
|
75
76
|
const processEnv = options.processEnv ?? process.env;
|
|
@@ -79,6 +80,7 @@ function resolveHoloFrameworkOptions(options = {}) {
|
|
|
79
80
|
envName: options.envName,
|
|
80
81
|
preferCache: options.preferCache ?? processEnv.NODE_ENV === "production",
|
|
81
82
|
processEnv,
|
|
83
|
+
renderView: options.renderView,
|
|
82
84
|
registerProjectQueueJobs: options.registerProjectQueueJobs
|
|
83
85
|
}
|
|
84
86
|
};
|
|
@@ -91,6 +93,14 @@ function createHoloProjectAccessors(resolveProject) {
|
|
|
91
93
|
return {
|
|
92
94
|
getApp: resolveProject,
|
|
93
95
|
getProject: resolveProject,
|
|
96
|
+
async getSession() {
|
|
97
|
+
const project = await resolveProject();
|
|
98
|
+
return project.runtime.session;
|
|
99
|
+
},
|
|
100
|
+
async getAuth() {
|
|
101
|
+
const project = await resolveProject();
|
|
102
|
+
return project.runtime.auth;
|
|
103
|
+
},
|
|
94
104
|
useConfig,
|
|
95
105
|
async config(path) {
|
|
96
106
|
const project = await resolveProject();
|
|
@@ -124,11 +134,9 @@ async function initializeSingletonFrameworkProject(stateKey, displayName, option
|
|
|
124
134
|
}
|
|
125
135
|
configureConfigRuntime(currentRuntime.loadedConfig.all);
|
|
126
136
|
configureDB(currentRuntime.manager);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
...createQueueDbRuntimeOptions()
|
|
137
|
+
await reconfigureOptionalHoloSubsystems(state.project.projectRoot, currentRuntime.loadedConfig, {
|
|
138
|
+
renderView: resolved.runtime.renderView
|
|
130
139
|
});
|
|
131
|
-
configurePlainNodeStorageRuntime(state.project.projectRoot, currentRuntime.loadedConfig);
|
|
132
140
|
if (state.project.runtime !== currentRuntime) {
|
|
133
141
|
;
|
|
134
142
|
state.project = {
|
|
@@ -154,7 +162,7 @@ async function resetSingletonFrameworkProject(stateKey) {
|
|
|
154
162
|
state.project = void 0;
|
|
155
163
|
state.projectRoot = void 0;
|
|
156
164
|
state.sourceSignature = void 0;
|
|
157
|
-
|
|
165
|
+
await resetOptionalHoloSubsystems();
|
|
158
166
|
await resetHoloRuntime();
|
|
159
167
|
}
|
|
160
168
|
function createHoloFrameworkAdapter(options) {
|
|
@@ -201,7 +209,9 @@ async function createHoloAdapterProject(projectRoot, options = {}) {
|
|
|
201
209
|
async function initializeHoloAdapterProject(projectRoot, options = {}) {
|
|
202
210
|
const project = await createHoloAdapterProject(projectRoot, options);
|
|
203
211
|
const runtime = await ensureHolo(project.projectRoot, options);
|
|
204
|
-
|
|
212
|
+
await reconfigureOptionalHoloSubsystems(project.projectRoot, runtime.loadedConfig, {
|
|
213
|
+
renderView: options.renderView
|
|
214
|
+
});
|
|
205
215
|
return {
|
|
206
216
|
...project,
|
|
207
217
|
runtime
|
|
@@ -213,6 +223,7 @@ var adapterInternals = {
|
|
|
213
223
|
export {
|
|
214
224
|
HOLO_MINIMUM_ADAPTER_CAPABILITIES,
|
|
215
225
|
adapterInternals,
|
|
226
|
+
configureHoloRenderingRuntime,
|
|
216
227
|
createHolo,
|
|
217
228
|
createHoloAdapterProject,
|
|
218
229
|
createHoloFrameworkAdapter,
|
|
@@ -224,10 +235,14 @@ export {
|
|
|
224
235
|
holoRuntimeInternals,
|
|
225
236
|
initializeHolo,
|
|
226
237
|
initializeHoloAdapterProject,
|
|
238
|
+
loadGeneratedBroadcastManifest,
|
|
227
239
|
loadGeneratedProjectRegistry,
|
|
228
240
|
peekHolo,
|
|
241
|
+
reconfigureOptionalHoloSubsystems,
|
|
229
242
|
registryInternals,
|
|
243
|
+
resetHoloRenderingRuntime,
|
|
230
244
|
resetHoloRuntime,
|
|
245
|
+
resetOptionalHoloSubsystems,
|
|
231
246
|
resetSingletonFrameworkProject,
|
|
232
247
|
resolveGeneratedProjectRegistryPath,
|
|
233
248
|
resolveHoloFrameworkOptions,
|