@danielfgray/pg-sourcerer 0.2.2 → 0.4.0

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 (307) hide show
  1. package/bin/pgsourcerer +2 -0
  2. package/dist/__tests__/fixtures/index.d.ts +15 -0
  3. package/dist/__tests__/fixtures/index.d.ts.map +1 -0
  4. package/dist/__tests__/fixtures/index.js +19 -0
  5. package/dist/__tests__/fixtures/index.js.map +1 -0
  6. package/dist/__tests__/fixtures/introspection.json +40522 -0
  7. package/dist/cli.d.ts +0 -1
  8. package/dist/cli.js +7 -46
  9. package/dist/cli.js.map +1 -1
  10. package/dist/config.d.ts +38 -5
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js +13 -2
  13. package/dist/config.js.map +1 -1
  14. package/dist/{lib/conjure.d.ts → conjure/index.d.ts} +62 -3
  15. package/dist/conjure/index.d.ts.map +1 -0
  16. package/dist/{lib/conjure.js → conjure/index.js} +124 -3
  17. package/dist/conjure/index.js.map +1 -0
  18. package/dist/conjure/signature.d.ts +85 -0
  19. package/dist/conjure/signature.d.ts.map +1 -0
  20. package/dist/conjure/signature.js +130 -0
  21. package/dist/conjure/signature.js.map +1 -0
  22. package/dist/conjure/types.d.ts +97 -0
  23. package/dist/conjure/types.d.ts.map +1 -0
  24. package/dist/conjure/types.js +206 -0
  25. package/dist/conjure/types.js.map +1 -0
  26. package/dist/errors.d.ts +114 -139
  27. package/dist/errors.d.ts.map +1 -1
  28. package/dist/errors.js +82 -36
  29. package/dist/errors.js.map +1 -1
  30. package/dist/generate.d.ts +45 -46
  31. package/dist/generate.d.ts.map +1 -1
  32. package/dist/generate.js +86 -59
  33. package/dist/generate.js.map +1 -1
  34. package/dist/hex/builder.d.ts +12 -0
  35. package/dist/hex/builder.d.ts.map +1 -0
  36. package/dist/hex/builder.js +64 -0
  37. package/dist/hex/builder.js.map +1 -0
  38. package/dist/hex/ddl.d.ts +53 -0
  39. package/dist/hex/ddl.d.ts.map +1 -0
  40. package/dist/hex/ddl.js +306 -0
  41. package/dist/hex/ddl.js.map +1 -0
  42. package/dist/hex/index.d.ts +105 -0
  43. package/dist/hex/index.d.ts.map +1 -0
  44. package/dist/hex/index.js +81 -0
  45. package/dist/hex/index.js.map +1 -0
  46. package/dist/hex/primitives.d.ts +23 -0
  47. package/dist/hex/primitives.d.ts.map +1 -0
  48. package/dist/hex/primitives.js +38 -0
  49. package/dist/hex/primitives.js.map +1 -0
  50. package/dist/hex/query.d.ts +116 -0
  51. package/dist/hex/query.d.ts.map +1 -0
  52. package/dist/hex/query.js +219 -0
  53. package/dist/hex/query.js.map +1 -0
  54. package/dist/hex/types.d.ts +287 -0
  55. package/dist/hex/types.d.ts.map +1 -0
  56. package/dist/hex/types.js +431 -0
  57. package/dist/hex/types.js.map +1 -0
  58. package/dist/index.d.ts +17 -25
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +33 -44
  61. package/dist/index.js.map +1 -1
  62. package/dist/init.d.ts.map +1 -1
  63. package/dist/init.js +76 -140
  64. package/dist/init.js.map +1 -1
  65. package/dist/ir/extensions/queries.d.ts +6 -6
  66. package/dist/ir/extensions/queries.d.ts.map +1 -1
  67. package/dist/ir/extensions/queries.js +6 -4
  68. package/dist/ir/extensions/queries.js.map +1 -1
  69. package/dist/ir/extensions/schema-builder.d.ts.map +1 -1
  70. package/dist/ir/extensions/schema-builder.js.map +1 -1
  71. package/dist/ir/index.d.ts.map +1 -1
  72. package/dist/ir/index.js.map +1 -1
  73. package/dist/ir/relation-graph.d.ts.map +1 -1
  74. package/dist/ir/relation-graph.js +8 -8
  75. package/dist/ir/relation-graph.js.map +1 -1
  76. package/dist/ir/semantic-ir.d.ts +38 -0
  77. package/dist/ir/semantic-ir.d.ts.map +1 -1
  78. package/dist/ir/semantic-ir.js +50 -2
  79. package/dist/ir/semantic-ir.js.map +1 -1
  80. package/dist/ir/smart-tags.d.ts.map +1 -1
  81. package/dist/ir/smart-tags.js.map +1 -1
  82. package/dist/lib/field-utils.d.ts.map +1 -1
  83. package/dist/lib/field-utils.js +7 -7
  84. package/dist/lib/field-utils.js.map +1 -1
  85. package/dist/lib/join-graph.d.ts +95 -0
  86. package/dist/lib/join-graph.d.ts.map +1 -0
  87. package/dist/lib/join-graph.js +305 -0
  88. package/dist/lib/join-graph.js.map +1 -0
  89. package/dist/lib/picker.d.ts +60 -0
  90. package/dist/lib/picker.d.ts.map +1 -0
  91. package/dist/lib/picker.js +325 -0
  92. package/dist/lib/picker.js.map +1 -0
  93. package/dist/plugins/arktype.d.ts +20 -24
  94. package/dist/plugins/arktype.d.ts.map +1 -1
  95. package/dist/plugins/arktype.js +462 -386
  96. package/dist/plugins/arktype.js.map +1 -1
  97. package/dist/plugins/effect/http.d.ts +7 -0
  98. package/dist/plugins/effect/http.d.ts.map +1 -0
  99. package/dist/plugins/effect/http.js +460 -0
  100. package/dist/plugins/effect/http.js.map +1 -0
  101. package/dist/plugins/effect/index.d.ts +22 -0
  102. package/dist/plugins/effect/index.d.ts.map +1 -0
  103. package/dist/plugins/effect/index.js +65 -0
  104. package/dist/plugins/effect/index.js.map +1 -0
  105. package/dist/plugins/effect/models.d.ts +6 -0
  106. package/dist/plugins/effect/models.d.ts.map +1 -0
  107. package/dist/plugins/effect/models.js +116 -0
  108. package/dist/plugins/effect/models.js.map +1 -0
  109. package/dist/plugins/effect/repos.d.ts +21 -0
  110. package/dist/plugins/effect/repos.d.ts.map +1 -0
  111. package/dist/plugins/effect/repos.js +131 -0
  112. package/dist/plugins/effect/repos.js.map +1 -0
  113. package/dist/plugins/effect/schemas.d.ts +7 -0
  114. package/dist/plugins/effect/schemas.d.ts.map +1 -0
  115. package/dist/plugins/effect/schemas.js +75 -0
  116. package/dist/plugins/effect/schemas.js.map +1 -0
  117. package/dist/plugins/effect/shared.d.ts +116 -0
  118. package/dist/plugins/effect/shared.d.ts.map +1 -0
  119. package/dist/plugins/effect/shared.js +164 -0
  120. package/dist/plugins/effect/shared.js.map +1 -0
  121. package/dist/plugins/http-elysia.d.ts +20 -27
  122. package/dist/plugins/http-elysia.d.ts.map +1 -1
  123. package/dist/plugins/http-elysia.js +350 -475
  124. package/dist/plugins/http-elysia.js.map +1 -1
  125. package/dist/plugins/http-express.d.ts +20 -31
  126. package/dist/plugins/http-express.d.ts.map +1 -1
  127. package/dist/plugins/http-express.js +281 -268
  128. package/dist/plugins/http-express.js.map +1 -1
  129. package/dist/plugins/http-hono.d.ts +17 -33
  130. package/dist/plugins/http-hono.d.ts.map +1 -1
  131. package/dist/plugins/http-hono.js +317 -341
  132. package/dist/plugins/http-hono.js.map +1 -1
  133. package/dist/plugins/http-orpc.d.ts +34 -33
  134. package/dist/plugins/http-orpc.d.ts.map +1 -1
  135. package/dist/plugins/http-orpc.js +345 -257
  136. package/dist/plugins/http-orpc.js.map +1 -1
  137. package/dist/plugins/http-trpc.d.ts +33 -35
  138. package/dist/plugins/http-trpc.d.ts.map +1 -1
  139. package/dist/plugins/http-trpc.js +337 -241
  140. package/dist/plugins/http-trpc.js.map +1 -1
  141. package/dist/plugins/kysely.d.ts +54 -59
  142. package/dist/plugins/kysely.d.ts.map +1 -1
  143. package/dist/plugins/kysely.js +826 -687
  144. package/dist/plugins/kysely.js.map +1 -1
  145. package/dist/plugins/sql-queries.d.ts +38 -44
  146. package/dist/plugins/sql-queries.d.ts.map +1 -1
  147. package/dist/plugins/sql-queries.js +497 -897
  148. package/dist/plugins/sql-queries.js.map +1 -1
  149. package/dist/plugins/types.d.ts +12 -20
  150. package/dist/plugins/types.d.ts.map +1 -1
  151. package/dist/plugins/types.js +84 -227
  152. package/dist/plugins/types.js.map +1 -1
  153. package/dist/plugins/valibot.d.ts +7 -44
  154. package/dist/plugins/valibot.d.ts.map +1 -1
  155. package/dist/plugins/valibot.js +376 -382
  156. package/dist/plugins/valibot.js.map +1 -1
  157. package/dist/plugins/zod.d.ts +20 -24
  158. package/dist/plugins/zod.d.ts.map +1 -1
  159. package/dist/plugins/zod.js +370 -367
  160. package/dist/plugins/zod.js.map +1 -1
  161. package/dist/runtime/emit.d.ts +64 -0
  162. package/dist/runtime/emit.d.ts.map +1 -0
  163. package/dist/runtime/emit.js +445 -0
  164. package/dist/runtime/emit.js.map +1 -0
  165. package/dist/runtime/errors.d.ts +36 -0
  166. package/dist/runtime/errors.d.ts.map +1 -0
  167. package/dist/runtime/errors.js +29 -0
  168. package/dist/runtime/errors.js.map +1 -0
  169. package/dist/runtime/file-assignment.d.ts +161 -0
  170. package/dist/runtime/file-assignment.d.ts.map +1 -0
  171. package/dist/runtime/file-assignment.js +195 -0
  172. package/dist/runtime/file-assignment.js.map +1 -0
  173. package/dist/runtime/orchestrator.d.ts +62 -0
  174. package/dist/runtime/orchestrator.d.ts.map +1 -0
  175. package/dist/runtime/orchestrator.js +99 -0
  176. package/dist/runtime/orchestrator.js.map +1 -0
  177. package/dist/runtime/registry.d.ts +268 -0
  178. package/dist/runtime/registry.d.ts.map +1 -0
  179. package/dist/runtime/registry.js +436 -0
  180. package/dist/runtime/registry.js.map +1 -0
  181. package/dist/runtime/types.d.ts +182 -0
  182. package/dist/runtime/types.d.ts.map +1 -0
  183. package/dist/runtime/types.js +2 -0
  184. package/dist/runtime/types.js.map +1 -0
  185. package/dist/runtime/validation.d.ts +41 -0
  186. package/dist/runtime/validation.d.ts.map +1 -0
  187. package/dist/runtime/validation.js +70 -0
  188. package/dist/runtime/validation.js.map +1 -0
  189. package/dist/services/config-loader.d.ts.map +1 -1
  190. package/dist/services/config-loader.js +15 -6
  191. package/dist/services/config-loader.js.map +1 -1
  192. package/dist/services/config.d.ts +55 -25
  193. package/dist/services/config.d.ts.map +1 -1
  194. package/dist/services/config.js +60 -34
  195. package/dist/services/config.js.map +1 -1
  196. package/dist/services/file-writer.d.ts +3 -3
  197. package/dist/services/file-writer.d.ts.map +1 -1
  198. package/dist/services/file-writer.js +6 -8
  199. package/dist/services/file-writer.js.map +1 -1
  200. package/dist/services/inflection.d.ts +126 -27
  201. package/dist/services/inflection.d.ts.map +1 -1
  202. package/dist/services/inflection.js +300 -72
  203. package/dist/services/inflection.js.map +1 -1
  204. package/dist/services/introspection.d.ts.map +1 -1
  205. package/dist/services/introspection.js +6 -6
  206. package/dist/services/introspection.js.map +1 -1
  207. package/dist/services/ir-builder.d.ts.map +1 -1
  208. package/dist/services/ir-builder.js +73 -77
  209. package/dist/services/ir-builder.js.map +1 -1
  210. package/dist/services/ir.d.ts.map +1 -1
  211. package/dist/services/ir.js.map +1 -1
  212. package/dist/services/pg-types.d.ts.map +1 -1
  213. package/dist/services/pg-types.js +3 -3
  214. package/dist/services/pg-types.js.map +1 -1
  215. package/dist/services/smart-tags-parser.d.ts.map +1 -1
  216. package/dist/services/smart-tags-parser.js +4 -4
  217. package/dist/services/smart-tags-parser.js.map +1 -1
  218. package/dist/services/type-hints.d.ts.map +1 -1
  219. package/dist/services/type-hints.js +1 -1
  220. package/dist/services/type-hints.js.map +1 -1
  221. package/dist/services/user-module-parser.d.ts +46 -0
  222. package/dist/services/user-module-parser.d.ts.map +1 -0
  223. package/dist/services/user-module-parser.js +181 -0
  224. package/dist/services/user-module-parser.js.map +1 -0
  225. package/dist/shared/converters.d.ts +60 -0
  226. package/dist/shared/converters.d.ts.map +1 -0
  227. package/dist/shared/converters.js +168 -0
  228. package/dist/shared/converters.js.map +1 -0
  229. package/dist/shared/query-types.d.ts +95 -0
  230. package/dist/shared/query-types.d.ts.map +1 -0
  231. package/dist/shared/query-types.js +9 -0
  232. package/dist/shared/query-types.js.map +1 -0
  233. package/dist/testing.d.ts +125 -37
  234. package/dist/testing.d.ts.map +1 -1
  235. package/dist/testing.js +134 -42
  236. package/dist/testing.js.map +1 -1
  237. package/dist/user-module.d.ts +86 -0
  238. package/dist/user-module.d.ts.map +1 -0
  239. package/dist/user-module.js +55 -0
  240. package/dist/user-module.js.map +1 -0
  241. package/package.json +10 -6
  242. package/dist/lib/conjure.d.ts.map +0 -1
  243. package/dist/lib/conjure.js.map +0 -1
  244. package/dist/lib/hex.d.ts +0 -119
  245. package/dist/lib/hex.d.ts.map +0 -1
  246. package/dist/lib/hex.js +0 -188
  247. package/dist/lib/hex.js.map +0 -1
  248. package/dist/plugins/effect.d.ts +0 -53
  249. package/dist/plugins/effect.d.ts.map +0 -1
  250. package/dist/plugins/effect.js +0 -1074
  251. package/dist/plugins/effect.js.map +0 -1
  252. package/dist/plugins/kysely/queries.d.ts +0 -92
  253. package/dist/plugins/kysely/queries.d.ts.map +0 -1
  254. package/dist/plugins/kysely/queries.js +0 -1169
  255. package/dist/plugins/kysely/queries.js.map +0 -1
  256. package/dist/plugins/kysely/shared.d.ts +0 -59
  257. package/dist/plugins/kysely/shared.d.ts.map +0 -1
  258. package/dist/plugins/kysely/shared.js +0 -247
  259. package/dist/plugins/kysely/shared.js.map +0 -1
  260. package/dist/plugins/kysely/types.d.ts +0 -22
  261. package/dist/plugins/kysely/types.d.ts.map +0 -1
  262. package/dist/plugins/kysely/types.js +0 -428
  263. package/dist/plugins/kysely/types.js.map +0 -1
  264. package/dist/services/artifact-store.d.ts +0 -65
  265. package/dist/services/artifact-store.d.ts.map +0 -1
  266. package/dist/services/artifact-store.js +0 -57
  267. package/dist/services/artifact-store.js.map +0 -1
  268. package/dist/services/core-providers.d.ts +0 -15
  269. package/dist/services/core-providers.d.ts.map +0 -1
  270. package/dist/services/core-providers.js +0 -23
  271. package/dist/services/core-providers.js.map +0 -1
  272. package/dist/services/emissions.d.ts +0 -103
  273. package/dist/services/emissions.d.ts.map +0 -1
  274. package/dist/services/emissions.js +0 -241
  275. package/dist/services/emissions.js.map +0 -1
  276. package/dist/services/execution.d.ts +0 -35
  277. package/dist/services/execution.d.ts.map +0 -1
  278. package/dist/services/execution.js +0 -86
  279. package/dist/services/execution.js.map +0 -1
  280. package/dist/services/file-builder.d.ts +0 -85
  281. package/dist/services/file-builder.d.ts.map +0 -1
  282. package/dist/services/file-builder.js +0 -112
  283. package/dist/services/file-builder.js.map +0 -1
  284. package/dist/services/plugin-meta.d.ts +0 -33
  285. package/dist/services/plugin-meta.d.ts.map +0 -1
  286. package/dist/services/plugin-meta.js +0 -24
  287. package/dist/services/plugin-meta.js.map +0 -1
  288. package/dist/services/plugin-runner.d.ts +0 -42
  289. package/dist/services/plugin-runner.d.ts.map +0 -1
  290. package/dist/services/plugin-runner.js +0 -84
  291. package/dist/services/plugin-runner.js.map +0 -1
  292. package/dist/services/plugin.d.ts +0 -421
  293. package/dist/services/plugin.d.ts.map +0 -1
  294. package/dist/services/plugin.js +0 -197
  295. package/dist/services/plugin.js.map +0 -1
  296. package/dist/services/resolution.d.ts +0 -38
  297. package/dist/services/resolution.d.ts.map +0 -1
  298. package/dist/services/resolution.js +0 -242
  299. package/dist/services/resolution.js.map +0 -1
  300. package/dist/services/service-registry.d.ts +0 -74
  301. package/dist/services/service-registry.d.ts.map +0 -1
  302. package/dist/services/service-registry.js +0 -61
  303. package/dist/services/service-registry.js.map +0 -1
  304. package/dist/services/symbols.d.ts +0 -144
  305. package/dist/services/symbols.d.ts.map +0 -1
  306. package/dist/services/symbols.js +0 -144
  307. package/dist/services/symbols.js.map +0 -1
