every-plugin 0.1.6 → 0.2.1
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/client/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin.d.ts +5 -12
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +0 -1
- package/dist/runtime/index.d.ts +21 -35
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +57 -69
- package/dist/runtime/services/module-federation.service.d.ts +7 -11
- package/dist/runtime/services/module-federation.service.d.ts.map +1 -1
- package/dist/runtime/services/module-federation.service.js +7 -9
- package/dist/runtime/services/plugin-lifecycle.service.d.ts +9 -12
- package/dist/runtime/services/plugin-lifecycle.service.d.ts.map +1 -1
- package/dist/runtime/services/plugin-lifecycle.service.js +5 -6
- package/dist/runtime/services/plugin-loader.service.d.ts +34 -13
- package/dist/runtime/services/plugin-loader.service.d.ts.map +1 -1
- package/dist/runtime/services/plugin-loader.service.js +34 -27
- package/dist/runtime/services/plugin.service.d.ts +29 -17
- package/dist/runtime/services/plugin.service.d.ts.map +1 -1
- package/dist/runtime/services/plugin.service.js +13 -7
- package/dist/runtime/services/secrets.service.d.ts +8 -9
- package/dist/runtime/services/secrets.service.d.ts.map +1 -1
- package/dist/runtime/services/secrets.service.js +28 -27
- package/dist/runtime/services.d.ts +3 -1
- package/dist/runtime/services.d.ts.map +1 -1
- package/dist/runtime/services.js +3 -1
- package/dist/testing/index.d.ts +45 -12
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +34 -27
- package/dist/testing/mocks/module-federation.service.d.ts +3 -5
- package/dist/testing/mocks/module-federation.service.d.ts.map +1 -1
- package/dist/testing/mocks/module-federation.service.js +18 -24
- package/dist/types.d.ts +40 -74
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -1
package/dist/client/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export function getPluginRouter(initialized) {
|
|
|
12
12
|
throw new Error("Plugin instance is undefined - check service layer dependencies (ModuleFederationService, SecretsService)");
|
|
13
13
|
}
|
|
14
14
|
if (typeof initialized.plugin.createRouter !== "function") {
|
|
15
|
-
throw new Error(`Plugin ${initialized.
|
|
15
|
+
throw new Error(`Plugin ${initialized.plugin.id || 'unknown'} does not have a createRouter method`);
|
|
16
16
|
}
|
|
17
17
|
if (!initialized.context) {
|
|
18
18
|
throw new Error("Plugin context is undefined - plugin initialization incomplete");
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export * from "./errors";
|
|
|
2
2
|
export * from "./plugin";
|
|
3
3
|
export * from "./runtime";
|
|
4
4
|
export { getNormalizedRemoteName } from "./runtime/services/normalize";
|
|
5
|
-
export type { AnyPlugin, ConfigOf, InitializedPlugin,
|
|
5
|
+
export type { AnyPlugin, ConfigOf, EveryPlugin, InitializedPlugin, LoadedPlugin, PluginInstance, PluginOf, PluginRegistry, PluginRuntimeConfig, RegistryBindings, RouterOf, SecretsConfig } from "./types";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,YAAY,EACX,SAAS,EACT,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,YAAY,EACX,SAAS,EACT,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,MAAM,SAAS,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -2,10 +2,6 @@ import type { AnyContractRouter } from "@orpc/contract";
|
|
|
2
2
|
import type { Context, Router } from "@orpc/server";
|
|
3
3
|
import { Effect, type Scope } from "effect";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
/**
|
|
6
|
-
* Derive router type from contract at the type level
|
|
7
|
-
*/
|
|
8
|
-
type RouterFromContract<C extends AnyContractRouter, TContext extends Context = Record<never, never>> = Router<C, TContext>;
|
|
9
5
|
/**
|
|
10
6
|
* Helper type that correctly constructs the config schema type
|
|
11
7
|
*/
|
|
@@ -14,9 +10,9 @@ export type PluginConfigFor<V extends z.ZodTypeAny, S extends z.ZodTypeAny> = z.
|
|
|
14
10
|
secrets: S;
|
|
15
11
|
}>;
|
|
16
12
|
/**
|
|
17
|
-
*
|
|
13
|
+
* Loaded plugin with static binding property
|
|
18
14
|
*/
|
|
19
|
-
export interface
|
|
15
|
+
export interface LoadedPluginWithBinding<TContract extends AnyContractRouter, TVariables extends z.ZodTypeAny, TSecrets extends z.ZodTypeAny, TContext extends Context = Record<never, never>> {
|
|
20
16
|
new (): Plugin<TContract, TVariables, TSecrets, TContext>;
|
|
21
17
|
binding: {
|
|
22
18
|
contract: TContract;
|
|
@@ -92,7 +88,6 @@ export declare const CommonPluginErrors: {
|
|
|
92
88
|
*/
|
|
93
89
|
export interface Plugin<TContract extends AnyContractRouter, TVariables extends z.ZodTypeAny, TSecrets extends z.ZodTypeAny, TContext extends Context = Record<never, never>> {
|
|
94
90
|
readonly id: string;
|
|
95
|
-
readonly type: string;
|
|
96
91
|
readonly contract: TContract;
|
|
97
92
|
readonly configSchema: PluginConfigFor<TVariables, TSecrets>;
|
|
98
93
|
initialize(config: {
|
|
@@ -106,14 +101,13 @@ export interface Plugin<TContract extends AnyContractRouter, TVariables extends
|
|
|
106
101
|
* @param context The initialized plugin context
|
|
107
102
|
* @returns A router with procedures matching the plugin's contract
|
|
108
103
|
*/
|
|
109
|
-
createRouter(context?: TContext):
|
|
104
|
+
createRouter(context?: TContext): Router<TContract, TContext>;
|
|
110
105
|
}
|
|
111
106
|
/**
|
|
112
107
|
* Factory function to create plugins
|
|
113
108
|
*/
|
|
114
109
|
export declare function createPlugin<V extends z.ZodTypeAny, S extends z.ZodTypeAny, TContract extends AnyContractRouter, TContext extends Context = Record<never, never>>(config: {
|
|
115
110
|
id: string;
|
|
116
|
-
type?: string;
|
|
117
111
|
variables: V;
|
|
118
112
|
secrets: S;
|
|
119
113
|
contract: TContract;
|
|
@@ -121,8 +115,7 @@ export declare function createPlugin<V extends z.ZodTypeAny, S extends z.ZodType
|
|
|
121
115
|
variables: z.infer<V>;
|
|
122
116
|
secrets: z.infer<S>;
|
|
123
117
|
}) => Effect.Effect<TContext, Error, Scope.Scope>;
|
|
124
|
-
createRouter: (ctx: TContext) =>
|
|
118
|
+
createRouter: (ctx: TContext) => Router<TContract, TContext>;
|
|
125
119
|
shutdown?: (ctx: TContext) => Effect.Effect<void, Error, never>;
|
|
126
|
-
}):
|
|
127
|
-
export {};
|
|
120
|
+
}): LoadedPluginWithBinding<TContract, V, S, TContext>;
|
|
128
121
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
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AAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KAAE,KAClD,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,YAAY,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;CAChE,GAsD4B,uBAAuB,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAC9E"}
|
package/dist/plugin.js
CHANGED
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,46 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ManagedRuntime } from "effect";
|
|
2
2
|
import type { z } from "zod";
|
|
3
|
-
import type { InitializedPlugin,
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly loadPlugin: <K extends keyof R>(pluginId: K) => Effect.Effect<PluginConstructor<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
8
|
-
readonly instantiatePlugin: <K extends keyof R>(ctor: PluginConstructor<PluginOf<R[K]>>) => Effect.Effect<PluginInstance<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
9
|
-
readonly initializePlugin: <K extends keyof R>(instance: PluginInstance<PluginOf<R[K]>>, config: z.infer<PluginOf<R[K]>["configSchema"]>) => Effect.Effect<InitializedPlugin<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
10
|
-
readonly usePlugin: <K extends keyof R>(pluginId: K, config: z.infer<PluginOf<R[K]>["configSchema"]>) => Effect.Effect<PluginResult<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
11
|
-
readonly shutdown: () => Effect.Effect<void, never, never>;
|
|
12
|
-
}
|
|
13
|
-
export declare class PluginRuntimeImpl<R extends RegistryBindings = RegistryBindings> implements IPluginRuntime<R> {
|
|
14
|
-
private pluginService;
|
|
3
|
+
import type { ConfigOf, EveryPlugin, InitializedPlugin, LoadedPlugin, PluginInstance, PluginOf, PluginRegistry, RegistryBindings, RuntimeOptions, SecretsConfig } from "../types";
|
|
4
|
+
import { PluginService } from "./services/plugin.service";
|
|
5
|
+
export declare class PluginRuntime<R extends RegistryBindings = RegistryBindings> {
|
|
6
|
+
private runtime;
|
|
15
7
|
private registry;
|
|
16
8
|
private pluginCache;
|
|
17
|
-
constructor(
|
|
9
|
+
constructor(runtime: ManagedRuntime.ManagedRuntime<PluginService, never>, registry: PluginRegistry);
|
|
18
10
|
private generateCacheKey;
|
|
19
11
|
private validatePluginId;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
private runPromise;
|
|
13
|
+
loadPlugin<K extends keyof R>(pluginId: K): Promise<LoadedPlugin<PluginOf<R[K]>>>;
|
|
14
|
+
instantiatePlugin<K extends keyof R>(pluginId: K, loadedPlugin: LoadedPlugin<PluginOf<R[K]>>): Promise<PluginInstance<PluginOf<R[K]>>>;
|
|
15
|
+
initializePlugin<K extends keyof R>(instance: PluginInstance<PluginOf<R[K]>>, config: z.infer<PluginOf<R[K]>["configSchema"]>): Promise<InitializedPlugin<PluginOf<R[K]>> & {
|
|
16
|
+
config: ConfigOf<R[K]>;
|
|
17
|
+
}>;
|
|
18
|
+
usePlugin<K extends keyof R>(pluginId: K, config: z.infer<PluginOf<R[K]>["configSchema"]>): Promise<EveryPlugin<PluginOf<R[K]>> & {
|
|
19
|
+
initialized: InitializedPlugin<PluginOf<R[K]>> & {
|
|
20
|
+
config: ConfigOf<R[K]>;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
shutdown(): Promise<void>;
|
|
24
|
+
evictPlugin<K extends keyof R>(pluginId: K, config: z.infer<PluginOf<R[K]>["configSchema"]>): Promise<void>;
|
|
33
25
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Creates a typed plugin runtime with compile-time registry key validation.
|
|
36
|
-
*/
|
|
37
26
|
export declare function createPluginRuntime<R extends RegistryBindings = RegistryBindings>(config: {
|
|
38
27
|
registry: PluginRegistry;
|
|
39
28
|
secrets?: SecretsConfig;
|
|
40
29
|
options?: RuntimeOptions;
|
|
41
|
-
}):
|
|
42
|
-
|
|
43
|
-
PluginRuntime: Effect.Effect<PluginRuntimeImpl<R>, never, never>;
|
|
44
|
-
};
|
|
45
|
-
export type { ConfigOf, InitializedPlugin, PluginOf, PluginResult, RegistryBindings } from "../types";
|
|
30
|
+
}): PluginRuntime<R>;
|
|
31
|
+
export type { ConfigOf, EveryPlugin, InitializedPlugin, PluginOf, RegistryBindings } from "../types";
|
|
46
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,cAAc,EAAU,MAAM,QAAQ,CAAC;AAC3E,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAEX,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,qBAAa,aAAa,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IAItE,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ;IAJjB,OAA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AAC,GAAG;QACxC,WAAW,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;YAChD,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvB,CAAC;KACF,CAAC;IAoCF,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAQzB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,EAC5B,QAAQ,EAAE,CAAC,EACX,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,GAC7C,OAAO,CAAC,IAAI,CAAC;CAwBhB;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAChF,MAAM,EAAE;IAAE,QAAQ,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,GACrF,aAAa,CAAC,CAAC,CAAC,CAQlB;AAED,YAAY,EACX,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,MAAM,UAAU,CAAC"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cause, Effect, Exit, Hash, ManagedRuntime, Option } from "effect";
|
|
2
2
|
import { createPluginClient, getPluginRouter } from "../client/index";
|
|
3
3
|
import { PluginRuntimeError } from "./errors";
|
|
4
|
-
import { SecretsService } from "./services";
|
|
5
|
-
import { ModuleFederationService } from "./services/module-federation.service";
|
|
6
4
|
import { PluginService } from "./services/plugin.service";
|
|
7
|
-
export class
|
|
8
|
-
|
|
5
|
+
export class PluginRuntime {
|
|
6
|
+
runtime;
|
|
9
7
|
registry;
|
|
10
8
|
pluginCache = new Map();
|
|
11
|
-
constructor(
|
|
12
|
-
this.
|
|
9
|
+
constructor(runtime, registry) {
|
|
10
|
+
this.runtime = runtime;
|
|
13
11
|
this.registry = registry;
|
|
14
12
|
}
|
|
15
13
|
generateCacheKey(pluginId, config) {
|
|
@@ -18,7 +16,6 @@ export class PluginRuntimeImpl {
|
|
|
18
16
|
}
|
|
19
17
|
validatePluginId(pluginId) {
|
|
20
18
|
const pluginIdStr = pluginId;
|
|
21
|
-
// Runtime validation against registry
|
|
22
19
|
if (!(pluginIdStr in this.registry)) {
|
|
23
20
|
return Effect.fail(new PluginRuntimeError({
|
|
24
21
|
pluginId: pluginIdStr,
|
|
@@ -29,39 +26,55 @@ export class PluginRuntimeImpl {
|
|
|
29
26
|
}
|
|
30
27
|
return Effect.succeed(pluginIdStr);
|
|
31
28
|
}
|
|
29
|
+
async runPromise(effect) {
|
|
30
|
+
const exit = await this.runtime.runPromiseExit(effect);
|
|
31
|
+
if (Exit.isFailure(exit)) {
|
|
32
|
+
const error = Cause.failureOption(exit.cause);
|
|
33
|
+
if (Option.isSome(error)) {
|
|
34
|
+
throw error.value;
|
|
35
|
+
}
|
|
36
|
+
throw Cause.squash(exit.cause);
|
|
37
|
+
}
|
|
38
|
+
return exit.value;
|
|
39
|
+
}
|
|
32
40
|
loadPlugin(pluginId) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const validatedId = yield*
|
|
36
|
-
const result = yield*
|
|
41
|
+
const effect = Effect.gen(this, function* () {
|
|
42
|
+
const pluginService = yield* PluginService;
|
|
43
|
+
const validatedId = yield* this.validatePluginId(pluginId);
|
|
44
|
+
const result = yield* pluginService.loadPlugin(validatedId);
|
|
37
45
|
return result;
|
|
38
46
|
});
|
|
47
|
+
return this.runPromise(effect);
|
|
39
48
|
}
|
|
40
|
-
instantiatePlugin(
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
49
|
+
instantiatePlugin(pluginId, loadedPlugin) {
|
|
50
|
+
const effect = Effect.gen(this, function* () {
|
|
51
|
+
const pluginService = yield* PluginService;
|
|
52
|
+
const pluginIdStr = pluginId;
|
|
53
|
+
const result = yield* pluginService.instantiatePlugin(pluginIdStr, loadedPlugin);
|
|
44
54
|
return result;
|
|
45
55
|
});
|
|
56
|
+
return this.runPromise(effect);
|
|
46
57
|
}
|
|
47
58
|
initializePlugin(instance, config) {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const result = yield*
|
|
59
|
+
const effect = Effect.gen(this, function* () {
|
|
60
|
+
const pluginService = yield* PluginService;
|
|
61
|
+
const result = yield* pluginService.initializePlugin(instance, config);
|
|
51
62
|
return result;
|
|
52
63
|
});
|
|
64
|
+
return this.runPromise(effect);
|
|
53
65
|
}
|
|
54
|
-
usePlugin(pluginId, config) {
|
|
66
|
+
async usePlugin(pluginId, config) {
|
|
55
67
|
const cacheKey = this.generateCacheKey(String(pluginId), config);
|
|
56
68
|
let cachedPlugin = this.pluginCache.get(cacheKey);
|
|
57
69
|
if (!cachedPlugin) {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const validatedId = yield*
|
|
70
|
+
const operation = Effect.gen(this, function* () {
|
|
71
|
+
const pluginService = yield* PluginService;
|
|
72
|
+
const validatedId = yield* this.validatePluginId(pluginId);
|
|
61
73
|
// Load → Instantiate → Initialize
|
|
62
|
-
const ctor = yield*
|
|
63
|
-
const instance = yield*
|
|
64
|
-
const
|
|
74
|
+
const ctor = yield* pluginService.loadPlugin(validatedId);
|
|
75
|
+
const instance = yield* pluginService.instantiatePlugin(String(pluginId), ctor);
|
|
76
|
+
const _initialized = yield* pluginService.initializePlugin(instance, config);
|
|
77
|
+
const initialized = _initialized;
|
|
65
78
|
const client = createPluginClient(initialized);
|
|
66
79
|
const router = getPluginRouter(initialized);
|
|
67
80
|
return {
|
|
@@ -70,63 +83,38 @@ export class PluginRuntimeImpl {
|
|
|
70
83
|
metadata: initialized.metadata,
|
|
71
84
|
initialized
|
|
72
85
|
};
|
|
73
|
-
});
|
|
86
|
+
}).pipe(Effect.provide(this.runtime));
|
|
74
87
|
cachedPlugin = Effect.cached(operation).pipe(Effect.flatten);
|
|
75
88
|
this.pluginCache.set(cacheKey, cachedPlugin);
|
|
76
89
|
}
|
|
77
|
-
return cachedPlugin;
|
|
90
|
+
return this.runPromise(cachedPlugin);
|
|
78
91
|
}
|
|
79
92
|
shutdown() {
|
|
80
|
-
|
|
93
|
+
const effect = Effect.gen(function* () {
|
|
94
|
+
const pluginService = yield* PluginService;
|
|
95
|
+
yield* pluginService.cleanup();
|
|
96
|
+
});
|
|
97
|
+
return this.runPromise(effect);
|
|
81
98
|
}
|
|
82
|
-
/**
|
|
83
|
-
* Evict a plugin from cache and shutdown its instance
|
|
84
|
-
*/
|
|
85
99
|
evictPlugin(pluginId, config) {
|
|
86
100
|
const cacheKey = this.generateCacheKey(String(pluginId), config);
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const cachedPlugin = self.pluginCache.get(cacheKey);
|
|
101
|
+
const effect = Effect.gen(this, function* () {
|
|
102
|
+
const pluginService = yield* PluginService;
|
|
103
|
+
const cachedPlugin = this.pluginCache.get(cacheKey);
|
|
91
104
|
if (cachedPlugin) {
|
|
92
|
-
|
|
93
|
-
self.pluginCache.delete(cacheKey);
|
|
94
|
-
// Try to shutdown the plugin gracefully
|
|
105
|
+
this.pluginCache.delete(cacheKey);
|
|
95
106
|
const pluginResult = yield* cachedPlugin.pipe(Effect.catchAll(() => Effect.succeed(null)));
|
|
96
107
|
if (pluginResult?.initialized) {
|
|
97
|
-
yield*
|
|
98
|
-
);
|
|
108
|
+
yield* pluginService.shutdownPlugin(pluginResult.initialized).pipe(Effect.catchAll(() => Effect.void));
|
|
99
109
|
}
|
|
100
110
|
}
|
|
101
|
-
}).pipe(Effect.catchAll(() => Effect.void)
|
|
102
|
-
);
|
|
111
|
+
}).pipe(Effect.catchAll(() => Effect.void));
|
|
112
|
+
return this.runPromise(effect);
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
|
-
export class PluginRuntimeService extends Context.Tag("PluginRuntimeService")() {
|
|
106
|
-
static Live = (config) => {
|
|
107
|
-
const secrets = config.secrets || {};
|
|
108
|
-
return Layer.scoped(PluginRuntimeService, Effect.gen(function* () {
|
|
109
|
-
const pluginService = yield* PluginService;
|
|
110
|
-
// Register cleanup finalizer for automatic resource management
|
|
111
|
-
yield* Effect.addFinalizer(() => pluginService.cleanup().pipe(Effect.catchAll(() => Effect.void) // Ensure cleanup never fails
|
|
112
|
-
));
|
|
113
|
-
return pluginService;
|
|
114
|
-
})).pipe(Layer.provide(PluginService.Live(config.registry, secrets).pipe(Layer.provide(Layer.mergeAll(ModuleFederationService.Live, SecretsService.Live(secrets))))));
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Creates a typed plugin runtime with compile-time registry key validation.
|
|
119
|
-
*/
|
|
120
115
|
export function createPluginRuntime(config) {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
const runtime = ManagedRuntime.make(PluginRuntimeService.Live(runtimeConfig));
|
|
127
|
-
const createTypedRuntime = Effect.gen(function* () {
|
|
128
|
-
const pluginService = yield* PluginRuntimeService;
|
|
129
|
-
return new PluginRuntimeImpl(pluginService, runtimeConfig.registry);
|
|
130
|
-
}).pipe(Effect.provide(runtime));
|
|
131
|
-
return { runtime, PluginRuntime: createTypedRuntime };
|
|
116
|
+
const secrets = config.secrets || {};
|
|
117
|
+
const layer = PluginService.Live(config.registry, secrets);
|
|
118
|
+
const runtime = ManagedRuntime.make(layer);
|
|
119
|
+
return new PluginRuntime(runtime, config.registry);
|
|
132
120
|
}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { Effect
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import type { AnyPlugin } from "../../types";
|
|
3
3
|
import { ModuleFederationError } from "../errors";
|
|
4
|
-
|
|
5
|
-
readonly
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
4
|
+
declare const ModuleFederationService_base: Effect.Service.Class<ModuleFederationService, "ModuleFederationService", {
|
|
5
|
+
readonly effect: Effect.Effect<{
|
|
6
|
+
registerRemote: (pluginId: string, url: string) => Effect.Effect<undefined, ModuleFederationError, never>;
|
|
7
|
+
loadRemoteConstructor: (pluginId: string, url: string) => Effect.Effect<new () => AnyPlugin, ModuleFederationError, never>;
|
|
8
|
+
}, never, never>;
|
|
9
|
+
}>;
|
|
11
10
|
export declare class ModuleFederationService extends ModuleFederationService_base {
|
|
12
|
-
static Live: Layer.Layer<ModuleFederationService, never, never>;
|
|
13
11
|
}
|
|
14
|
-
export declare const ModuleFederationServiceTag: typeof ModuleFederationService;
|
|
15
|
-
export declare const ModuleFederationServiceLive: Layer.Layer<ModuleFederationService, never, never>;
|
|
16
12
|
export {};
|
|
17
13
|
//# sourceMappingURL=module-federation.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-federation.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/services/module-federation.service.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"module-federation.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/services/module-federation.service.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;;;mCAkFpB,MAAM,OAAO,MAAM;0CA2CZ,MAAM,OAAO,MAAM,6BAzHzC,SAAS;;;AAyExB,qBAAa,uBAAwB,SAAQ,4BAuF3C;CAAG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { betterFetch } from "@better-fetch/fetch";
|
|
2
2
|
import { createInstance, getInstance, } from "@module-federation/enhanced/runtime";
|
|
3
3
|
import { setGlobalFederationInstance } from "@module-federation/runtime-core";
|
|
4
|
-
import { Effect
|
|
4
|
+
import { Effect } from "effect";
|
|
5
5
|
import { ModuleFederationError } from "../errors";
|
|
6
6
|
import { getNormalizedRemoteName } from "./normalize";
|
|
7
|
-
|
|
7
|
+
import pkg from "../../../package.json";
|
|
8
8
|
const createModuleFederationInstance = Effect.cached(Effect.sync(() => {
|
|
9
9
|
try {
|
|
10
10
|
let instance = getInstance();
|
|
@@ -26,7 +26,7 @@ const createModuleFederationInstance = Effect.cached(Effect.sync(() => {
|
|
|
26
26
|
version: pkg.dependencies.effect,
|
|
27
27
|
shareConfig: {
|
|
28
28
|
singleton: true,
|
|
29
|
-
requiredVersion: "^3.
|
|
29
|
+
requiredVersion: "^3.18.0", // Allow any 3.18.x patch version
|
|
30
30
|
eager: true,
|
|
31
31
|
strictVersion: true, // Enforce major/minor compatibility
|
|
32
32
|
},
|
|
@@ -68,8 +68,8 @@ const createModuleFederationInstance = Effect.cached(Effect.sync(() => {
|
|
|
68
68
|
throw new Error(`Failed to initialize Module Federation: ${error}`);
|
|
69
69
|
}
|
|
70
70
|
}));
|
|
71
|
-
export class ModuleFederationService extends Effect.
|
|
72
|
-
|
|
71
|
+
export class ModuleFederationService extends Effect.Service()("ModuleFederationService", {
|
|
72
|
+
effect: Effect.gen(function* () {
|
|
73
73
|
const mf = yield* Effect.flatten(createModuleFederationInstance);
|
|
74
74
|
return {
|
|
75
75
|
registerRemote: (pluginId, url) => Effect.gen(function* () {
|
|
@@ -91,7 +91,6 @@ export class ModuleFederationService extends Effect.Tag("ModuleFederationService
|
|
|
91
91
|
cause: new Error(`Remote not available (${url}): ${JSON.stringify(error)}`),
|
|
92
92
|
}));
|
|
93
93
|
}
|
|
94
|
-
// Register remote using normalized name
|
|
95
94
|
const remoteName = getNormalizedRemoteName(pluginId);
|
|
96
95
|
yield* Effect.try({
|
|
97
96
|
try: () => mf.registerRemotes([{ name: remoteName, entry: url }]),
|
|
@@ -130,7 +129,6 @@ export class ModuleFederationService extends Effect.Tag("ModuleFederationService
|
|
|
130
129
|
});
|
|
131
130
|
}),
|
|
132
131
|
};
|
|
133
|
-
})
|
|
132
|
+
}),
|
|
133
|
+
}) {
|
|
134
134
|
}
|
|
135
|
-
export const ModuleFederationServiceTag = ModuleFederationService;
|
|
136
|
-
export const ModuleFederationServiceLive = ModuleFederationService.Live;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import type { AnyPlugin, InitializedPlugin } from "../../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
3
|
+
declare const PluginLifecycleService_base: Effect.Service.Class<PluginLifecycleService, "PluginLifecycleService", {
|
|
4
|
+
readonly effect: Effect.Effect<{
|
|
5
|
+
register: <T extends AnyPlugin>(plugin: InitializedPlugin<T>) => Effect.Effect<void, never, never>;
|
|
6
|
+
unregister: (plugin: InitializedPlugin<AnyPlugin>) => Effect.Effect<void, never, never>;
|
|
7
|
+
shutdown: (plugin: InitializedPlugin<AnyPlugin>) => Effect.Effect<void, import("../errors").PluginRuntimeError, never>;
|
|
8
|
+
cleanup: () => Effect.Effect<void, never, never>;
|
|
9
|
+
}, never, never>;
|
|
10
|
+
}>;
|
|
11
11
|
export declare class PluginLifecycleService extends PluginLifecycleService_base {
|
|
12
|
-
static Live: Layer.Layer<PluginLifecycleService, never, never>;
|
|
13
12
|
}
|
|
14
|
-
export declare const PluginLifecycleServiceTag: typeof PluginLifecycleService;
|
|
15
|
-
export declare const PluginLifecycleServiceLive: Layer.Layer<PluginLifecycleService, never, never>;
|
|
16
13
|
export {};
|
|
17
14
|
//# sourceMappingURL=plugin-lifecycle.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-lifecycle.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/services/plugin-lifecycle.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin-lifecycle.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/services/plugin-lifecycle.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;;;mBAQ/C,CAAC,SAAS,SAAS,UAAU,iBAAiB,CAAC,CAAC,CAAC;6BAKvC,iBAAiB,CAAC,SAAS,CAAC;2BAO9B,iBAAiB,CAAC,SAAS,CAAC;;;;AAjBrD,qBAAa,sBAAuB,SAAQ,2BAgE1C;CAAI"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect, Ref } from "effect";
|
|
2
2
|
import { toPluginRuntimeError } from "../errors";
|
|
3
|
-
export class PluginLifecycleService extends
|
|
4
|
-
|
|
3
|
+
export class PluginLifecycleService extends Effect.Service()("PluginLifecycleService", {
|
|
4
|
+
effect: Effect.gen(function* () {
|
|
5
5
|
const activePlugins = yield* Ref.make(new Set());
|
|
6
6
|
return {
|
|
7
7
|
register: (plugin) => Ref.update(activePlugins, plugins => new Set(plugins).add(plugin)),
|
|
@@ -29,7 +29,6 @@ export class PluginLifecycleService extends Context.Tag("PluginLifecycleService"
|
|
|
29
29
|
}).pipe(Effect.catchAll(() => Effect.void) // Convert errors to void for cleanup
|
|
30
30
|
),
|
|
31
31
|
};
|
|
32
|
-
})
|
|
32
|
+
}),
|
|
33
|
+
}) {
|
|
33
34
|
}
|
|
34
|
-
export const PluginLifecycleServiceTag = PluginLifecycleService;
|
|
35
|
-
export const PluginLifecycleServiceLive = PluginLifecycleService.Live;
|
|
@@ -1,21 +1,42 @@
|
|
|
1
|
-
import { Context, Effect,
|
|
2
|
-
import type {
|
|
1
|
+
import { Context, Effect, Scope } from "effect";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { AnyPlugin, LoadedPlugin, PluginInstance, PluginRegistry } from "../../types";
|
|
3
4
|
import { PluginRuntimeError } from "../errors";
|
|
4
5
|
import { ModuleFederationService } from "./module-federation.service";
|
|
5
6
|
import { SecretsService } from "./secrets.service";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly instantiatePlugin: <T extends AnyPlugin>(pluginConstructor: PluginConstructor<T>) => Effect.Effect<PluginInstance<T>, PluginRuntimeError>;
|
|
9
|
-
readonly initializePlugin: <T extends AnyPlugin>(pluginInstance: PluginInstance<T>, config: {
|
|
10
|
-
variables: unknown;
|
|
11
|
-
secrets: unknown;
|
|
12
|
-
}) => Effect.Effect<InitializedPlugin<T>, PluginRuntimeError>;
|
|
7
|
+
declare const PluginRegistryTag_base: Context.TagClass<PluginRegistryTag, "PluginRegistry", PluginRegistry>;
|
|
8
|
+
export declare class PluginRegistryTag extends PluginRegistryTag_base {
|
|
13
9
|
}
|
|
14
|
-
declare const
|
|
10
|
+
declare const RegistryService_base: Effect.Service.Class<RegistryService, "RegistryService", {
|
|
11
|
+
readonly effect: Effect.Effect<{
|
|
12
|
+
get: (pluginId: string) => Effect.Effect<import("../../types").PluginMetadata, PluginRuntimeError, never>;
|
|
13
|
+
}, never, PluginRegistryTag>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare class RegistryService extends RegistryService_base {
|
|
16
|
+
}
|
|
17
|
+
declare const PluginLoaderService_base: Effect.Service.Class<PluginLoaderService, "PluginLoaderService", {
|
|
18
|
+
readonly effect: Effect.Effect<{
|
|
19
|
+
loadPlugin: (pluginId: string) => Effect.Effect<{
|
|
20
|
+
ctor: new () => AnyPlugin;
|
|
21
|
+
metadata: import("../../types").PluginMetadata;
|
|
22
|
+
}, PluginRuntimeError, never>;
|
|
23
|
+
instantiatePlugin: <T extends AnyPlugin>(pluginId: string, loadedPlugin: LoadedPlugin<T>) => Effect.Effect<{
|
|
24
|
+
plugin: T;
|
|
25
|
+
metadata: import("../../types").PluginMetadata;
|
|
26
|
+
}, PluginRuntimeError, never>;
|
|
27
|
+
initializePlugin: <T extends AnyPlugin>(pluginInstance: PluginInstance<T>, config: {
|
|
28
|
+
variables: unknown;
|
|
29
|
+
secrets: unknown;
|
|
30
|
+
}) => Effect.Effect<{
|
|
31
|
+
plugin: T;
|
|
32
|
+
metadata: import("../../types").PluginMetadata;
|
|
33
|
+
config: z.infer<T["configSchema"]>;
|
|
34
|
+
context: any;
|
|
35
|
+
scope: Scope.CloseableScope;
|
|
36
|
+
}, PluginRuntimeError, never>;
|
|
37
|
+
}, never, ModuleFederationService | SecretsService | RegistryService>;
|
|
38
|
+
}>;
|
|
15
39
|
export declare class PluginLoaderService extends PluginLoaderService_base {
|
|
16
|
-
static Live: (registry: PluginRegistry, secrets: SecretsConfig) => Layer.Layer<PluginLoaderService, never, ModuleFederationService | SecretsService>;
|
|
17
40
|
}
|
|
18
|
-
export declare const PluginLoaderServiceTag: typeof PluginLoaderService;
|
|
19
|
-
export declare const PluginLoaderServiceLive: (registry: PluginRegistry, secrets: SecretsConfig) => Layer.Layer<PluginLoaderService, never, ModuleFederationService | SecretsService>;
|
|
20
41
|
export {};
|
|
21
42
|
//# sourceMappingURL=plugin-loader.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-loader.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/services/plugin-loader.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"plugin-loader.service.d.ts","sourceRoot":"","sources":["../../../src/runtime/services/plugin-loader.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACX,SAAS,EAET,YAAY,EACZ,cAAc,EACd,cAAc,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAwB,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;;AAEnD,qBAAa,iBAAkB,SAAQ,sBAGpC;CAAI;;;wBAOY,MAAM;;;AALzB,qBAAa,eAAgB,SAAQ,oBAkBnC;CAAI;;;+BAgBoB,MAAM;;;;4BAyBT,CAAC,SAAS,SAAS,YAC5B,MAAM,gBACF,YAAY,CAAC,CAAC,CAAC;;;;2BAmCX,CAAC,SAAS,SAAS,kBACrB,cAAc,CAAC,CAAC,CAAC,UACzB;YAAE,SAAS,EAAE,OAAO,CAAC;YAAC,OAAO,EAAE,OAAO,CAAA;SAAE;;;oBAwD3B,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;;;;;;AAtInD,qBAAa,mBAAoB,SAAQ,wBA6IvC;CACD"}
|