-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
62 lines (55 loc) · 1.98 KB
/
index.ts
File metadata and controls
62 lines (55 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @module Effect/Bootstrap
* @description
* Main re-export module for Bootstrap service.
* Provides atomic exports for bootstrap orchestration.
*
* @example
* ```ts
* import { Bootstrap, BootstrapLive, BootstrapTag } from "./Effect/Bootstrap/index.js";
*
* // Using the service
* const program = Effect.gen(function* () {
* const bootstrap = yield* BootstrapTag;
* const result = yield* bootstrap.run({ debugMode: true });
* return result;
* });
*
* // Providing the layer
* const runnable = program.pipe(Effect.provide(BootstrapLive));
* ```
*
* @see {@link Effect/Bootstrap/Interface/BootstrapService} Service interface
* @see {@link Effect/Bootstrap/Implementation/BootstrapImplementation} Live implementation
* @see [Effect-TS Documentation](https://effect.website/docs/guide/context)
* @category Service
*/
// Type definitions
export type { BootstrapOptions, StageResult, BootstrapResult } from "./Type/BootstrapType.js";
// Service interface
export type { BootstrapService } from "./Interface/BootstrapService.js";
// Service tag
export { BootstrapTag } from "./Tag/BootstrapTag.js";
// Stage implementations
export {
stage0_Environment,
stage1_Preload,
stage2_Configuration,
stage3_Services,
stage4_Preparation,
stage5_Initialization,
stage6_HealthCheck,
} from "./Implementation/BootstrapStage.js";
// Live implementation layer
export { BootstrapLive } from "./Implementation/BootstrapImplementation.js";
// Mock implementation layer
export { BootstrapMock, makeMockBootstrap } from "./Layer/BootstrapMock.js";
// Convenience export for quick bootstrap execution
import { Effect } from "effect";
import { BootstrapTag } from "./Tag/BootstrapTag.js";
import { BootstrapLive } from "./Implementation/BootstrapImplementation.js";
export const runBootstrap = (options?: import("./Type/BootstrapType.js").BootstrapOptions) =>
Effect.gen(function* () {
const bootstrap = yield* BootstrapTag;
return yield* bootstrap.run(options);
}).pipe(Effect.provide(BootstrapLive));