every-plugin 0.8.4 → 0.8.6

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 (80) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +1 -7
  2. package/dist/_virtual/rolldown_runtime.mjs +1 -7
  3. package/dist/build/rspack/dev-server-middleware.cjs.map +1 -1
  4. package/dist/build/rspack/dev-server-middleware.mjs.map +1 -1
  5. package/dist/build/rspack/index.cjs +7 -1
  6. package/dist/build/rspack/index.d.cts +2 -1
  7. package/dist/build/rspack/index.d.mts +2 -1
  8. package/dist/build/rspack/index.mjs +2 -1
  9. package/dist/build/rspack/module-federation.cjs +2 -33
  10. package/dist/build/rspack/module-federation.cjs.map +1 -1
  11. package/dist/build/rspack/module-federation.mjs +2 -33
  12. package/dist/build/rspack/module-federation.mjs.map +1 -1
  13. package/dist/build/rspack/plugin.cjs +2 -2
  14. package/dist/build/rspack/plugin.cjs.map +1 -1
  15. package/dist/build/rspack/plugin.d.cts.map +1 -1
  16. package/dist/build/rspack/plugin.d.mts.map +1 -1
  17. package/dist/build/rspack/plugin.mjs.map +1 -1
  18. package/dist/build/rspack/utils.cjs +2 -2
  19. package/dist/build/rspack/utils.cjs.map +1 -1
  20. package/dist/build/shared-deps.cjs +80 -0
  21. package/dist/build/shared-deps.cjs.map +1 -0
  22. package/dist/build/shared-deps.d.cts +16 -0
  23. package/dist/build/shared-deps.d.cts.map +1 -0
  24. package/dist/build/shared-deps.d.mts +16 -0
  25. package/dist/build/shared-deps.d.mts.map +1 -0
  26. package/dist/build/shared-deps.mjs +76 -0
  27. package/dist/build/shared-deps.mjs.map +1 -0
  28. package/dist/errors.d.cts.map +1 -1
  29. package/dist/errors.d.mts.map +1 -1
  30. package/dist/orpc.cjs +15 -15
  31. package/dist/package.cjs +28 -10
  32. package/dist/package.cjs.map +1 -1
  33. package/dist/package.mjs +23 -11
  34. package/dist/package.mjs.map +1 -1
  35. package/dist/plugin.cjs +5 -5
  36. package/dist/plugin.cjs.map +1 -1
  37. package/dist/plugin.d.cts +5 -5
  38. package/dist/plugin.d.cts.map +1 -1
  39. package/dist/plugin.d.mts +5 -5
  40. package/dist/plugin.d.mts.map +1 -1
  41. package/dist/plugin.mjs.map +1 -1
  42. package/dist/runtime/errors.cjs +5 -5
  43. package/dist/runtime/errors.cjs.map +1 -1
  44. package/dist/runtime/errors.d.cts.map +1 -1
  45. package/dist/runtime/errors.d.mts.map +1 -1
  46. package/dist/runtime/errors.mjs.map +1 -1
  47. package/dist/runtime/index.cjs +2 -2
  48. package/dist/runtime/index.cjs.map +1 -1
  49. package/dist/runtime/index.d.cts.map +1 -1
  50. package/dist/runtime/index.d.mts.map +1 -1
  51. package/dist/runtime/index.mjs.map +1 -1
  52. package/dist/runtime/services/module-federation.service.cjs +11 -14
  53. package/dist/runtime/services/module-federation.service.cjs.map +1 -1
  54. package/dist/runtime/services/module-federation.service.d.cts.map +1 -1
  55. package/dist/runtime/services/module-federation.service.d.mts.map +1 -1
  56. package/dist/runtime/services/module-federation.service.mjs +6 -9
  57. package/dist/runtime/services/module-federation.service.mjs.map +1 -1
  58. package/dist/runtime/services/normalize.d.cts.map +1 -1
  59. package/dist/runtime/services/normalize.d.mts.map +1 -1
  60. package/dist/runtime/services/plugin-lifecycle.service.d.cts.map +1 -1
  61. package/dist/runtime/services/plugin-lifecycle.service.d.mts.map +1 -1
  62. package/dist/runtime/services/plugin-loader.service.d.cts.map +1 -1
  63. package/dist/runtime/services/plugin-loader.service.d.mts.map +1 -1
  64. package/dist/runtime/services/plugin.service.d.cts.map +1 -1
  65. package/dist/runtime/services/plugin.service.d.mts.map +1 -1
  66. package/dist/runtime/services/secrets.service.cjs.map +1 -1
  67. package/dist/runtime/services/secrets.service.d.cts.map +1 -1
  68. package/dist/runtime/services/secrets.service.d.mts.map +1 -1
  69. package/dist/runtime/services/secrets.service.mjs.map +1 -1
  70. package/dist/testing/index.cjs.map +1 -1
  71. package/dist/testing/index.d.cts.map +1 -1
  72. package/dist/testing/index.d.mts.map +1 -1
  73. package/dist/testing/index.mjs.map +1 -1
  74. package/dist/types.d.cts +26 -27
  75. package/dist/types.d.cts.map +1 -1
  76. package/dist/types.d.mts +26 -27
  77. package/dist/types.d.mts.map +1 -1
  78. package/dist/zod.d.cts.map +1 -1
  79. package/dist/zod.d.mts.map +1 -1
  80. package/package.json +54 -24
@@ -0,0 +1,76 @@
1
+ import { dependencies, sharedDependencies, version } from "../package.mjs";
2
+
3
+ //#region src/build/shared-deps.ts
4
+ const uiDeps = sharedDependencies.ui;
5
+ function getPluginSharedDependencies() {
6
+ return {
7
+ "every-plugin": {
8
+ version,
9
+ singleton: true,
10
+ strictVersion: false,
11
+ eager: false
12
+ },
13
+ effect: {
14
+ version: dependencies.effect,
15
+ singleton: true,
16
+ strictVersion: false,
17
+ eager: false
18
+ },
19
+ zod: {
20
+ version: dependencies.zod,
21
+ singleton: true,
22
+ strictVersion: false,
23
+ eager: false
24
+ },
25
+ "@orpc/contract": {
26
+ version: dependencies["@orpc/contract"],
27
+ singleton: true,
28
+ strictVersion: false,
29
+ eager: false
30
+ },
31
+ "@orpc/server": {
32
+ version: dependencies["@orpc/server"],
33
+ singleton: true,
34
+ strictVersion: false,
35
+ eager: false
36
+ }
37
+ };
38
+ }
39
+ function cleanVersion(version$1) {
40
+ return version$1.replace(/^[\^~>=<]+/, "");
41
+ }
42
+ function getUISharedDependencies() {
43
+ if (!uiDeps) return {};
44
+ const result = {};
45
+ for (const [name, version$1] of Object.entries(uiDeps)) result[name] = {
46
+ version: cleanVersion(version$1),
47
+ singleton: true,
48
+ strictVersion: false,
49
+ eager: name === "react" || name === "react-dom"
50
+ };
51
+ return result;
52
+ }
53
+ function getHostSharedDependencies() {
54
+ return {
55
+ ...getPluginSharedDependencies(),
56
+ ...getUISharedDependencies()
57
+ };
58
+ }
59
+ function getMajorMinorVersion(version$1) {
60
+ const match = version$1.replace(/^[\^~>=<]+/, "").match(/^(\d+)\.(\d+)/);
61
+ if (!match) return "^0.0.0";
62
+ return `^${match[1]}.${match[2]}.0`;
63
+ }
64
+ function getPluginSharedDependenciesVersionRange() {
65
+ const deps = getPluginSharedDependencies();
66
+ const result = {};
67
+ for (const [key, config] of Object.entries(deps)) result[key] = {
68
+ ...config,
69
+ version: getMajorMinorVersion(config.version)
70
+ };
71
+ return result;
72
+ }
73
+
74
+ //#endregion
75
+ export { getHostSharedDependencies, getMajorMinorVersion, getPluginSharedDependencies, getPluginSharedDependenciesVersionRange, getUISharedDependencies };
76
+ //# sourceMappingURL=shared-deps.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-deps.mjs","names":["pkg.version","version"],"sources":["../../src/build/shared-deps.ts"],"sourcesContent":["import pkg from \"../../package.json\";\n\nexport interface SharedDependencyConfig {\n version: string;\n singleton: boolean;\n strictVersion: boolean;\n eager: boolean;\n}\n\nexport type SharedDependencies = Record<string, SharedDependencyConfig>;\n\nconst uiDeps = (pkg as any).sharedDependencies?.ui as Record<string, string> | undefined;\n\nexport function getPluginSharedDependencies(): SharedDependencies {\n return {\n \"every-plugin\": {\n version: pkg.version,\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n effect: {\n version: pkg.dependencies.effect,\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n zod: {\n version: pkg.dependencies.zod,\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n \"@orpc/contract\": {\n version: pkg.dependencies[\"@orpc/contract\"],\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n \"@orpc/server\": {\n version: pkg.dependencies[\"@orpc/server\"],\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n };\n}\n\nfunction cleanVersion(version: string): string {\n return version.replace(/^[\\^~>=<]+/, \"\");\n}\n\nexport function getUISharedDependencies(): SharedDependencies {\n if (!uiDeps) return {};\n \n const result: SharedDependencies = {};\n for (const [name, version] of Object.entries(uiDeps)) {\n result[name] = {\n version: cleanVersion(version),\n singleton: true,\n strictVersion: false,\n eager: name === \"react\" || name === \"react-dom\",\n };\n }\n return result;\n}\n\nexport function getHostSharedDependencies(): SharedDependencies {\n return {\n ...getPluginSharedDependencies(),\n ...getUISharedDependencies(),\n };\n}\n\nexport function getMajorMinorVersion(version: string): string {\n const clean = version.replace(/^[\\^~>=<]+/, \"\");\n const match = clean.match(/^(\\d+)\\.(\\d+)/);\n if (!match) return \"^0.0.0\";\n return `^${match[1]}.${match[2]}.0`;\n}\n\nexport function getPluginSharedDependenciesVersionRange(): SharedDependencies {\n const deps = getPluginSharedDependencies();\n const result: SharedDependencies = {};\n \n for (const [key, config] of Object.entries(deps)) {\n result[key] = {\n ...config,\n version: getMajorMinorVersion(config.version),\n };\n }\n \n return result;\n}\n"],"mappings":";;;AAWA,MAAM,4BAA0C;AAEhD,SAAgB,8BAAkD;AAChE,QAAO;EACL,gBAAgB;GACLA;GACT,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,QAAQ;GACN,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,KAAK;GACH,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,kBAAkB;GAChB,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,gBAAgB;GACd,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACF;;AAGH,SAAS,aAAa,WAAyB;AAC7C,QAAOC,UAAQ,QAAQ,cAAc,GAAG;;AAG1C,SAAgB,0BAA8C;AAC5D,KAAI,CAAC,OAAQ,QAAO,EAAE;CAEtB,MAAM,SAA6B,EAAE;AACrC,MAAK,MAAM,CAAC,MAAMA,cAAY,OAAO,QAAQ,OAAO,CAClD,QAAO,QAAQ;EACb,SAAS,aAAaA,UAAQ;EAC9B,WAAW;EACX,eAAe;EACf,OAAO,SAAS,WAAW,SAAS;EACrC;AAEH,QAAO;;AAGT,SAAgB,4BAAgD;AAC9D,QAAO;EACL,GAAG,6BAA6B;EAChC,GAAG,yBAAyB;EAC7B;;AAGH,SAAgB,qBAAqB,WAAyB;CAE5D,MAAM,QADQA,UAAQ,QAAQ,cAAc,GAAG,CAC3B,MAAM,gBAAgB;AAC1C,KAAI,CAAC,MAAO,QAAO;AACnB,QAAO,IAAI,MAAM,GAAG,GAAG,MAAM,GAAG;;AAGlC,SAAgB,0CAA8D;CAC5E,MAAM,OAAO,6BAA6B;CAC1C,MAAM,SAA6B,EAAE;AAErC,MAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,KAAK,CAC9C,QAAO,OAAO;EACZ,GAAG;EACH,SAAS,qBAAqB,OAAO,QAAQ;EAC9C;AAGH,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKa,cAAA,cASH,EAAA;EAiBG,SAAA,kBAOH,EAAA,SAAA,CAAA,cAAA,CAAA;;;;;;;;;AAEV;;;;;;;;;;;AAUA;;;cAnBa;;;;;;;MA4BA,KAAA,EAUH,OAAA;;;;;cA7BG;;;;;;;;;;IA+BA,CAAA,CAAA,CAAA;;;cArBA;;;;;IA6BA,eAMH,6BAAA,0BAAA,CAAA;;;cA1BG;;;;;;MA4BA,OAOH,2BAAA;;;;;cAvBG;;;;;EAyBA,CAAA,6BAAA,CAAA;;cAjBA;;;;;;;cAQA;;;IAuBA,SAAA,6BASH,0BAAA,CAAA;;;;;cAvBG;;;;;;;;;;;;;cAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,SAAA,SAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAA"}
1
+ {"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;AAKA;AA0BA;cA1Ba,cAAA;EAAA,SAAA,kBAAA;EAAA,SAAA,cAAA;EAAA,SAAA,OAAA;EAAA,SAAA,gBAAA;EAAA,SAAA,UAAA;EAAA,SAAA,IAAA;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AA;;;;;cAvBG;;;;;;;;;;;;;cAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,SAAA,SAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAA"}
1
+ {"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;AAKA;AA0BA;cA1Ba,cAAA;EAAA,SAAA,kBAAA;EAAA,SAAA,cAAA;EAAA,SAAA,OAAA;EAAA,SAAA,gBAAA;EAAA,SAAA,UAAA;EAAA,SAAA,IAAA;EAAA,SAAA,YAAA;EAAA,SAAA,mBAAA;AAAA;AAAA;AA0Bb;;;;;;;;;AASA;;;;AAnCa,cA0BA,YAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;cASA,YAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;;cAUA,mBAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;cASA,WAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;cAYA,SAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;cAQA,SAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;cAQA,OAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;cASA,gBAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;AAcb;cAAa,YAAA;EAAA,SAAA,YAAA;IAAA,SAAA,MAAA;IAAA,SAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcA,kBAAA;EAAA,SAAA,YAAA;IAAA,SAAA,MAAA;IAAA,SAAA,IAAA"}
package/dist/orpc.cjs CHANGED
@@ -1,46 +1,46 @@
1
1
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
- let __orpc_experimental_publisher_ioredis = require("@orpc/experimental-publisher/ioredis");
3
- let __orpc_experimental_publisher_memory = require("@orpc/experimental-publisher/memory");
4
- let __orpc_experimental_publisher_upstash_redis = require("@orpc/experimental-publisher/upstash-redis");
2
+ let _orpc_experimental_publisher_ioredis = require("@orpc/experimental-publisher/ioredis");
3
+ let _orpc_experimental_publisher_memory = require("@orpc/experimental-publisher/memory");
4
+ let _orpc_experimental_publisher_upstash_redis = require("@orpc/experimental-publisher/upstash-redis");
5
5
 
