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.
Files changed (84) hide show
  1. package/dist/client.cjs +69 -0
  2. package/dist/client.cjs.map +1 -0
  3. package/dist/client.d.cts +15 -0
  4. package/dist/client.d.cts.map +1 -0
  5. package/dist/client.d.mts +15 -0
  6. package/dist/client.d.mts.map +1 -0
  7. package/dist/client.mjs +68 -0
  8. package/dist/client.mjs.map +1 -0
  9. package/dist/dev/host.cjs +149 -0
  10. package/dist/dev/host.cjs.map +1 -0
  11. package/dist/dev/host.d.cts +32 -0
  12. package/dist/dev/host.d.cts.map +1 -0
  13. package/dist/dev/host.d.mts +32 -0
  14. package/dist/dev/host.d.mts.map +1 -0
  15. package/dist/dev/host.mjs +148 -0
  16. package/dist/dev/host.mjs.map +1 -0
  17. package/dist/dev/serve.cjs +14 -109
  18. package/dist/dev/serve.cjs.map +1 -1
  19. package/dist/dev/serve.d.cts.map +1 -1
  20. package/dist/dev/serve.d.mts.map +1 -1
  21. package/dist/dev/serve.mjs +14 -109
  22. package/dist/dev/serve.mjs.map +1 -1
  23. package/dist/errors.cjs +1 -0
  24. package/dist/errors.cjs.map +1 -1
  25. package/dist/errors.d.cts +2 -2
  26. package/dist/errors.d.mts +2 -2
  27. package/dist/errors.mjs +2 -2
  28. package/dist/errors.mjs.map +1 -1
  29. package/dist/index.cjs +3 -0
  30. package/dist/index.d.cts +5 -4
  31. package/dist/index.d.mts +5 -4
  32. package/dist/index.mjs +3 -2
  33. package/dist/plugin.cjs +1 -0
  34. package/dist/plugin.cjs.map +1 -1
  35. package/dist/plugin.d.cts +17 -3
  36. package/dist/plugin.d.cts.map +1 -1
  37. package/dist/plugin.d.mts +16 -2
  38. package/dist/plugin.d.mts.map +1 -1
  39. package/dist/plugin.mjs +1 -0
  40. package/dist/plugin.mjs.map +1 -1
  41. package/dist/runtime/errors.cjs +20 -0
  42. package/dist/runtime/errors.cjs.map +1 -1
  43. package/dist/runtime/errors.d.cts +23 -1
  44. package/dist/runtime/errors.d.cts.map +1 -1
  45. package/dist/runtime/errors.d.mts +23 -1
  46. package/dist/runtime/errors.d.mts.map +1 -1
  47. package/dist/runtime/errors.mjs +20 -1
  48. package/dist/runtime/errors.mjs.map +1 -1
  49. package/dist/runtime/mf-config.cjs +1 -1
  50. package/dist/runtime/mf-config.mjs +1 -1
  51. package/dist/runtime/services/module-federation.service.cjs +1 -7
  52. package/dist/runtime/services/module-federation.service.cjs.map +1 -1
  53. package/dist/runtime/services/module-federation.service.mjs +1 -7
  54. package/dist/runtime/services/module-federation.service.mjs.map +1 -1
  55. package/dist/runtime/services/plugin-loader.service.cjs +26 -1
  56. package/dist/runtime/services/plugin-loader.service.cjs.map +1 -1
  57. package/dist/runtime/services/plugin-loader.service.d.cts +2 -2
  58. package/dist/runtime/services/plugin-loader.service.mjs +26 -1
  59. package/dist/runtime/services/plugin-loader.service.mjs.map +1 -1
  60. package/dist/runtime/services/shared-identity.cjs +1 -1
  61. package/dist/runtime/services/shared-identity.cjs.map +1 -1
  62. package/dist/runtime/services/shared-identity.mjs +1 -1
  63. package/dist/runtime/services/shared-identity.mjs.map +1 -1
  64. package/dist/types.d.cts +26 -2
  65. package/dist/types.d.cts.map +1 -1
  66. package/dist/types.d.mts +25 -1
  67. package/dist/types.d.mts.map +1 -1
  68. package/dist/version-manifest.cjs +1 -1
  69. package/dist/version-manifest.cjs.map +1 -1
  70. package/dist/version-manifest.mjs +1 -1
  71. package/dist/version-manifest.mjs.map +1 -1
  72. package/package.json +19 -2
  73. package/src/client.ts +111 -0
  74. package/src/dev/host.ts +235 -0
  75. package/src/dev/serve.ts +14 -135
  76. package/src/errors.ts +2 -1
  77. package/src/index.ts +9 -0
  78. package/src/plugin.ts +20 -1
  79. package/src/runtime/errors.ts +44 -0
  80. package/src/runtime/services/module-federation.service.ts +4 -7
  81. package/src/runtime/services/plugin-loader.service.ts +32 -0
  82. package/src/runtime/services/shared-identity.ts +1 -1
  83. package/src/types.ts +39 -2
  84. 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
- | { module: AnyPluginConstructor; remote?: string; version?: string; description?: string }
49
- | { remote: string; version?: string; description?: string };
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
  /**
@@ -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")