package/dist/errors.d.ts CHANGED
@@ -1,142 +1,117 @@
1
- interface ErrorBase {
2
- readonly message: string;
1
+ /**
2
+ * Core error types for pg-sourcerer
3
+ * Using Effect's Schema.TaggedError for typed error handling
4
+ */
5
+ import { Schema } from "effect";
6
+ declare const ConfigNotFound_base: Schema.TaggedErrorClass<ConfigNotFound, "ConfigNotFound", {
7
+ readonly _tag: Schema.tag<"ConfigNotFound">;
8
+ } & {
9
+ message: typeof Schema.String;
10
+ searchPaths: Schema.Array$<typeof Schema.String>;
11
+ }>;
12
+ export declare class ConfigNotFound extends ConfigNotFound_base {
13
+ }
14
+ declare const ConfigInvalid_base: Schema.TaggedErrorClass<ConfigInvalid, "ConfigInvalid", {
15
+ readonly _tag: Schema.tag<"ConfigInvalid">;
16
+ } & {
17
+ message: typeof Schema.String;
18
+ path: typeof Schema.String;
19
+ errors: Schema.Array$<typeof Schema.String>;
20
+ }>;
21
+ export declare class ConfigInvalid extends ConfigInvalid_base {
22
+ }
23
+ declare const ConnectionFailed_base: Schema.TaggedErrorClass<ConnectionFailed, "ConnectionFailed", {
24
+ readonly _tag: Schema.tag<"ConnectionFailed">;
25
+ } & {
26
+ message: typeof Schema.String;
27
+ connectionString: typeof Schema.String;
28
+ cause: Schema.optional<typeof Schema.Unknown>;
29
+ }>;
30
+ export declare class ConnectionFailed extends ConnectionFailed_base {
31
+ }
32
+ declare const IntrospectionFailed_base: Schema.TaggedErrorClass<IntrospectionFailed, "IntrospectionFailed", {
33
+ readonly _tag: Schema.tag<"IntrospectionFailed">;
34
+ } & {
35
+ message: typeof Schema.String;
36
+ schema: typeof Schema.String;
37
+ cause: Schema.optional<typeof Schema.Unknown>;
38
+ }>;
39
+ export declare class IntrospectionFailed extends IntrospectionFailed_base {
40
+ }
41
+ declare const TagParseError_base: Schema.TaggedErrorClass<TagParseError, "TagParseError", {
42
+ readonly _tag: Schema.tag<"TagParseError">;
43
+ } & {
44
+ message: typeof Schema.String;
45
+ objectType: Schema.Union<[Schema.Literal<["table"]>, Schema.Literal<["column"]>, Schema.Literal<["constraint"]>, Schema.Literal<["type"]>]>;
46
+ objectName: typeof Schema.String;
47
+ comment: typeof Schema.String;
48
+ cause: Schema.optional<typeof Schema.Unknown>;
49
+ }>;
50
+ export declare class TagParseError extends TagParseError_base {
51
+ }
52
+ declare const WriteError_base: Schema.TaggedErrorClass<WriteError, "WriteError", {
53
+ readonly _tag: Schema.tag<"WriteError">;
54
+ } & {
55
+ message: typeof Schema.String;
56
+ path: typeof Schema.String;
57
+ cause: Schema.optional<typeof Schema.Unknown>;
58
+ }>;
59
+ export declare class WriteError extends WriteError_base {
60
+ }
61
+ declare const ExportCollisionError_base: Schema.TaggedErrorClass<ExportCollisionError, "ExportCollisionError", {
62
+ readonly _tag: Schema.tag<"ExportCollisionError">;
63
+ } & {
64
+ file: typeof Schema.String;
65
+ exportName: typeof Schema.String;
66
+ exportKind: typeof Schema.String;
67
+ capability1: typeof Schema.String;
68
+ capability2: typeof Schema.String;
69
+ message: typeof Schema.String;
70
+ }>;
71
+ export declare class ExportCollisionError extends ExportCollisionError_base {
72
+ }
73
+ declare const UserModuleParseError_base: Schema.TaggedErrorClass<UserModuleParseError, "UserModuleParseError", {
74
+ readonly _tag: Schema.tag<"UserModuleParseError">;
75
+ } & {
76
+ message: typeof Schema.String;
77
+ /** Absolute path to the file that failed to parse */
78
+ path: typeof Schema.String;
79
+ cause: Schema.optional<typeof Schema.Unknown>;
80
+ }>;
81
+ /**
82
+ * Error when parsing a user module file fails.
83
+ */
84
+ export declare class UserModuleParseError extends UserModuleParseError_base {
85
+ }
86
+ declare const ExportNotFoundError_base: Schema.TaggedErrorClass<ExportNotFoundError, "ExportNotFoundError", {
87
+ readonly _tag: Schema.tag<"ExportNotFoundError">;
88
+ } & {
89
+ message: typeof Schema.String;
90
+ /** Absolute path to the module */
91
+ modulePath: typeof Schema.String;
92
+ /** The export name that was not found */
93
+ exportName: typeof Schema.String;
94
+ /** Available exports in the module */
95
+ availableExports: Schema.Array$<typeof Schema.String>;
96
+ }>;
97
+ /**
98
+ * Error when a requested export is not found in a user module.
99
+ */
100
+ export declare class ExportNotFoundError extends ExportNotFoundError_base {
101
+ }
102
+ declare const UserModuleNotFoundError_base: Schema.TaggedErrorClass<UserModuleNotFoundError, "UserModuleNotFoundError", {
103
+ readonly _tag: Schema.tag<"UserModuleNotFoundError">;
104
+ } & {
105
+ message: typeof Schema.String;
106
+ /** Path as specified in config (relative to config file) */
107
+ configPath: typeof Schema.String;
108
+ /** Resolved absolute path that was checked */
109
+ resolvedPath: typeof Schema.String;
110
+ }>;
111
+ /**
112
+ * Error when a user module file is not found.
113
+ */
114
+ export declare class UserModuleNotFoundError extends UserModuleNotFoundError_base {
3
115
  }
4
- declare const ConfigNotFound_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
5
- readonly _tag: "ConfigNotFound";
6
- } & Readonly<A>;
7
- export declare class ConfigNotFound extends ConfigNotFound_base<ErrorBase & {
8
- readonly searchPaths: readonly string[];
9
- }> {
10
- }
11
- declare const ConfigInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
12
- readonly _tag: "ConfigInvalid";
13
- } & Readonly<A>;
14
- export declare class ConfigInvalid extends ConfigInvalid_base<ErrorBase & {
15
- readonly path: string;
16
- readonly errors: readonly string[];
17
- }> {
18
- }
19
- declare const ConnectionFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
20
- readonly _tag: "ConnectionFailed";
21
- } & Readonly<A>;
22
- export declare class ConnectionFailed extends ConnectionFailed_base<ErrorBase & {
23
- readonly connectionString: string;
24
- readonly cause: unknown;
25
- }> {
26
- }
27
- declare const IntrospectionFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
28
- readonly _tag: "IntrospectionFailed";
29
- } & Readonly<A>;
30
- export declare class IntrospectionFailed extends IntrospectionFailed_base<ErrorBase & {
31
- readonly schema: string;
32
- readonly cause: unknown;
33
- }> {
34
- }
35
- declare const TagParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
36
- readonly _tag: "TagParseError";
37
- } & Readonly<A>;
38
- export declare class TagParseError extends TagParseError_base<ErrorBase & {
39
- readonly objectType: "table" | "column" | "constraint" | "type";
40
- readonly objectName: string;
41
- readonly comment: string;
42
- readonly cause: unknown;
43
- }> {
44
- }
45
- declare const DuplicatePlugin_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
46
- readonly _tag: "DuplicatePlugin";
47
- } & Readonly<A>;
48
- export declare class DuplicatePlugin extends DuplicatePlugin_base<ErrorBase & {
49
- readonly plugin: string;
50
- }> {
51
- }
52
- declare const CapabilityNotSatisfied_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
53
- readonly _tag: "CapabilityNotSatisfied";
54
- } & Readonly<A>;
55
- export declare class CapabilityNotSatisfied extends CapabilityNotSatisfied_base<ErrorBase & {
56
- readonly required: string;
57
- readonly requiredBy: string;
58
- }> {
59
- }
60
- declare const CapabilityConflict_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
61
- readonly _tag: "CapabilityConflict";
62
- } & Readonly<A>;
63
- export declare class CapabilityConflict extends CapabilityConflict_base<ErrorBase & {
64
- readonly capability: string;
65
- readonly providers: readonly string[];
66
- }> {
67
- }
68
- declare const CapabilityCycle_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
69
- readonly _tag: "CapabilityCycle";
70
- } & Readonly<A>;
71
- export declare class CapabilityCycle extends CapabilityCycle_base<ErrorBase & {
72
- readonly cycle: readonly string[];
73
- }> {
74
- }
75
- declare const PluginConfigInvalid_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
76
- readonly _tag: "PluginConfigInvalid";
77
- } & Readonly<A>;
78
- export declare class PluginConfigInvalid extends PluginConfigInvalid_base<ErrorBase & {
79
- readonly plugin: string;
80
- readonly errors: readonly string[];
81
- }> {
82
- }
83
- declare const PluginExecutionFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
84
- readonly _tag: "PluginExecutionFailed";
85
- } & Readonly<A>;
86
- export declare class PluginExecutionFailed extends PluginExecutionFailed_base<ErrorBase & {
87
- readonly plugin: string;
88
- readonly entity?: string;
89
- readonly field?: string;
90
- readonly cause: unknown;
91
- readonly hint?: string;
92
- }> {
93
- }
94
- declare const EmitConflict_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
95
- readonly _tag: "EmitConflict";
96
- } & Readonly<A>;
97
- export declare class EmitConflict extends EmitConflict_base<ErrorBase & {
98
- readonly path: string;
99
- readonly plugins: readonly string[];
100
- }> {
101
- }
102
- declare const SymbolConflict_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
103
- readonly _tag: "SymbolConflict";
104
- } & Readonly<A>;
105
- export declare class SymbolConflict extends SymbolConflict_base<ErrorBase & {
106
- readonly symbol: string;
107
- readonly file: string;
108
- readonly plugins: readonly string[];
109
- }> {
110
- }
111
- declare const WriteError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
112
- readonly _tag: "WriteError";
113
- } & Readonly<A>;
114
- export declare class WriteError extends WriteError_base<ErrorBase & {
115
- readonly path: string;
116
- readonly cause: unknown;
117
- }> {
118
- }
119
- declare const UndefinedReference_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
120
- readonly _tag: "UndefinedReference";
121
- } & Readonly<A>;
122
- export declare class UndefinedReference extends UndefinedReference_base<ErrorBase & {
123
- readonly references: readonly {
124
- readonly capability: string;
125
- readonly entity: string;
126
- readonly shape?: string;
127
- readonly requestedBy: string;
128
- readonly inFile: string;
129
- }[];
130
- }> {
131
- }
132
- declare const FormatError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
133
- readonly _tag: "FormatError";
134
- } & Readonly<A>;
135
- export declare class FormatError extends FormatError_base<ErrorBase & {
136
- readonly path: string;
137
- readonly cause: unknown;
138
- }> {
139
- }
140
- export type SourcererError = ConfigNotFound | ConfigInvalid | ConnectionFailed | IntrospectionFailed | TagParseError | DuplicatePlugin | CapabilityNotSatisfied | CapabilityConflict | CapabilityCycle | PluginConfigInvalid | PluginExecutionFailed | EmitConflict | SymbolConflict | WriteError | UndefinedReference | FormatError;
141
116
  export {};