6
6
  Object.defineProperty(exports, 'IORedisPublisher', {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return __orpc_experimental_publisher_ioredis.IORedisPublisher;
9
+ return _orpc_experimental_publisher_ioredis.IORedisPublisher;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, 'MemoryPublisher', {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return __orpc_experimental_publisher_memory.MemoryPublisher;
15
+ return _orpc_experimental_publisher_memory.MemoryPublisher;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, 'UpstashRedisPublisher', {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return __orpc_experimental_publisher_upstash_redis.UpstashRedisPublisher;
21
+ return _orpc_experimental_publisher_upstash_redis.UpstashRedisPublisher;
22
22
  }
23
23
  });
24
- var __orpc_contract = require("@orpc/contract");
25
- Object.keys(__orpc_contract).forEach(function (k) {
24
+ var _orpc_contract = require("@orpc/contract");
25
+ Object.keys(_orpc_contract).forEach(function (k) {
26
26
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
27
27
  enumerable: true,
28
- get: function () { return __orpc_contract[k]; }
28
+ get: function () { return _orpc_contract[k]; }
29
29
  });
30
30
  });
31
31
 
32
- var __orpc_server = require("@orpc/server");
33
- Object.keys(__orpc_server).forEach(function (k) {
32
+ var _orpc_server = require("@orpc/server");
33
+ Object.keys(_orpc_server).forEach(function (k) {
34
34
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
35
35
  enumerable: true,
36
- get: function () { return __orpc_server[k]; }
36
+ get: function () { return _orpc_server[k]; }
37
37
  });
38
38
  });
39
39
 
40
- var __orpc_experimental_publisher = require("@orpc/experimental-publisher");
41
- Object.keys(__orpc_experimental_publisher).forEach(function (k) {
40
+ var _orpc_experimental_publisher = require("@orpc/experimental-publisher");
41
+ Object.keys(_orpc_experimental_publisher).forEach(function (k) {
42
42
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
43
43
  enumerable: true,
44
- get: function () { return __orpc_experimental_publisher[k]; }
44
+ get: function () { return _orpc_experimental_publisher[k]; }
45
45
  });
46
46
  });
package/dist/package.cjs CHANGED
@@ -1,17 +1,29 @@
1
1
 
2
2
  //#region package.json
3
- var version = "0.8.4";
3
+ var version = "0.8.6";
4
4
  var dependencies = {
5
- "@module-federation/enhanced": "^0.21.6",
6
- "@module-federation/node": "^2.7.25",
7
- "@module-federation/runtime-core": "^0.21.6",
8
- "@orpc/contract": "^1.12.3",
9
- "@orpc/experimental-publisher": "^1.12.3",
10
- "@orpc/server": "^1.12.3",
11
- "@orpc/zod": "^1.12.3",
12
- "effect": "3.19.12",
13
- "zod": "4.2.1"
5
+ "@module-federation/enhanced": "^0.22.1",
6
+ "@module-federation/node": "^2.7.27",
7
+ "@module-federation/runtime-core": "^0.22.1",
8
+ "@orpc/client": "^1.12.3",
9
+ "@orpc/contract": "^1.13.4",
10
+ "@orpc/experimental-publisher": "^1.13.4",
11
+ "@orpc/openapi": "^1.12.3",
12
+ "@orpc/react-query": "^1.13.4",
13
+ "@orpc/server": "^1.13.4",
14
+ "@orpc/tanstack-query": "^1.13.4",
15
+ "@orpc/zod": "^1.13.4",
16
+ "effect": "3.19.14",
17
+ "zod": "4.3.5"
14
18
  };
19
+ var sharedDependencies = { "ui": {
20
+ "react": "^19.2.0",
21
+ "react-dom": "^19.2.0",
22
+ "@tanstack/react-query": "^5.90.11",
23
+ "@tanstack/react-router": "^1.139.14",
24
+ "@hot-labs/near-connect": "^0.8.1",
25
+ "near-kit": "^0.7.0"
26
+ } };
15
27
 
16
28
  //#endregion
17
29
  Object.defineProperty(exports, 'dependencies', {
@@ -20,6 +32,12 @@ Object.defineProperty(exports, 'dependencies', {
20
32
  return dependencies;
21
33
  }
22
34
  });
35
+ Object.defineProperty(exports, 'sharedDependencies', {
36
+ enumerable: true,
37
+ get: function () {
38
+ return sharedDependencies;
39
+ }
40
+ });
23
41
  Object.defineProperty(exports, 'version', {
24
42
  enumerable: true,
25
43
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"every-plugin\",\n\t\"version\": \"0.8.4\",\n\t\"type\": \"module\",\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.mjs\",\n\t\"types\": \"./dist/index.d.mts\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/index.mjs\",\n\t\t\t\"require\": \"./dist/index.cjs\"\n\t\t},\n\t\t\"./runtime\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/runtime/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/runtime/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/runtime/index.mjs\",\n\t\t\t\"require\": \"./dist/runtime/index.cjs\"\n\t\t},\n\t\t\"./testing\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/testing/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/testing/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/testing/index.mjs\",\n\t\t\t\"require\": \"./dist/testing/index.cjs\"\n\t\t},\n\t\t\"./normalize\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/runtime/services/normalize.d.mts\",\n\t\t\t\t\"require\": \"./dist/runtime/services/normalize.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/runtime/services/normalize.mjs\",\n\t\t\t\"require\": \"./dist/runtime/services/normalize.cjs\"\n\t\t},\n\t\t\"./effect\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/effect.d.mts\",\n\t\t\t\t\"require\": \"./dist/effect.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/effect.mjs\",\n\t\t\t\"require\": \"./dist/effect.cjs\"\n\t\t},\n\t\t\"./zod\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/zod.d.mts\",\n\t\t\t\t\"require\": \"./dist/zod.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/zod.mjs\",\n\t\t\t\"require\": \"./dist/zod.cjs\"\n\t\t},\n\t\t\"./zod/v4/core\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/zod-core.d.mts\",\n\t\t\t\t\"require\": \"./dist/zod-core.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/zod-core.mjs\",\n\t\t\t\"require\": \"./dist/zod-core.cjs\"\n\t\t},\n\t\t\"./orpc\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/orpc.d.mts\",\n\t\t\t\t\"require\": \"./dist/orpc.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/orpc.mjs\",\n\t\t\t\"require\": \"./dist/orpc.cjs\"\n\t\t},\n\t\t\"./errors\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/errors.d.mts\",\n\t\t\t\t\"require\": \"./dist/errors.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/errors.mjs\",\n\t\t\t\"require\": \"./dist/errors.cjs\"\n\t\t},\n\t\t\"./types\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/types.d.mts\",\n\t\t\t\t\"require\": \"./dist/types.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/types.mjs\",\n\t\t\t\"require\": \"./dist/types.cjs\"\n\t\t},\n\t\t\"./build/rspack\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/build/rspack/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/build/rspack/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/build/rspack/index.mjs\",\n\t\t\t\"require\": \"./dist/build/rspack/index.cjs\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"files\": [\n\t\t\"dist\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"build:test\": \"cd tests/fixtures/test-plugin && bun run build\",\n\t\t\"test\": \"vitest run --config vitest.config.ts\",\n\t\t\"test:unit\": \"vitest run --config vitest.config.ts\",\n\t\t\"test:integration\": \"bun run build:test && vitest run --config vitest.integration.config.ts\",\n\t\t\"test:all\": \"bun run test:unit && bun run test:integration\",\n\t\t\"test:watch\": \"vitest --config vitest.config.ts --watch\",\n\t\t\"typecheck\": \"tsc --noEmit\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"@rspack/core\": \"1.6.7\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"effect\": \"^3.19.0\",\n\t\t\"zod\": \"^4.0.0\",\n\t\t\"@orpc/contract\": \"^1.12.0\",\n\t\t\"@orpc/server\": \"^1.12.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@effect/language-service\": \"^0.62.3\",\n\t\t\"@effect/vitest\": \"^0.27.0\",\n\t\t\"@orpc/client\": \"^1.12.3\",\n\t\t\"@orpc/openapi\": \"^1.12.3\",\n\t\t\"@rspack/cli\": \"^1.6.7\",\n\t\t\"@types/bun\": \"^1.3.4\",\n\t\t\"@types/node\": \"^25.0.2\",\n\t\t\"@vitest/ui\": \"4.0.16\",\n\t\t\"bun-types\": \"^1.3.4\",\n\t\t\"sirv\": \"^3.0.2\",\n\t\t\"tsdown\": \"^0.18.0\",\n\t\t\"vite-tsconfig-paths\": \"^6.0.1\",\n\t\t\"vitest\": \"^4.0.16\"\n\t},\n\t\"dependencies\": {\n\t\t\"@module-federation/enhanced\": \"^0.21.6\",\n\t\t\"@module-federation/node\": \"^2.7.25\",\n\t\t\"@module-federation/runtime-core\": \"^0.21.6\",\n\t\t\"@orpc/contract\": \"^1.12.3\",\n\t\t\"@orpc/experimental-publisher\": \"^1.12.3\",\n\t\t\"@orpc/server\": \"^1.12.3\",\n\t\t\"@orpc/zod\": \"^1.12.3\",\n\t\t\"effect\": \"3.19.12\",\n\t\t\"zod\": \"4.2.1\"\n\t},\n\t\"keywords\": [\n\t\t\"plugin\",\n\t\t\"module-federation\",\n\t\t\"orpc\",\n\t\t\"zod\",\n\t\t\"typescript\"\n\t],\n\t\"author\": \"plugin.every.near\",\n\t\"license\": \"MIT\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/near-everything/every-plugin.git\"\n\t},\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/near-everything/every-plugin/issues\"\n\t},\n\t\"homepage\": \"https://plugin.everything.dev\",\n\t\"workspaces\": [\n\t\t\"tests/fixtures/*\"\n\t]\n}\n"],"mappings":";;cAEY;mBAoIK;CACf,+BAA+B;CAC/B,2BAA2B;CAC3B,mCAAmC;CACnC,kBAAkB;CAClB,gCAAgC;CAChC,gBAAgB;CAChB,aAAa;CACb,UAAU;CACV,OAAO;CACP"}
1
+ {"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
package/dist/package.mjs CHANGED
@@ -1,17 +1,29 @@
1
1
  //#region package.json
2
- var version = "0.8.4";
2
+ var version = "0.8.6";
3
3
  var dependencies = {
4
- "@module-federation/enhanced": "^0.21.6",
5
- "@module-federation/node": "^2.7.25",
6
- "@module-federation/runtime-core": "^0.21.6",
7
- "@orpc/contract": "^1.12.3",
8
- "@orpc/experimental-publisher": "^1.12.3",
9
- "@orpc/server": "^1.12.3",
10
- "@orpc/zod": "^1.12.3",
11
- "effect": "3.19.12",
12
- "zod": "4.2.1"
4
+ "@module-federation/enhanced": "^0.22.1",
5
+ "@module-federation/node": "^2.7.27",
6
+ "@module-federation/runtime-core": "^0.22.1",
7
+ "@orpc/client": "^1.12.3",
8
+ "@orpc/contract": "^1.13.4",
9
+ "@orpc/experimental-publisher": "^1.13.4",
10
+ "@orpc/openapi": "^1.12.3",
11
+ "@orpc/react-query": "^1.13.4",
12
+ "@orpc/server": "^1.13.4",
13
+ "@orpc/tanstack-query": "^1.13.4",
14
+ "@orpc/zod": "^1.13.4",
15
+ "effect": "3.19.14",
16
+ "zod": "4.3.5"
13
17
  };
18
+ var sharedDependencies = { "ui": {
19
+ "react": "^19.2.0",
20
+ "react-dom": "^19.2.0",
21
+ "@tanstack/react-query": "^5.90.11",
22
+ "@tanstack/react-router": "^1.139.14",
23
+ "@hot-labs/near-connect": "^0.8.1",
24
+ "near-kit": "^0.7.0"
25
+ } };
14
26
 
15
27
  //#endregion
16
- export { dependencies, version };
28
+ export { dependencies, sharedDependencies, version };
17
29
  //# sourceMappingURL=package.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.mjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"every-plugin\",\n\t\"version\": \"0.8.4\",\n\t\"type\": \"module\",\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.mjs\",\n\t\"types\": \"./dist/index.d.mts\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/index.mjs\",\n\t\t\t\"require\": \"./dist/index.cjs\"\n\t\t},\n\t\t\"./runtime\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/runtime/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/runtime/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/runtime/index.mjs\",\n\t\t\t\"require\": \"./dist/runtime/index.cjs\"\n\t\t},\n\t\t\"./testing\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/testing/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/testing/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/testing/index.mjs\",\n\t\t\t\"require\": \"./dist/testing/index.cjs\"\n\t\t},\n\t\t\"./normalize\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/runtime/services/normalize.d.mts\",\n\t\t\t\t\"require\": \"./dist/runtime/services/normalize.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/runtime/services/normalize.mjs\",\n\t\t\t\"require\": \"./dist/runtime/services/normalize.cjs\"\n\t\t},\n\t\t\"./effect\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/effect.d.mts\",\n\t\t\t\t\"require\": \"./dist/effect.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/effect.mjs\",\n\t\t\t\"require\": \"./dist/effect.cjs\"\n\t\t},\n\t\t\"./zod\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/zod.d.mts\",\n\t\t\t\t\"require\": \"./dist/zod.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/zod.mjs\",\n\t\t\t\"require\": \"./dist/zod.cjs\"\n\t\t},\n\t\t\"./zod/v4/core\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/zod-core.d.mts\",\n\t\t\t\t\"require\": \"./dist/zod-core.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/zod-core.mjs\",\n\t\t\t\"require\": \"./dist/zod-core.cjs\"\n\t\t},\n\t\t\"./orpc\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/orpc.d.mts\",\n\t\t\t\t\"require\": \"./dist/orpc.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/orpc.mjs\",\n\t\t\t\"require\": \"./dist/orpc.cjs\"\n\t\t},\n\t\t\"./errors\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/errors.d.mts\",\n\t\t\t\t\"require\": \"./dist/errors.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/errors.mjs\",\n\t\t\t\"require\": \"./dist/errors.cjs\"\n\t\t},\n\t\t\"./types\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/types.d.mts\",\n\t\t\t\t\"require\": \"./dist/types.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/types.mjs\",\n\t\t\t\"require\": \"./dist/types.cjs\"\n\t\t},\n\t\t\"./build/rspack\": {\n\t\t\t\"types\": {\n\t\t\t\t\"import\": \"./dist/build/rspack/index.d.mts\",\n\t\t\t\t\"require\": \"./dist/build/rspack/index.d.cts\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/build/rspack/index.mjs\",\n\t\t\t\"require\": \"./dist/build/rspack/index.cjs\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"files\": [\n\t\t\"dist\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"build:test\": \"cd tests/fixtures/test-plugin && bun run build\",\n\t\t\"test\": \"vitest run --config vitest.config.ts\",\n\t\t\"test:unit\": \"vitest run --config vitest.config.ts\",\n\t\t\"test:integration\": \"bun run build:test && vitest run --config vitest.integration.config.ts\",\n\t\t\"test:all\": \"bun run test:unit && bun run test:integration\",\n\t\t\"test:watch\": \"vitest --config vitest.config.ts --watch\",\n\t\t\"typecheck\": \"tsc --noEmit\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"@rspack/core\": \"1.6.7\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"effect\": \"^3.19.0\",\n\t\t\"zod\": \"^4.0.0\",\n\t\t\"@orpc/contract\": \"^1.12.0\",\n\t\t\"@orpc/server\": \"^1.12.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@effect/language-service\": \"^0.62.3\",\n\t\t\"@effect/vitest\": \"^0.27.0\",\n\t\t\"@orpc/client\": \"^1.12.3\",\n\t\t\"@orpc/openapi\": \"^1.12.3\",\n\t\t\"@rspack/cli\": \"^1.6.7\",\n\t\t\"@types/bun\": \"^1.3.4\",\n\t\t\"@types/node\": \"^25.0.2\",\n\t\t\"@vitest/ui\": \"4.0.16\",\n\t\t\"bun-types\": \"^1.3.4\",\n\t\t\"sirv\": \"^3.0.2\",\n\t\t\"tsdown\": \"^0.18.0\",\n\t\t\"vite-tsconfig-paths\": \"^6.0.1\",\n\t\t\"vitest\": \"^4.0.16\"\n\t},\n\t\"dependencies\": {\n\t\t\"@module-federation/enhanced\": \"^0.21.6\",\n\t\t\"@module-federation/node\": \"^2.7.25\",\n\t\t\"@module-federation/runtime-core\": \"^0.21.6\",\n\t\t\"@orpc/contract\": \"^1.12.3\",\n\t\t\"@orpc/experimental-publisher\": \"^1.12.3\",\n\t\t\"@orpc/server\": \"^1.12.3\",\n\t\t\"@orpc/zod\": \"^1.12.3\",\n\t\t\"effect\": \"3.19.12\",\n\t\t\"zod\": \"4.2.1\"\n\t},\n\t\"keywords\": [\n\t\t\"plugin\",\n\t\t\"module-federation\",\n\t\t\"orpc\",\n\t\t\"zod\",\n\t\t\"typescript\"\n\t],\n\t\"author\": \"plugin.every.near\",\n\t\"license\": \"MIT\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/near-everything/every-plugin.git\"\n\t},\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/near-everything/every-plugin/issues\"\n\t},\n\t\"homepage\": \"https://plugin.everything.dev\",\n\t\"workspaces\": [\n\t\t\"tests/fixtures/*\"\n\t]\n}\n"],"mappings":";cAEY;mBAoIK;CACf,+BAA+B;CAC/B,2BAA2B;CAC3B,mCAAmC;CACnC,kBAAkB;CAClB,gCAAgC;CAChC,gBAAgB;CAChB,aAAa;CACb,UAAU;CACV,OAAO;CACP"}
1
+ {"version":3,"file":"package.mjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
package/dist/plugin.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
2
  const require_errors = require('./runtime/errors.cjs');
3
- let __orpc_contract = require("@orpc/contract");
3
+ let _orpc_contract = require("@orpc/contract");
4
4
  let effect = require("effect");
5
- let __orpc_server = require("@orpc/server");
5
+ let _orpc_server = require("@orpc/server");
6
6
 
7
7
  //#region src/plugin.ts
8
8
  /**
@@ -32,12 +32,12 @@ function createPlugin(config) {
32
32
  });
33
33
  }
34
34
  createRouter(deps) {
35
- const base = __orpc_server.os.$context().use((0, __orpc_server.onError)((error) => {
35
+ const base = _orpc_server.os.$context().use((0, _orpc_server.onError)((error) => {
36
36
  const unwrapped = require_errors.extractFromFiberFailure(error);
37
- if (unwrapped !== error && unwrapped instanceof __orpc_contract.ORPCError) throw unwrapped;
37
+ if (unwrapped !== error && unwrapped instanceof _orpc_contract.ORPCError) throw unwrapped;
38
38
  require_errors.formatORPCError(error);
39
39
  }));
40
- const builder = (0, __orpc_server.implement)(config.contract, base);
40
+ const builder = (0, _orpc_server.implement)(config.contract, base);
41
41
  return config.createRouter(deps, builder);
42
42
  }
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs","names":["configSchema: PluginConfigFor<V, S, TRequestContext>","Effect","os","extractFromFiberFailure","ORPCError"],"sources":["../src/plugin.ts"],"sourcesContent":["import type { AnyContractRouter, AnySchema, InferSchemaOutput } from \"@orpc/contract\";\nimport type { Context, Implementer, Router } from \"@orpc/server\";\nimport { ORPCError } from \"@orpc/contract\";\nimport { implement, onError, os } from \"@orpc/server\";\nimport { Effect, type Scope } from \"effect\";\nimport { extractFromFiberFailure, formatORPCError } from \"./runtime/errors\";\n\ntype ContextOutput<T> = T extends AnySchema ? InferSchemaOutput<T> : {};\n\n/**\n * Helper type that correctly constructs the config schema type\n */\nexport type PluginConfigFor<V extends AnySchema, S extends AnySchema, TRequestContext extends AnySchema | undefined> = {\n\tvariables: V;\n\tsecrets: S;\n\tcontext: TRequestContext;\n};\n\n/**\n * Loaded plugin with static binding property\n */\nexport interface LoadedPluginWithBinding<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\tnew(): Plugin<TContract, TVariables, TSecrets, TRequestContext, TDeps>;\n\tbinding: {\n\t\tcontract: TContract;\n\t\tvariables: TVariables;\n\t\tsecrets: TSecrets;\n\t\tcontext: TRequestContext;\n\t};\n}\n\n/**\n * Plugin interface\n */\nexport interface Plugin<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\treadonly id: string;\n\treadonly contract: TContract;\n\treadonly configSchema: PluginConfigFor<TVariables, TSecrets, TRequestContext>;\n\n\t// Plugin lifecycle\n\tinitialize(\n\t\tconfig: { variables: InferSchemaOutput<TVariables>; secrets: InferSchemaOutput<TSecrets> }\n\t): Effect.Effect<TDeps, unknown, Scope.Scope>;\n\n\tshutdown(): Effect.Effect<void, never>;\n\n\t/**\n\t * Creates the strongly-typed oRPC router for this plugin.\n\t * The router's procedure types are inferred directly from the contract.\n\t * @param deps The initialized plugin dependencies\n\t * @returns A router with procedures matching the plugin's contract\n\t */\n\tcreateRouter(deps: TDeps): Router<TContract, any>;\n}\n\n/**\n * Factory function to create plugins\n */\nexport function createPlugin<\n\tV extends AnySchema,\n\tS extends AnySchema,\n\tTContract extends AnyContractRouter,\n\tTRequestContext extends AnySchema | undefined = undefined,\n\tTDeps extends Context = Record<never, never>\n>(config: {\n\tvariables: V;\n\tsecrets: S;\n\tcontract: TContract;\n\tcontext?: TRequestContext;\n\tinitialize?: (\n\t\tconfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t) => Effect.Effect<TDeps, Error, Scope.Scope>;\n\tcreateRouter: (\n\t\tdeps: TDeps,\n\t\tbuilder: Implementer<TContract, ContextOutput<TRequestContext>, ContextOutput<TRequestContext>>\n\t) => Router<TContract, any>;\n\tshutdown?: (deps: TDeps) => Effect.Effect<void, Error, never>;\n}) {\n\tconst configSchema: PluginConfigFor<V, S, TRequestContext> = {\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\tclass CreatedPlugin implements Plugin<TContract, V, S, TRequestContext, TDeps> {\n\t\t/** set during instantiation - registry key */\n\t\tid!: string;\n\t\treadonly contract = config.contract;\n\t\treadonly configSchema = configSchema;\n\n\t\tprivate _deps: TDeps | null = null;\n\n\t\tinitialize(\n\t\t\tpluginConfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t\t): Effect.Effect<TDeps, unknown, Scope.Scope> {\n\t\t\tconst init = config.initialize ?? (() => Effect.succeed({} as TDeps));\n\n\t\t\treturn init(pluginConfig).pipe(\n\t\t\t\tEffect.tap((deps) => Effect.sync(() => { this._deps = deps; })),\n\t\t\t\tEffect.map(() => this._deps as TDeps),\n\t\t\t\tEffect.mapError((error) => error as unknown)\n\t\t\t);\n\t\t}\n\n\t\tshutdown(): Effect.Effect<void, never> {\n\t\t\tconst self = this;\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tif (config.shutdown && self._deps) {\n\t\t\t\t\tyield* config.shutdown(self._deps).pipe(\n\t\t\t\t\t\tEffect.catchAll(() => Effect.void)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcreateRouter(deps: TDeps): Router<TContract, any> {\n\t\t\tconst base = os\n\t\t\t\t.$context<ContextOutput<TRequestContext>>()\n\t\t\t\t.use(onError((error) => {\n\t\t\t\t\tconst unwrapped = extractFromFiberFailure(error);\n\t\t\t\t\t\n\t\t\t\t\tif (unwrapped !== error && unwrapped instanceof ORPCError) {\n\t\t\t\t\t\tthrow unwrapped;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tformatORPCError(error);\n\t\t\t\t}));\n\t\t\tconst builder = implement(config.contract, base);\n\t\t\tconst router = config.createRouter(deps, builder);\n\t\t\treturn router as Router<TContract, any>;\n\t\t}\n\t}\n\n\tconst PluginConstructor = CreatedPlugin as unknown as {\n\t\tnew(): Plugin<TContract, V, S, TRequestContext, TDeps>;\n\t\tbinding: {\n\t\t\tcontract: TContract;\n\t\t\tvariables: V;\n\t\t\tsecrets: S;\n\t\t\tcontext: TRequestContext;\n\t\t};\n\t};\n\n\tPluginConstructor.binding = {\n\t\tcontract: config.contract,\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\treturn PluginConstructor as LoadedPluginWithBinding<TContract, V, S, TRequestContext, TDeps>;\n}\n"],"mappings":";;;;;;;;;;AAsEA,SAAgB,aAMd,QAaC;CACF,MAAMA,eAAuD;EAC5D,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;CAED,MAAM,cAAyE;;EAE9E;EACA,AAAS,WAAW,OAAO;EAC3B,AAAS,eAAe;EAExB,AAAQ,QAAsB;EAE9B,WACC,cAC6C;AAG7C,WAFa,OAAO,qBAAqBC,cAAO,QAAQ,EAAE,CAAU,GAExD,aAAa,CAAC,KACzBA,cAAO,KAAK,SAASA,cAAO,WAAW;AAAE,SAAK,QAAQ;KAAQ,CAAC,EAC/DA,cAAO,UAAU,KAAK,MAAe,EACrCA,cAAO,UAAU,UAAU,MAAiB,CAC5C;;EAGF,WAAuC;GACtC,MAAM,OAAO;AACb,UAAOA,cAAO,IAAI,aAAa;AAC9B,QAAI,OAAO,YAAY,KAAK,MAC3B,QAAO,OAAO,SAAS,KAAK,MAAM,CAAC,KAClCA,cAAO,eAAeA,cAAO,KAAK,CAClC;KAED;;EAGH,aAAa,MAAqC;GACjD,MAAM,OAAOC,iBACX,UAA0C,CAC1C,gCAAa,UAAU;IACvB,MAAM,YAAYC,uCAAwB,MAAM;AAEhD,QAAI,cAAc,SAAS,qBAAqBC,0BAC/C,OAAM;AAGP,mCAAgB,MAAM;KACrB,CAAC;GACJ,MAAM,uCAAoB,OAAO,UAAU,KAAK;AAEhD,UADe,OAAO,aAAa,MAAM,QAAQ;;;CAKnD,MAAM,oBAAoB;AAU1B,mBAAkB,UAAU;EAC3B,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;AAED,QAAO"}
1
+ {"version":3,"file":"plugin.cjs","names":["Effect","os","extractFromFiberFailure","ORPCError"],"sources":["../src/plugin.ts"],"sourcesContent":["import type { AnyContractRouter, AnySchema, InferSchemaOutput } from \"@orpc/contract\";\nimport type { Context, Implementer, Router } from \"@orpc/server\";\nimport { ORPCError } from \"@orpc/contract\";\nimport { implement, onError, os } from \"@orpc/server\";\nimport { Effect, type Scope } from \"effect\";\nimport { extractFromFiberFailure, formatORPCError } from \"./runtime/errors\";\n\ntype ContextOutput<T> = T extends AnySchema ? InferSchemaOutput<T> : {};\n\n/**\n * Helper type that correctly constructs the config schema type\n */\nexport type PluginConfigFor<V extends AnySchema, S extends AnySchema, TRequestContext extends AnySchema | undefined> = {\n\tvariables: V;\n\tsecrets: S;\n\tcontext: TRequestContext;\n};\n\n/**\n * Loaded plugin with static binding property\n */\nexport interface LoadedPluginWithBinding<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\tnew(): Plugin<TContract, TVariables, TSecrets, TRequestContext, TDeps>;\n\tbinding: {\n\t\tcontract: TContract;\n\t\tvariables: TVariables;\n\t\tsecrets: TSecrets;\n\t\tcontext: TRequestContext;\n\t};\n}\n\n/**\n * Plugin interface\n */\nexport interface Plugin<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\treadonly id: string;\n\treadonly contract: TContract;\n\treadonly configSchema: PluginConfigFor<TVariables, TSecrets, TRequestContext>;\n\n\t// Plugin lifecycle\n\tinitialize(\n\t\tconfig: { variables: InferSchemaOutput<TVariables>; secrets: InferSchemaOutput<TSecrets> }\n\t): Effect.Effect<TDeps, unknown, Scope.Scope>;\n\n\tshutdown(): Effect.Effect<void, never>;\n\n\t/**\n\t * Creates the strongly-typed oRPC router for this plugin.\n\t * The router's procedure types are inferred directly from the contract.\n\t * @param deps The initialized plugin dependencies\n\t * @returns A router with procedures matching the plugin's contract\n\t */\n\tcreateRouter(deps: TDeps): Router<TContract, any>;\n}\n\n/**\n * Factory function to create plugins\n */\nexport function createPlugin<\n\tV extends AnySchema,\n\tS extends AnySchema,\n\tTContract extends AnyContractRouter,\n\tTRequestContext extends AnySchema | undefined = undefined,\n\tTDeps extends Context = Record<never, never>\n>(config: {\n\tvariables: V;\n\tsecrets: S;\n\tcontract: TContract;\n\tcontext?: TRequestContext;\n\tinitialize?: (\n\t\tconfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t) => Effect.Effect<TDeps, Error, Scope.Scope>;\n\tcreateRouter: (\n\t\tdeps: TDeps,\n\t\tbuilder: Implementer<TContract, ContextOutput<TRequestContext>, ContextOutput<TRequestContext>>\n\t) => Router<TContract, any>;\n\tshutdown?: (deps: TDeps) => Effect.Effect<void, Error, never>;\n}) {\n\tconst configSchema: PluginConfigFor<V, S, TRequestContext> = {\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\tclass CreatedPlugin implements Plugin<TContract, V, S, TRequestContext, TDeps> {\n\t\t/** set during instantiation - registry key */\n\t\tid!: string;\n\t\treadonly contract = config.contract;\n\t\treadonly configSchema = configSchema;\n\n\t\tprivate _deps: TDeps | null = null;\n\n\t\tinitialize(\n\t\t\tpluginConfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t\t): Effect.Effect<TDeps, unknown, Scope.Scope> {\n\t\t\tconst init = config.initialize ?? (() => Effect.succeed({} as TDeps));\n\n\t\t\treturn init(pluginConfig).pipe(\n\t\t\t\tEffect.tap((deps) => Effect.sync(() => { this._deps = deps; })),\n\t\t\t\tEffect.map(() => this._deps as TDeps),\n\t\t\t\tEffect.mapError((error) => error as unknown)\n\t\t\t);\n\t\t}\n\n\t\tshutdown(): Effect.Effect<void, never> {\n\t\t\tconst self = this;\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tif (config.shutdown && self._deps) {\n\t\t\t\t\tyield* config.shutdown(self._deps).pipe(\n\t\t\t\t\t\tEffect.catchAll(() => Effect.void)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcreateRouter(deps: TDeps): Router<TContract, any> {\n\t\t\tconst base = os\n\t\t\t\t.$context<ContextOutput<TRequestContext>>()\n\t\t\t\t.use(onError((error) => {\n\t\t\t\t\tconst unwrapped = extractFromFiberFailure(error);\n\t\t\t\t\t\n\t\t\t\t\tif (unwrapped !== error && unwrapped instanceof ORPCError) {\n\t\t\t\t\t\tthrow unwrapped;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tformatORPCError(error);\n\t\t\t\t}));\n\t\t\tconst builder = implement(config.contract, base);\n\t\t\tconst router = config.createRouter(deps, builder);\n\t\t\treturn router as Router<TContract, any>;\n\t\t}\n\t}\n\n\tconst PluginConstructor = CreatedPlugin as unknown as {\n\t\tnew(): Plugin<TContract, V, S, TRequestContext, TDeps>;\n\t\tbinding: {\n\t\t\tcontract: TContract;\n\t\t\tvariables: V;\n\t\t\tsecrets: S;\n\t\t\tcontext: TRequestContext;\n\t\t};\n\t};\n\n\tPluginConstructor.binding = {\n\t\tcontract: config.contract,\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\treturn PluginConstructor as LoadedPluginWithBinding<TContract, V, S, TRequestContext, TDeps>;\n}\n"],"mappings":";;;;;;;;;;AAsEA,SAAgB,aAMd,QAaC;CACF,MAAM,eAAuD;EAC5D,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;CAED,MAAM,cAAyE;;EAE9E;EACA,AAAS,WAAW,OAAO;EAC3B,AAAS,eAAe;EAExB,AAAQ,QAAsB;EAE9B,WACC,cAC6C;AAG7C,WAFa,OAAO,qBAAqBA,cAAO,QAAQ,EAAE,CAAU,GAExD,aAAa,CAAC,KACzBA,cAAO,KAAK,SAASA,cAAO,WAAW;AAAE,SAAK,QAAQ;KAAQ,CAAC,EAC/DA,cAAO,UAAU,KAAK,MAAe,EACrCA,cAAO,UAAU,UAAU,MAAiB,CAC5C;;EAGF,WAAuC;GACtC,MAAM,OAAO;AACb,UAAOA,cAAO,IAAI,aAAa;AAC9B,QAAI,OAAO,YAAY,KAAK,MAC3B,QAAO,OAAO,SAAS,KAAK,MAAM,CAAC,KAClCA,cAAO,eAAeA,cAAO,KAAK,CAClC;KAED;;EAGH,aAAa,MAAqC;GACjD,MAAM,OAAOC,gBACX,UAA0C,CAC1C,+BAAa,UAAU;IACvB,MAAM,YAAYC,uCAAwB,MAAM;AAEhD,QAAI,cAAc,SAAS,qBAAqBC,yBAC/C,OAAM;AAGP,mCAAgB,MAAM;KACrB,CAAC;GACJ,MAAM,sCAAoB,OAAO,UAAU,KAAK;AAEhD,UADe,OAAO,aAAa,MAAM,QAAQ;;;CAKnD,MAAM,oBAAoB;AAU1B,mBAAkB,UAAU;EAC3B,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;AAED,QAAO"}
package/dist/plugin.d.cts CHANGED
@@ -37,11 +37,11 @@ interface Plugin<TContract extends AnyContractRouter, TVariables extends AnySche
37
37
  }): Effect.Effect<TDeps, unknown, Scope.Scope>;
38
38
  shutdown(): Effect.Effect<void, never>;
39
39
  /**
40
- * Creates the strongly-typed oRPC router for this plugin.
41
- * The router's procedure types are inferred directly from the contract.
42
- * @param deps The initialized plugin dependencies
43
- * @returns A router with procedures matching the plugin's contract
44
- */
40
+ * Creates the strongly-typed oRPC router for this plugin.
41
+ * The router's procedure types are inferred directly from the contract.
42
+ * @param deps The initialized plugin dependencies
43
+ * @returns A router with procedures matching the plugin's contract
44
+ */
45
45
  createRouter(deps: TDeps): Router<TContract, any>;
46
46
  }
