polen 0.10.0 → 0.11.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/build/api/api.d.ts +1 -0
  2. package/build/api/api.d.ts.map +1 -1
  3. package/build/api/api.js +1 -0
  4. package/build/api/api.js.map +1 -1
  5. package/build/api/config/configurator.d.ts +20 -3
  6. package/build/api/config/configurator.d.ts.map +1 -1
  7. package/build/api/config/configurator.js +27 -3
  8. package/build/api/config/configurator.js.map +1 -1
  9. package/build/api/schema/data-sources/memory/memory.d.ts +2 -2
  10. package/build/api/schema/data-sources/memory/memory.d.ts.map +1 -1
  11. package/build/api/schema/data-sources/memory/memory.js +1 -3
  12. package/build/api/schema/data-sources/memory/memory.js.map +1 -1
  13. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.d.ts +7 -3
  14. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.d.ts.map +1 -1
  15. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.js +15 -11
  16. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.js.map +1 -1
  17. package/build/api/schema/data-sources/schema-directory/schema-directory.d.ts +16 -7
  18. package/build/api/schema/data-sources/schema-directory/schema-directory.d.ts.map +1 -1
  19. package/build/api/schema/data-sources/schema-directory/schema-directory.js +26 -7
  20. package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
  21. package/build/api/schema/data-sources/schema-file/schema-file.d.ts +7 -2
  22. package/build/api/schema/data-sources/schema-file/schema-file.d.ts.map +1 -1
  23. package/build/api/schema/data-sources/schema-file/schema-file.js +13 -5
  24. package/build/api/schema/data-sources/schema-file/schema-file.js.map +1 -1
  25. package/build/api/schema/metadata.d.ts +8 -0
  26. package/build/api/schema/metadata.d.ts.map +1 -0
  27. package/build/api/schema/metadata.js +19 -0
  28. package/build/api/schema/metadata.js.map +1 -0
  29. package/build/api/schema/read.d.ts +3 -3
  30. package/build/api/schema/read.d.ts.map +1 -1
  31. package/build/api/schema/read.js.map +1 -1
  32. package/build/api/schema/schema.d.ts +33 -2
  33. package/build/api/schema/schema.d.ts.map +1 -1
  34. package/build/api/schema/schema.js +42 -0
  35. package/build/api/schema/schema.js.map +1 -1
  36. package/build/api/schema-source/index.d.ts +2 -0
  37. package/build/api/schema-source/index.d.ts.map +1 -0
  38. package/build/api/schema-source/index.js +2 -0
  39. package/build/api/schema-source/index.js.map +1 -0
  40. package/build/api/schema-source/schema-source.d.ts +33 -0
  41. package/build/api/schema-source/schema-source.d.ts.map +1 -0
  42. package/build/api/schema-source/schema-source.js +137 -0
  43. package/build/api/schema-source/schema-source.js.map +1 -0
  44. package/build/api/vite/plugins/core.d.ts +1 -0
  45. package/build/api/vite/plugins/core.d.ts.map +1 -1
  46. package/build/api/vite/plugins/core.js +21 -18
  47. package/build/api/vite/plugins/core.js.map +1 -1
  48. package/build/api/vite/plugins/schema-assets.d.ts +22 -0
  49. package/build/api/vite/plugins/schema-assets.d.ts.map +1 -0
  50. package/build/api/vite/plugins/schema-assets.js +269 -0
  51. package/build/api/vite/plugins/schema-assets.js.map +1 -0
  52. package/build/api/vite/plugins/serve.d.ts.map +1 -1
  53. package/build/api/vite/plugins/serve.js +11 -0
  54. package/build/api/vite/plugins/serve.js.map +1 -1
  55. package/build/lib/graphql-change/change-groups.d.ts +2 -0
  56. package/build/lib/graphql-change/change-groups.d.ts.map +1 -1
  57. package/build/lib/graphql-change/change-groups.js +54 -0
  58. package/build/lib/graphql-change/change-groups.js.map +1 -1
  59. package/build/lib/kit-temp.d.ts +9 -0
  60. package/build/lib/kit-temp.d.ts.map +1 -1
  61. package/build/lib/kit-temp.js +12 -0
  62. package/build/lib/kit-temp.js.map +1 -1
  63. package/build/lib/path-map/path-map.d.ts.map +1 -1
  64. package/build/lib/path-map/path-map.js +3 -1
  65. package/build/lib/path-map/path-map.js.map +1 -1
  66. package/build/project-data.d.ts +3 -11
  67. package/build/project-data.d.ts.map +1 -1
  68. package/build/template/components/Changelog.d.ts +3 -3
  69. package/build/template/components/Changelog.d.ts.map +1 -1
  70. package/build/template/components/Changelog.js +8 -84
  71. package/build/template/components/Changelog.js.map +1 -1
  72. package/build/template/components/CodeBlock.d.ts +2 -0
  73. package/build/template/components/CodeBlock.d.ts.map +1 -1
  74. package/build/template/components/CodeBlock.js +1 -4
  75. package/build/template/components/CodeBlock.js.map +1 -1
  76. package/build/template/components/ComponentDispatch.d.ts +34 -0
  77. package/build/template/components/ComponentDispatch.d.ts.map +1 -0
  78. package/build/template/components/ComponentDispatch.js +33 -0
  79. package/build/template/components/ComponentDispatch.js.map +1 -0
  80. package/build/template/components/ReferenceLink.d.ts +19 -0
  81. package/build/template/components/ReferenceLink.d.ts.map +1 -0
  82. package/build/template/components/ReferenceLink.js +19 -0
  83. package/build/template/components/ReferenceLink.js.map +1 -0
  84. package/build/template/components/TypeAnnotation.d.ts.map +1 -1
  85. package/build/template/components/TypeAnnotation.js +3 -3
  86. package/build/template/components/TypeAnnotation.js.map +1 -1
  87. package/build/template/components/TypeFieldsLinkList.d.ts.map +1 -1
  88. package/build/template/components/TypeFieldsLinkList.js +4 -4
  89. package/build/template/components/TypeFieldsLinkList.js.map +1 -1
  90. package/build/template/components/TypeIndex.js +2 -2
  91. package/build/template/components/TypeIndex.js.map +1 -1
  92. package/build/template/components/VersionSelector.d.ts +7 -0
  93. package/build/template/components/VersionSelector.d.ts.map +1 -0
  94. package/build/template/components/VersionSelector.js +30 -0
  95. package/build/template/components/VersionSelector.js.map +1 -0
  96. package/build/template/components/graphql/type-link.d.ts.map +1 -1
  97. package/build/template/components/graphql/type-link.js +2 -2
  98. package/build/template/components/graphql/type-link.js.map +1 -1
  99. package/build/template/hooks/useVersionPath.d.ts +6 -0
  100. package/build/template/hooks/useVersionPath.d.ts.map +1 -0
  101. package/build/template/hooks/useVersionPath.js +10 -0
  102. package/build/template/hooks/useVersionPath.js.map +1 -0
  103. package/build/template/layouts/ChangelogLayout.d.ts.map +1 -0
  104. package/build/template/{components → layouts}/ChangelogLayout.js +1 -1
  105. package/build/template/layouts/ChangelogLayout.js.map +1 -0
  106. package/build/template/layouts/index.d.ts +1 -0
  107. package/build/template/layouts/index.d.ts.map +1 -1
  108. package/build/template/layouts/index.js +1 -0
  109. package/build/template/layouts/index.js.map +1 -1
  110. package/build/template/lib/fetch-text.d.ts +8 -0
  111. package/build/template/lib/fetch-text.d.ts.map +1 -0
  112. package/build/template/lib/fetch-text.js +14 -0
  113. package/build/template/lib/fetch-text.js.map +1 -0
  114. package/build/template/lib/polen-url.d.ts +14 -0
  115. package/build/template/lib/polen-url.d.ts.map +1 -1
  116. package/build/template/lib/polen-url.js +16 -0
  117. package/build/template/lib/polen-url.js.map +1 -1
  118. package/build/template/lib/schema-utils/constants.d.ts +5 -0
  119. package/build/template/lib/schema-utils/constants.d.ts.map +1 -0
  120. package/build/template/lib/schema-utils/constants.js +5 -0
  121. package/build/template/lib/schema-utils/constants.js.map +1 -0
  122. package/build/template/lib/schema-utils/schema-utils.d.ts +15 -0
  123. package/build/template/lib/schema-utils/schema-utils.d.ts.map +1 -0
  124. package/build/template/lib/schema-utils/schema-utils.js +37 -0
  125. package/build/template/lib/schema-utils/schema-utils.js.map +1 -0
  126. package/build/template/routes/changelog.d.ts +4 -3
  127. package/build/template/routes/changelog.d.ts.map +1 -1
  128. package/build/template/routes/changelog.js +13 -7
  129. package/build/template/routes/changelog.js.map +1 -1
  130. package/build/template/routes/pages.d.ts +10 -0
  131. package/build/template/routes/pages.d.ts.map +1 -0
  132. package/build/template/routes/pages.js +76 -0
  133. package/build/template/routes/pages.js.map +1 -0
  134. package/build/template/routes/reference.$type.$field.js +1 -1
  135. package/build/template/routes/reference.$type.$field.js.map +1 -1
  136. package/build/template/routes/reference.$type.d.ts +4 -0
  137. package/build/template/routes/reference.$type.d.ts.map +1 -1
  138. package/build/template/routes/reference.$type.js +2 -0
  139. package/build/template/routes/reference.$type.js.map +1 -1
  140. package/build/template/routes/reference.d.ts +9 -3
  141. package/build/template/routes/reference.d.ts.map +1 -1
  142. package/build/template/routes/reference.js +30 -8
  143. package/build/template/routes/reference.js.map +1 -1
  144. package/build/template/routes/reference.version.$version.$type.$field.d.ts +6 -0
  145. package/build/template/routes/reference.version.$version.$type.$field.d.ts.map +1 -0
  146. package/build/template/routes/reference.version.$version.$type.$field.js +32 -0
  147. package/build/template/routes/reference.version.$version.$type.$field.js.map +1 -0
  148. package/build/template/routes/reference.version.$version.$type.d.ts +11 -0
  149. package/build/template/routes/reference.version.$version.$type.d.ts.map +1 -0
  150. package/build/template/routes/reference.version.$version.$type.js +26 -0
  151. package/build/template/routes/reference.version.$version.$type.js.map +1 -0
  152. package/build/template/routes/root.d.ts.map +1 -1
  153. package/build/template/routes/root.js +8 -72
  154. package/build/template/routes/root.js.map +1 -1
  155. package/build/template/server/app.d.ts +22 -1
  156. package/build/template/server/app.d.ts.map +1 -1
  157. package/build/template/server/app.js +19 -9
  158. package/build/template/server/app.js.map +1 -1
  159. package/build/template/server/main.js +9 -1
  160. package/build/template/server/main.js.map +1 -1
  161. package/build/template/server/ssg/generate.js +2 -2
  162. package/build/template/server/ssg/generate.js.map +1 -1
  163. package/build/template/server/ssg/get-route-paths.d.ts +1 -1
  164. package/build/template/server/ssg/get-route-paths.d.ts.map +1 -1
  165. package/build/template/server/ssg/get-route-paths.js +51 -27
  166. package/build/template/server/ssg/get-route-paths.js.map +1 -1
  167. package/build/template/sources/schema-source.d.ts +15 -0
  168. package/build/template/sources/schema-source.d.ts.map +1 -0
  169. package/build/template/sources/schema-source.js +63 -0
  170. package/build/template/sources/schema-source.js.map +1 -0
  171. package/package.json +1 -1
  172. package/src/api/api.ts +1 -0
  173. package/src/api/config/configurator.ts +51 -6
  174. package/src/api/schema/data-sources/memory/memory.ts +3 -5
  175. package/src/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.ts +29 -13
  176. package/src/api/schema/data-sources/schema-directory/schema-directory.ts +56 -16
  177. package/src/api/schema/data-sources/schema-file/schema-file.ts +16 -7
  178. package/src/api/schema/metadata.ts +23 -0
  179. package/src/api/schema/read.ts +3 -3
  180. package/src/api/schema/schema.ts +62 -2
  181. package/src/api/schema-source/index.ts +1 -0
  182. package/src/api/schema-source/schema-source.ts +189 -0
  183. package/src/api/vite/plugins/core.ts +23 -18
  184. package/src/api/vite/plugins/schema-assets.ts +317 -0
  185. package/src/api/vite/plugins/serve.ts +15 -8
  186. package/src/lib/graphql-change/change-groups.ts +57 -0
  187. package/src/lib/kit-temp.ts +13 -0
  188. package/src/lib/path-map/$.test.ts +22 -19
  189. package/src/lib/path-map/path-map.ts +3 -1
  190. package/src/project-data.ts +3 -11
  191. package/src/template/components/Changelog.tsx +16 -67
  192. package/src/template/components/CodeBlock.tsx +3 -5
  193. package/src/template/components/ComponentDispatch.tsx +42 -0
  194. package/src/template/components/ReferenceLink.tsx +34 -0
  195. package/src/template/components/TypeAnnotation.tsx +5 -7
  196. package/src/template/components/TypeFieldsLinkList.tsx +20 -23
  197. package/src/template/components/TypeIndex.tsx +10 -12
  198. package/src/template/components/VersionSelector.tsx +50 -0
  199. package/src/template/components/graphql/type-link.tsx +4 -3
  200. package/src/template/hooks/useVersionPath.ts +10 -0
  201. package/src/template/{components → layouts}/ChangelogLayout.tsx +1 -1
  202. package/src/template/layouts/index.ts +1 -0
  203. package/src/template/lib/fetch-text.ts +13 -0
  204. package/src/template/lib/polen-url.ts +20 -0
  205. package/src/template/lib/schema-utils/constants.ts +4 -0
  206. package/src/template/lib/schema-utils/schema-utils.ts +42 -0
  207. package/src/template/routes/changelog.tsx +17 -8
  208. package/src/template/routes/pages.tsx +109 -0
  209. package/src/template/routes/reference.$type.$field.tsx +1 -1
  210. package/src/template/routes/reference.$type.tsx +2 -0
  211. package/src/template/routes/reference.tsx +38 -6
  212. package/src/template/routes/reference.version.$version.$type.$field.tsx +35 -0
  213. package/src/template/routes/reference.version.$version.$type.tsx +30 -0
  214. package/src/template/routes/root.tsx +8 -109
  215. package/src/template/server/app.ts +47 -14
  216. package/src/template/server/main.ts +9 -1
  217. package/src/template/server/ssg/generate.ts +2 -2
  218. package/src/template/server/ssg/get-route-paths.ts +53 -27
  219. package/src/template/sources/schema-source.ts +68 -0
  220. package/build/lib/graphql-document/$$.d.ts +0 -5
  221. package/build/lib/graphql-document/$$.d.ts.map +0 -1
  222. package/build/lib/graphql-document/$$.js +0 -5
  223. package/build/lib/graphql-document/$$.js.map +0 -1
  224. package/build/lib/graphql-document/$.d.ts +0 -2
  225. package/build/lib/graphql-document/$.d.ts.map +0 -1
  226. package/build/lib/graphql-document/$.js +0 -2
  227. package/build/lib/graphql-document/$.js.map +0 -1
  228. package/build/lib/graphql-document/analysis.d.ts +0 -44
  229. package/build/lib/graphql-document/analysis.d.ts.map +0 -1
  230. package/build/lib/graphql-document/analysis.js +0 -361
  231. package/build/lib/graphql-document/analysis.js.map +0 -1
  232. package/build/lib/graphql-document/components/GraphQLDocument.d.ts +0 -38
  233. package/build/lib/graphql-document/components/GraphQLDocument.d.ts.map +0 -1
  234. package/build/lib/graphql-document/components/GraphQLDocument.js +0 -151
  235. package/build/lib/graphql-document/components/GraphQLDocument.js.map +0 -1
  236. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts +0 -7
  237. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts.map +0 -1
  238. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js +0 -27
  239. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js.map +0 -1
  240. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts +0 -33
  241. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts.map +0 -1
  242. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js +0 -50
  243. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js.map +0 -1
  244. package/build/lib/graphql-document/components/IdentifierLink.d.ts +0 -39
  245. package/build/lib/graphql-document/components/IdentifierLink.d.ts.map +0 -1
  246. package/build/lib/graphql-document/components/IdentifierLink.js +0 -75
  247. package/build/lib/graphql-document/components/IdentifierLink.js.map +0 -1
  248. package/build/lib/graphql-document/components/graphql-document-styles.d.ts +0 -5
  249. package/build/lib/graphql-document/components/graphql-document-styles.d.ts.map +0 -1
  250. package/build/lib/graphql-document/components/graphql-document-styles.js +0 -144
  251. package/build/lib/graphql-document/components/graphql-document-styles.js.map +0 -1
  252. package/build/lib/graphql-document/components/index.d.ts +0 -5
  253. package/build/lib/graphql-document/components/index.d.ts.map +0 -1
  254. package/build/lib/graphql-document/components/index.js +0 -5
  255. package/build/lib/graphql-document/components/index.js.map +0 -1
  256. package/build/lib/graphql-document/example.d.ts +0 -25
  257. package/build/lib/graphql-document/example.d.ts.map +0 -1
  258. package/build/lib/graphql-document/example.js +0 -140
  259. package/build/lib/graphql-document/example.js.map +0 -1
  260. package/build/lib/graphql-document/graphql-document.d.ts +0 -35
  261. package/build/lib/graphql-document/graphql-document.d.ts.map +0 -1
  262. package/build/lib/graphql-document/graphql-document.js +0 -36
  263. package/build/lib/graphql-document/graphql-document.js.map +0 -1
  264. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts +0 -43
  265. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts.map +0 -1
  266. package/build/lib/graphql-document/hooks/use-tooltip-state.js +0 -132
  267. package/build/lib/graphql-document/hooks/use-tooltip-state.js.map +0 -1
  268. package/build/lib/graphql-document/positioning-simple.d.ts +0 -63
  269. package/build/lib/graphql-document/positioning-simple.d.ts.map +0 -1
  270. package/build/lib/graphql-document/positioning-simple.js +0 -185
  271. package/build/lib/graphql-document/positioning-simple.js.map +0 -1
  272. package/build/lib/graphql-document/schema-context.d.ts +0 -8
  273. package/build/lib/graphql-document/schema-context.d.ts.map +0 -1
  274. package/build/lib/graphql-document/schema-context.js +0 -11
  275. package/build/lib/graphql-document/schema-context.js.map +0 -1
  276. package/build/lib/graphql-document/schema-integration.d.ts +0 -135
  277. package/build/lib/graphql-document/schema-integration.d.ts.map +0 -1
  278. package/build/lib/graphql-document/schema-integration.js +0 -328
  279. package/build/lib/graphql-document/schema-integration.js.map +0 -1
  280. package/build/lib/graphql-document/types.d.ts +0 -117
  281. package/build/lib/graphql-document/types.d.ts.map +0 -1
  282. package/build/lib/graphql-document/types.js +0 -2
  283. package/build/lib/graphql-document/types.js.map +0 -1
  284. package/build/template/components/ChangelogLayout.d.ts.map +0 -1
  285. package/build/template/components/ChangelogLayout.js.map +0 -1
  286. package/build/template/components/CodeHikePre.d.ts +0 -16
  287. package/build/template/components/CodeHikePre.d.ts.map +0 -1
  288. package/build/template/components/CodeHikePre.js +0 -37
  289. package/build/template/components/CodeHikePre.js.map +0 -1
  290. package/src/lib/graphql-document/$$.ts +0 -4
  291. package/src/lib/graphql-document/$.test.ts +0 -132
  292. package/src/lib/graphql-document/$.ts +0 -1
  293. package/src/lib/graphql-document/README.md +0 -102
  294. package/src/lib/graphql-document/analysis.ts +0 -415
  295. package/src/lib/graphql-document/components/GraphQLDocument.tsx +0 -265
  296. package/src/lib/graphql-document/components/GraphQLDocument.unit.test.ts +0 -188
  297. package/src/lib/graphql-document/components/GraphQLDocumentWithSchema.tsx +0 -46
  298. package/src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx +0 -199
  299. package/src/lib/graphql-document/components/IdentifierLink.tsx +0 -160
  300. package/src/lib/graphql-document/components/graphql-document-styles.ts +0 -144
  301. package/src/lib/graphql-document/components/index.ts +0 -4
  302. package/src/lib/graphql-document/demo.md +0 -155
  303. package/src/lib/graphql-document/example.ts +0 -163
  304. package/src/lib/graphql-document/graphql-document.ts +0 -37
  305. package/src/lib/graphql-document/hooks/use-tooltip-state.test.ts +0 -76
  306. package/src/lib/graphql-document/hooks/use-tooltip-state.ts +0 -191
  307. package/src/lib/graphql-document/positioning-simple.test.ts +0 -248
  308. package/src/lib/graphql-document/positioning-simple.ts +0 -260
  309. package/src/lib/graphql-document/schema-context.tsx +0 -20
  310. package/src/lib/graphql-document/schema-integration.test.ts +0 -365
  311. package/src/lib/graphql-document/schema-integration.ts +0 -488
  312. package/src/lib/graphql-document/types.ts +0 -129
  313. package/src/template/components/CodeHikePre.tsx +0 -51
  314. /package/build/template/{components → layouts}/ChangelogLayout.d.ts +0 -0
