@holo-js/core 0.1.2 → 0.1.4
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-4VPELMZN.mjs +2747 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +31 -15
- 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-4VPELMZN.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,16 +68,20 @@ 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;
|
|
76
77
|
return {
|
|
77
|
-
projectRoot: resolve(options.projectRoot ??
|
|
78
|
+
projectRoot: resolve(options.projectRoot ?? /* turbopackIgnore: true */
|
|
79
|
+
process.cwd()),
|
|
78
80
|
runtime: {
|
|
79
81
|
envName: options.envName,
|
|
80
82
|
preferCache: options.preferCache ?? processEnv.NODE_ENV === "production",
|
|
81
83
|
processEnv,
|
|
84
|
+
renderView: options.renderView,
|
|
82
85
|
registerProjectQueueJobs: options.registerProjectQueueJobs
|
|
83
86
|
}
|
|
84
87
|
};
|
|
@@ -91,6 +94,14 @@ function createHoloProjectAccessors(resolveProject) {
|
|
|
91
94
|
return {
|
|
92
95
|
getApp: resolveProject,
|
|
93
96
|
getProject: resolveProject,
|
|
97
|
+
async getSession() {
|
|
98
|
+
const project = await resolveProject();
|
|
99
|
+
return project.runtime.session;
|
|
100
|
+
},
|
|
101
|
+
async getAuth() {
|
|
102
|
+
const project = await resolveProject();
|
|
103
|
+
return project.runtime.auth;
|
|
104
|
+
},
|
|
94
105
|
useConfig,
|
|
95
106
|
async config(path) {
|
|
96
107
|
const project = await resolveProject();
|
|
@@ -124,11 +135,9 @@ async function initializeSingletonFrameworkProject(stateKey, displayName, option
|
|
|
124
135
|
}
|
|
125
136
|
configureConfigRuntime(currentRuntime.loadedConfig.all);
|
|
126
137
|
configureDB(currentRuntime.manager);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
...createQueueDbRuntimeOptions()
|
|
138
|
+
await reconfigureOptionalHoloSubsystems(state.project.projectRoot, currentRuntime.loadedConfig, {
|
|
139
|
+
renderView: resolved.runtime.renderView
|
|
130
140
|
});
|
|
131
|
-
configurePlainNodeStorageRuntime(state.project.projectRoot, currentRuntime.loadedConfig);
|
|
132
141
|
if (state.project.runtime !== currentRuntime) {
|
|
133
142
|
;
|
|
134
143
|
state.project = {
|
|
@@ -154,7 +163,7 @@ async function resetSingletonFrameworkProject(stateKey) {
|
|
|
154
163
|
state.project = void 0;
|
|
155
164
|
state.projectRoot = void 0;
|
|
156
165
|
state.sourceSignature = void 0;
|
|
157
|
-
|
|
166
|
+
await resetOptionalHoloSubsystems();
|
|
158
167
|
await resetHoloRuntime();
|
|
159
168
|
}
|
|
160
169
|
function createHoloFrameworkAdapter(options) {
|
|
@@ -201,7 +210,9 @@ async function createHoloAdapterProject(projectRoot, options = {}) {
|
|
|
201
210
|
async function initializeHoloAdapterProject(projectRoot, options = {}) {
|
|
202
211
|
const project = await createHoloAdapterProject(projectRoot, options);
|
|
203
212
|
const runtime = await ensureHolo(project.projectRoot, options);
|
|
204
|
-
|
|
213
|
+
await reconfigureOptionalHoloSubsystems(project.projectRoot, runtime.loadedConfig, {
|
|
214
|
+
renderView: options.renderView
|
|
215
|
+
});
|
|
205
216
|
return {
|
|
206
217
|
...project,
|
|
207
218
|
runtime
|
|
@@ -213,6 +224,7 @@ var adapterInternals = {
|
|
|
213
224
|
export {
|
|
214
225
|
HOLO_MINIMUM_ADAPTER_CAPABILITIES,
|
|
215
226
|
adapterInternals,
|
|
227
|
+
configureHoloRenderingRuntime,
|
|
216
228
|
createHolo,
|
|
217
229
|
createHoloAdapterProject,
|
|
218
230
|
createHoloFrameworkAdapter,
|
|
@@ -224,10 +236,14 @@ export {
|
|
|
224
236
|
holoRuntimeInternals,
|
|
225
237
|
initializeHolo,
|
|
226
238
|
initializeHoloAdapterProject,
|
|
239
|
+
loadGeneratedBroadcastManifest,
|
|
227
240
|
loadGeneratedProjectRegistry,
|
|
228
241
|
peekHolo,
|
|
242
|
+
reconfigureOptionalHoloSubsystems,
|
|
229
243
|
registryInternals,
|
|
244
|
+
resetHoloRenderingRuntime,
|
|
230
245
|
resetHoloRuntime,
|
|
246
|
+
resetOptionalHoloSubsystems,
|
|
231
247
|
resetSingletonFrameworkProject,
|
|
232
248
|
resolveGeneratedProjectRegistryPath,
|
|
233
249
|
resolveHoloFrameworkOptions,
|