47
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAOK,mBAAmB,UAAU,YAAY,kBAAkB;;AAHpB;;AAGV,KAKtB,eALsB,CAAA,UAKI,SALJ,EAAA,UAKyB,SALzB,EAAA,wBAK4D,SAL5D,GAAA,SAAA,CAAA,GAAA;EAA8B,SAAA,EAMpD,CANoD;EAAlB,OAAA,EAOpC,CAPoC;EAAiB,OAAA,EAQrD,eARqD;AAK/D,CAAA;;;;AACY,UAQK,uBARL,CAAA,kBASO,iBATP,EAAA,mBAUQ,SAVR,EAAA,iBAWM,SAXN,EAAA,wBAYa,SAZb,GAAA,SAAA,EAAA,cAaG,SAbH,GAaa,MAbb,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA,CAAA;EACF,MAAA,EAcF,MAdE,CAcK,SAdL,EAcgB,UAdhB,EAc4B,QAd5B,EAcsC,eAdtC,EAcuD,KAdvD,CAAA;EACA,OAAA,EAAA;IAAe,QAAA,EAeb,SAfa;IAMR,SAAA,EAUJ,UAVI;IACE,OAAA,EAUR,QAVQ;IACC,OAAA,EAUT,eAVS;EACF,CAAA;;;;;AAIQ,UAYT,MAZS,CAAA,kBAaP,iBAbO,EAAA,mBAcN,SAdM,EAAA,iBAeR,SAfQ,EAAA,w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A,EAAA;EAAA,SAAA,QAAA,EAGL,SAAA;EAAA,SAAA,YAAA,EACI,eAAA,CAAgB,UAAA,EAAY,QAAA,EAAU,eAAA;EAAA,UAAA,CAAA,MAAA;IAAA,SAAA,EAIvC,iBAAA,CAAkB,UAAA;IAAA,OAAA,EAAsB,iBAAA,CAAkB,QAAA;EAAA,IAC7E,MAAA,CAAO,MAAA,CAAO,KAAA,WAAgB,KAAA,CAAM,KAAA;EAAA,QAAA,IAE3B,MAAA,CAAO,MAAA;EAAA;;;;;AAcpB;EAdoB,YAAA,CAAA,IAAA,EAQA,KAAA,GAAQ,MAAA,CAAO,SAAA;AAAA;AAAA;;;AAAA,iBAMnB,YAAA,WACL,SAAA,YACA,SAAA,oBACQ,iBAAA,0BACM,SAAA,wCACV,SAAA,GAAU,MAAA,eAAA,CAAA,MAAA;EAAA,SAAA,EAEb,CAAA;EAAA,OAAA,EACF,CAAA;EAAA,QAAA,EACC,SAAA;EAAA,OAAA,GACA,eAAA;EAAA,UAAA,IAAA,MAAA;IAAA,SAAA,EAEY,iBAAA,CAAkB,CAAA;IAAA,OAAA,EAAa,iBAAA,CAAkB,CAAA;EAAA,MAClE,MAAA,CAAO,MAAA,CAAO,KAAA,EAAO,KAAA,EAAO,KAAA,CAAM,KAAA;EAAA,YAAA,GAAA,IAAA,EAEhC,KAAA,EAAA,OAAA,EACG,WAAA,CAAY,SAAA,EAAW,aAAA,CAAc,eAAA,GAAkB,aAAA,CAAc,eAAA,OAC1E,MAAA,CAAO,SAAA;EAAA,QAAA,IAAA,IAAA,EACM,KAAA,KAAU,MAAA,CAAO,MAAA,OAAa,KAAA;AAAA,IA0EpB,uBAAA,CAAwB,SAAA,EAAW,CAAA,EAAG,CAAA,EAAG,eAAA,EAAiB,KAAA"}
package/dist/plugin.d.mts CHANGED
@@ -37,11 +37,11 @@ interface Plugin<TContract extends AnyContractRouter, TVariables extends AnySche
37
37
  }): Effect.Effect<TDeps, unknown, Scope.Scope>;