@@ -1,328 +0,0 @@
1
- /**
2
- * Layer 2: Schema Integration
3
- *
4
- * Bridge between GraphQL analysis and Polen's schema system.
5
- * Resolves identifiers against the actual schema, extracts documentation,
6
- * and generates reference URLs for navigation.
7
- */
8
- import { getNamedType, isInputObjectType, isInterfaceType, isListType, isNonNullType, isObjectType, } from 'graphql';
9
- import { analyze } from './analysis.js';
10
- /**
11
- * Polen's implementation of SchemaResolver
12
- */
13
- export class PolenSchemaResolver {
14
- schema;
15
- routeConfig;
16
- constructor(schema, routeConfig = {}) {
17
- this.schema = schema;
18
- this.routeConfig = routeConfig;
19
- }
20
- /**
21
- * Resolve an identifier against the schema
22
- */
23
- resolveIdentifier(identifier) {
24
- const basePath = this.routeConfig.basePath || `/reference`;
25
- switch (identifier.kind) {
26
- case `Type`:
27
- return this.resolveType(identifier, basePath);
28
- case `Field`:
29
- return this.resolveField(identifier, basePath);
30
- case `Argument`:
31
- return this.resolveArgument(identifier, basePath);
32
- case `Variable`:
33
- // Variables don't have schema resolution
34
- return {
35
- exists: true,
36
- referenceUrl: `${basePath}#variables`,
37
- documentation: {
38
- typeInfo: `Variable`,
39
- description: `Query variable: $${identifier.name}`,
40
- },
41
- };
42
- case `Directive`:
43
- return this.resolveDirective(identifier, basePath);
44
- case `Fragment`:
45
- // Fragments don't have schema resolution
46
- return {
47
- exists: true,
48
- referenceUrl: `${basePath}#fragments`,
49
- documentation: {
50
- typeInfo: `Fragment`,
51
- description: `Fragment: ${identifier.name}`,
52
- },
53
- };
54
- default:
55
- return null;
56
- }
57
- }
58
- /**
59
- * Get documentation for a schema path
60
- */
61
- getDocumentation(schemaPath) {
62
- if (schemaPath.length === 0)
63
- return null;
64
- const [typeName, fieldName, argName] = schemaPath;
65
- if (!typeName)
66
- return null;
67
- const type = this.schema.getType(typeName);
68
- if (!type)
69
- return null;
70
- // Type-level documentation
71
- if (schemaPath.length === 1) {
72
- return {
73
- typeInfo: this.getTypeSignature(type),
74
- description: type.description || undefined,
75
- deprecated: `deprecationReason` in type
76
- ? {
77
- reason: type.deprecationReason,
78
- }
79
- : undefined,
80
- };
81
- }
82
- // Field-level documentation
83
- if (fieldName && schemaPath.length === 2) {
84
- const field = this.getFieldFromType(type, fieldName);
85
- if (!field)
86
- return null;
87
- return {
88
- typeInfo: this.getTypeSignature(field.type),
89
- description: field.description || undefined,
90
- deprecated: field.deprecationReason
91
- ? {
92
- reason: field.deprecationReason,
93
- }
94
- : undefined,
95
- };
96
- }
97
- // Argument-level documentation
98
- if (fieldName && argName && schemaPath.length === 3) {
99
- const field = this.getFieldFromType(type, fieldName);
100
- if (!field || !(`args` in field))
101
- return null;
102
- const arg = field.args.find((a) => a.name === argName);
103
- if (!arg)
104
- return null;
105
- return {
106
- typeInfo: this.getTypeSignature(arg.type),
107
- description: arg.description || undefined,
108
- defaultValue: arg.defaultValue !== undefined
109
- ? String(arg.defaultValue)
110
- : undefined,
111
- };
112
- }
113
- return null;
114
- }
115
- /**
116
- * Generate a reference URL for a schema path
117
- */
118
- generateReferenceLink(schemaPath) {
119
- const basePath = this.routeConfig.basePath || `/reference`;
120
- const includeFragments = this.routeConfig.includeFragments !== false;
121
- if (schemaPath.length === 0)
122
- return basePath;
123
- const [typeName, fieldName, argName] = schemaPath;
124
- // Type reference
125
- if (schemaPath.length === 1) {
126
- return `${basePath}/${typeName}`;
127
- }
128
- // Field reference
129
- if (fieldName && schemaPath.length === 2) {
130
- const fragment = includeFragments ? `#${fieldName}` : ``;
131
- return `${basePath}/${typeName}${fragment}`;
132
- }
133
- // Argument reference
134
- if (fieldName && argName && schemaPath.length === 3) {
135
- const fragment = includeFragments ? `#${fieldName}-${argName}` : ``;
136
- return `${basePath}/${typeName}${fragment}`;
137
- }
138
- return `${basePath}/${typeName}`;
139
- }
140
- /**
141
- * Check if a type exists in the schema
142
- */
143
- typeExists(typeName) {
144
- return !!this.schema.getType(typeName);
145
- }
146
- /**
147
- * Get all available types for validation
148
- */
149
- getAllTypes() {
150
- return Object.keys(this.schema.getTypeMap())
151
- .filter(name => !name.startsWith(`__`)); // Filter out introspection types
152
- }
153
- // Private helper methods
154
- resolveType(identifier, basePath) {
155
- const type = this.schema.getType(identifier.name);
156
- return {
157
- exists: !!type,
158
- graphqlType: type || undefined,
159
- referenceUrl: `${basePath}/${identifier.name}`,
160
- documentation: type
161
- ? {
162
- typeInfo: this.getTypeSignature(type),
163
- description: type.description || undefined,
164
- }
165
- : undefined,
166
- };
167
- }
168
- resolveField(identifier, basePath) {
169
- if (!identifier.parentType) {
170
- return {
171
- exists: false,
172
- referenceUrl: `${basePath}#${identifier.name}`,
173
- };
174
- }
175
- const parentType = this.schema.getType(identifier.parentType);
176
- if (!parentType) {
177
- return {
178
- exists: false,
179
- referenceUrl: `${basePath}/${identifier.parentType}#${identifier.name}`,
180
- };
181
- }
182
- const field = this.getFieldFromType(parentType, identifier.name);
183
- return {
184
- exists: !!field,
185
- referenceUrl: `${basePath}/${identifier.parentType}#${identifier.name}`,
186
- documentation: field
187
- ? {
188
- typeInfo: this.getTypeSignature(field.type),
189
- description: field.description || undefined,
190
- deprecated: field.deprecationReason
191
- ? {
192
- reason: field.deprecationReason,
193
- }
194
- : undefined,
195
- }
196
- : undefined,
197
- deprecated: field?.deprecationReason
198
- ? {
199
- reason: field.deprecationReason,
200
- }
201
- : undefined,
202
- };
203
- }
204
- resolveArgument(identifier, basePath) {
205
- const schemaPath = identifier.schemaPath;
206
- if (schemaPath.length < 3) {
207
- return {
208
- exists: false,
209
- referenceUrl: `${basePath}#${identifier.name}`,
210
- };
211
- }
212
- const [typeName, fieldName] = schemaPath;
213
- if (!typeName || !fieldName) {
214
- return {
215
- exists: false,
216
- referenceUrl: `${basePath}#${identifier.name}`,
217
- };
218
- }
219
- const parentType = this.schema.getType(typeName);
220
- if (!parentType) {
221
- return {
222
- exists: false,
223
- referenceUrl: `${basePath}/${typeName}#${fieldName}-${identifier.name}`,
224
- };
225
- }
226
- const field = this.getFieldFromType(parentType, fieldName);
227
- if (!field || !(`args` in field)) {
228
- return {
229
- exists: false,
230
- referenceUrl: `${basePath}/${typeName}#${fieldName}-${identifier.name}`,
231
- };
232
- }
233
- const arg = field.args.find((a) => a.name === identifier.name);
234
- return {
235
- exists: !!arg,
236
- referenceUrl: `${basePath}/${typeName}#${fieldName}-${identifier.name}`,
237
- documentation: arg
238
- ? {
239
- typeInfo: this.getTypeSignature(arg.type),
240
- description: arg.description || undefined,
241
- defaultValue: arg.defaultValue !== undefined
242
- ? String(arg.defaultValue)
243
- : undefined,
244
- }
245
- : undefined,
246
- };
247
- }
248
- resolveDirective(identifier, basePath) {
249
- const directive = this.schema.getDirective(identifier.name);
250
- return {
251
- exists: !!directive,
252
- referenceUrl: `${basePath}/directives#${identifier.name}`,
253
- documentation: directive
254
- ? {
255
- typeInfo: `Directive`,
256
- description: directive.description || undefined,
257
- }
258
- : undefined,
259
- };
260
- }
261
- getFieldFromType(type, fieldName) {
262
- if (isObjectType(type) || isInterfaceType(type)) {
263
- return type.getFields()[fieldName] || null;
264
- }
265
- if (isInputObjectType(type)) {
266
- return type.getFields()[fieldName] || null;
267
- }
268
- return null;
269
- }
270
- getTypeSignature(type) {
271
- if (isNonNullType(type)) {
272
- return `${this.getTypeSignature(type.ofType)}!`;
273
- }
274
- if (isListType(type)) {
275
- return `[${this.getTypeSignature(type.ofType)}]`;
276
- }
277
- return getNamedType(type).name;
278
- }
279
- }
280
- /**
281
- * Create a schema resolver for Polen
282
- */
283
- export const createPolenSchemaResolver = (schema, routeConfig) => {
284
- return new PolenSchemaResolver(schema, routeConfig);
285
- };
286
- /**
287
- * Perform schema-aware analysis of a GraphQL document
288
- */
289
- export const analyzeWithSchema = (source, schema, routeConfig) => {
290
- const analysis = analyze(source, {
291
- schema,
292
- validateAgainstSchema: true,
293
- includePositions: true,
294
- });
295
- const resolver = createPolenSchemaResolver(schema, routeConfig);
296
- const resolutions = new Map();
297
- const schemaErrors = [];
298
- // Resolve all identifiers against schema
299
- for (const identifier of analysis.identifiers.all) {
300
- const key = `${identifier.position.start}-${identifier.name}-${identifier.kind}`;
301
- const resolution = resolver.resolveIdentifier(identifier);
302
- if (resolution) {
303
- resolutions.set(key, resolution);
304
- // Add validation errors for non-existent identifiers
305
- if (!resolution.exists && (identifier.kind === `Type` || identifier.kind === `Field`)) {
306
- schemaErrors.push({
307
- identifier,
308
- message: `${identifier.kind} "${identifier.name}" does not exist in schema`,
309
- severity: `error`,
310
- });
311
- }
312
- // Add deprecation warnings
313
- if (resolution.deprecated) {
314
- schemaErrors.push({
315
- identifier,
316
- message: `${identifier.kind} "${identifier.name}" is deprecated: ${resolution.deprecated.reason}`,
317
- severity: `warning`,
318
- });
319
- }
320
- }
321
- }
322
- return {
323
- analysis,
324
- resolutions,
325
- schemaErrors,
326
- };
327
- };
328
- //# sourceMappingURL=schema-integration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-integration.js","sourceRoot":"","sources":["../../../src/lib/graphql-document/schema-integration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EAKZ,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,aAAa,EACb,YAAY,GACb,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AA+EvC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAEpB;IACA;IAFV,YACU,MAAqB,EACrB,cAA2B,EAAE;QAD7B,WAAM,GAAN,MAAM,CAAe;QACrB,gBAAW,GAAX,WAAW,CAAkB;IACpC,CAAC;IAEJ;;OAEG;IACH,iBAAiB,CAAC,UAAsB;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,IAAI,YAAY,CAAA;QAE1D,QAAQ,UAAU,CAA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gBACtF,YAAY,CAAC,IAAI,CAAC;oBAChB,UAAU;oBACV,OAAO,EAAE,GAAG,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,4BAA4B;oBAC3E,QAAQ,EAAE,OAAO;iBAClB,CAAC,CAAA;YACJ,CAAC;YAED,2BAA2B;YAC3B,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;gBAC1B,YAAY,CAAC,IAAI,CAAC;oBAChB,UAAU;oBACV,OAAO,EAAE,GAAG,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,oBAAoB,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE;oBACjG,QAAQ,EAAE,SAAS;iBACpB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,QAAQ;QACR,WAAW;QACX,YAAY;KACb,CAAA;AACH,CAAC,CAAA"}
@@ -1,117 +0,0 @@
1
- import type { DocumentNode, GraphQLError, GraphQLSchema } from 'graphql';
2
- /**
3
- * Represents a GraphQL identifier found in a document
4
- */
5
- export interface Identifier {
6
- /** The name of the identifier (e.g., 'User', 'name', 'id') */
7
- name: string;
8
- /** The kind of GraphQL construct this identifier represents */
9
- kind: `Type` | `Field` | `Argument` | `Directive` | `Variable` | `Fragment`;
10
- /** Position information in the source document */
11
- position: {
12
- /** Character offset from start of document */
13
- start: number;
14
- /** Character offset for end of identifier */
15
- end: number;
16
- /** Line number (1-based) */
17
- line: number;
18
- /** Column number (1-based) */
19
- column: number;
20
- };
21
- /** The parent type name if this is a field or argument */
22
- parentType?: string;
23
- /** Path through the schema to this identifier (e.g., ['User', 'posts', 'title']) */
24
- schemaPath: string[];
25
- /** Context about where this identifier appears */
26
- context: IdentifierContext;
27
- }
28
- /**
29
- * Additional context about where an identifier appears in the document
30
- */
31
- export interface IdentifierContext {
32
- /** The operation type if this identifier is within an operation */
33
- operationType?: `query` | `mutation` | `subscription`;
34
- /** The operation name if this identifier is within a named operation */
35
- operationName?: string;
36
- /** Whether this identifier is in a fragment definition */
37
- inFragment?: string;
38
- /** The selection path leading to this identifier */
39
- selectionPath: string[];
40
- }
41
- /**
42
- * Map of all identifiers found in a GraphQL document
43
- */
44
- export interface IdentifierMap {
45
- /** Quick lookup by character position */
46
- byPosition: Map<number, Identifier>;
47
- /** Grouped by identifier kind for easy filtering */
48
- byKind: Map<Identifier[`kind`], Identifier[]>;
49
- /** Any validation errors found during analysis */
50
- errors: AnalysisError[];
51
- /** All identifiers as a flat array */
52
- all: Identifier[];
53
- }
54
- /**
55
- * Analysis error with context about the identifier that caused it
56
- */
57
- export interface AnalysisError {
58
- /** The identifier that caused the error (if applicable) */
59
- identifier?: Identifier;
60
- /** Human-readable error message */
61
- message: string;
62
- /** Error severity level */
63
- severity: `error` | `warning` | `info`;
64
- /** Position in the document where the error occurred */
65
- position?: {
66
- line: number;
67
- column: number;
68
- };
69
- }
70
- /**
71
- * Result of analyzing a GraphQL document
72
- */
73
- export interface AnalysisResult {
74
- /** The parsed AST */
75
- ast: DocumentNode;
76
- /** Map of all identifiers found */
77
- identifiers: IdentifierMap;
78
- /** Whether the document parsed successfully */
79
- isValid: boolean;
80
- /** Any parse or validation errors */
81
- errors: GraphQLError[];
82
- }
83
- /**
84
- * Configuration for GraphQL document analysis
85
- */
86
- export interface AnalysisConfig {
87
- /** Whether to include position information for identifiers */
88
- includePositions?: boolean;
89
- /** Whether to validate against a schema (if provided) */
90
- validateAgainstSchema?: boolean;
91
- /** Schema to validate against */
92
- schema?: GraphQLSchema;
93
- /** Whether to extract fragment information */
94
- includeFragments?: boolean;
95
- }
96
- /**
97
- * Interface for the main GraphQL analyzer
98
- */
99
- export interface GraphQLAnalyzer {
100
- /**
101
- * Parse a GraphQL document string into an AST
102
- */
103
- parse(source: string): DocumentNode;
104
- /**
105
- * Extract all identifiers from a GraphQL AST
106
- */
107
- extractIdentifiers(ast: DocumentNode, config?: AnalysisConfig): IdentifierMap;
108
- /**
109
- * Validate a GraphQL document against a schema
110
- */
111
- validateAgainstSchema(ast: DocumentNode, schema: GraphQLSchema): GraphQLError[];
112
- /**
113
- * Perform complete analysis of a GraphQL document
114
- */
115
- analyze(source: string, config?: AnalysisConfig): AnalysisResult;
116
- }
117
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/graphql-document/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,+DAA+D;IAC/D,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAA;IAC3E,kDAAkD;IAClD,QAAQ,EAAE;QACR,8CAA8C;QAC9C,KAAK,EAAE,MAAM,CAAA;QACb,6CAA6C;QAC7C,GAAG,EAAE,MAAM,CAAA;QACX,4BAA4B;QAC5B,IAAI,EAAE,MAAM,CAAA;QACZ,8BAA8B;QAC9B,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oFAAoF;IACpF,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,kDAAkD;IAClD,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,aAAa,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,cAAc,CAAA;IACrD,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oDAAoD;IACpD,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,UAAU,EA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,cAAc,GAAG,aAAa,CAAA;IAE7E;;OAEG;IACH,qBAAqB,CACnB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,aAAa,GACpB,YAAY,EAAE,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,cAAc,CAAA;CACjE"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/graphql-document/types.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChangelogLayout.d.ts","sourceRoot":"","sources":["../../../src/template/components/ChangelogLayout.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,EAAE,gBAAgB,CAAC,SAAS,EAAE,CAAA;CACvC;AAoED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAyE1D,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChangelogLayout.js","sourceRoot":"","sources":["../../../src/template/components/ChangelogLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAa3C,MAAM,eAAe,GAAG,CAAC,OAAmC,EAAiB,EAAE;IAC7E,O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EAAE,OAAO,EAAE,yBAE1D,EACN,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAC/C,KAAC,YAAY,IAEX,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAHjD,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAI/B,CACH,CAAC,IACE,EAGN,KAAC,GAAG,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,YACjC,QAAQ,GACL,IACD,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -1,16 +0,0 @@
1
- import { Pre as CodeHikePre } from 'codehike/code';
2
- import React from 'react';
3
- type CodeHikePreProps = React.ComponentProps<typeof CodeHikePre>;
4
- type HTMLPreProps = React.ComponentPropsWithoutRef<'pre'>;
5
- type PreProps = CodeHikePreProps | HTMLPreProps;
6
- /**
7
- * Custom Pre component that adds interactive GraphQL support to Code Hike
8
- *
9
- * Usage in MDX:
10
- * ```graphql interactive
11
- * query { ... }
12
- * ```
13
- */
14
- export declare const Pre: React.FC<PreProps>;
15
- export {};
16
- //# sourceMappingURL=CodeHikePre.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeHikePre.d.ts","sourceRoot":"","sources":["../../../src/template/components/CodeHikePre.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,KAAK,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,CAAA;AAChE,KAAK,YAAY,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AACzD,KAAK,QAAQ,GAAG,gBAAgB,GAAG,YAAY,CAAA;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAkClC,CAAA"}
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Pre as CodeHikePre } from 'codehike/code';
3
- import React from 'react';
4
- import { GraphQLDocument } from '../../lib/graphql-document/components/GraphQLDocument.js';
5
- /**
6
- * Custom Pre component that adds interactive GraphQL support to Code Hike
7
- *
8
- * Usage in MDX:
9
- * ```graphql interactive
10
- * query { ... }
11
- * ```
12
- */
13
- export const Pre = (props) => {
14
- // Check if this is a Code Hike pre component (has 'code' prop)
15
- if ('code' in props && props.code) {
16
- const { code } = props;
17
- // Check if this is an interactive GraphQL block
18
- if (code.lang === 'graphql' && code.meta?.includes('interactive')) {
19
- // Extract the GraphQL schema if available
20
- const schema = typeof window !== 'undefined'
21
- ? window.__POLEN_GRAPHQL_SCHEMA__
22
- : null;
23
- // For interactive GraphQL blocks, we need to apply Code Hike's styling
24
- // but add GraphQLDocument's interactive features
25
- return (_jsx(GraphQLDocument, { schema: schema, options: {
26
- className: 'ch-code-container',
27
- // Use Code Hike's Pre component for rendering
28
- renderCode: () => _jsx(CodeHikePre, { ...props }),
29
- }, children: code.code }));
30
- }
31
- // For other Code Hike code blocks, use Code Hike's Pre
32
- return _jsx(CodeHikePre, { ...props });
33
- }
34
- // For standard HTML pre elements, render as-is
35
- return _jsx("pre", { ...props });
36
- };
37
- //# sourceMappingURL=CodeHikePre.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeHikePre.js","sourceRoot":"","sources":["../../../src/template/components/CodeHikePre.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAA;AAM1F;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAAuB,CAAC,KAAK,EAAE,EAAE;IAC/C,+DAA+D;IAC/D,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAA;QAEtB,gDAAgD;QAChD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAClE,0CAA0C;YAC1C,MAAM,MAAM,GAAG,OAAO,MAAM,KAAK,WAAW;gBAC1C,CAAC,CAAE,MAAc,CAAC,wBAAwB;gBAC1C,CAAC,CAAC,IAAI,CAAA;YAER,uEAAuE;YACvE,iDAAiD;YACjD,OAAO,CACL,KAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;oBACP,SAAS,EAAE,mBAAmB;oBAC9B,8CAA8C;oBAC9C,UAAU,EAAE,GAAG,EAAE,CAAC,KAAC,WAAW,OAAK,KAAyB,GAAI;iBACjE,YAEA,IAAI,CAAC,IAAI,GACM,CACnB,CAAA;QACH,CAAC;QAED,uDAAuD;QACvD,OAAO,KAAC,WAAW,OAAK,KAAyB,GAAI,CAAA;IACvD,CAAC;IAED,+CAA+C;IAC/C,OAAO,iBAAS,KAAqB,GAAI,CAAA;AAC3C,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './analysis.js'
2
- export * from './positioning-simple.js'
3
- export * from './schema-integration.js'
4
- export * from './types.js'