@playfast/reform 1.2.1 → 1.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/boundary/boundary.d.ts +64 -0
- package/dist/boundary/boundary.d.ts.map +1 -0
- package/dist/boundary/boundary.js +102 -0
- package/dist/boundary/boundary.js.map +1 -0
- package/dist/calc/asyncCalc.d.ts +21 -0
- package/dist/calc/asyncCalc.d.ts.map +1 -0
- package/dist/calc/asyncCalc.js +90 -0
- package/dist/calc/asyncCalc.js.map +1 -0
- package/dist/calc/asyncCalcTypes.d.ts +78 -0
- package/dist/calc/asyncCalcTypes.d.ts.map +1 -0
- package/dist/calc/asyncCalcTypes.js +2 -0
- package/dist/calc/asyncCalcTypes.js.map +1 -0
- package/dist/calc/asyncData.d.ts +29 -0
- package/dist/calc/asyncData.d.ts.map +1 -0
- package/dist/calc/asyncData.js +21 -0
- package/dist/calc/asyncData.js.map +1 -0
- package/dist/calc/calc.d.ts +39 -0
- package/dist/calc/calc.d.ts.map +1 -0
- package/dist/calc/calc.js +48 -0
- package/dist/calc/calc.js.map +1 -0
- package/dist/calc/calcFamily.d.ts +40 -0
- package/dist/calc/calcFamily.d.ts.map +1 -0
- package/dist/calc/calcFamily.js +113 -0
- package/dist/calc/calcFamily.js.map +1 -0
- package/dist/calc/compose.d.ts +5 -0
- package/dist/calc/compose.d.ts.map +1 -0
- package/dist/calc/compose.js +5 -0
- package/dist/calc/compose.js.map +1 -0
- package/dist/calc/queryState.d.ts +12 -0
- package/dist/calc/queryState.d.ts.map +1 -0
- package/dist/calc/queryState.js +17 -0
- package/dist/calc/queryState.js.map +1 -0
- package/dist/channel/channel.d.ts +51 -0
- package/dist/channel/channel.d.ts.map +1 -0
- package/dist/channel/channel.js +86 -0
- package/dist/channel/channel.js.map +1 -0
- package/dist/channel/procedures.d.ts +24 -0
- package/dist/channel/procedures.d.ts.map +1 -0
- package/dist/channel/procedures.js +82 -0
- package/dist/channel/procedures.js.map +1 -0
- package/dist/compose/composition.d.ts +12 -0
- package/dist/compose/composition.d.ts.map +1 -0
- package/dist/compose/composition.js +56 -0
- package/dist/compose/composition.js.map +1 -0
- package/dist/compose/compositionTypes.d.ts +127 -0
- package/dist/compose/compositionTypes.d.ts.map +1 -0
- package/dist/compose/compositionTypes.js +2 -0
- package/dist/compose/compositionTypes.js.map +1 -0
- package/dist/compose/host.d.ts +6 -0
- package/dist/compose/host.d.ts.map +1 -0
- package/dist/compose/host.js +2 -0
- package/dist/compose/host.js.map +1 -0
- package/dist/compose/props.d.ts +10 -0
- package/dist/compose/props.d.ts.map +1 -0
- package/dist/compose/props.js +6 -0
- package/dist/compose/props.js.map +1 -0
- package/dist/compose/provide.d.ts +18 -0
- package/dist/compose/provide.d.ts.map +1 -0
- package/dist/compose/provide.js +49 -0
- package/dist/compose/provide.js.map +1 -0
- package/dist/compose/slot.d.ts +70 -0
- package/dist/compose/slot.d.ts.map +1 -0
- package/dist/compose/slot.js +26 -0
- package/dist/compose/slot.js.map +1 -0
- package/dist/compose/structure.d.ts +51 -0
- package/dist/compose/structure.d.ts.map +1 -0
- package/dist/compose/structure.js +92 -0
- package/dist/compose/structure.js.map +1 -0
- package/dist/compose/ui.d.ts +112 -0
- package/dist/compose/ui.d.ts.map +1 -0
- package/dist/compose/ui.js +47 -0
- package/dist/compose/ui.js.map +1 -0
- package/dist/definition/definition.d.ts +11 -0
- package/dist/definition/definition.d.ts.map +1 -0
- package/dist/definition/definition.js +35 -0
- package/dist/definition/definition.js.map +1 -0
- package/dist/event/event.d.ts +52 -0
- package/dist/event/event.d.ts.map +1 -0
- package/dist/event/event.js +67 -0
- package/dist/event/event.js.map +1 -0
- package/dist/event/eventGroup.d.ts +8 -0
- package/dist/event/eventGroup.d.ts.map +1 -0
- package/dist/event/eventGroup.js +3 -0
- package/dist/event/eventGroup.js.map +1 -0
- package/dist/feature/feature.d.ts +27 -0
- package/dist/feature/feature.d.ts.map +1 -0
- package/dist/feature/feature.js +20 -0
- package/dist/feature/feature.js.map +1 -0
- package/dist/feature/featureBinding.d.ts +85 -0
- package/dist/feature/featureBinding.d.ts.map +1 -0
- package/dist/feature/featureBinding.js +10 -0
- package/dist/feature/featureBinding.js.map +1 -0
- package/dist/feature/featureClass.d.ts +10 -0
- package/dist/feature/featureClass.d.ts.map +1 -0
- package/dist/feature/featureClass.js +2 -0
- package/dist/feature/featureClass.js.map +1 -0
- package/dist/feature/featureConfig.d.ts +86 -0
- package/dist/feature/featureConfig.d.ts.map +1 -0
- package/dist/feature/featureConfig.js +13 -0
- package/dist/feature/featureConfig.js.map +1 -0
- package/dist/feature/featureFactory.d.ts +15 -0
- package/dist/feature/featureFactory.d.ts.map +1 -0
- package/dist/feature/featureFactory.js +59 -0
- package/dist/feature/featureFactory.js.map +1 -0
- package/dist/feature/featureModule.d.ts +28 -0
- package/dist/feature/featureModule.d.ts.map +1 -0
- package/dist/feature/featureModule.js +33 -0
- package/dist/feature/featureModule.js.map +1 -0
- package/dist/feature/featureNativeTree.d.ts +26 -0
- package/dist/feature/featureNativeTree.d.ts.map +1 -0
- package/dist/feature/featureNativeTree.js +2 -0
- package/dist/feature/featureNativeTree.js.map +1 -0
- package/dist/feature/featureRequirement.d.ts +43 -0
- package/dist/feature/featureRequirement.d.ts.map +1 -0
- package/dist/feature/featureRequirement.js +6 -0
- package/dist/feature/featureRequirement.js.map +1 -0
- package/dist/feature/featureVariants.d.ts +9 -0
- package/dist/feature/featureVariants.d.ts.map +1 -0
- package/dist/feature/featureVariants.js +59 -0
- package/dist/feature/featureVariants.js.map +1 -0
- package/dist/feature/mountFeature.d.ts +10 -0
- package/dist/feature/mountFeature.d.ts.map +1 -0
- package/dist/feature/mountFeature.js +14 -0
- package/dist/feature/mountFeature.js.map +1 -0
- package/dist/graph/closure.d.ts +77 -0
- package/dist/graph/closure.d.ts.map +1 -0
- package/dist/graph/closure.js +4 -0
- package/dist/graph/closure.js.map +1 -0
- package/dist/graph/services.d.ts +30 -0
- package/dist/graph/services.d.ts.map +1 -0
- package/dist/graph/services.js +2 -0
- package/dist/graph/services.js.map +1 -0
- package/dist/graph/summary.d.ts +60 -0
- package/dist/graph/summary.d.ts.map +1 -0
- package/dist/graph/summary.js +7 -0
- package/dist/graph/summary.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/bucketCache.d.ts +19 -0
- package/dist/internal/bucketCache.d.ts.map +1 -0
- package/dist/internal/bucketCache.js +20 -0
- package/dist/internal/bucketCache.js.map +1 -0
- package/dist/internal/capture.d.ts +17 -0
- package/dist/internal/capture.d.ts.map +1 -0
- package/dist/internal/capture.js +5 -0
- package/dist/internal/capture.js.map +1 -0
- package/dist/internal/env.d.ts +2 -0
- package/dist/internal/env.d.ts.map +1 -0
- package/dist/internal/env.js +5 -0
- package/dist/internal/env.js.map +1 -0
- package/dist/internal/errors.d.ts +48 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +69 -0
- package/dist/internal/errors.js.map +1 -0
- package/dist/internal/inspect.d.ts +5 -0
- package/dist/internal/inspect.d.ts.map +1 -0
- package/dist/internal/inspect.js +20 -0
- package/dist/internal/inspect.js.map +1 -0
- package/dist/internal/queryDriver.d.ts +7 -0
- package/dist/internal/queryDriver.d.ts.map +1 -0
- package/dist/internal/queryDriver.js +198 -0
- package/dist/internal/queryDriver.js.map +1 -0
- package/dist/internal/queryDriverHydrate.d.ts +17 -0
- package/dist/internal/queryDriverHydrate.d.ts.map +1 -0
- package/dist/internal/queryDriverHydrate.js +19 -0
- package/dist/internal/queryDriverHydrate.js.map +1 -0
- package/dist/internal/queryDriverStore.d.ts +54 -0
- package/dist/internal/queryDriverStore.d.ts.map +1 -0
- package/dist/internal/queryDriverStore.js +77 -0
- package/dist/internal/queryDriverStore.js.map +1 -0
- package/dist/internal/queryDriverTypes.d.ts +41 -0
- package/dist/internal/queryDriverTypes.d.ts.map +1 -0
- package/dist/internal/queryDriverTypes.js +9 -0
- package/dist/internal/queryDriverTypes.js.map +1 -0
- package/dist/internal/queryEvents.d.ts +12 -0
- package/dist/internal/queryEvents.d.ts.map +1 -0
- package/dist/internal/queryEvents.js +11 -0
- package/dist/internal/queryEvents.js.map +1 -0
- package/dist/internal/queryStore.d.ts +13 -0
- package/dist/internal/queryStore.d.ts.map +1 -0
- package/dist/internal/queryStore.js +11 -0
- package/dist/internal/queryStore.js.map +1 -0
- package/dist/internal/reuse.d.ts +2 -0
- package/dist/internal/reuse.d.ts.map +1 -0
- package/dist/internal/reuse.js +55 -0
- package/dist/internal/reuse.js.map +1 -0
- package/dist/internal/scheduler.d.ts +13 -0
- package/dist/internal/scheduler.d.ts.map +1 -0
- package/dist/internal/scheduler.js +38 -0
- package/dist/internal/scheduler.js.map +1 -0
- package/dist/internal/seeds.d.ts +3 -0
- package/dist/internal/seeds.d.ts.map +1 -0
- package/dist/internal/seeds.js +3 -0
- package/dist/internal/seeds.js.map +1 -0
- package/dist/internal/sources.d.ts +20 -0
- package/dist/internal/sources.d.ts.map +1 -0
- package/dist/internal/sources.js +39 -0
- package/dist/internal/sources.js.map +1 -0
- package/dist/internal/stateRegistry.d.ts +2 -0
- package/dist/internal/stateRegistry.d.ts.map +1 -0
- package/dist/internal/stateRegistry.js +15 -0
- package/dist/internal/stateRegistry.js.map +1 -0
- package/dist/internal/store.d.ts +15 -0
- package/dist/internal/store.d.ts.map +1 -0
- package/dist/internal/store.js +61 -0
- package/dist/internal/store.js.map +1 -0
- package/dist/internal/track.d.ts +15 -0
- package/dist/internal/track.d.ts.map +1 -0
- package/dist/internal/track.js +11 -0
- package/dist/internal/track.js.map +1 -0
- package/dist/internal/variance.d.ts +4 -0
- package/dist/internal/variance.d.ts.map +1 -0
- package/dist/internal/variance.js +2 -0
- package/dist/internal/variance.js.map +1 -0
- package/dist/internal.d.ts +42 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +58 -0
- package/dist/internal.js.map +1 -0
- package/dist/namespace/namespace.d.ts +24 -0
- package/dist/namespace/namespace.d.ts.map +1 -0
- package/dist/namespace/namespace.js +20 -0
- package/dist/namespace/namespace.js.map +1 -0
- package/dist/procedure/procedure.d.ts +32 -0
- package/dist/procedure/procedure.d.ts.map +1 -0
- package/dist/procedure/procedure.js +34 -0
- package/dist/procedure/procedure.js.map +1 -0
- package/dist/reducer/reducer.d.ts +35 -0
- package/dist/reducer/reducer.d.ts.map +1 -0
- package/dist/reducer/reducer.js +73 -0
- package/dist/reducer/reducer.js.map +1 -0
- package/dist/remote/pendingQueue.d.ts +20 -0
- package/dist/remote/pendingQueue.d.ts.map +1 -0
- package/dist/remote/pendingQueue.js +113 -0
- package/dist/remote/pendingQueue.js.map +1 -0
- package/dist/remote/remoteState.d.ts +13 -0
- package/dist/remote/remoteState.d.ts.map +1 -0
- package/dist/remote/remoteState.js +176 -0
- package/dist/remote/remoteState.js.map +1 -0
- package/dist/remote/remoteStateMake.d.ts +8 -0
- package/dist/remote/remoteStateMake.d.ts.map +1 -0
- package/dist/remote/remoteStateMake.js +46 -0
- package/dist/remote/remoteStateMake.js.map +1 -0
- package/dist/remote/remoteStateSend.d.ts +41 -0
- package/dist/remote/remoteStateSend.d.ts.map +1 -0
- package/dist/remote/remoteStateSend.js +67 -0
- package/dist/remote/remoteStateSend.js.map +1 -0
- package/dist/remote/remoteStateTypes.d.ts +103 -0
- package/dist/remote/remoteStateTypes.d.ts.map +1 -0
- package/dist/remote/remoteStateTypes.js +4 -0
- package/dist/remote/remoteStateTypes.js.map +1 -0
- package/dist/runtime/appRuntime.d.ts +10 -0
- package/dist/runtime/appRuntime.d.ts.map +1 -0
- package/dist/runtime/appRuntime.js +6 -0
- package/dist/runtime/appRuntime.js.map +1 -0
- package/dist/runtime/bus.d.ts +17 -0
- package/dist/runtime/bus.d.ts.map +1 -0
- package/dist/runtime/bus.js +12 -0
- package/dist/runtime/bus.js.map +1 -0
- package/dist/runtime/capturedAppRuntime.d.ts +7 -0
- package/dist/runtime/capturedAppRuntime.d.ts.map +1 -0
- package/dist/runtime/capturedAppRuntime.js +151 -0
- package/dist/runtime/capturedAppRuntime.js.map +1 -0
- package/dist/runtime/eventBudget.d.ts +32 -0
- package/dist/runtime/eventBudget.d.ts.map +1 -0
- package/dist/runtime/eventBudget.js +67 -0
- package/dist/runtime/eventBudget.js.map +1 -0
- package/dist/runtime/featureMount.d.ts +16 -0
- package/dist/runtime/featureMount.d.ts.map +1 -0
- package/dist/runtime/featureMount.js +54 -0
- package/dist/runtime/featureMount.js.map +1 -0
- package/dist/runtime/instrumentation.d.ts +18 -0
- package/dist/runtime/instrumentation.d.ts.map +1 -0
- package/dist/runtime/instrumentation.js +16 -0
- package/dist/runtime/instrumentation.js.map +1 -0
- package/dist/runtime/loop.d.ts +32 -0
- package/dist/runtime/loop.d.ts.map +1 -0
- package/dist/runtime/loop.js +128 -0
- package/dist/runtime/loop.js.map +1 -0
- package/dist/runtime/queries.d.ts +20 -0
- package/dist/runtime/queries.d.ts.map +1 -0
- package/dist/runtime/queries.js +21 -0
- package/dist/runtime/queries.js.map +1 -0
- package/dist/runtime/runtimeHandle.d.ts +56 -0
- package/dist/runtime/runtimeHandle.d.ts.map +1 -0
- package/dist/runtime/runtimeHandle.js +2 -0
- package/dist/runtime/runtimeHandle.js.map +1 -0
- package/dist/scene/scene.d.ts +55 -0
- package/dist/scene/scene.d.ts.map +1 -0
- package/dist/scene/scene.js +74 -0
- package/dist/scene/scene.js.map +1 -0
- package/dist/state/state.d.ts +54 -0
- package/dist/state/state.d.ts.map +1 -0
- package/dist/state/state.js +41 -0
- package/dist/state/state.js.map +1 -0
- package/dist/state/stateFamily.d.ts +59 -0
- package/dist/state/stateFamily.d.ts.map +1 -0
- package/dist/state/stateFamily.js +91 -0
- package/dist/state/stateFamily.js.map +1 -0
- package/dist/state/stateGroup.d.ts +36 -0
- package/dist/state/stateGroup.d.ts.map +1 -0
- package/dist/state/stateGroup.js +33 -0
- package/dist/state/stateGroup.js.map +1 -0
- package/dist/state/token.d.ts +35 -0
- package/dist/state/token.d.ts.map +1 -0
- package/dist/state/token.js +18 -0
- package/dist/state/token.js.map +1 -0
- package/dist/synced/syncedStore.d.ts +44 -0
- package/dist/synced/syncedStore.d.ts.map +1 -0
- package/dist/synced/syncedStore.js +32 -0
- package/dist/synced/syncedStore.js.map +1 -0
- package/dist/testkit/flight.testkit.d.ts +18 -0
- package/dist/testkit/flight.testkit.d.ts.map +1 -0
- package/dist/testkit/flight.testkit.js +45 -0
- package/dist/testkit/flight.testkit.js.map +1 -0
- package/dist/ui/node.d.ts +3 -0
- package/dist/ui/node.d.ts.map +1 -0
- package/dist/ui/node.js +2 -0
- package/dist/ui/node.js.map +1 -0
- package/dist/ui/trigger.d.ts +2 -0
- package/dist/ui/trigger.d.ts.map +1 -0
- package/dist/ui/trigger.js +2 -0
- package/dist/ui/trigger.js.map +1 -0
- package/dist/wire/tree.d.ts +32 -0
- package/dist/wire/tree.d.ts.map +1 -0
- package/dist/wire/tree.js +59 -0
- package/dist/wire/tree.js.map +1 -0
- package/dist/wire/triggers.d.ts +25 -0
- package/dist/wire/triggers.d.ts.map +1 -0
- package/dist/wire/triggers.js +31 -0
- package/dist/wire/triggers.js.map +1 -0
- package/package.json +17 -5
- package/src/calc/asyncCalcTypes.test.ts +64 -0
- package/src/calc/asyncCalcTypes.ts +2 -10
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Effect } from 'effect';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
import type { AnyComposition, CompositionClass, CompositionPropsReceiver, HasExactCompositionId } from '../compose/composition.js';
|
|
4
|
+
import type { UiContract } from '../compose/ui.js';
|
|
5
|
+
import type { AnyFeatureGraphSummary } from '../graph/closure.js';
|
|
6
|
+
import type { FeatureLoadFailed } from '../internal/errors.js';
|
|
7
|
+
import type { Tagged } from '../runtime/bus.js';
|
|
8
|
+
import { type AnyFeatureBinding, type FailedProps, type FeatureManifest, type FeatureToken } from './featureBinding.js';
|
|
9
|
+
import type { AnyLoadedModule, FeatureModule } from './featureModule.js';
|
|
10
|
+
import type { FeatureRequirement } from './featureRequirement.js';
|
|
11
|
+
export interface RuntimeFeatureTree {
|
|
12
|
+
readonly composition: AnyComposition;
|
|
13
|
+
readonly load: Effect.Effect<AnyLoadedModule, FeatureLoadFailed>;
|
|
14
|
+
readonly binding: AnyFeatureBinding;
|
|
15
|
+
readonly eagerModule: AnyLoadedModule | undefined;
|
|
16
|
+
readonly supportModule: AnyLoadedModule | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface RuntimeFeature {
|
|
19
|
+
new (): {};
|
|
20
|
+
readonly manifest: FeatureManifest;
|
|
21
|
+
readonly token: FeatureToken<unknown, RuntimeFeatureTree>;
|
|
22
|
+
readonly summary: AnyFeatureGraphSummary;
|
|
23
|
+
}
|
|
24
|
+
export declare const isFeature: (candidate: unknown) => candidate is RuntimeFeature;
|
|
25
|
+
export type PlaceholderComposition<P> = AnyComposition & CompositionPropsReceiver<P>;
|
|
26
|
+
export interface Placeholders<P> {
|
|
27
|
+
readonly loading: PlaceholderComposition<P>;
|
|
28
|
+
readonly failed: PlaceholderComposition<FailedProps>;
|
|
29
|
+
}
|
|
30
|
+
export type FeatureMountProps<UsesInput extends boolean, CompositionProps, InputSchema extends Schema.Schema.AnyNoContext> = UsesInput extends true ? Schema.Schema.Type<InputSchema> : CompositionProps;
|
|
31
|
+
export type FeatureUsesInput<InputSchema extends Schema.Schema.AnyNoContext> = [InputSchema] extends [
|
|
32
|
+
never
|
|
33
|
+
] ? false : true;
|
|
34
|
+
export type FeatureInputValue<InputSchema extends Schema.Schema.AnyNoContext> = [InputSchema] extends [
|
|
35
|
+
never
|
|
36
|
+
] ? never : Schema.Schema.Type<InputSchema>;
|
|
37
|
+
export interface FeatureConfigBaseExternalApi<P, C extends UiContract, S extends ReadonlyArray<unknown>, N extends string, Identity> {
|
|
38
|
+
readonly composition: CompositionClass<P, C, S, N, Identity>;
|
|
39
|
+
readonly boot?: ReadonlyArray<Tagged>;
|
|
40
|
+
}
|
|
41
|
+
export interface ExactFeatureCompositionConfig<Composition extends AnyComposition> {
|
|
42
|
+
readonly composition: Composition;
|
|
43
|
+
}
|
|
44
|
+
export type IncludesComposition<ROut, N extends string, Identity> = HasExactCompositionId<ROut, N, Identity> extends true ? object : {
|
|
45
|
+
readonly missingCompositionService: 'The feature module must provide its root composition';
|
|
46
|
+
};
|
|
47
|
+
export type EagerFeatureConfigExternalApi<P, C extends UiContract, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, OpenServices, S extends ReadonlyArray<unknown>, N extends string, Identity> = FeatureConfigBaseExternalApi<P, C, S, N, Identity> & {
|
|
48
|
+
readonly loadingStrategy?: 'default';
|
|
49
|
+
readonly module: FeatureModule<ROut, DirectRequires, OpenServices, false, never> & IncludesComposition<ROut, N, Identity>;
|
|
50
|
+
};
|
|
51
|
+
export type LazyFeatureConfigExternalApi<CompositionProps, C extends UiContract, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, OpenServices, SupportOut, SupportDirectRequires extends ReadonlyArray<FeatureRequirement>, SupportOpenServices, S extends ReadonlyArray<unknown>, N extends string, Identity, InputSchema extends Schema.Schema.AnyNoContext, Loading extends AnyComposition, Failed extends AnyComposition> = FeatureConfigBaseExternalApi<CompositionProps, C, S, N, Identity> & {
|
|
52
|
+
readonly composition: CompositionClass<CompositionProps, C, S, N, Identity> & CompositionPropsReceiver<NoInfer<FeatureMountProps<FeatureUsesInput<InputSchema>, CompositionProps, InputSchema>>>;
|
|
53
|
+
readonly loadingStrategy: 'lazy';
|
|
54
|
+
readonly input?: InputSchema;
|
|
55
|
+
readonly load: Effect.Effect<FeatureModule<ROut, DirectRequires, OpenServices, FeatureUsesInput<InputSchema>, FeatureInputValue<InputSchema>> & IncludesComposition<ROut, N, Identity>, FeatureLoadFailed>;
|
|
56
|
+
readonly placeholder: {
|
|
57
|
+
readonly loading: Loading & CompositionPropsReceiver<NoInfer<FeatureMountProps<FeatureUsesInput<InputSchema>, CompositionProps, InputSchema>>>;
|
|
58
|
+
readonly failed: Failed & CompositionPropsReceiver<FailedProps>;
|
|
59
|
+
};
|
|
60
|
+
readonly eager?: FeatureModule<SupportOut, SupportDirectRequires, SupportOpenServices, false, never>;
|
|
61
|
+
} & (FeatureUsesInput<InputSchema> extends true ? {
|
|
62
|
+
readonly input: InputSchema;
|
|
63
|
+
} : object);
|
|
64
|
+
export type MakeImplementationConfigExternalApi = {
|
|
65
|
+
readonly composition: AnyComposition;
|
|
66
|
+
readonly boot?: ReadonlyArray<Tagged>;
|
|
67
|
+
readonly loadingStrategy?: 'default';
|
|
68
|
+
readonly module: AnyLoadedModule;
|
|
69
|
+
} | {
|
|
70
|
+
readonly composition: AnyComposition;
|
|
71
|
+
readonly boot?: ReadonlyArray<Tagged>;
|
|
72
|
+
readonly loadingStrategy: 'lazy';
|
|
73
|
+
readonly input?: Schema.Schema.Any;
|
|
74
|
+
readonly load: Effect.Effect<AnyLoadedModule, FeatureLoadFailed>;
|
|
75
|
+
readonly placeholder: {
|
|
76
|
+
readonly loading: AnyComposition;
|
|
77
|
+
readonly failed: AnyComposition;
|
|
78
|
+
};
|
|
79
|
+
readonly eager?: AnyLoadedModule;
|
|
80
|
+
};
|
|
81
|
+
export declare const isMakeImplementationConfig: (candidate: unknown) => candidate is MakeImplementationConfigExternalApi;
|
|
82
|
+
export type RuntimePlaceholders = {
|
|
83
|
+
readonly loading: AnyComposition;
|
|
84
|
+
readonly failed: AnyComposition;
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=featureConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureConfig.d.ts","sourceRoot":"","sources":["../../src/feature/featureConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,EAC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S,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CACjC,GACD;IACE,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAA;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACrC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAA;IAChE,QAAQ,CAAC,WAAW,EAAE;QACpB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;QAChC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;KAChC,CAAA;IACD,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAA;CACjC,CAAA;AAEL,eAAO,MAAM,0BAA0B,GACrC,WAAW,OAAO,KACjB,SAAS,IAAI,mCAKgE,CAAA;AAEhF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAChC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { FeatureNativeTypeId, } from './featureBinding.js';
|
|
3
|
+
const isRuntimeFeatureToken = (candidate) => typeof candidate === 'object' && candidate !== null && FeatureNativeTypeId in candidate;
|
|
4
|
+
export const isFeature = (candidate) => (typeof candidate === 'function' || typeof candidate === 'object') &&
|
|
5
|
+
candidate !== null &&
|
|
6
|
+
'token' in candidate &&
|
|
7
|
+
isRuntimeFeatureToken(candidate.token);
|
|
8
|
+
export const isMakeImplementationConfig = (candidate) => typeof candidate === 'object' &&
|
|
9
|
+
candidate !== null &&
|
|
10
|
+
'composition' in candidate &&
|
|
11
|
+
(!('input' in candidate) || Schema.isSchema(candidate.input)) &&
|
|
12
|
+
('module' in candidate || ('load' in candidate && 'placeholder' in candidate));
|
|
13
|
+
//# sourceMappingURL=featureConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureConfig.js","sourceRoot":"","sources":["../../src/feature/featureConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAW/B,OAAO,EAIL,mBAAmB,GAEpB,MAAM,kBAAkB,CAAA;AAmBzB,MAAM,qBAAqB,GAAG,CAC5B,SAAkB,EACsC,EAAE,CAC1D,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI,mBAAmB,IAAI,SAAS,CAAA;AAEzF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAkB,EAA+B,EAAE,CAC3E,CAAC,OAAO,SAAS,KAAK,UAAU,IAAI,OAAO,SAAS,KAAK,QAAQ,CAAC;IAClE,SAAS,KAAK,IAAI;IAClB,OAAO,IAAI,SAAS;IACpB,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAqIxC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,SAAkB,EACgC,EAAE,CACpD,OAAO,SAAS,KAAK,QAAQ;IAC7B,SAAS,KAAK,IAAI;IAClB,aAAa,IAAI,SAAS;IAC1B,CAAC,CAAC,CAAC,OAAO,IAAI,SAAS,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC,QAAQ,IAAI,SAAS,IAAI,CAAC,MAAM,IAAI,SAAS,IAAI,aAAa,IAAI,SAAS,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Effect, Option, Schema } from 'effect';
|
|
2
|
+
import type { AnyComposition, CompositionClass } from '../compose/composition.js';
|
|
3
|
+
import type { UiContract } from '../compose/ui.js';
|
|
4
|
+
import { type AnyFeatureGraphSummary, type FeatureSummaryCompositionIdentity, type FeatureSummaryCompositionProps, type FeatureSummaryContract, type FeatureSummaryInput, type FeatureSummaryName, type FeatureSummaryOpenServices, type FeatureSummaryStates, type FeatureSummaryUsesInput } from '../graph/closure.js';
|
|
5
|
+
import type { FeatureLoadFailed } from '../internal/errors.js';
|
|
6
|
+
import type { Tagged } from '../runtime/bus.js';
|
|
7
|
+
import { type FeatureBinding, type FeatureManifest } from './featureBinding.js';
|
|
8
|
+
import type { RuntimePlaceholders } from './featureConfig.js';
|
|
9
|
+
import type { LoadedModule } from './featureModule.js';
|
|
10
|
+
import type { FeatureSummaryOf } from './featureNativeTree.js';
|
|
11
|
+
import type { FeatureRequirement } from './featureRequirement.js';
|
|
12
|
+
export declare const makeFeatureManifest: (name: string, strategy: "lazy" | "default", composition: AnyComposition, placeholder: Option.Option<RuntimePlaceholders>) => FeatureManifest;
|
|
13
|
+
export declare const makeFeatureSummary: <FeatureIdentity, MountProps, CompositionProps, C extends UiContract, S extends ReadonlyArray<unknown>, N extends string, Identity, OpenServices, SupportOpenServices, UsesInput extends boolean, Input>(composition: CompositionClass<CompositionProps, C, S, N, Identity>) => FeatureSummaryOf<FeatureIdentity, MountProps, CompositionProps, C, S, N, Identity, OpenServices, SupportOpenServices, UsesInput, Input>;
|
|
14
|
+
export declare const makeFeatureBinding: <Summary extends AnyFeatureGraphSummary, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>>(identity: symbol, manifest: FeatureManifest, summary: Summary, composition: CompositionClass<FeatureSummaryCompositionProps<Summary>, FeatureSummaryContract<Summary>, FeatureSummaryStates<Summary>, FeatureSummaryName<Summary>, FeatureSummaryCompositionIdentity<Summary>>, load: Effect.Effect<LoadedModule<ROut, DirectRequires, FeatureSummaryOpenServices<Summary>, FeatureSummaryUsesInput<Summary>, FeatureSummaryInput<Summary>>, FeatureLoadFailed>, placeholder: Option.Option<RuntimePlaceholders>, inputSchema: Schema.Schema.AnyNoContext | undefined, boot: ReadonlyArray<Tagged>) => FeatureBinding<Summary, ROut, DirectRequires>;
|
|
15
|
+
//# sourceMappingURL=featureFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureFactory.d.ts","sourceRoot":"","sources":["../../src/feature/featureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EACL,KAAK,sBAAsB,EAK3B,KAAK,iCAAiC,EACtC,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAE7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,eAAO,MAAM,mBAAmB,GAC9B,MAAM,MAAM,EACZ,UAAU,MAAM,GAAG,SAAS,EAC5B,aAAa,cAAc,EAC3B,aAAa,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAC9C,eASD,CAAA;AAwBF,eAAO,MAAM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 @@
|
|
|
1
|
+
import { Option, Schema } from 'effect';
|
|
2
|
+
import { FeatureChildSummaryTypeId, FeatureGraphSummaryTypeId, FeatureGraphValidTypeId, FeatureModuleGraphValidTypeId, SlotBindingSummaryTypeId, } from '../graph/closure.js';
|
|
3
|
+
import { FeatureBindingTypeId, } from './featureBinding.js';
|
|
4
|
+
export const makeFeatureManifest = (name, strategy, composition, placeholder) => ({
|
|
5
|
+
kind: 'Feature',
|
|
6
|
+
name,
|
|
7
|
+
strategy,
|
|
8
|
+
composition: composition.manifest,
|
|
9
|
+
placeholder: Option.map(placeholder, (placeholders) => ({
|
|
10
|
+
loading: placeholders.loading.manifest,
|
|
11
|
+
failed: placeholders.failed.manifest,
|
|
12
|
+
})),
|
|
13
|
+
});
|
|
14
|
+
const makeFeatureInputParser = (composition, inputSchema, placeholder) => (input) => Option.flatMap(Option.match(Option.fromNullable(inputSchema), {
|
|
15
|
+
onNone: () => Option.some(input),
|
|
16
|
+
onSome: (schema) => Schema.validateOption(schema)(input),
|
|
17
|
+
}), (decoded) => Option.flatMap(composition.parseProps(decoded), () => Option.match(placeholder, {
|
|
18
|
+
onNone: () => Option.some(decoded),
|
|
19
|
+
onSome: (placeholders) => Option.map(placeholders.loading.parseProps(decoded), () => decoded),
|
|
20
|
+
})));
|
|
21
|
+
export const makeFeatureSummary = (composition) => ({
|
|
22
|
+
[SlotBindingSummaryTypeId]: SlotBindingSummaryTypeId,
|
|
23
|
+
[FeatureChildSummaryTypeId]: {
|
|
24
|
+
featureIdentity: [],
|
|
25
|
+
compositionIdentity: [],
|
|
26
|
+
},
|
|
27
|
+
[FeatureGraphSummaryTypeId]: {
|
|
28
|
+
featureIdentity: [],
|
|
29
|
+
mountProps: [],
|
|
30
|
+
compositionProps: [],
|
|
31
|
+
contract: [],
|
|
32
|
+
states: [],
|
|
33
|
+
name: composition.manifest.name,
|
|
34
|
+
compositionIdentity: [],
|
|
35
|
+
openServices: [],
|
|
36
|
+
supportOpenServices: [],
|
|
37
|
+
usesInput: [],
|
|
38
|
+
input: [],
|
|
39
|
+
validated: FeatureModuleGraphValidTypeId,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export const makeFeatureBinding = (identity, manifest, summary, composition, load, placeholder, inputSchema, boot) => {
|
|
43
|
+
const binding = {
|
|
44
|
+
[FeatureBindingTypeId]: FeatureBindingTypeId,
|
|
45
|
+
[FeatureGraphValidTypeId]: FeatureGraphValidTypeId,
|
|
46
|
+
manifest,
|
|
47
|
+
identity,
|
|
48
|
+
summary,
|
|
49
|
+
composition,
|
|
50
|
+
strategy: manifest.strategy,
|
|
51
|
+
load,
|
|
52
|
+
placeholder,
|
|
53
|
+
parseInput: makeFeatureInputParser(composition, inputSchema, placeholder),
|
|
54
|
+
boot,
|
|
55
|
+
capture: (visit) => visit(binding),
|
|
56
|
+
};
|
|
57
|
+
return binding;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=featureFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureFactory.js","sourceRoot":"","sources":["../../src/feature/featureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAGpD,OAAO,EAEL,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAS7B,wBAAwB,GACzB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAGL,oBAAoB,GAErB,MAAM,kBAAkB,CAAA;AAMzB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAAY,EACZ,QAA4B,EAC5B,WAA2B,EAC3B,WAA+C,EAC9B,EAAE,CAAC,CAAC;IACrB,IAAI,EAAE,SAAS;IACf,IAAI;IACJ,QAAQ;IACR,WAAW,EAAE,WAAW,CAAC,QAAQ;IACjC,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACtD,OAAO,E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AAE;QACpB,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,IAAI;QAC/B,mBAAmB,EAAE,EAAE;QACvB,YAAY,EAAE,EAAE;QAChB,mBAAmB,EAAE,EAAE;QACvB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,6BAA6B;KACzC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAKhC,QAAgB,EAChB,QAAyB,EACzB,OAAgB,EAChB,WAMC,EACD,IASC,EACD,WAA+C,EAC/C,WAAmD,EACnD,IAA2B,EACoB,EAAE;IACjD,MAAM,OAAO,GAAkD;QAC7D,CAAC,oBAAoB,CAAC,EAAE,oBAAoB;QAC5C,CAAC,uBAAuB,CAAC,EAAE,uBAAuB;QAClD,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,WAAW;QACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,IAAI;QACJ,WAAW;QACX,UAAU,EAAE,sBAAsB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;QACzE,IAAI;QACJ,OAAO,EAAE,CAAS,KAAoC,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;KAClF,CAAA;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Effect, type Layer, type Schema } from 'effect';
|
|
2
|
+
import { FeatureModuleGraphValidTypeId, type ModuleOpenServices, type ValidateFeatureGraphLayer } from '../graph/closure.js';
|
|
3
|
+
import { FeatureLoadFailed } from '../internal/errors.js';
|
|
4
|
+
import type { DefaultFeatureOpenServices, FeatureModuleInput, FeatureRequirement } from './featureRequirement.js';
|
|
5
|
+
export interface FeatureModule<ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, OpenServices = DefaultFeatureOpenServices<ROut, DirectRequires>, UsesInput extends boolean = false, Input = never> extends AnyLoadedModule {
|
|
6
|
+
readonly [FeatureModuleGraphValidTypeId]: FeatureModuleGraphValidTypeId;
|
|
7
|
+
readonly requires: DirectRequires;
|
|
8
|
+
readonly usesInput: UsesInput;
|
|
9
|
+
readonly layer: Layer.Layer<ROut, never, FeatureModuleInput<OpenServices, UsesInput>>;
|
|
10
|
+
readonly inputSchema: UsesInput extends true ? Schema.Schema.AnyNoContext : undefined;
|
|
11
|
+
readonly Input: (input: Input) => void;
|
|
12
|
+
}
|
|
13
|
+
export type LoadedModuleCapture<Result> = <ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, OpenServices, UsesInput extends boolean, Input>(module: LoadedModule<ROut, DirectRequires, OpenServices, UsesInput, Input>) => Result;
|
|
14
|
+
export interface AnyLoadedModule {
|
|
15
|
+
readonly capture: <Result>(visit: LoadedModuleCapture<Result>) => Result;
|
|
16
|
+
}
|
|
17
|
+
export type FeatureLayerOutput<L extends Layer.Layer.Any> = Layer.Layer.Success<L>;
|
|
18
|
+
export type ExactFeatureLayer<L extends Layer.Layer.Any, UsesInput extends boolean> = Layer.Layer<FeatureLayerOutput<L>, never, FeatureModuleInput<ModuleOpenServices<L, UsesInput>, UsesInput>> & (unknown extends Layer.Layer.Context<L> ? {
|
|
19
|
+
readonly featureLayerContextMustBeExact: 'A feature layer context cannot be erased';
|
|
20
|
+
} : object);
|
|
21
|
+
export declare const featureModule: <const DirectRequires extends ReadonlyArray<FeatureRequirement>, L extends Layer.Layer.Any>(requires: DirectRequires, layer: L & ExactFeatureLayer<L, false> & ValidateFeatureGraphLayer<L, DirectRequires, false>) => FeatureModule<FeatureLayerOutput<L>, DirectRequires, ModuleOpenServices<L, false>, false, never>;
|
|
22
|
+
export declare const featureModuleFromInput: <const InputSchema extends Schema.Schema.AnyNoContext, const DirectRequires extends ReadonlyArray<FeatureRequirement>, L extends Layer.Layer.Any>(input: InputSchema, requires: DirectRequires, layer: L & ExactFeatureLayer<L, true> & ValidateFeatureGraphLayer<L, DirectRequires, true>) => FeatureModule<FeatureLayerOutput<L>, DirectRequires, ModuleOpenServices<L, true>, true, Schema.Schema.Type<InputSchema>>;
|
|
23
|
+
export declare const lazyImport: <M>(thunk: () => Promise<{
|
|
24
|
+
readonly default: M;
|
|
25
|
+
}>) => Effect.Effect<M, FeatureLoadFailed>;
|
|
26
|
+
export interface LoadedModule<ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, OpenServices = DefaultFeatureOpenServices<ROut, DirectRequires>, UsesInput extends boolean = false, Input = never> extends FeatureModule<ROut, DirectRequires, OpenServices, UsesInput, Input> {
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=featureModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureModule.d.ts","sourceRoot":"","sources":["../../src/feature/featureModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EACL,6BAA6B,EAC7B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC/B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,aAAa,CAC5B,IAAI,EACJ,cAAc,SAAS,aAAa,CAAC,kBAAkB,CAAC,EACxD,YAAY,GAAG,0BAA0B,CAAC,IAAI,EAAE,cAAc,CAAC,EAC/D,SAAS,SAAS,OAAO,GAAG,KAAK,EACjC,KAAK,GAAG,KAAK,CACb,SAAQ,eAAe;IACvB,QAAQ,CAAC,CAAC,6BAA6B,CAAC,EAAE,6BAA6B,CAAA;IACvE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,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C,IAAI,EAAE,cAAc,CAAC,EAC/D,SAAS,SAAS,OAAO,GAAG,KAAK,EACjC,KAAK,GAAG,KAAK,CACb,SAAQ,aAAa,CAAC,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC;CAAG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { FeatureModuleGraphValidTypeId, } from '../graph/closure.js';
|
|
3
|
+
import { FeatureLoadFailed } from '../internal/errors.js';
|
|
4
|
+
export const featureModule = (requires, layer) => {
|
|
5
|
+
const module = {
|
|
6
|
+
[FeatureModuleGraphValidTypeId]: FeatureModuleGraphValidTypeId,
|
|
7
|
+
requires,
|
|
8
|
+
usesInput: false,
|
|
9
|
+
layer,
|
|
10
|
+
inputSchema: undefined,
|
|
11
|
+
Input: () => undefined,
|
|
12
|
+
capture: (visit) => visit(module),
|
|
13
|
+
};
|
|
14
|
+
return module;
|
|
15
|
+
};
|
|
16
|
+
export const featureModuleFromInput = (input, requires, layer) => {
|
|
17
|
+
const module = {
|
|
18
|
+
[FeatureModuleGraphValidTypeId]: FeatureModuleGraphValidTypeId,
|
|
19
|
+
requires,
|
|
20
|
+
usesInput: true,
|
|
21
|
+
layer,
|
|
22
|
+
inputSchema: input,
|
|
23
|
+
Input: () => undefined,
|
|
24
|
+
capture: (visit) => visit(module),
|
|
25
|
+
};
|
|
26
|
+
return module;
|
|
27
|
+
};
|
|
28
|
+
// Seal dynamic imports as typed Effects so chunk failures become FeatureLoadFailed.
|
|
29
|
+
export const lazyImport = (thunk) => Effect.tryPromise({
|
|
30
|
+
try: thunk,
|
|
31
|
+
catch: (cause) => new FeatureLoadFailed({ cause }),
|
|
32
|
+
}).pipe(Effect.map((module) => module.default));
|
|
33
|
+
//# sourceMappingURL=featureModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureModule.js","sourceRoot":"","sources":["../../src/feature/featureModule.ts"],"names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E,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Effect } from 'effect';
|
|
2
|
+
import type { CompositionClass } from '../compose/composition.js';
|
|
3
|
+
import type { UiContract } from '../compose/ui.js';
|
|
4
|
+
import type { AnyFeatureGraphSummary, FeatureGraphSummary, FeatureSummaryCompositionIdentity, FeatureSummaryCompositionProps, FeatureSummaryContract, FeatureSummaryInput, FeatureSummaryName, FeatureSummaryOpenServices, FeatureSummaryStates, FeatureSummarySupportOpenServices, FeatureSummaryUsesInput } from '../graph/closure.js';
|
|
5
|
+
import type { FeatureLoadFailed } from '../internal/errors.js';
|
|
6
|
+
import type { CapturedFeatureBinding } from './featureBinding.js';
|
|
7
|
+
import type { FeatureModule } from './featureModule.js';
|
|
8
|
+
import type { FeatureRequirement } from './featureRequirement.js';
|
|
9
|
+
export interface FeatureNativeTree<Summary extends AnyFeatureGraphSummary, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, SupportOut, SupportDirectRequires extends ReadonlyArray<FeatureRequirement>, Composition extends CompositionClass<FeatureSummaryCompositionProps<Summary>, FeatureSummaryContract<Summary>, FeatureSummaryStates<Summary>, FeatureSummaryName<Summary>, FeatureSummaryCompositionIdentity<Summary>> = CompositionClass<FeatureSummaryCompositionProps<Summary>, FeatureSummaryContract<Summary>, FeatureSummaryStates<Summary>, FeatureSummaryName<Summary>, FeatureSummaryCompositionIdentity<Summary>>> {
|
|
10
|
+
readonly identity: symbol;
|
|
11
|
+
readonly summary: Summary;
|
|
12
|
+
readonly composition: Composition;
|
|
13
|
+
readonly load: Effect.Effect<FeatureModule<ROut, DirectRequires, FeatureSummaryOpenServices<Summary>, FeatureSummaryUsesInput<Summary>, FeatureSummaryInput<Summary>>, FeatureLoadFailed>;
|
|
14
|
+
readonly binding: CapturedFeatureBinding<Summary, ROut, DirectRequires>;
|
|
15
|
+
readonly eagerModule: FeatureModule<ROut, DirectRequires, FeatureSummaryOpenServices<Summary>, false, never> | undefined;
|
|
16
|
+
readonly supportModule: FeatureModule<SupportOut, SupportDirectRequires, FeatureSummarySupportOpenServices<Summary>, false, never> | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface EagerFeatureNativeTree<Summary extends AnyFeatureGraphSummary, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, Composition extends CompositionClass<FeatureSummaryCompositionProps<Summary>, FeatureSummaryContract<Summary>, FeatureSummaryStates<Summary>, FeatureSummaryName<Summary>, FeatureSummaryCompositionIdentity<Summary>> = CompositionClass<FeatureSummaryCompositionProps<Summary>, FeatureSummaryContract<Summary>, FeatureSummaryStates<Summary>, FeatureSummaryName<Summary>, FeatureSummaryCompositionIdentity<Summary>>> extends FeatureNativeTree<Summary, ROut, DirectRequires, never, readonly [], Composition> {
|
|
19
|
+
readonly eagerModule: FeatureModule<ROut, DirectRequires, FeatureSummaryOpenServices<Summary>, false, never>;
|
|
20
|
+
readonly supportModule: undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface LazyFeatureNativeTree<Summary extends AnyFeatureGraphSummary, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, SupportOut, SupportDirectRequires extends ReadonlyArray<FeatureRequirement>, Composition extends CompositionClass<FeatureSummaryCompositionProps<Summary>, FeatureSummaryContract<Summary>, FeatureSummaryStates<Summary>, FeatureSummaryName<Summary>, FeatureSummaryCompositionIdentity<Summary>> = CompositionClass<FeatureSummaryCompositionProps<Summary>, FeatureSummaryContract<Summary>, FeatureSummaryStates<Summary>, FeatureSummaryName<Summary>, FeatureSummaryCompositionIdentity<Summary>>> extends FeatureNativeTree<Summary, ROut, DirectRequires, SupportOut, SupportDirectRequires, Composition> {
|
|
23
|
+
readonly eagerModule: undefined;
|
|
24
|
+
}
|
|
25
|
+
export type FeatureSummaryOf<FeatureIdentity, MountProps, CompositionProps, C extends UiContract, S extends ReadonlyArray<unknown>, N extends string, Identity, OpenServices, SupportOpenServices, UsesInput extends boolean, Input> = FeatureGraphSummary<FeatureIdentity, MountProps, CompositionProps, C, S, N, Identity, OpenServices, SupportOpenServices, UsesInput, Input>;
|
|
26
|
+
//# sourceMappingURL=featureNativeTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureNativeTree.d.ts","sourceRoot":"","sources":["../../src/feature/featureNativeTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,EACjC,8BAA8B,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,MAAM,WAAW,iBAAiB,CAChC,OAAO,SAAS,sBAAsB,EACtC,IAAI,EACJ,cAAc,SAAS,aAAa,CAAC,kBAAkB,CAAC,EACxD,UAAU,EACV,qBAAqB,SAAS,aAAa,CAAC,kBAAkB,CAAC,EAC/D,WAAW,SAAS,gBAAgB,CAClC,8BAA8B,CAAC,OAAO,CAAC,EACvC,sBAAsB,CAAC,OAAO,CAAC,EAC/B,oBAAoB,CAAC,OAAO,CAAC,EAC7B,kBAAkB,CAAC,OAAO,CAAC,EAC3B,iCAAiC,CAAC,OAAO,CAAC,CAC3C,GAAG,gB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AAC,SAAS,aAAa,CAAC,OAAO,CAAC,EAChC,CAAC,SAAS,MAAM,EAChB,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACnB,SAAS,SAAS,OAAO,EACzB,KAAK,IACH,mBAAmB,CACrB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,CAAC,EACD,CAAC,EACD,CAAC,EACD,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,KAAK,CACN,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureNativeTree.js","sourceRoot":"","sources":["../../src/feature/featureNativeTree.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import { CompositionIdTypeId } from '../compose/composition.js';
|
|
3
|
+
import type { OpenServicesFromFeatureSlotWitnesses } from '../graph/closure.js';
|
|
4
|
+
import type { EngineServices } from '../runtime/loop.js';
|
|
5
|
+
declare const FeatureInputBase: Context.TagClass<FeatureInput, 'reform/FeatureInput', unknown>;
|
|
6
|
+
export declare class FeatureInput extends FeatureInputBase {
|
|
7
|
+
}
|
|
8
|
+
export interface FeatureServiceTag<out Identifier = unknown, out Service = unknown> {
|
|
9
|
+
readonly [Context.TagTypeId]: object;
|
|
10
|
+
readonly Identifier: Identifier;
|
|
11
|
+
readonly Service: Service;
|
|
12
|
+
}
|
|
13
|
+
export interface StoredFeatureRequirement<out Identifier = unknown, out Service = unknown> {
|
|
14
|
+
readonly store: FeatureServiceTag<Identifier, Service>;
|
|
15
|
+
}
|
|
16
|
+
export type RequireCarrier = StoredFeatureRequirement | {
|
|
17
|
+
readonly members: ReadonlyArray<StoredFeatureRequirement>;
|
|
18
|
+
};
|
|
19
|
+
export type FeatureRequirement = RequireCarrier | FeatureServiceTag;
|
|
20
|
+
export type TagRequirement<Tag> = Tag extends FeatureServiceTag<infer Identifier, infer _Service> ? Identifier : never;
|
|
21
|
+
export type StoredRequirementIdentifier<Carrier> = Carrier extends {
|
|
22
|
+
readonly store: infer Tag;
|
|
23
|
+
} ? TagRequirement<Tag> : never;
|
|
24
|
+
export type RequirementIdentifier<Requirement> = Requirement extends FeatureServiceTag ? TagRequirement<Requirement> : Requirement extends {
|
|
25
|
+
readonly members: infer Members extends ReadonlyArray<StoredFeatureRequirement>;
|
|
26
|
+
} ? StoredRequirementIdentifier<Members[number]> : StoredRequirementIdentifier<Requirement>;
|
|
27
|
+
export type ProvidedBy<Requires extends ReadonlyArray<FeatureRequirement>> = RequirementIdentifier<Requires[number]>;
|
|
28
|
+
export type DefaultFeatureOpenServices<ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>> = ProvidedBy<DirectRequires> | OpenServicesFromFeatureSlotWitnesses<ROut>;
|
|
29
|
+
export type CompositionNames<ROut> = ROut extends {
|
|
30
|
+
readonly [CompositionIdTypeId]: {
|
|
31
|
+
readonly name: infer Name extends string;
|
|
32
|
+
};
|
|
33
|
+
} ? Name : never;
|
|
34
|
+
export type CompositionIdentities<ROut> = ROut extends {
|
|
35
|
+
readonly [CompositionIdTypeId]: {
|
|
36
|
+
readonly identity: infer Identity;
|
|
37
|
+
};
|
|
38
|
+
} ? Identity : never;
|
|
39
|
+
export type RootCompositionName<ROut> = [CompositionNames<ROut>] extends [never] ? string : CompositionNames<ROut>;
|
|
40
|
+
export type RootCompositionIdentity<ROut> = [CompositionIdentities<ROut>] extends [never] ? unknown : CompositionIdentities<ROut>;
|
|
41
|
+
export type FeatureModuleInput<OpenServices, UsesInput extends boolean> = EngineServices | OpenServices | (UsesInput extends true ? FeatureInput : never);
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=featureRequirement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureRequirement.d.ts","sourceRoot":"","sources":["../../src/feature/featureRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAE,mBA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,OAAO,GACP,qBAAqB,CAAC,IAAI,CAAC,CAAA;AAG/B,MAAM,MAAM,kBAAkB,CAAC,YAAY,EAAE,SAAS,SAAS,OAAO,IAClE,cAAc,GACd,YAAY,GACZ,CAAC,SAAS,SAAS,IAAI,GAAG,YAAY,GAAG,KAAK,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import { CompositionIdTypeId } from '../compose/composition.js';
|
|
3
|
+
const FeatureInputBase = Context.Tag('reform/FeatureInput')();
|
|
4
|
+
export class FeatureInput extends FeatureInputBase {
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=featureRequirement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureRequirement.js","sourceRoot":"","sources":["../../src/feature/featureRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAI5D,MAAM,gBAAgB,GACpB,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAyB,CAAA;AAC7D,MAAM,OAAO,YAAa,SAAQ,gBAAgB;CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Schema } from 'effect';
|
|
2
|
+
import type { AnyComposition, CompositionClass } from '../compose/composition.js';
|
|
3
|
+
import type { UiContract } from '../compose/ui.js';
|
|
4
|
+
import type { EagerFeatureClass, LazyFeatureClass } from './featureClass.js';
|
|
5
|
+
import type { EagerFeatureConfigExternalApi, ExactFeatureCompositionConfig, FeatureMountProps, FeatureUsesInput, LazyFeatureConfigExternalApi } from './featureConfig.js';
|
|
6
|
+
import type { FeatureRequirement } from './featureRequirement.js';
|
|
7
|
+
export declare const makeEagerFeature: <P, C extends UiContract, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, OpenServices, S extends ReadonlyArray<unknown>, N extends string, Identity, Composition extends CompositionClass<P, C, S, N, Identity>>(name: string, config: EagerFeatureConfigExternalApi<P, C, ROut, DirectRequires, OpenServices, S, N, Identity> & ExactFeatureCompositionConfig<Composition>) => EagerFeatureClass<Identity, P, C, ROut, DirectRequires, OpenServices, S, N, Identity, Composition>;
|
|
8
|
+
export declare const makeLazyFeature: <CompositionProps, C extends UiContract, ROut, DirectRequires extends ReadonlyArray<FeatureRequirement>, OpenServices, SupportOut, SupportDirectRequires extends ReadonlyArray<FeatureRequirement>, SupportOpenServices, S extends ReadonlyArray<unknown>, N extends string, Identity, Composition extends CompositionClass<CompositionProps, C, S, N, Identity>, InputSchema extends Schema.Schema.AnyNoContext, Loading extends AnyComposition, Failed extends AnyComposition>(name: string, config: LazyFeatureConfigExternalApi<CompositionProps, C, ROut, DirectRequires, OpenServices, SupportOut, SupportDirectRequires, SupportOpenServices, S, N, Identity, InputSchema, Loading, Failed> & ExactFeatureCompositionConfig<Composition>) => LazyFeatureClass<Identity, FeatureMountProps<FeatureUsesInput<InputSchema>, CompositionProps, InputSchema>, C, ROut, DirectRequires, OpenServices, SupportOut, SupportDirectRequires, SupportOpenServices, FeatureUsesInput<InputSchema>, S, N, CompositionProps, Identity, Composition>;
|
|
9
|
+
//# sourceMappingURL=featureVariants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureVariants.d.ts","sourceRoot":"","sources":["../../src/feature/featureVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAO/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,KAAK,EACV,6BAA6B,EAC7B,6BAA6B,EAE7B,iBAAiB,EACjB,gBAAg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,QAAQ,4BAA4B,CAClC,gBAAgB,EAChB,CAAC,EACD,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,CAAC,EACD,CAAC,EACD,QAAQ,EACR,WAAW,EACX,OAAO,EACP,MAAM,CACP,GACC,6BAA6B,CAAC,WAAW,CAAC,KAC3C,gBAAgB,CACjB,QAAQ,EACR,iBAAiB,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,gBAAgB,EAAE,WAAW,CAAC,EAC/E,CAAC,EACD,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,CAAC,WAAW,CAAC,EAC7B,CAAC,EACD,CAAC,EACD,gBAAgB,EAChB,QAAQ,EACR,WAAW,CAyEZ,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Effect, Option } from 'effect';
|
|
2
|
+
import { definitionClass } from '../definition/definition.js';
|
|
3
|
+
import { FeatureNativeTypeId, FeatureTokenIdentityTypeId, } from './featureBinding.js';
|
|
4
|
+
import { makeFeatureBinding, makeFeatureManifest, makeFeatureSummary } from './featureFactory.js';
|
|
5
|
+
export const makeEagerFeature = (name, config) => {
|
|
6
|
+
const featureIdentity = Symbol(name);
|
|
7
|
+
const placeholder = Option.none();
|
|
8
|
+
const manifest = makeFeatureManifest(name, 'default', config.composition, placeholder);
|
|
9
|
+
const load = Effect.succeed(config.module);
|
|
10
|
+
const summary = makeFeatureSummary(config.composition);
|
|
11
|
+
const binding = makeFeatureBinding(featureIdentity, manifest, summary, config.composition, load, placeholder, undefined, Option.getOrElse(Option.fromNullable(config.boot), () => []));
|
|
12
|
+
const native = {
|
|
13
|
+
identity: featureIdentity,
|
|
14
|
+
summary,
|
|
15
|
+
composition: config.composition,
|
|
16
|
+
load,
|
|
17
|
+
binding,
|
|
18
|
+
eagerModule: config.module,
|
|
19
|
+
supportModule: undefined,
|
|
20
|
+
};
|
|
21
|
+
const token = {
|
|
22
|
+
identity: featureIdentity,
|
|
23
|
+
[FeatureTokenIdentityTypeId]: [],
|
|
24
|
+
[FeatureNativeTypeId]: native,
|
|
25
|
+
};
|
|
26
|
+
return definitionClass({
|
|
27
|
+
manifest,
|
|
28
|
+
summary,
|
|
29
|
+
token,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export const makeLazyFeature = (name, config) => {
|
|
33
|
+
const featureIdentity = Symbol(name);
|
|
34
|
+
const placeholder = Option.some(config.placeholder);
|
|
35
|
+
const manifest = makeFeatureManifest(name, 'lazy', config.composition, placeholder);
|
|
36
|
+
const inputSchema = 'input' in config ? config.input : undefined;
|
|
37
|
+
const summary = makeFeatureSummary(config.composition);
|
|
38
|
+
const binding = makeFeatureBinding(featureIdentity, manifest, summary, config.composition, config.load, placeholder, inputSchema, Option.getOrElse(Option.fromNullable(config.boot), () => []));
|
|
39
|
+
const native = {
|
|
40
|
+
identity: featureIdentity,
|
|
41
|
+
summary,
|
|
42
|
+
composition: config.composition,
|
|
43
|
+
load: config.load,
|
|
44
|
+
binding,
|
|
45
|
+
eagerModule: undefined,
|
|
46
|
+
supportModule: config.eager,
|
|
47
|
+
};
|
|
48
|
+
const token = {
|
|
49
|
+
identity: featureIdentity,
|
|
50
|
+
[FeatureTokenIdentityTypeId]: [],
|
|
51
|
+
[FeatureNativeTypeId]: native,
|
|
52
|
+
};
|
|
53
|
+
return definitionClass({
|
|
54
|
+
manifest,
|
|
55
|
+
summary,
|
|
56
|
+
token,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=featureVariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureVariants.js","sourceRoot":"","sources":["../../src/feature/featureVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAA;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,C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AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context, Effect, type Scope } from 'effect';
|
|
2
|
+
import type { AnyFeatureGraphSummary, FeatureSummaryInput, FeatureSummaryOpenServices } from '../graph/closure.js';
|
|
3
|
+
import type { FeatureLoadFailed } from '../internal/errors.js';
|
|
4
|
+
import type { EngineServices } from '../runtime/loop.js';
|
|
5
|
+
import type { FeatureBinding } from './featureBinding.js';
|
|
6
|
+
import { type FeatureRequirement } from './featureRequirement.js';
|
|
7
|
+
type MountFeature = <Summary extends AnyFeatureGraphSummary, ROut, const DirectRequires extends ReadonlyArray<FeatureRequirement>, HostServices>(binding: FeatureBinding<Summary, ROut, DirectRequires>, engineContext: Context.Context<HostServices | EngineServices | FeatureSummaryOpenServices<Summary>>, props?: FeatureSummaryInput<Summary>) => Effect.Effect<Context.Context<HostServices | EngineServices | FeatureSummaryOpenServices<Summary> | ROut>, FeatureLoadFailed, Scope.Scope>;
|
|
8
|
+
export declare const mountFeature: MountFeature;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=mountFeature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mountFeature.d.ts","sourceRoot":"","sources":["../../src/feature/mountFeature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAS,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC3D,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE5E,KAAK,YAAY,GAAG,CAClB,OAAO,SAAS,sBAAsB,EACtC,IAAI,EACJ,KAAK,CAAC,cAAc,SAAS,aAAa,CAAC,kBAAkB,CAAC,EAC9D,YAAY,EAEZ,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,EACtD,aAAa,EAAE,OAAO,CAAC,OAAO,CAC5B,YAAY,GAAG,cAAc,GAAG,0BAA0B,CAAC,OAAO,CAAC,CACpE,EACD,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,KACjC,MAAM,CAAC,MAAM,CAChB,OAAO,CAAC,OAAO,CAAC,YAAY,GAAG,cAAc,GAAG,0BAA0B,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EAC3F,iBAAiB,EACjB,KAAK,CAAC,KAAK,CACZ,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,YAwBzB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from 'effect';
|
|
2
|
+
import { Bus, publish } from '../runtime/bus.js';
|
|
3
|
+
import { FeatureInput } from './featureRequirement.js';
|
|
4
|
+
export const mountFeature = Effect.fn('mountFeature')(function* (binding, engineContext, props = undefined) {
|
|
5
|
+
const { layer } = yield* binding.load;
|
|
6
|
+
const bus = Context.get(engineContext, Bus);
|
|
7
|
+
const featureContext = Context.add(engineContext, FeatureInput, props);
|
|
8
|
+
const context = yield* Layer.build(Layer.provide(layer, Layer.succeedContext(featureContext)));
|
|
9
|
+
yield* Effect.forEach(binding.boot, (event) => publish('High', event), {
|
|
10
|
+
discard: true,
|
|
11
|
+
}).pipe(Effect.provideService(Bus, bus));
|
|
12
|
+
return Context.merge(engineContext, context);
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=mountFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mountFeature.js","sourceRoot":"","sources":["../../src/feature/mountFeature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAc,MAAM,QAAQ,CAAA;AAO3D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,EAAE,YAAY,EAA2B,MAAM,sBAAsB,CAAA;AAmB5E,MAAM,CAAC,MAAM,YAAY,GAAiB,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,EAM3E,OAAsD,EACtD,aAEC,EACD,QAAkD,SAAS;IAM3D,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAA;IACrC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;IAC3C,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,CAAC,CAAA;IACtE,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAA;IAC9F,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QACrE,OAAO,EAAE,IAAI;KACd,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;IACxC,OAAO,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;AAC9C,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Layer } from 'effect';
|
|
2
|
+
import { CompositionIdTypeId } from '../compose/composition.js';
|
|
3
|
+
import { SlotServiceTypeId } from '../compose/slot.js';
|
|
4
|
+
import type { FeatureRequirement, ProvidedBy } from '../feature/feature.js';
|
|
5
|
+
import type { EngineServices } from '../runtime/loop.js';
|
|
6
|
+
import type { ExactIdentity, ExactServiceExclude, ExactServiceExtract, GraphValidationPassed, InputService, IsErased } from './services.js';
|
|
7
|
+
import type { CompositionChildSummary } from './summary.js';
|
|
8
|
+
import type { DescendantOpenServices } from './services.js';
|
|
9
|
+
export { CompositionChildSummaryTypeId, FeatureChildSummaryTypeId, FeatureGraphSummaryTypeId, FeatureGraphValidTypeId, FeatureModuleGraphValidTypeId, SlotBindingSummaryTypeId, } from './summary.js';
|
|
10
|
+
export type { AnyFeatureGraphSummary, CompositionChildSummary, FeatureChildSummary, FeatureGraphSummary, FeatureSummaryCompositionIdentity, FeatureSummaryCompositionProps, FeatureSummaryContract, FeatureSummaryIdentity, FeatureSummaryInput, FeatureSummaryMountProps, FeatureSummaryName, FeatureSummaryOpenServices, FeatureSummaryStates, FeatureSummarySupportOpenServices, FeatureSummaryUsesInput, SlotBindingSummary, } from './summary.js';
|
|
11
|
+
export type { DescendantOpenServices, ExactServiceExclude, ModuleOpenServices, OpenServicesFromFeatureSlotWitnesses, } from './services.js';
|
|
12
|
+
type LayerErrorIsNever<L extends Layer.Layer.Any> = IsErased<Layer.Layer.Error<L>> extends true ? {
|
|
13
|
+
readonly featureLayerErrorMustBeNever: 'A feature layer error channel cannot be erased';
|
|
14
|
+
} : [Layer.Layer.Error<L>] extends [never] ? GraphValidationPassed : {
|
|
15
|
+
readonly featureLayerErrorMustBeNever: 'A feature layer must have an error channel of exactly never';
|
|
16
|
+
};
|
|
17
|
+
type LayerOutputsAreExact<L extends Layer.Layer.Any> = IsErased<Layer.Layer.Success<L>> extends true ? {
|
|
18
|
+
readonly featureLayerOutputsMustBeExact: 'A feature layer output cannot be erased';
|
|
19
|
+
} : GraphValidationPassed;
|
|
20
|
+
type DescendantOpenServicesAreExact<L extends Layer.Layer.Any> = IsErased<DescendantOpenServices<L>> extends true ? {
|
|
21
|
+
readonly featureDescendantOpenServicesMustBeExact: "A child feature's open services cannot be erased";
|
|
22
|
+
} : GraphValidationPassed;
|
|
23
|
+
type UnexpectedOpenServices<L extends Layer.Layer.Any, DirectRequires extends ReadonlyArray<FeatureRequirement>, UsesInput extends boolean> = ExactServiceExclude<Layer.Layer.Context<L>, EngineServices | InputService<UsesInput> | ProvidedBy<DirectRequires> | DescendantOpenServices<L>>;
|
|
24
|
+
type OpenServicesAreDeclared<L extends Layer.Layer.Any, DirectRequires extends ReadonlyArray<FeatureRequirement>, UsesInput extends boolean> = IsErased<Layer.Layer.Context<L>> extends true ? {
|
|
25
|
+
readonly featureLayerContextMustBeExact: 'A feature layer context cannot be erased';
|
|
26
|
+
} : [UnexpectedOpenServices<L, DirectRequires, UsesInput>] extends [never] ? GraphValidationPassed : {
|
|
27
|
+
readonly undeclaredFeatureOpenServices: UnexpectedOpenServices<L, DirectRequires, UsesInput>;
|
|
28
|
+
};
|
|
29
|
+
type MissingDirectRequirements<L extends Layer.Layer.Any, DirectRequires extends ReadonlyArray<FeatureRequirement>> = ExactServiceExclude<ProvidedBy<DirectRequires>, Layer.Layer.Context<L>>;
|
|
30
|
+
type DirectRequirementsAreOpen<L extends Layer.Layer.Any, DirectRequires extends ReadonlyArray<FeatureRequirement>> = [MissingDirectRequirements<L, DirectRequires>] extends [never] ? GraphValidationPassed : {
|
|
31
|
+
readonly unusedDirectFeatureRequirements: MissingDirectRequirements<L, DirectRequires>;
|
|
32
|
+
};
|
|
33
|
+
type PrivateEngineOutputs<L extends Layer.Layer.Any> = Extract<Layer.Layer.Success<L>, EngineServices>;
|
|
34
|
+
type EngineOutputsAreShared<L extends Layer.Layer.Any> = [PrivateEngineOutputs<L>] extends [never] ? GraphValidationPassed : {
|
|
35
|
+
readonly featureCannotProvideEngineServices: PrivateEngineOutputs<L>;
|
|
36
|
+
};
|
|
37
|
+
type SelfRequiredOutputs<L extends Layer.Layer.Any> = ExactServiceExtract<Layer.Layer.Context<L>, Layer.Layer.Success<L>>;
|
|
38
|
+
type OutputsAreNotSelfRequired<L extends Layer.Layer.Any> = [SelfRequiredOutputs<L>] extends [never] ? GraphValidationPassed : {
|
|
39
|
+
readonly featureCannotRequireItsOwnOutputs: SelfRequiredOutputs<L>;
|
|
40
|
+
};
|
|
41
|
+
type SlotIdentity<Descriptor> = IsErased<Descriptor> extends true ? unknown : Descriptor extends ReadonlyArray<infer Entry> ? SlotIdentity<Entry> : Descriptor extends {
|
|
42
|
+
readonly [SlotServiceTypeId]: {
|
|
43
|
+
readonly identity: infer Identity;
|
|
44
|
+
};
|
|
45
|
+
} ? Identity : Descriptor;
|
|
46
|
+
type RequiredSlotIdentities<Services> = Services extends {
|
|
47
|
+
readonly [CompositionIdTypeId]: {
|
|
48
|
+
readonly requiredSlots: infer RequiredSlots;
|
|
49
|
+
};
|
|
50
|
+
} ? SlotIdentity<RequiredSlots> : never;
|
|
51
|
+
type BoundSlotIdentities<Services> = Services extends {
|
|
52
|
+
readonly [SlotServiceTypeId]: {
|
|
53
|
+
readonly identity: infer Identity;
|
|
54
|
+
};
|
|
55
|
+
} ? ExactIdentity<Identity> : never;
|
|
56
|
+
type MissingSlotBindings<L extends Layer.Layer.Any> = Exclude<RequiredSlotIdentities<Layer.Layer.Success<L>>, BoundSlotIdentities<Layer.Layer.Success<L>>>;
|
|
57
|
+
type RequiredSlotsAreBound<L extends Layer.Layer.Any> = [MissingSlotBindings<L>] extends [never] ? GraphValidationPassed : {
|
|
58
|
+
readonly unboundFeatureSlotIdentities: MissingSlotBindings<L>;
|
|
59
|
+
};
|
|
60
|
+
type PlainChildCompositionIdentities<Services> = Services extends {
|
|
61
|
+
readonly [SlotServiceTypeId]: {
|
|
62
|
+
readonly binding: CompositionChildSummary<infer CompositionIdentity>;
|
|
63
|
+
};
|
|
64
|
+
} ? CompositionIdentity : never;
|
|
65
|
+
type LiveCompositionIdentities<Services> = Services extends {
|
|
66
|
+
readonly [CompositionIdTypeId]: {
|
|
67
|
+
readonly identity: infer Identity;
|
|
68
|
+
};
|
|
69
|
+
} ? ExactIdentity<Identity> : never;
|
|
70
|
+
type MissingPlainChildCompositions<L extends Layer.Layer.Any> = Exclude<PlainChildCompositionIdentities<Layer.Layer.Success<L>>, LiveCompositionIdentities<Layer.Layer.Success<L> | Layer.Layer.Context<L>>>;
|
|
71
|
+
type PlainChildrenAreLive<L extends Layer.Layer.Any> = [MissingPlainChildCompositions<L>] extends [
|
|
72
|
+
never
|
|
73
|
+
] ? GraphValidationPassed : {
|
|
74
|
+
readonly missingPlainChildCompositions: MissingPlainChildCompositions<L>;
|
|
75
|
+
};
|
|
76
|
+
export type ValidateFeatureGraphLayer<L extends Layer.Layer.Any, DirectRequires extends ReadonlyArray<FeatureRequirement>, UsesInput extends boolean> = LayerErrorIsNever<L> & LayerOutputsAreExact<L> & DescendantOpenServicesAreExact<L> & OpenServicesAreDeclared<L, DirectRequires, UsesInput> & DirectRequirementsAreOpen<L, DirectRequires> & EngineOutputsAreShared<L> & OutputsAreNotSelfRequired<L> & RequiredSlotsAreBound<L> & PlainChildrenAreLive<L>;
|
|
77
|
+
//# sourceMappingURL=closure.d.ts.map
|