38
38
  shutdown(): Effect.Effect<void, never>;
39
39
  /**
40
- * Creates the strongly-typed oRPC router for this plugin.
41
- * The router's procedure types are inferred directly from the contract.
42
- * @param deps The initialized plugin dependencies
43
- * @returns A router with procedures matching the plugin's contract
44
- */
40
+ * Creates the strongly-typed oRPC router for this plugin.
41
+ * The router's procedure types are inferred directly from the contract.
42
+ * @param deps The initialized plugin dependencies
43
+ * @returns A router with procedures matching the plugin's contract
44
+ */
45
45
  createRouter(deps: TDeps): Router<TContract, any>;
46
46
  }
47
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAOK,mBAAmB,UAAU,YAAY,kBAAkB;;AAHpB;;AAGV,KAKtB,eALsB,CAAA,UAKI,SALJ,EAAA,UAKyB,SALzB,EAAA,wBAK4D,SAL5D,GAAA,SAAA,CAAA,GAAA;EAA8B,SAAA,EAMpD,CANoD;EAAlB,OAAA,EAOpC,CAPoC;EAAiB,OAAA,EAQrD,eARqD;AAK/D,CAAA;;;;AACY,UAQK,uBARL,CAAA,kBASO,iBATP,EAAA,mBAUQ,SAVR,EAAA,iBAWM,SAXN,EAAA,wBAYa,SAZb,GAAA,SAAA,EAAA,cAaG,SAbH,GAaa,MAbb,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA,CAAA;EACF,MAAA,EAcF,MAdE,CAcK,SAdL,EAcgB,UAdhB,EAc4B,QAd5B,EAcsC,eAdtC,EAcuD,KAdvD,CAAA;EACA,OAAA,EAAA;IAAe,QAAA,EAeb,SAfa;IAMR,SAAA,EAUJ,UAVI;IACE,OAAA,EAUR,QAVQ;IACC,OAAA,EAUT,eAVS;EACF,CAAA;;;;;AAIQ,UAYT,MAZS,CAAA,kBAaP,iBAbO,EAAA,mBAcN,SAdM,EAAA,iBAeR,SAfQ,EAAA,wBAgBD,SAhBC,GAAA,SAAA,EAAA,cAiBX,SAjBW,GAiBD,MAjBC,CAAA,KAAA,EAAA,KAAA,CAA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AA,EAAU,eAAA;EAAA,UAAA,CAAA,MAAA;IAAA,SAAA,EAIvC,iBAAA,CAAkB,UAAA;IAAA,OAAA,EAAsB,iBAAA,CAAkB,QAAA;EAAA,IAC7E,MAAA,CAAO,MAAA,CAAO,KAAA,WAAgB,KAAA,CAAM,KAAA;EAAA,QAAA,IAE3B,MAAA,CAAO,MAAA;EAAA;;;;;AAcpB;EAdoB,YAAA,CAAA,IAAA,EAQA,KAAA,GAAQ,MAAA,CAAO,SAAA;AAAA;AAAA;;;AAAA,iBAMnB,YAAA,WACL,SAAA,YACA,SAAA,oBACQ,iBAAA,0BACM,SAAA,wCACV,SAAA,GAAU,MAAA,eAAA,CAAA,MAAA;EAAA,SAAA,EAEb,CAAA;EAAA,OAAA,EACF,CAAA;EAAA,QAAA,EACC,SAAA;EAAA,OAAA,GACA,eAAA;EAAA,UAAA,IAAA,MAAA;IAAA,SAAA,EAEY,iBAAA,CAAkB,CAAA;IAAA,OAAA,EAAa,iBAAA,CAAkB,CAAA;EAAA,MAClE,MAAA,CAAO,MAAA,CAAO,KAAA,EAAO,KAAA,EAAO,KAAA,CAAM,KAAA;EAAA,YAAA,GAAA,IAAA,EAEhC,KAAA,EAAA,OAAA,EACG,WAAA,CAAY,SAAA,EAAW,aAAA,CAAc,eAAA,GAAkB,aAAA,CAAc,eAAA,OAC1E,MAAA,CAAO,SAAA;EAAA,QAAA,IAAA,IAAA,EACM,KAAA,KAAU,MAAA,CAAO,MAAA,OAAa,KAAA;AAAA,IA0EpB,uBAAA,CAAwB,SAAA,EAAW,CAAA,EAAG,CAAA,EAAG,eAAA,EAAiB,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":["configSchema: PluginConfigFor<V, S, TRequestContext>"],"sources":["../src/plugin.ts"],"sourcesContent":["import type { AnyContractRouter, AnySchema, InferSchemaOutput } from \"@orpc/contract\";\nimport type { Context, Implementer, Router } from \"@orpc/server\";\nimport { ORPCError } from \"@orpc/contract\";\nimport { implement, onError, os } from \"@orpc/server\";\nimport { Effect, type Scope } from \"effect\";\nimport { extractFromFiberFailure, formatORPCError } from \"./runtime/errors\";\n\ntype ContextOutput<T> = T extends AnySchema ? InferSchemaOutput<T> : {};\n\n/**\n * Helper type that correctly constructs the config schema type\n */\nexport type PluginConfigFor<V extends AnySchema, S extends AnySchema, TRequestContext extends AnySchema | undefined> = {\n\tvariables: V;\n\tsecrets: S;\n\tcontext: TRequestContext;\n};\n\n/**\n * Loaded plugin with static binding property\n */\nexport interface LoadedPluginWithBinding<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\tnew(): Plugin<TContract, TVariables, TSecrets, TRequestContext, TDeps>;\n\tbinding: {\n\t\tcontract: TContract;\n\t\tvariables: TVariables;\n\t\tsecrets: TSecrets;\n\t\tcontext: TRequestContext;\n\t};\n}\n\n/**\n * Plugin interface\n */\nexport interface Plugin<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\treadonly id: string;\n\treadonly contract: TContract;\n\treadonly configSchema: PluginConfigFor<TVariables, TSecrets, TRequestContext>;\n\n\t// Plugin lifecycle\n\tinitialize(\n\t\tconfig: { variables: InferSchemaOutput<TVariables>; secrets: InferSchemaOutput<TSecrets> }\n\t): Effect.Effect<TDeps, unknown, Scope.Scope>;\n\n\tshutdown(): Effect.Effect<void, never>;\n\n\t/**\n\t * Creates the strongly-typed oRPC router for this plugin.\n\t * The router's procedure types are inferred directly from the contract.\n\t * @param deps The initialized plugin dependencies\n\t * @returns A router with procedures matching the plugin's contract\n\t */\n\tcreateRouter(deps: TDeps): Router<TContract, any>;\n}\n\n/**\n * Factory function to create plugins\n */\nexport function createPlugin<\n\tV extends AnySchema,\n\tS extends AnySchema,\n\tTContract extends AnyContractRouter,\n\tTRequestContext extends AnySchema | undefined = undefined,\n\tTDeps extends Context = Record<never, never>\n>(config: {\n\tvariables: V;\n\tsecrets: S;\n\tcontract: TContract;\n\tcontext?: TRequestContext;\n\tinitialize?: (\n\t\tconfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t) => Effect.Effect<TDeps, Error, Scope.Scope>;\n\tcreateRouter: (\n\t\tdeps: TDeps,\n\t\tbuilder: Implementer<TContract, ContextOutput<TRequestContext>, ContextOutput<TRequestContext>>\n\t) => Router<TContract, any>;\n\tshutdown?: (deps: TDeps) => Effect.Effect<void, Error, never>;\n}) {\n\tconst configSchema: PluginConfigFor<V, S, TRequestContext> = {\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\tclass CreatedPlugin implements Plugin<TContract, V, S, TRequestContext, TDeps> {\n\t\t/** set during instantiation - registry key */\n\t\tid!: string;\n\t\treadonly contract = config.contract;\n\t\treadonly configSchema = configSchema;\n\n\t\tprivate _deps: TDeps | null = null;\n\n\t\tinitialize(\n\t\t\tpluginConfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t\t): Effect.Effect<TDeps, unknown, Scope.Scope> {\n\t\t\tconst init = config.initialize ?? (() => Effect.succeed({} as TDeps));\n\n\t\t\treturn init(pluginConfig).pipe(\n\t\t\t\tEffect.tap((deps) => Effect.sync(() => { this._deps = deps; })),\n\t\t\t\tEffect.map(() => this._deps as TDeps),\n\t\t\t\tEffect.mapError((error) => error as unknown)\n\t\t\t);\n\t\t}\n\n\t\tshutdown(): Effect.Effect<void, never> {\n\t\t\tconst self = this;\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tif (config.shutdown && self._deps) {\n\t\t\t\t\tyield* config.shutdown(self._deps).pipe(\n\t\t\t\t\t\tEffect.catchAll(() => Effect.void)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcreateRouter(deps: TDeps): Router<TContract, any> {\n\t\t\tconst base = os\n\t\t\t\t.$context<ContextOutput<TRequestContext>>()\n\t\t\t\t.use(onError((error) => {\n\t\t\t\t\tconst unwrapped = extractFromFiberFailure(error);\n\t\t\t\t\t\n\t\t\t\t\tif (unwrapped !== error && unwrapped instanceof ORPCError) {\n\t\t\t\t\t\tthrow unwrapped;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tformatORPCError(error);\n\t\t\t\t}));\n\t\t\tconst builder = implement(config.contract, base);\n\t\t\tconst router = config.createRouter(deps, builder);\n\t\t\treturn router as Router<TContract, any>;\n\t\t}\n\t}\n\n\tconst PluginConstructor = CreatedPlugin as unknown as {\n\t\tnew(): Plugin<TContract, V, S, TRequestContext, TDeps>;\n\t\tbinding: {\n\t\t\tcontract: TContract;\n\t\t\tvariables: V;\n\t\t\tsecrets: S;\n\t\t\tcontext: TRequestContext;\n\t\t};\n\t};\n\n\tPluginConstructor.binding = {\n\t\tcontract: config.contract,\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\treturn PluginConstructor as LoadedPluginWithBinding<TContract, V, S, TRequestContext, TDeps>;\n}\n"],"mappings":";;;;;;;;;AAsEA,SAAgB,aAMd,QAaC;CACF,MAAMA,eAAuD;EAC5D,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;CAED,MAAM,cAAyE;;EAE9E;EACA,AAAS,WAAW,OAAO;EAC3B,AAAS,eAAe;EAExB,AAAQ,QAAsB;EAE9B,WACC,cAC6C;AAG7C,WAFa,OAAO,qBAAqB,OAAO,QAAQ,EAAE,CAAU,GAExD,aAAa,CAAC,KACzB,OAAO,KAAK,SAAS,OAAO,WAAW;AAAE,SAAK,QAAQ;KAAQ,CAAC,EAC/D,OAAO,UAAU,KAAK,MAAe,EACrC,OAAO,UAAU,UAAU,MAAiB,CAC5C;;EAGF,WAAuC;GACtC,MAAM,OAAO;AACb,UAAO,OAAO,IAAI,aAAa;AAC9B,QAAI,OAAO,YAAY,KAAK,MAC3B,QAAO,OAAO,SAAS,KAAK,MAAM,CAAC,KAClC,OAAO,eAAe,OAAO,KAAK,CAClC;KAED;;EAGH,aAAa,MAAqC;GACjD,MAAM,OAAO,GACX,UAA0C,CAC1C,IAAI,SAAS,UAAU;IACvB,MAAM,YAAY,wBAAwB,MAAM;AAEhD,QAAI,cAAc,SAAS,qBAAqB,UAC/C,OAAM;AAGP,oBAAgB,MAAM;KACrB,CAAC;GACJ,MAAM,UAAU,UAAU,OAAO,UAAU,KAAK;AAEhD,UADe,OAAO,aAAa,MAAM,QAAQ;;;CAKnD,MAAM,oBAAoB;AAU1B,mBAAkB,UAAU;EAC3B,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;AAED,QAAO"}
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { AnyContractRouter, AnySchema, InferSchemaOutput } from \"@orpc/contract\";\nimport type { Context, Implementer, Router } from \"@orpc/server\";\nimport { ORPCError } from \"@orpc/contract\";\nimport { implement, onError, os } from \"@orpc/server\";\nimport { Effect, type Scope } from \"effect\";\nimport { extractFromFiberFailure, formatORPCError } from \"./runtime/errors\";\n\ntype ContextOutput<T> = T extends AnySchema ? InferSchemaOutput<T> : {};\n\n/**\n * Helper type that correctly constructs the config schema type\n */\nexport type PluginConfigFor<V extends AnySchema, S extends AnySchema, TRequestContext extends AnySchema | undefined> = {\n\tvariables: V;\n\tsecrets: S;\n\tcontext: TRequestContext;\n};\n\n/**\n * Loaded plugin with static binding property\n */\nexport interface LoadedPluginWithBinding<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\tnew(): Plugin<TContract, TVariables, TSecrets, TRequestContext, TDeps>;\n\tbinding: {\n\t\tcontract: TContract;\n\t\tvariables: TVariables;\n\t\tsecrets: TSecrets;\n\t\tcontext: TRequestContext;\n\t};\n}\n\n/**\n * Plugin interface\n */\nexport interface Plugin<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\treadonly id: string;\n\treadonly contract: TContract;\n\treadonly configSchema: PluginConfigFor<TVariables, TSecrets, TRequestContext>;\n\n\t// Plugin lifecycle\n\tinitialize(\n\t\tconfig: { variables: InferSchemaOutput<TVariables>; secrets: InferSchemaOutput<TSecrets> }\n\t): Effect.Effect<TDeps, unknown, Scope.Scope>;\n\n\tshutdown(): Effect.Effect<void, never>;\n\n\t/**\n\t * Creates the strongly-typed oRPC router for this plugin.\n\t * The router's procedure types are inferred directly from the contract.\n\t * @param deps The initialized plugin dependencies\n\t * @returns A router with procedures matching the plugin's contract\n\t */\n\tcreateRouter(deps: TDeps): Router<TContract, any>;\n}\n\n/**\n * Factory function to create plugins\n */\nexport function createPlugin<\n\tV extends AnySchema,\n\tS extends AnySchema,\n\tTContract extends AnyContractRouter,\n\tTRequestContext extends AnySchema | undefined = undefined,\n\tTDeps extends Context = Record<never, never>\n>(config: {\n\tvariables: V;\n\tsecrets: S;\n\tcontract: TContract;\n\tcontext?: TRequestContext;\n\tinitialize?: (\n\t\tconfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t) => Effect.Effect<TDeps, Error, Scope.Scope>;\n\tcreateRouter: (\n\t\tdeps: TDeps,\n\t\tbuilder: Implementer<TContract, ContextOutput<TRequestContext>, ContextOutput<TRequestContext>>\n\t) => Router<TContract, any>;\n\tshutdown?: (deps: TDeps) => Effect.Effect<void, Error, never>;\n}) {\n\tconst configSchema: PluginConfigFor<V, S, TRequestContext> = {\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\tclass CreatedPlugin implements Plugin<TContract, V, S, TRequestContext, TDeps> {\n\t\t/** set during instantiation - registry key */\n\t\tid!: string;\n\t\treadonly contract = config.contract;\n\t\treadonly configSchema = configSchema;\n\n\t\tprivate _deps: TDeps | null = null;\n\n\t\tinitialize(\n\t\t\tpluginConfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t\t): Effect.Effect<TDeps, unknown, Scope.Scope> {\n\t\t\tconst init = config.initialize ?? (() => Effect.succeed({} as TDeps));\n\n\t\t\treturn init(pluginConfig).pipe(\n\t\t\t\tEffect.tap((deps) => Effect.sync(() => { this._deps = deps; })),\n\t\t\t\tEffect.map(() => this._deps as TDeps),\n\t\t\t\tEffect.mapError((error) => error as unknown)\n\t\t\t);\n\t\t}\n\n\t\tshutdown(): Effect.Effect<void, never> {\n\t\t\tconst self = this;\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tif (config.shutdown && self._deps) {\n\t\t\t\t\tyield* config.shutdown(self._deps).pipe(\n\t\t\t\t\t\tEffect.catchAll(() => Effect.void)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcreateRouter(deps: TDeps): Router<TContract, any> {\n\t\t\tconst base = os\n\t\t\t\t.$context<ContextOutput<TRequestContext>>()\n\t\t\t\t.use(onError((error) => {\n\t\t\t\t\tconst unwrapped = extractFromFiberFailure(error);\n\t\t\t\t\t\n\t\t\t\t\tif (unwrapped !== error && unwrapped instanceof ORPCError) {\n\t\t\t\t\t\tthrow unwrapped;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tformatORPCError(error);\n\t\t\t\t}));\n\t\t\tconst builder = implement(config.contract, base);\n\t\t\tconst router = config.createRouter(deps, builder);\n\t\t\treturn router as Router<TContract, any>;\n\t\t}\n\t}\n\n\tconst PluginConstructor = CreatedPlugin as unknown as {\n\t\tnew(): Plugin<TContract, V, S, TRequestContext, TDeps>;\n\t\tbinding: {\n\t\t\tcontract: TContract;\n\t\t\tvariables: V;\n\t\t\tsecrets: S;\n\t\t\tcontext: TRequestContext;\n\t\t};\n\t};\n\n\tPluginConstructor.binding = {\n\t\tcontract: config.contract,\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\treturn PluginConstructor as LoadedPluginWithBinding<TContract, V, S, TRequestContext, TDeps>;\n}\n"],"mappings":";;;;;;;;;AAsEA,SAAgB,aAMd,QAaC;CACF,MAAM,eAAuD;EAC5D,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;CAED,MAAM,cAAyE;;EAE9E;EACA,AAAS,WAAW,OAAO;EAC3B,AAAS,eAAe;EAExB,AAAQ,QAAsB;EAE9B,WACC,cAC6C;AAG7C,WAFa,OAAO,qBAAqB,OAAO,QAAQ,EAAE,CAAU,GAExD,aAAa,CAAC,KACzB,OAAO,KAAK,SAAS,OAAO,WAAW;AAAE,SAAK,QAAQ;KAAQ,CAAC,EAC/D,OAAO,UAAU,KAAK,MAAe,EACrC,OAAO,UAAU,UAAU,MAAiB,CAC5C;;EAGF,WAAuC;GACtC,MAAM,OAAO;AACb,UAAO,OAAO,IAAI,aAAa;AAC9B,QAAI,OAAO,YAAY,KAAK,MAC3B,QAAO,OAAO,SAAS,KAAK,MAAM,CAAC,KAClC,OAAO,eAAe,OAAO,KAAK,CAClC;KAED;;EAGH,aAAa,MAAqC;GACjD,MAAM,OAAO,GACX,UAA0C,CAC1C,IAAI,SAAS,UAAU;IACvB,MAAM,YAAY,wBAAwB,MAAM;AAEhD,QAAI,cAAc,SAAS,qBAAqB,UAC/C,OAAM;AAGP,oBAAgB,MAAM;KACrB,CAAC;GACJ,MAAM,UAAU,UAAU,OAAO,UAAU,KAAK;AAEhD,UADe,OAAO,aAAa,MAAM,QAAQ;;;CAKnD,MAAM,oBAAoB;AAU1B,mBAAkB,UAAU;EAC3B,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;AAED,QAAO"}
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let __orpc_contract = require("@orpc/contract");
2
+ let _orpc_contract = require("@orpc/contract");
3
3
  let effect = require("effect");