142
117
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAOA,UAAU,SAAS;IACjB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;;;;AAGD,qBAAa,cAAe,SAAQ,oBAClC,SAAS,GAAG;IAAE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CACxD;CAAG;;;;AAEJ,qBAAa,aAAc,SAAQ,mBACjC,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,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G;AACH,qBAAa,uBAAwB,SAAQ,4BAS5C;CAAG"}
package/dist/errors.js CHANGED
@@ -1,43 +1,89 @@
1
1
  /**
2
2
  * Core error types for pg-sourcerer
3
- * Using Effect's Data.TaggedEnum for typed error handling
3
+ * Using Effect's Schema.TaggedError for typed error handling
4
4
  */
5
- import { Data } from "effect";
6
- // Configuration errors
7
- export class ConfigNotFound extends Data.TaggedError("ConfigNotFound") {
8
- }
9
- export class ConfigInvalid extends Data.TaggedError("ConfigInvalid") {
10
- }
11
- // Database errors
12
- export class ConnectionFailed extends Data.TaggedError("ConnectionFailed") {
13
- }
14
- export class IntrospectionFailed extends Data.TaggedError("IntrospectionFailed") {
15
- }
16
- // Smart tags errors
17
- export class TagParseError extends Data.TaggedError("TagParseError") {
18
- }
19
- // Plugin errors
20
- export class DuplicatePlugin extends Data.TaggedError("DuplicatePlugin") {
21
- }
22
- export class CapabilityNotSatisfied extends Data.TaggedError("CapabilityNotSatisfied") {
23
- }
24
- export class CapabilityConflict extends Data.TaggedError("CapabilityConflict") {
25
- }
26
- export class CapabilityCycle extends Data.TaggedError("CapabilityCycle") {
27
- }
28
- export class PluginConfigInvalid extends Data.TaggedError("PluginConfigInvalid") {
29
- }
30
- export class PluginExecutionFailed extends Data.TaggedError("PluginExecutionFailed") {
31
- }
32
- // Emission errors
33
- export class EmitConflict extends Data.TaggedError("EmitConflict") {
34
- }
35
- export class SymbolConflict extends Data.TaggedError("SymbolConflict") {
36
- }
37
- export class WriteError extends Data.TaggedError("WriteError") {
5
+ import { Schema } from "effect";
6
+ export class ConfigNotFound extends Schema.TaggedError()("ConfigNotFound", {
7
+ message: Schema.String,
8
+ searchPaths: Schema.Array(Schema.String),
9
+ }) {
10
+ }
11
+ export class ConfigInvalid extends Schema.TaggedError()("ConfigInvalid", {
12
+ message: Schema.String,
13
+ path: Schema.String,
14
+ errors: Schema.Array(Schema.String),
15
+ }) {
16
+ }
17
+ export class ConnectionFailed extends Schema.TaggedError()("ConnectionFailed", {
18
+ message: Schema.String,
19
+ connectionString: Schema.String,
20
+ cause: Schema.optional(Schema.Unknown),
21
+ }) {
22
+ }
23
+ export class IntrospectionFailed extends Schema.TaggedError()("IntrospectionFailed", {
24
+ message: Schema.String,
25
+ schema: Schema.String,
26
+ cause: Schema.optional(Schema.Unknown),
27
+ }) {
28
+ }
29
+ export class TagParseError extends Schema.TaggedError()("TagParseError", {
30
+ message: Schema.String,
31
+ objectType: Schema.Union(Schema.Literal("table"), Schema.Literal("column"), Schema.Literal("constraint"), Schema.Literal("type")),
32
+ objectName: Schema.String,
33
+ comment: Schema.String,
34
+ cause: Schema.optional(Schema.Unknown),
35
+ }) {
36
+ }
37
+ export class WriteError extends Schema.TaggedError()("WriteError", {
38
+ message: Schema.String,
39
+ path: Schema.String,
40
+ cause: Schema.optional(Schema.Unknown),
41
+ }) {
42
+ }
43
+ export class ExportCollisionError extends Schema.TaggedError()("ExportCollisionError", {
44
+ file: Schema.String,
45
+ exportName: Schema.String,
46
+ exportKind: Schema.String,
47
+ capability1: Schema.String,
48
+ capability2: Schema.String,
49
+ message: Schema.String,
50
+ }) {
51
+ }
52
+ // =============================================================================
53
+ // User Module Errors
54
+ // =============================================================================
55
+ /**
56
+ * Error when parsing a user module file fails.
57
+ */
58
+ export class UserModuleParseError extends Schema.TaggedError()("UserModuleParseError", {
59
+ message: Schema.String,
60
+ /** Absolute path to the file that failed to parse */
61
+ path: Schema.String,
62
+ cause: Schema.optional(Schema.Unknown),
63
+ }) {
38
64
  }
39
- export class UndefinedReference extends Data.TaggedError("UndefinedReference") {
65
+ /**
66
+ * Error when a requested export is not found in a user module.
67
+ */
68
+ export class ExportNotFoundError extends Schema.TaggedError()("ExportNotFoundError", {
69
+ message: Schema.String,
70
+ /** Absolute path to the module */
71
+ modulePath: Schema.String,
72
+ /** The export name that was not found */
73
+ exportName: Schema.String,
74
+ /** Available exports in the module */
75
+ availableExports: Schema.Array(Schema.String),
76
+ }) {
40
77
  }
41
- export class FormatError extends Data.TaggedError("FormatError") {
78
+ /**
79
+ * Error when a user module file is not found.
80
+ */
81
+ export class UserModuleNotFoundError extends Schema.TaggedError()("UserModuleNotFoundError", {
82
+ message: Schema.String,
83
+ /** Path as specified in config (relative to config file) */
84
+ configPath: Schema.String,
85
+ /** Resolved absolute path that was checked */
86
+ resolvedPath: Schema.String,
87
+ }) {
42
88
  }
43
89
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAO7B,uBAAuB;AACvB,MAAM,OAAO,cAAe,SAAQ,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAEpE;CAAG;AAEJ,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,WAAW,CAAC,eAAe,CAElE;CAAG;AAEJ,kBAAkB;AAClB,MAAM,OAAO,gBAAiB,SAAQ,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAExE;CAAG;AAEJ,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAE9E;CAAG;AAEJ,oBAAoB;AACpB,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,WAAW,CAAC,eAAe,CAOlE;CAAG;AAEJ,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAEtE;CAAG;AAEJ,MAAM,OAAO,sBAAuB,SAAQ,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAEpF;CAAG;AAEJ,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAE5E;CAAG;AAEJ,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAEtE;CAAG;AAEJ,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAE9E;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AAE,MAAM,CAAC,MAAM;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,MAAM,CAAC,WAAW,EAAwB,CAClF,sBAAsB,EACtB;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;CACvC,CACF;CAAG;AAEJ;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,EAAuB,CAChF,qBAAqB,EACrB;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC,MAAM;IACzB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC,MAAM;IACzB,sCAAsC;IACtC,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;CAC9C,CACF;CAAG;AAEJ;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,MAAM,CAAC,WAAW,EAA2B,CACxF,yBAAyB,EACzB;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC,MAAM;IACzB,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC,MAAM;CAC5B,CACF;CAAG"}
@@ -1,28 +1,13 @@
1
- /**
2
- * Generate Orchestration Function
3
- *
4
- * Threads together the full code generation pipeline:
5
- * 1. Load config
6
- * 2. Introspect database
7
- * 3. Build IR
8
- * 4. Run providers
9
- * 5. Write files
10
- *
11
- * Logging:
12
- * - Effect.log (INFO) - Progress messages shown by default
13
- * - Effect.logDebug (DEBUG) - Detailed info (entity names, file lists)
14
- *
15
- * Configure via Logger.withMinimumLogLevel at the call site.
16
- */
17
- import { Effect, Layer } from "effect";
18
- import { FileSystem, Path, CommandExecutor } from "@effect/platform";
1
+ import { Effect, Layer, Schema } from "effect";
2
+ import { FileSystem } from "@effect/platform";
19
3
  import type { ResolvedConfig } from "./config.js";
20
- import { type PluginRunResult, type PluginRunError } from "./services/plugin-runner.js";
4
+ import type { RenderedSymbol } from "./runtime/types.js";
5
+ import { type OrchestratorResult } from "./runtime/orchestrator.js";
6
+ import { type EmittedFile } from "./runtime/emit.js";
21
7
  import { ConfigService } from "./services/config.js";
22
8
  import { DatabaseIntrospectionService } from "./services/introspection.js";
23
9
  import { type WriteResult } from "./services/file-writer.js";
24
10
  import { type SemanticIR } from "./ir/semantic-ir.js";
25
- import { ConfigNotFound, ConfigInvalid, ConnectionFailed, IntrospectionFailed, TagParseError, WriteError, FormatError } from "./errors.js";
26
11
  /**
27
12
  * Options for the generate function
28
13
  */
@@ -41,45 +26,59 @@ export interface GenerateResult {
41
26
  /** The built semantic IR */
42
27
  readonly ir: SemanticIR;
43
28
  /** Plugin execution results */
44
- readonly pluginResult: PluginRunResult;
29
+ readonly pluginResult: OrchestratorResult;
30
+ /** Emitted files before writing */
31
+ readonly emittedFiles: readonly EmittedFile[];
45
32
  /** File write results */
46
33
  readonly writeResults: readonly WriteResult[];
47
34
  }
48
- /**
49
- * All possible errors from the generate pipeline
50
- */
51
- export type GenerateError = ConfigNotFound | ConfigInvalid | ConnectionFailed | IntrospectionFailed | TagParseError | PluginRunError | WriteError | FormatError;
35
+ declare const FormatError_base: Schema.TaggedErrorClass<FormatError, "FormatError", {
36
+ readonly _tag: Schema.tag<"FormatError">;
37
+ } & {
38
+ message: typeof Schema.String;
39
+ path: typeof Schema.String;
40
+ cause: Schema.optional<typeof Schema.Unknown>;
41
+ }>;
42
+ export declare class FormatError extends FormatError_base {
43
+ }
52
44
  /**
53
45
  * The main generate pipeline.
54
46
  *
55
47
  * Config is provided via ConfigService layer (Effect DI).
56
- * Use ConfigFromFile or ConfigWithInit layers depending on context.
48
+ * Use ConfigFromFile or ConfigWithFallback layers depending on context.
57
49
  */
58
- export declare const generate: (options?: GenerateOptions) => Effect.Effect<GenerateResult, GenerateError, ConfigService | DatabaseIntrospectionService | FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor>;
50
+ export declare const generate: (options?: GenerateOptions) => Effect.Effect<{
51
+ config: ResolvedConfig;
52
+ ir: SemanticIR;
53
+ pluginResult: {
54
+ declarations: import("./index.js").SymbolDeclaration[];
55
+ rendered: RenderedSymbol[];
56
+ fileGroups: ReadonlyMap<string, readonly import("./index.js").AssignedSymbol[]>;
57
+ registry: import("./runtime/registry.js").SymbolRegistryImpl;
58
+ references: ReadonlyMap<string, readonly string[]>;
59
+ };
60
+ emittedFiles: readonly EmittedFile[];
61
+ writeResults: readonly WriteResult[];
62
+ }, import("./runtime/registry.js").SymbolCollision | import("./runtime/registry.js").CategoryConflict | import("./runtime/errors.js").DeclareError | import("./runtime/errors.js").RenderError | import("./runtime/validation.js").UnsatisfiedCapability | import("./runtime/validation.js").CircularDependency | import("./errors.js").ConnectionFailed | import("./errors.js").IntrospectionFailed | import("./errors.js").TagParseError | import("./errors.js").WriteError | import("./errors.js").UserModuleParseError | import("./errors.js").ExportNotFoundError | import("./errors.js").UserModuleNotFoundError | FormatError, ConfigService | DatabaseIntrospectionService | FileSystem.FileSystem | import("@effect/platform/Path").Path | import("@effect/platform/CommandExecutor").CommandExecutor>;
59
63
  /**
60
64
  * Layer that provides database introspection for generate().
61
- *
62
- * Note: ConfigService is NOT included here - it must be provided separately
63
- * via ConfigFromFile, ConfigWithInit, or ConfigTest layers.
64
65
  */
65
66
  export declare const GenerateLive: Layer.Layer<DatabaseIntrospectionService, never, never>;
66
67
  /**
67
68
  * Run generate with database introspection provided.
68
- *
69
- * ConfigService must still be provided by the caller via one of:
70
- * - ConfigFromFile (load from disk, fail if not found)
71
- * - ConfigWithInit (load from disk, or run interactive init)
72
- * - ConfigTest (provide config directly for testing)
73
- *
74
- * @example
75
- * ```typescript
76
- * import { ConfigFromFile } from "./services/config.js"
77
- *
78
- * runGenerate({ dryRun: true }).pipe(
79
- * Effect.provide(ConfigFromFile()),
80
- * // ... platform layers
81
- * )
82
- * ```
83
69
  */
84
- export declare const runGenerate: (options?: GenerateOptions) => Effect.Effect<GenerateResult, GenerateError, ConfigService | FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor>;
70
+ export declare const runGenerate: (options?: GenerateOptions) => Effect.Effect<{
71
+ config: ResolvedConfig;
72
+ ir: SemanticIR;
73
+ pluginResult: {
74
+ declarations: import("./index.js").SymbolDeclaration[];
75
+ rendered: RenderedSymbol[];
76
+ fileGroups: ReadonlyMap<string, readonly import("./index.js").AssignedSymbol[]>;
77
+ registry: import("./runtime/registry.js").SymbolRegistryImpl;
78
+ references: ReadonlyMap<string, readonly string[]>;
79
+ };
80
+ emittedFiles: readonly EmittedFile[];
81
+ writeResults: readonly WriteResult[];
82
+ }, import("./runtime/registry.js").SymbolCollision | import("./runtime/registry.js").CategoryConflict | import("./runtime/errors.js").DeclareError | import("./runtime/errors.js").RenderError | import("./runtime/validation.js").UnsatisfiedCapability | import("./runtime/validation.js").CircularDependency | import("./errors.js").ConnectionFailed | import("./errors.js").IntrospectionFailed | import("./errors.js").TagParseError | import("./errors.js").WriteError | import("./errors.js").UserModuleParseError | import("./errors.js").ExportNotFoundError | import("./errors.js").UserModuleNotFoundError | FormatError, ConfigService | FileSystem.FileSystem | import("@effect/platform/Path").Path | import("@effect/platform/CommandExecutor").CommandExecutor>;
83
+ export {};
85
84
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAW,eAAe,EAAE,MAAM,kBA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