every-plugin 3.0.0-rc.0 → 3.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +69 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +15 -0
- package/dist/client.d.cts.map +1 -0
- package/dist/client.d.mts +15 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +68 -0
- package/dist/client.mjs.map +1 -0
- package/dist/dev/host.cjs +149 -0
- package/dist/dev/host.cjs.map +1 -0
- package/dist/dev/host.d.cts +32 -0
- package/dist/dev/host.d.cts.map +1 -0
- package/dist/dev/host.d.mts +32 -0
- package/dist/dev/host.d.mts.map +1 -0
- package/dist/dev/host.mjs +148 -0
- package/dist/dev/host.mjs.map +1 -0
- package/dist/dev/serve.cjs +14 -109
- package/dist/dev/serve.cjs.map +1 -1
- package/dist/dev/serve.d.cts.map +1 -1
- package/dist/dev/serve.d.mts.map +1 -1
- package/dist/dev/serve.mjs +14 -109
- package/dist/dev/serve.mjs.map +1 -1
- package/dist/errors.cjs +1 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/errors.d.mts +2 -2
- package/dist/errors.mjs +2 -2
- package/dist/errors.mjs.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +5 -4
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +3 -2
- package/dist/plugin.cjs +1 -0
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +17 -3
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +16 -2
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +1 -0
- package/dist/plugin.mjs.map +1 -1
- package/dist/runtime/errors.cjs +20 -0
- package/dist/runtime/errors.cjs.map +1 -1
- package/dist/runtime/errors.d.cts +23 -1
- package/dist/runtime/errors.d.cts.map +1 -1
- package/dist/runtime/errors.d.mts +23 -1
- package/dist/runtime/errors.d.mts.map +1 -1
- package/dist/runtime/errors.mjs +20 -1
- package/dist/runtime/errors.mjs.map +1 -1
- package/dist/runtime/mf-config.cjs +1 -1
- package/dist/runtime/mf-config.mjs +1 -1
- package/dist/runtime/services/module-federation.service.cjs +1 -7
- package/dist/runtime/services/module-federation.service.cjs.map +1 -1
- package/dist/runtime/services/module-federation.service.mjs +1 -7
- package/dist/runtime/services/module-federation.service.mjs.map +1 -1
- package/dist/runtime/services/plugin-loader.service.cjs +26 -1
- package/dist/runtime/services/plugin-loader.service.cjs.map +1 -1
- package/dist/runtime/services/plugin-loader.service.d.cts +2 -2
- package/dist/runtime/services/plugin-loader.service.mjs +26 -1
- package/dist/runtime/services/plugin-loader.service.mjs.map +1 -1
- package/dist/runtime/services/shared-identity.cjs +1 -1
- package/dist/runtime/services/shared-identity.cjs.map +1 -1
- package/dist/runtime/services/shared-identity.mjs +1 -1
- package/dist/runtime/services/shared-identity.mjs.map +1 -1
- package/dist/types.d.cts +26 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +25 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/version-manifest.cjs +1 -1
- package/dist/version-manifest.cjs.map +1 -1
- package/dist/version-manifest.mjs +1 -1
- package/dist/version-manifest.mjs.map +1 -1
- package/package.json +19 -2
- package/src/client.ts +111 -0
- package/src/dev/host.ts +235 -0
- package/src/dev/serve.ts +14 -135
- package/src/errors.ts +2 -1
- package/src/index.ts +9 -0
- package/src/plugin.ts +20 -1
- package/src/runtime/errors.ts +44 -0
- package/src/runtime/services/module-federation.service.ts +4 -7
- package/src/runtime/services/plugin-loader.service.ts +32 -0
- package/src/runtime/services/shared-identity.ts +1 -1
- package/src/types.ts +39 -2
- package/src/version-manifest.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
import type { ContractedRouter, RouterClient } from "@orpc/server";
|
|
8
8
|
import type { Context, Scope } from "effect";
|
|
9
9
|
import type { Plugin } from "./plugin";
|
|
10
|
+
import type { PluginWarningInfo } from "./runtime/errors";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Registry bindings interface - populated via module augmentation
|
|
@@ -23,6 +24,24 @@ import type { Plugin } from "./plugin";
|
|
|
23
24
|
// biome-ignore lint/suspicious/noEmptyInterface: required for module augmentation pattern
|
|
24
25
|
export interface RegisteredPlugins {}
|
|
25
26
|
|
|
27
|
+
export type ModuleTransport = "inproc" | "rpc" | "mf";
|
|
28
|
+
|
|
29
|
+
export type ModuleSurface = "api" | "ui" | "jobs";
|
|
30
|
+
|
|
31
|
+
export interface ModuleEndpoint {
|
|
32
|
+
readonly transport: ModuleTransport;
|
|
33
|
+
readonly surface?: ModuleSurface;
|
|
34
|
+
readonly url: string;
|
|
35
|
+
readonly path?: `/${string}`;
|
|
36
|
+
readonly manifest?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type PluginTransport = ModuleTransport;
|
|
40
|
+
|
|
41
|
+
export type PluginSurface = ModuleSurface;
|
|
42
|
+
|
|
43
|
+
export type PluginEndpoint = ModuleEndpoint;
|
|
44
|
+
|
|
26
45
|
/**
|
|
27
46
|
* Base type for any plugin instance.
|
|
28
47
|
*/
|
|
@@ -45,8 +64,14 @@ export type AnyPluginConstructor = {
|
|
|
45
64
|
* Registry entry that supports both direct module imports and remote URLs
|
|
46
65
|
*/
|
|
47
66
|
export type PluginRegistryEntry =
|
|
48
|
-
| {
|
|
49
|
-
|
|
67
|
+
| {
|
|
68
|
+
module: AnyPluginConstructor;
|
|
69
|
+
remote?: string;
|
|
70
|
+
endpoint?: PluginEndpoint;
|
|
71
|
+
version?: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
}
|
|
74
|
+
| { remote: string; endpoint?: PluginEndpoint; version?: string; description?: string };
|
|
50
75
|
|
|
51
76
|
/**
|
|
52
77
|
* Extract plugin constructor type from registry entry
|
|
@@ -115,8 +140,18 @@ export type PluginClientType<T> = RouterClient<PluginRouterType<T>>;
|
|
|
115
140
|
export type PluginServicesEntry<T = any> = {
|
|
116
141
|
client: (context?: PluginContextInput<T>) => PluginClientType<T>;
|
|
117
142
|
router: PluginRouterType<T>;
|
|
143
|
+
endpoint?: PluginEndpoint;
|
|
118
144
|
};
|
|
119
145
|
|
|
146
|
+
export type ModuleClientEntry<C extends AnyContractRouter = AnyContractRouter> = {
|
|
147
|
+
client: (context?: Record<string, unknown>) => RouterClient<ContractedRouter<C, any>>;
|
|
148
|
+
router?: ContractedRouter<C, any>;
|
|
149
|
+
endpoint?: PluginEndpoint;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type PluginClientEntry<C extends AnyContractRouter = AnyContractRouter> =
|
|
153
|
+
ModuleClientEntry<C>;
|
|
154
|
+
|
|
120
155
|
/**
|
|
121
156
|
* Extract plugin type from registered plugins by key
|
|
122
157
|
* @param K - The plugin key
|
|
@@ -204,6 +239,8 @@ export interface InitializedPlugin<T extends AnyPlugin = AnyPlugin> {
|
|
|
204
239
|
*/
|
|
205
240
|
readonly effectContext: Context.Context<any>;
|
|
206
241
|
readonly scope: Scope.Closeable;
|
|
242
|
+
/** Non-fatal config warnings collected during initialization (empty when none). */
|
|
243
|
+
readonly warnings: PluginWarningInfo[];
|
|
207
244
|
}
|
|
208
245
|
|
|
209
246
|
/**
|
package/src/version-manifest.ts
CHANGED
|
@@ -67,7 +67,7 @@ export interface VersionManifestInput {
|
|
|
67
67
|
* coordinate → a new version (and a new file).
|
|
68
68
|
*/
|
|
69
69
|
export function composeVersionManifest(input: VersionManifestInput): WorkspaceVersionManifest {
|
|
70
|
-
const { builtAt, ...hashedInputs } = input;
|
|
70
|
+
const { builtAt: _builtAt, ...hashedInputs } = input;
|
|
71
71
|
const version = createHash("sha256")
|
|
72
72
|
.update(stableStringify(hashedInputs))
|
|
73
73
|
.digest("hex")
|