4
4
 
5
5
  //#region src/runtime/errors.ts
@@ -61,7 +61,7 @@ const formatORPCValidationError = (error) => {
61
61
  return lines;
62
62
  };
63
63
  const formatORPCError = (error) => {
64
- if (!(error instanceof __orpc_contract.ORPCError)) return;
64
+ if (!(error instanceof _orpc_contract.ORPCError)) return;
65
65
  const validationLines = formatORPCValidationError(error);
66
66
  if (validationLines) {
67
67
  console.error(validationLines.join("\n"));
@@ -177,15 +177,15 @@ const extractFromFiberFailure = (error) => {
177
177
  const cause = error.cause;
178
178
  if (cause && typeof cause === "object" && "_tag" in cause) try {
179
179
  const squashed = effect.Cause.squash(cause);
180
- if (squashed instanceof __orpc_contract.ORPCError) return squashed;
180
+ if (squashed instanceof _orpc_contract.ORPCError) return squashed;
181
181
  return squashed;
182
182
  } catch {}
183
- if (cause instanceof __orpc_contract.ORPCError) return cause;
183
+ if (cause instanceof _orpc_contract.ORPCError) return cause;
184
184
  }
185
185
  return error;
186
186
  };
187
187
  const toPluginRuntimeError = (error, pluginId, procedureName, operation, defaultRetryable = false) => {
188
- if (error instanceof __orpc_contract.ORPCError) return wrapORPCError(error, pluginId, procedureName, operation);
188
+ if (error instanceof _orpc_contract.ORPCError) return wrapORPCError(error, pluginId, procedureName, operation);
189
189
  if (error instanceof PluginRuntimeError) return error;
190
190
  const validationLines = formatORPCValidationError(error);
191
191
  if (validationLines) console.error(validationLines.join("\n"));
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","names":["Data","lines: string[]","ORPCError","Cause"],"sources":["../../src/runtime/errors.ts"],"sourcesContent":["import { ORPCError } from \"@orpc/contract\";\nimport { Cause, Data } from \"effect\";\nimport type { z } from \"zod\";\n\nexport class PluginRuntimeError extends Data.TaggedError(\"PluginRuntimeError\")<{\n\treadonly pluginId?: string;\n\treadonly operation?: string;\n\treadonly procedureName?: string;\n\treadonly cause?: Error;\n\treadonly retryable: boolean;\n}> { }\n\nexport class ModuleFederationError extends Data.TaggedError(\n\t\"ModuleFederationError\",\n)<{\n\treadonly pluginId: string;\n\treadonly remoteUrl: string;\n\treadonly cause?: Error;\n}> { }\n\nexport class ValidationError extends Data.TaggedError(\"ValidationError\")<{\n\treadonly pluginId: string;\n\treadonly stage: \"config\" | \"input\" | \"output\" | \"state\";\n\treadonly zodError: z.ZodError;\n}> { }\n\nconst extractErrorMessage = (error: unknown): string => {\n\tif (!error) return 'Unknown error';\n\n\tif (error instanceof Error) {\n\t\tif (error.message) return error.message;\n\t\tif ((error as any).cause instanceof Error) {\n\t\t\treturn extractErrorMessage((error as any).cause);\n\t\t}\n\t}\n\n\tif (error instanceof AggregateError && error.errors?.length) {\n\t\treturn error.errors.map(e => extractErrorMessage(e)).join('; ');\n\t}\n\n\tif (typeof error === 'object' && 'message' in error) {\n\t\treturn String((error as any).message);\n\t}\n\n\treturn String(error);\n};\n\nconst formatValidationIssue = (issue: any, index: number, maxDisplay: number): string => {\n\tif (index >= maxDisplay) return '';\n\t\n\tconst path = Array.isArray(issue.path) && issue.path.length > 0\n\t\t? issue.path.join('.')\n\t\t: issue.path || 'root';\n\t\n\tconst message = issue.message || 'Validation failed';\n\t\n\treturn `│ ${index + 1}. ${path}: ${message}`;\n};\n\nconst formatDataPreview = (data: unknown, maxLength = 100): string => {\n\tif (!data) return 'undefined';\n\t\n\ttry {\n\t\tconst str = JSON.stringify(data);\n\t\tif (str.length <= maxLength) return str;\n\t\t\n\t\tif (typeof data === 'object' && data !== null) {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\treturn `Array(${data.length}) [...]`;\n\t\t\t}\n\t\t\tconst keys = Object.keys(data);\n\t\t\treturn `{ ${keys.slice(0, 3).join(', ')}${keys.length > 3 ? ', ...' : ''} }`;\n\t\t}\n\t\t\n\t\treturn str.slice(0, maxLength) + '...';\n\t} catch {\n\t\treturn String(data).slice(0, maxLength);\n\t}\n};\n\nconst formatORPCValidationError = (error: any): string[] | null => {\n\tconst cause = error?.cause || error;\n\t\n\tif (!cause?.issues || !Array.isArray(cause.issues) || cause.issues.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst lines: string[] = [];\n\tconst errorType = error?.message || cause?.message || 'Validation failed';\n\t\n\tlines.push(`\\n╭─ oRPC Validation Error ${'─'.repeat(30)}`);\n\tlines.push(`│ ${errorType}`);\n\tlines.push(`│`);\n\t\n\tconst maxDisplay = 10;\n\tconst totalIssues = cause.issues.length;\n\t\n\tlines.push(`│ Issues (${totalIssues}):`);\n\t\n\tconst displayedIssues = cause.issues.slice(0, maxDisplay);\n\tdisplayedIssues.forEach((issue: any, idx: number) => {\n\t\tconst formatted = formatValidationIssue(issue, idx, maxDisplay);\n\t\tif (formatted) lines.push(formatted);\n\t});\n\t\n\tif (totalIssues > maxDisplay) {\n\t\tlines.push(`│ ... and ${totalIssues - maxDisplay} more`);\n\t}\n\t\n\tif (cause.data !== undefined) {\n\t\tlines.push(`│`);\n\t\tlines.push(`│ Data preview: ${formatDataPreview(cause.data, 80)}`);\n\t}\n\t\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\t\n\treturn lines;\n};\n\nexport const formatORPCError = (error: any): void => {\n\tif (!(error instanceof ORPCError)) {\n\t\treturn;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t\treturn;\n\t}\n\n\tconst lines: string[] = [];\n\tconst code = error.code || 'UNKNOWN';\n\tconst status = error.status || 500;\n\tconst message = error.message || 'An error occurred';\n\n\tlines.push(`\\n╭─ oRPC Error ${'─'.repeat(40)}`);\n\tlines.push(`│ ${message}`);\n\tlines.push(`│ Code: ${code} (${status})`);\n\tlines.push(`│`);\n\n\tif (error.data) {\n\t\tconst dataType = typeof error.data;\n\t\tif (dataType === 'object' && error.data !== null) {\n\t\t\tif ('retryAfter' in error.data) {\n\t\t\t\tlines.push(`│ Retry after: ${error.data.retryAfter} seconds`);\n\t\t\t}\n\t\t\tif ('remainingRequests' in error.data) {\n\t\t\t\tlines.push(`│ Remaining: ${error.data.remainingRequests} requests`);\n\t\t\t}\n\t\t\tif ('host' in error.data) {\n\t\t\t\tlines.push(`│ Host: ${error.data.host}`);\n\t\t\t}\n\t\t\tif ('port' in error.data) {\n\t\t\t\tlines.push(`│ Port: ${error.data.port}`);\n\t\t\t}\n\t\t\tif ('suggestion' in error.data) {\n\t\t\t\tlines.push(`│ → ${error.data.suggestion}`);\n\t\t\t}\n\t\t\tif ('resource' in error.data) {\n\t\t\t\tlines.push(`│ Resource: ${error.data.resource}`);\n\t\t\t}\n\t\t\tif ('resourceId' in error.data) {\n\t\t\t\tlines.push(`│ ID: ${error.data.resourceId}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch (code) {\n\t\tcase 'UNAUTHORIZED':\n\t\t\tlines.push(`│ → Check your API key or credentials`);\n\t\t\tbreak;\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\t\tlines.push(`│ → Wait before retrying`);\n\t\t\tbreak;\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\t\tlines.push(`│ → The service may be temporarily unavailable`);\n\t\t\tbreak;\n\t\tcase 'TIMEOUT':\n\t\t\tlines.push(`│ → The operation took too long`);\n\t\t\tbreak;\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\tconsole.error(lines.join('\\n'));\n};\n\nconst formatPluginError = (\n\tpluginId: string | undefined,\n\toperation: string | undefined,\n\tmessage: string\n): void => {\n\tconst lines: string[] = [];\n\n\tlines.push(`\\n╭─ Plugin Error ${'─'.repeat(40)}`);\n\tif (pluginId) lines.push(`│ Plugin: ${pluginId}`);\n\tif (operation) lines.push(`│ During: ${operation}`);\n\tlines.push(`│`);\n\n\tif (message.includes('ECONNREFUSED')) {\n\t\tlines.push(`│ ❌ Connection refused`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ A required service is not running.`);\n\t\tlines.push(`│ → Run: docker compose up -d`);\n\t} else if (message.includes('ENOTFOUND')) {\n\t\tlines.push(`│ ❌ Host not found`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your connection URL or network settings.`);\n\t} else if (message.includes('ETIMEDOUT') || message.includes('timeout')) {\n\t\tlines.push(`│ ❌ Connection timeout`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ The service took too long to respond.`);\n\t} else if (message.includes('EACCES') || message.includes('permission')) {\n\t\tlines.push(`│ ❌ Permission denied`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check credentials or access permissions.`);\n\t} else if (message.includes('401') || message.includes('unauthorized')) {\n\t\tlines.push(`│ ❌ Authentication failed`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your API key or credentials.`);\n\t} else {\n\t\tlines.push(`│ ❌ ${message}`);\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\n\tconsole.error(lines.join('\\n'));\n};\n\nconst isRetryableError = (message: string): boolean => {\n\tconst retryablePatterns = ['ETIMEDOUT', 'ECONNRESET', 'timeout', '503', '429'];\n\treturn retryablePatterns.some(p => message.toLowerCase().includes(p.toLowerCase()));\n};\n\n// Helper to determine if an oRPC error code is retryable\nexport const isRetryableORPCCode = (code: string): boolean => {\n\tswitch (code) {\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\tcase 'TIMEOUT':\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n};\n\n// Convert ORPC errors from plugin procedures to PluginRuntimeError\nexport const wrapORPCError = (\n\torpcError: ORPCError<string, unknown>,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string\n): PluginRuntimeError => {\n\tconst validationLines = formatORPCValidationError(orpcError);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t}\n\t\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: isRetryableORPCCode(orpcError.code),\n\t\tcause: orpcError as Error\n\t});\n};\n\n/**\n * Extracts the underlying error from Effect's FiberFailure wrapper.\n * When Effect.runPromise rejects, errors are wrapped in FiberFailure.\n * This extracts the original error so oRPC can handle it properly.\n */\nexport const extractFromFiberFailure = (error: unknown): unknown => {\n\tif (!error || typeof error !== 'object') return error;\n\t\n\tif ('cause' in error) {\n\t\tconst cause = (error as { cause?: unknown }).cause;\n\t\t\n\t\tif (cause && typeof cause === 'object' && '_tag' in cause) {\n\t\t\ttry {\n\t\t\t\tconst squashed = Cause.squash(cause as Cause.Cause<unknown>);\n\t\t\t\tif (squashed instanceof ORPCError) {\n\t\t\t\t\treturn squashed;\n\t\t\t\t}\n\t\t\t\treturn squashed;\n\t\t\t} catch {\n\t\t\t\t// Not a valid Cause\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (cause instanceof ORPCError) {\n\t\t\treturn cause;\n\t\t}\n\t}\n\t\n\treturn error;\n};\n\n// Universal error converter for the runtime\nexport const toPluginRuntimeError = (\n\terror: unknown,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string,\n\tdefaultRetryable = false\n): PluginRuntimeError => {\n\tif (error instanceof ORPCError) {\n\t\treturn wrapORPCError(error, pluginId, procedureName, operation);\n\t}\n\n\tif (error instanceof PluginRuntimeError) {\n\t\treturn error;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t} else {\n\t\tconst message = extractErrorMessage(error);\n\t\tformatPluginError(pluginId, operation, message);\n\t}\n\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: defaultRetryable || isRetryableError(extractErrorMessage(error)),\n\t\tcause: error instanceof Error ? error : new Error(extractErrorMessage(error))\n\t});\n};\n"],"mappings":";;;;;AAIA,IAAa,qBAAb,cAAwCA,YAAK,YAAY,qBAAqB,CAM3E;AAEH,IAAa,wBAAb,cAA2CA,YAAK,YAC/C,wBACA,CAIE;AAEH,IAAa,kBAAb,cAAqCA,YAAK,YAAY,kBAAkB,CAIrE;AAEH,MAAM,uBAAuB,UAA2B;AACvD,KAAI,CAAC,MAAO,QAAO;AAEnB,KAAI,iBAAiB,OAAO;AAC3B,MAAI,MAAM,QAAS,QAAO,MAAM;AAChC,MAAK,MAAc,iBAAiB,MACnC,QAAO,oBAAqB,MAAc,MAAM;;AAIlD,KAAI,iBAAiB,kBAAkB,MAAM,QAAQ,OACpD,QAAO,MAAM,OAAO,KAAI,MAAK,oBAAoB,EAAE,CAAC,CAAC,KAAK,KAAK;AAGhE,KAAI,OAAO,UAAU,YAAY,aAAa,MAC7C,QAAO,OAAQ,MAAc,QAAQ;AAGtC,QAAO,OAAO,MAAM;;AAGrB,MAAM,yBAAyB,OAAY,OAAe,eAA+B;AACxF,KAAI,SAAS,WAAY,QAAO;CAEhC,MAAM,OAAO,MAAM,QAAQ,MAAM,KAAK,IAAI,MAAM,KAAK,SAAS,IAC3D,MAAM,KAAK,KAAK,IAAI,GACpB,MAAM,QAAQ;CAEjB,MAAM,UAAU,MAAM,WAAW;AAEjC,QAAO,QAAQ,QAAQ,EAAE,IAAI,KAAK,IAAI;;AAGvC,MAAM,qBAAqB,MAAe,YAAY,QAAgB;AACrE,KAAI,CAAC,KAAM,QAAO;AAElB,KAAI;EACH,MAAM,MAAM,KAAK,UAAU,KAAK;AAChC,MAAI,IAAI,UAAU,UAAW,QAAO;AAEpC,MAAI,OAAO,SAAS,YAAY,SAAS,MAAM;AAC9C,OAAI,MAAM,QAAQ,KAAK,CACtB,QAAO,SAAS,KAAK,OAAO;GAE7B,MAAM,OAAO,O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eACA,cACwB;CACxB,MAAM,kBAAkB,0BAA0B,UAAU;AAC5D,KAAI,gBACH,SAAQ,MAAM,gBAAgB,KAAK,KAAK,CAAC;AAG1C,QAAO,IAAI,mBAAmB;EAC7B;EACA;EACA;EACA,WAAW,oBAAoB,UAAU,KAAK;EAC9C,OAAO;EACP,CAAC;;;;;;;AAQH,MAAa,2BAA2B,UAA4B;AACnE,KAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAEhD,KAAI,WAAW,OAAO;EACrB,MAAM,QAAS,MAA8B;AAE7C,MAAI,SAAS,OAAO,UAAU,YAAY,UAAU,MACnD,KAAI;GACH,MAAM,WAAWE,aAAM,OAAO,MAA8B;AAC5D,OAAI,oBAAoBD,0BACvB,QAAO;AAER,UAAO;UACA;AAKT,MAAI,iBAAiBA,0BACpB,QAAO;;AAIT,QAAO;;AAIR,MAAa,wBACZ,OACA,UACA,eACA,WACA,mBAAmB,UACK;AACxB,KAAI,iBAAiBA,0BACpB,QAAO,cAAc,OAAO,UAAU,eAAe,UAAU;AAGhE,KAAI,iBAAiB,mBACpB,QAAO;CAGR,MAAM,kBAAkB,0BAA0B,MAAM;AACxD,KAAI,gBACH,SAAQ,MAAM,gBAAgB,KAAK,KAAK,CAAC;KAGzC,mBAAkB,UAAU,WADZ,oBAAoB,MAAM,CACK;AAGhD,QAAO,IAAI,mBAAmB;EAC7B;EACA;EACA;EACA,WAAW,oBAAoB,iBAAiB,oBAAoB,MAAM,CAAC;EAC3E,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,oBAAoB,MAAM,CAAC;EAC7E,CAAC"}
1
+ {"version":3,"file":"errors.cjs","names":["Data","ORPCError","Cause"],"sources":["../../src/runtime/errors.ts"],"sourcesContent":["import { ORPCError } from \"@orpc/contract\";\nimport { Cause, Data } from \"effect\";\nimport type { z } from \"zod\";\n\nexport class PluginRuntimeError extends Data.TaggedError(\"PluginRuntimeError\")<{\n\treadonly pluginId?: string;\n\treadonly operation?: string;\n\treadonly procedureName?: string;\n\treadonly cause?: Error;\n\treadonly retryable: boolean;\n}> { }\n\nexport class ModuleFederationError extends Data.TaggedError(\n\t\"ModuleFederationError\",\n)<{\n\treadonly pluginId: string;\n\treadonly remoteUrl: string;\n\treadonly cause?: Error;\n}> { }\n\nexport class ValidationError extends Data.TaggedError(\"ValidationError\")<{\n\treadonly pluginId: string;\n\treadonly stage: \"config\" | \"input\" | \"output\" | \"state\";\n\treadonly zodError: z.ZodError;\n}> { }\n\nconst extractErrorMessage = (error: unknown): string => {\n\tif (!error) return 'Unknown error';\n\n\tif (error instanceof Error) {\n\t\tif (error.message) return error.message;\n\t\tif ((error as any).cause instanceof Error) {\n\t\t\treturn extractErrorMessage((error as any).cause);\n\t\t}\n\t}\n\n\tif (error instanceof AggregateError && error.errors?.length) {\n\t\treturn error.errors.map(e => extractErrorMessage(e)).join('; ');\n\t}\n\n\tif (typeof error === 'object' && 'message' in error) {\n\t\treturn String((error as any).message);\n\t}\n\n\treturn String(error);\n};\n\nconst formatValidationIssue = (issue: any, index: number, maxDisplay: number): string => {\n\tif (index >= maxDisplay) return '';\n\t\n\tconst path = Array.isArray(issue.path) && issue.path.length > 0\n\t\t? issue.path.join('.')\n\t\t: issue.path || 'root';\n\t\n\tconst message = issue.message || 'Validation failed';\n\t\n\treturn `│ ${index + 1}. ${path}: ${message}`;\n};\n\nconst formatDataPreview = (data: unknown, maxLength = 100): string => {\n\tif (!data) return 'undefined';\n\t\n\ttry {\n\t\tconst str = JSON.stringify(data);\n\t\tif (str.length <= maxLength) return str;\n\t\t\n\t\tif (typeof data === 'object' && data !== null) {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\treturn `Array(${data.length}) [...]`;\n\t\t\t}\n\t\t\tconst keys = Object.keys(data);\n\t\t\treturn `{ ${keys.slice(0, 3).join(', ')}${keys.length > 3 ? ', ...' : ''} }`;\n\t\t}\n\t\t\n\t\treturn str.slice(0, maxLength) + '...';\n\t} catch {\n\t\treturn String(data).slice(0, maxLength);\n\t}\n};\n\nconst formatORPCValidationError = (error: any): string[] | null => {\n\tconst cause = error?.cause || error;\n\t\n\tif (!cause?.issues || !Array.isArray(cause.issues) || cause.issues.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst lines: string[] = [];\n\tconst errorType = error?.message || cause?.message || 'Validation failed';\n\t\n\tlines.push(`\\n╭─ oRPC Validation Error ${'─'.repeat(30)}`);\n\tlines.push(`│ ${errorType}`);\n\tlines.push(`│`);\n\t\n\tconst maxDisplay = 10;\n\tconst totalIssues = cause.issues.length;\n\t\n\tlines.push(`│ Issues (${totalIssues}):`);\n\t\n\tconst displayedIssues = cause.issues.slice(0, maxDisplay);\n\tdisplayedIssues.forEach((issue: any, idx: number) => {\n\t\tconst formatted = formatValidationIssue(issue, idx, maxDisplay);\n\t\tif (formatted) lines.push(formatted);\n\t});\n\t\n\tif (totalIssues > maxDisplay) {\n\t\tlines.push(`│ ... and ${totalIssues - maxDisplay} more`);\n\t}\n\t\n\tif (cause.data !== undefined) {\n\t\tlines.push(`│`);\n\t\tlines.push(`│ Data preview: ${formatDataPreview(cause.data, 80)}`);\n\t}\n\t\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\t\n\treturn lines;\n};\n\nexport const formatORPCError = (error: any): void => {\n\tif (!(error instanceof ORPCError)) {\n\t\treturn;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t\treturn;\n\t}\n\n\tconst lines: string[] = [];\n\tconst code = error.code || 'UNKNOWN';\n\tconst status = error.status || 500;\n\tconst message = error.message || 'An error occurred';\n\n\tlines.push(`\\n╭─ oRPC Error ${'─'.repeat(40)}`);\n\tlines.push(`│ ${message}`);\n\tlines.push(`│ Code: ${code} (${status})`);\n\tlines.push(`│`);\n\n\tif (error.data) {\n\t\tconst dataType = typeof error.data;\n\t\tif (dataType === 'object' && error.data !== null) {\n\t\t\tif ('retryAfter' in error.data) {\n\t\t\t\tlines.push(`│ Retry after: ${error.data.retryAfter} seconds`);\n\t\t\t}\n\t\t\tif ('remainingRequests' in error.data) {\n\t\t\t\tlines.push(`│ Remaining: ${error.data.remainingRequests} requests`);\n\t\t\t}\n\t\t\tif ('host' in error.data) {\n\t\t\t\tlines.push(`│ Host: ${error.data.host}`);\n\t\t\t}\n\t\t\tif ('port' in error.data) {\n\t\t\t\tlines.push(`│ Port: ${error.data.port}`);\n\t\t\t}\n\t\t\tif ('suggestion' in error.data) {\n\t\t\t\tlines.push(`│ → ${error.data.suggestion}`);\n\t\t\t}\n\t\t\tif ('resource' in error.data) {\n\t\t\t\tlines.push(`│ Resource: ${error.data.resource}`);\n\t\t\t}\n\t\t\tif ('resourceId' in error.data) {\n\t\t\t\tlines.push(`│ ID: ${error.data.resourceId}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch (code) {\n\t\tcase 'UNAUTHORIZED':\n\t\t\tlines.push(`│ → Check your API key or credentials`);\n\t\t\tbreak;\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\t\tlines.push(`│ → Wait before retrying`);\n\t\t\tbreak;\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\t\tlines.push(`│ → The service may be temporarily unavailable`);\n\t\t\tbreak;\n\t\tcase 'TIMEOUT':\n\t\t\tlines.push(`│ → The operation took too long`);\n\t\t\tbreak;\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\tconsole.error(lines.join('\\n'));\n};\n\nconst formatPluginError = (\n\tpluginId: string | undefined,\n\toperation: string | undefined,\n\tmessage: string\n): void => {\n\tconst lines: string[] = [];\n\n\tlines.push(`\\n╭─ Plugin Error ${'─'.repeat(40)}`);\n\tif (pluginId) lines.push(`│ Plugin: ${pluginId}`);\n\tif (operation) lines.push(`│ During: ${operation}`);\n\tlines.push(`│`);\n\n\tif (message.includes('ECONNREFUSED')) {\n\t\tlines.push(`│ ❌ Connection refused`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ A required service is not running.`);\n\t\tlines.push(`│ → Run: docker compose up -d`);\n\t} else if (message.includes('ENOTFOUND')) {\n\t\tlines.push(`│ ❌ Host not found`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your connection URL or network settings.`);\n\t} else if (message.includes('ETIMEDOUT') || message.includes('timeout')) {\n\t\tlines.push(`│ ❌ Connection timeout`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ The service took too long to respond.`);\n\t} else if (message.includes('EACCES') || message.includes('permission')) {\n\t\tlines.push(`│ ❌ Permission denied`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check credentials or access permissions.`);\n\t} else if (message.includes('401') || message.includes('unauthorized')) {\n\t\tlines.push(`│ ❌ Authentication failed`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your API key or credentials.`);\n\t} else {\n\t\tlines.push(`│ ❌ ${message}`);\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\n\tconsole.error(lines.join('\\n'));\n};\n\nconst isRetryableError = (message: string): boolean => {\n\tconst retryablePatterns = ['ETIMEDOUT', 'ECONNRESET', 'timeout', '503', '429'];\n\treturn retryablePatterns.some(p => message.toLowerCase().includes(p.toLowerCase()));\n};\n\n// Helper to determine if an oRPC error code is retryable\nexport const isRetryableORPCCode = (code: string): boolean => {\n\tswitch (code) {\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\tcase 'TIMEOUT':\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n};\n\n// Convert ORPC errors from plugin procedures to PluginRuntimeError\nexport const wrapORPCError = (\n\torpcError: ORPCError<string, unknown>,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string\n): PluginRuntimeError => {\n\tconst validationLines = formatORPCValidationError(orpcError);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t}\n\t\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: isRetryableORPCCode(orpcError.code),\n\t\tcause: orpcError as Error\n\t});\n};\n\n/**\n * Extracts the underlying error from Effect's FiberFailure wrapper.\n * When Effect.runPromise rejects, errors are wrapped in FiberFailure.\n * This extracts the original error so oRPC can handle it properly.\n */\nexport const extractFromFiberFailure = (error: unknown): unknown => {\n\tif (!error || typeof error !== 'object') return error;\n\t\n\tif ('cause' in error) {\n\t\tconst cause = (error as { cause?: unknown }).cause;\n\t\t\n\t\tif (cause && typeof cause === 'object' && '_tag' in cause) {\n\t\t\ttry {\n\t\t\t\tconst squashed = Cause.squash(cause as Cause.Cause<unknown>);\n\t\t\t\tif (squashed instanceof ORPCError) {\n\t\t\t\t\treturn squashed;\n\t\t\t\t}\n\t\t\t\treturn squashed;\n\t\t\t} catch {\n\t\t\t\t// Not a valid Cause\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (cause instanceof ORPCError) {\n\t\t\treturn cause;\n\t\t}\n\t}\n\t\n\treturn error;\n};\n\n// Universal error converter for the runtime\nexport const toPluginRuntimeError = (\n\terror: unknown,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string,\n\tdefaultRetryable = false\n): PluginRuntimeError => {\n\tif (error instanceof ORPCError) {\n\t\treturn wrapORPCError(error, pluginId, procedureName, operation);\n\t}\n\n\tif (error instanceof PluginRuntimeError) {\n\t\treturn error;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t} else {\n\t\tconst message = extractErrorMessage(error);\n\t\tformatPluginError(pluginId, operation, message);\n\t}\n\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: defaultRetryable || isRetryableError(extractErrorMessage(error)),\n\t\tcause: error instanceof Error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