@alloy-js/core 0.23.0-dev.12 → 0.23.0-dev.15

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 (521) hide show
  1. package/api-extractor.json +1 -8
  2. package/api-extractor.testing.json +19 -0
  3. package/dist/dev/src/binder.js +108 -1
  4. package/dist/dev/src/binder.js.map +1 -1
  5. package/dist/dev/src/components/Block.js +17 -5
  6. package/dist/dev/src/components/Block.js.map +1 -1
  7. package/dist/dev/src/components/List.js +1 -1
  8. package/dist/dev/src/components/List.js.map +1 -1
  9. package/dist/dev/src/components/MemberDeclaration.js +6 -6
  10. package/dist/dev/src/components/MemberName.js +7 -0
  11. package/dist/dev/src/components/MemberName.js.map +1 -1
  12. package/dist/dev/src/components/MemberScope.js +7 -2
  13. package/dist/dev/src/components/MemberScope.js.map +1 -1
  14. package/dist/dev/src/components/Output.js +4 -4
  15. package/dist/dev/src/components/Output.js.map +1 -1
  16. package/dist/dev/src/components/Scope.js +7 -1
  17. package/dist/dev/src/components/Scope.js.map +1 -1
  18. package/dist/dev/src/components/SourceFile.js +3 -3
  19. package/dist/dev/src/components/SourceFile.js.map +1 -1
  20. package/dist/dev/src/context/binder.js +5 -0
  21. package/dist/dev/src/context/binder.js.map +1 -1
  22. package/dist/dev/src/context/format-options.js +14 -1
  23. package/dist/dev/src/context/format-options.js.map +1 -1
  24. package/dist/dev/src/context/scope.js +5 -0
  25. package/dist/dev/src/context/scope.js.map +1 -1
  26. package/dist/dev/src/context/source-directory.js +9 -0
  27. package/dist/dev/src/context/source-directory.js.map +1 -1
  28. package/dist/dev/src/debug/cli.js +3 -2
  29. package/dist/dev/src/debug/cli.js.map +1 -1
  30. package/dist/dev/src/debug/source-map.browser.js +24 -0
  31. package/dist/dev/src/debug/source-map.browser.js.map +1 -0
  32. package/dist/dev/src/debug/trace.js +7 -6
  33. package/dist/dev/src/debug/trace.js.map +1 -1
  34. package/dist/dev/src/host/node-host.browser.js +21 -0
  35. package/dist/dev/src/host/node-host.browser.js.map +1 -0
  36. package/dist/dev/src/host/node-host.js +20 -0
  37. package/dist/dev/src/host/node-host.js.map +1 -0
  38. package/dist/dev/src/library-symbol-reference.js +54 -0
  39. package/dist/dev/src/library-symbol-reference.js.map +1 -1
  40. package/dist/dev/src/name-policy.js +27 -0
  41. package/dist/dev/src/name-policy.js.map +1 -1
  42. package/dist/dev/src/reactivity.js +16 -0
  43. package/dist/dev/src/reactivity.js.map +1 -1
  44. package/dist/dev/src/render-stack.js +4 -3
  45. package/dist/dev/src/render-stack.js.map +1 -1
  46. package/dist/dev/src/render.js.map +1 -1
  47. package/dist/dev/src/symbols/output-scope.js +34 -1
  48. package/dist/dev/src/symbols/output-scope.js.map +1 -1
  49. package/dist/dev/src/symbols/output-space.js +15 -0
  50. package/dist/dev/src/symbols/output-space.js.map +1 -1
  51. package/dist/dev/src/symbols/output-symbol.js +81 -11
  52. package/dist/dev/src/symbols/output-symbol.js.map +1 -1
  53. package/dist/dev/src/symbols/symbol-slot.js +7 -0
  54. package/dist/dev/src/symbols/symbol-slot.js.map +1 -1
  55. package/dist/dev/src/symbols/symbol-slot.test.js +27 -2
  56. package/dist/dev/src/symbols/symbol-slot.test.js.map +1 -1
  57. package/dist/dev/src/write-output.js +6 -5
  58. package/dist/dev/src/write-output.js.map +1 -1
  59. package/dist/dev/test/browser-build.test.js +67 -68
  60. package/dist/dev/test/browser-build.test.js.map +1 -1
  61. package/dist/dev/testing/create-test-wrapper.js +59 -5
  62. package/dist/dev/testing/create-test-wrapper.js.map +1 -1
  63. package/dist/dev/testing/extend-expect.js +20 -0
  64. package/dist/dev/testing/extend-expect.js.map +1 -1
  65. package/dist/dev/testing/index.js +1 -1
  66. package/dist/dev/testing/index.js.map +1 -1
  67. package/dist/dev/testing/render.js +11 -0
  68. package/dist/dev/testing/render.js.map +1 -1
  69. package/dist/src/binder.d.ts +107 -3
  70. package/dist/src/binder.d.ts.map +1 -1
  71. package/dist/src/binder.js +108 -1
  72. package/dist/src/binder.js.map +1 -1
  73. package/dist/src/components/Block.d.ts +12 -0
  74. package/dist/src/components/Block.d.ts.map +1 -1
  75. package/dist/src/components/Block.js +12 -0
  76. package/dist/src/components/Block.js.map +1 -1
  77. package/dist/src/components/List.d.ts +11 -1
  78. package/dist/src/components/List.d.ts.map +1 -1
  79. package/dist/src/components/List.js.map +1 -1
  80. package/dist/src/components/MemberDeclaration.d.ts +6 -6
  81. package/dist/src/components/MemberDeclaration.js +6 -6
  82. package/dist/src/components/MemberName.d.ts +6 -0
  83. package/dist/src/components/MemberName.d.ts.map +1 -1
  84. package/dist/src/components/MemberName.js +7 -0
  85. package/dist/src/components/MemberName.js.map +1 -1
  86. package/dist/src/components/MemberScope.d.ts +5 -0
  87. package/dist/src/components/MemberScope.d.ts.map +1 -1
  88. package/dist/src/components/MemberScope.js +5 -0
  89. package/dist/src/components/MemberScope.js.map +1 -1
  90. package/dist/src/components/Output.d.ts +4 -2
  91. package/dist/src/components/Output.d.ts.map +1 -1
  92. package/dist/src/components/Output.js.map +1 -1
  93. package/dist/src/components/Scope.d.ts +6 -0
  94. package/dist/src/components/Scope.d.ts.map +1 -1
  95. package/dist/src/components/Scope.js +6 -0
  96. package/dist/src/components/Scope.js.map +1 -1
  97. package/dist/src/components/SourceFile.d.ts +22 -2
  98. package/dist/src/components/SourceFile.d.ts.map +1 -1
  99. package/dist/src/components/SourceFile.js.map +1 -1
  100. package/dist/src/context/binder.d.ts +4 -0
  101. package/dist/src/context/binder.d.ts.map +1 -1
  102. package/dist/src/context/binder.js +5 -0
  103. package/dist/src/context/binder.js.map +1 -1
  104. package/dist/src/context/format-options.d.ts +14 -1
  105. package/dist/src/context/format-options.d.ts.map +1 -1
  106. package/dist/src/context/format-options.js +14 -1
  107. package/dist/src/context/format-options.js.map +1 -1
  108. package/dist/src/context/scope.d.ts +4 -0
  109. package/dist/src/context/scope.d.ts.map +1 -1
  110. package/dist/src/context/scope.js +5 -0
  111. package/dist/src/context/scope.js.map +1 -1
  112. package/dist/src/context/source-directory.d.ts +9 -0
  113. package/dist/src/context/source-directory.d.ts.map +1 -1
  114. package/dist/src/context/source-directory.js +9 -0
  115. package/dist/src/context/source-directory.js.map +1 -1
  116. package/dist/src/debug/cli.d.ts.map +1 -1
  117. package/dist/src/debug/cli.js +3 -2
  118. package/dist/src/debug/cli.js.map +1 -1
  119. package/dist/src/debug/source-map.browser.d.ts +16 -0
  120. package/dist/src/debug/source-map.browser.d.ts.map +1 -0
  121. package/dist/src/debug/source-map.browser.js +24 -0
  122. package/dist/src/debug/source-map.browser.js.map +1 -0
  123. package/dist/src/debug/trace.d.ts.map +1 -1
  124. package/dist/src/debug/trace.js +7 -6
  125. package/dist/src/debug/trace.js.map +1 -1
  126. package/dist/src/host/node-host.browser.d.ts +11 -0
  127. package/dist/src/host/node-host.browser.d.ts.map +1 -0
  128. package/dist/src/host/node-host.browser.js +21 -0
  129. package/dist/src/host/node-host.browser.js.map +1 -0
  130. package/dist/src/host/node-host.d.ts +11 -0
  131. package/dist/src/host/node-host.d.ts.map +1 -0
  132. package/dist/src/host/node-host.js +20 -0
  133. package/dist/src/host/node-host.js.map +1 -0
  134. package/dist/src/library-symbol-reference.d.ts +52 -0
  135. package/dist/src/library-symbol-reference.d.ts.map +1 -1
  136. package/dist/src/library-symbol-reference.js +54 -0
  137. package/dist/src/library-symbol-reference.js.map +1 -1
  138. package/dist/src/name-policy.d.ts +30 -3
  139. package/dist/src/name-policy.d.ts.map +1 -1
  140. package/dist/src/name-policy.js +27 -0
  141. package/dist/src/name-policy.js.map +1 -1
  142. package/dist/src/reactivity.d.ts +15 -0
  143. package/dist/src/reactivity.d.ts.map +1 -1
  144. package/dist/src/reactivity.js +16 -0
  145. package/dist/src/reactivity.js.map +1 -1
  146. package/dist/src/render-stack.d.ts.map +1 -1
  147. package/dist/src/render-stack.js +4 -3
  148. package/dist/src/render-stack.js.map +1 -1
  149. package/dist/src/render.d.ts +2 -0
  150. package/dist/src/render.d.ts.map +1 -1
  151. package/dist/src/render.js.map +1 -1
  152. package/dist/src/symbols/output-scope.d.ts +33 -1
  153. package/dist/src/symbols/output-scope.d.ts.map +1 -1
  154. package/dist/src/symbols/output-scope.js +34 -1
  155. package/dist/src/symbols/output-scope.js.map +1 -1
  156. package/dist/src/symbols/output-space.d.ts +12 -0
  157. package/dist/src/symbols/output-space.d.ts.map +1 -1
  158. package/dist/src/symbols/output-space.js +15 -0
  159. package/dist/src/symbols/output-space.js.map +1 -1
  160. package/dist/src/symbols/output-symbol.d.ts +93 -12
  161. package/dist/src/symbols/output-symbol.d.ts.map +1 -1
  162. package/dist/src/symbols/output-symbol.js +81 -11
  163. package/dist/src/symbols/output-symbol.js.map +1 -1
  164. package/dist/src/symbols/symbol-slot.d.ts.map +1 -1
  165. package/dist/src/symbols/symbol-slot.js +7 -0
  166. package/dist/src/symbols/symbol-slot.js.map +1 -1
  167. package/dist/src/symbols/symbol-slot.test.js +18 -1
  168. package/dist/src/symbols/symbol-slot.test.js.map +1 -1
  169. package/dist/src/write-output.d.ts.map +1 -1
  170. package/dist/src/write-output.js +6 -5
  171. package/dist/src/write-output.js.map +1 -1
  172. package/dist/test/browser-build.test.js +67 -68
  173. package/dist/test/browser-build.test.js.map +1 -1
  174. package/dist/testing/create-test-wrapper.d.ts +75 -2
  175. package/dist/testing/create-test-wrapper.d.ts.map +1 -1
  176. package/dist/testing/create-test-wrapper.js +55 -1
  177. package/dist/testing/create-test-wrapper.js.map +1 -1
  178. package/dist/testing/extend-expect.d.ts +26 -0
  179. package/dist/testing/extend-expect.d.ts.map +1 -1
  180. package/dist/testing/extend-expect.js +20 -0
  181. package/dist/testing/extend-expect.js.map +1 -1
  182. package/dist/testing/index.d.ts +1 -1
  183. package/dist/testing/index.d.ts.map +1 -1
  184. package/dist/testing/index.js +1 -1
  185. package/dist/testing/index.js.map +1 -1
  186. package/dist/testing/render.d.ts +9 -0
  187. package/dist/testing/render.d.ts.map +1 -1
  188. package/dist/testing/render.js +11 -0
  189. package/dist/testing/render.js.map +1 -1
  190. package/dist/tsconfig.tsbuildinfo +1 -1
  191. package/docs/api/components/AppendRegion.md +83 -0
  192. package/docs/api/components/Block.md +49 -0
  193. package/docs/api/components/CopyFile.md +26 -0
  194. package/docs/api/components/Declaration.md +85 -0
  195. package/docs/api/components/For.md +91 -0
  196. package/docs/api/components/Indent.md +40 -0
  197. package/docs/api/components/List.md +68 -0
  198. package/docs/api/components/MemberDeclaration.md +89 -0
  199. package/docs/api/components/MemberName.md +21 -0
  200. package/docs/api/components/MemberScope.md +81 -0
  201. package/docs/api/components/Name.md +19 -0
  202. package/docs/api/components/Output.md +62 -0
  203. package/docs/api/components/Prose.md +29 -0
  204. package/docs/api/components/ReferenceOrContent.md +28 -0
  205. package/docs/api/components/Scope.md +83 -0
  206. package/docs/api/components/Show.md +32 -0
  207. package/docs/api/components/SourceDirectory.md +28 -0
  208. package/docs/api/components/SourceFile.md +60 -0
  209. package/docs/api/components/StatementList.md +29 -0
  210. package/docs/api/components/Switch.md +42 -0
  211. package/docs/api/components/TemplateFile.md +71 -0
  212. package/docs/api/components/TemplateVariable.md +57 -0
  213. package/docs/api/components/UpdateFile.md +56 -0
  214. package/docs/api/components/Wrap.md +40 -0
  215. package/docs/api/components/createAccessExpression.md +55 -0
  216. package/docs/api/components/index.md +27 -0
  217. package/docs/api/contexts/Assignment-context.md +43 -0
  218. package/docs/api/contexts/Binder-context.md +22 -0
  219. package/docs/api/contexts/Declaration-context.md +15 -0
  220. package/docs/api/contexts/Member-context.md +17 -0
  221. package/docs/api/contexts/MemberDeclaration-context.md +24 -0
  222. package/docs/api/contexts/NamePolicy-context.md +18 -0
  223. package/docs/api/contexts/Scope-context.md +20 -0
  224. package/docs/api/contexts/SourceDirectory-context.md +26 -0
  225. package/docs/api/contexts/SourceFile-context.md +19 -0
  226. package/docs/api/contexts/index.md +11 -0
  227. package/docs/api/functions/attachDiagnosticsCollector.md +18 -0
  228. package/docs/api/functions/baseListPropsToMapJoinArgs.md +20 -0
  229. package/docs/api/functions/children.md +27 -0
  230. package/docs/api/functions/childrenArray.md +25 -0
  231. package/docs/api/functions/code.md +25 -0
  232. package/docs/api/functions/computed.md +18 -0
  233. package/docs/api/functions/createComponent.md +20 -0
  234. package/docs/api/functions/createContentSlot.md +33 -0
  235. package/docs/api/functions/createContext.md +19 -0
  236. package/docs/api/functions/createCustomContext.md +18 -0
  237. package/docs/api/functions/createDeclarationTap.md +20 -0
  238. package/docs/api/functions/createFileResource.md +35 -0
  239. package/docs/api/functions/createFormatOptionsContextFor.md +28 -0
  240. package/docs/api/functions/createIntrinsic.md +19 -0
  241. package/docs/api/functions/createMemberTap.md +20 -0
  242. package/docs/api/functions/createNamePolicy.md +37 -0
  243. package/docs/api/functions/createNamedContext.md +19 -0
  244. package/docs/api/functions/createOutputBinder.md +24 -0
  245. package/docs/api/functions/createRenderTreeHook.md +19 -0
  246. package/docs/api/functions/createResource.md +77 -0
  247. package/docs/api/functions/createScope.md +35 -0
  248. package/docs/api/functions/createScopeTap.md +20 -0
  249. package/docs/api/functions/createSourceFileTap.md +20 -0
  250. package/docs/api/functions/createSymbol.md +25 -0
  251. package/docs/api/functions/createSymbolSlot.md +19 -0
  252. package/docs/api/functions/createTap.md +55 -0
  253. package/docs/api/functions/decl.md +20 -0
  254. package/docs/api/functions/defaultProps.md +21 -0
  255. package/docs/api/functions/effect.md +26 -0
  256. package/docs/api/functions/emitDiagnostic.md +18 -0
  257. package/docs/api/functions/emitSymbol.md +18 -0
  258. package/docs/api/functions/ensureIsEmpty.md +20 -0
  259. package/docs/api/functions/findCurrentEffectId.md +19 -0
  260. package/docs/api/functions/findKeyedChild.md +19 -0
  261. package/docs/api/functions/findKeyedChildren.md +19 -0
  262. package/docs/api/functions/findUnkeyedChildren.md +18 -0
  263. package/docs/api/functions/formatReactivePropertyLabel.md +21 -0
  264. package/docs/api/functions/getAssignmentSymbol.md +19 -0
  265. package/docs/api/functions/getContext.md +17 -0
  266. package/docs/api/functions/getContextForRenderNode.md +18 -0
  267. package/docs/api/functions/getDiagnosticsForTree.md +18 -0
  268. package/docs/api/functions/getEffectDebugId.md +18 -0
  269. package/docs/api/functions/getElementCache.md +17 -0
  270. package/docs/api/functions/getReactiveCreationLocation.md +18 -0
  271. package/docs/api/functions/getSymbolCreator.md +18 -0
  272. package/docs/api/functions/getSymbolCreatorSymbol.md +17 -0
  273. package/docs/api/functions/index.md +105 -0
  274. package/docs/api/functions/inspectRefkey.md +18 -0
  275. package/docs/api/functions/instantiateTakenMembersTo.md +20 -0
  276. package/docs/api/functions/isComponentCreator.md +19 -0
  277. package/docs/api/functions/isCustomContext.md +18 -0
  278. package/docs/api/functions/isIntrinsicElement.md +18 -0
  279. package/docs/api/functions/isKeyedChild.md +18 -0
  280. package/docs/api/functions/isLibrarySymbolReference.md +18 -0
  281. package/docs/api/functions/isMemberRefkey.md +18 -0
  282. package/docs/api/functions/isNamekey.md +18 -0
  283. package/docs/api/functions/isPrintHook.md +18 -0
  284. package/docs/api/functions/isRefkey.md +18 -0
  285. package/docs/api/functions/isRefkeyable.md +18 -0
  286. package/docs/api/functions/isRenderableObject.md +20 -0
  287. package/docs/api/functions/isSymbolRefkey.md +18 -0
  288. package/docs/api/functions/join.md +33 -0
  289. package/docs/api/functions/mapJoin.md +106 -0
  290. package/docs/api/functions/memberRefkey.md +27 -0
  291. package/docs/api/functions/memo.md +29 -0
  292. package/docs/api/functions/mergeProps.md +64 -0
  293. package/docs/api/functions/moveTakenMembersTo.md +18 -0
  294. package/docs/api/functions/namekey.md +41 -0
  295. package/docs/api/functions/nextReactiveId.md +19 -0
  296. package/docs/api/functions/notifyContentState.md +17 -0
  297. package/docs/api/functions/onCleanup.md +26 -0
  298. package/docs/api/functions/printTree.md +31 -0
  299. package/docs/api/functions/reactivePropertyRefId.md +21 -0
  300. package/docs/api/functions/ref.md +21 -0
  301. package/docs/api/functions/refId.md +18 -0
  302. package/docs/api/functions/refkey.md +24 -0
  303. package/docs/api/functions/render.md +31 -0
  304. package/docs/api/functions/renderAsync.md +31 -0
  305. package/docs/api/functions/renderTree.md +18 -0
  306. package/docs/api/functions/reportDiagnostics.md +18 -0
  307. package/docs/api/functions/resetRefIdCounter.md +17 -0
  308. package/docs/api/functions/resolve.md +31 -0
  309. package/docs/api/functions/root.md +25 -0
  310. package/docs/api/functions/shallowReactive.md +18 -0
  311. package/docs/api/functions/shallowRef.md +21 -0
  312. package/docs/api/functions/sourceFilesForTree.md +31 -0
  313. package/docs/api/functions/splitProps.md +19 -0
  314. package/docs/api/functions/stc.md +18 -0
  315. package/docs/api/functions/sti.md +18 -0
  316. package/docs/api/functions/symbolForRefkey.md +24 -0
  317. package/docs/api/functions/taggedComponent.md +19 -0
  318. package/docs/api/functions/takeSymbols.md +18 -0
  319. package/docs/api/functions/text.md +19 -0
  320. package/docs/api/functions/toRef.md +20 -0
  321. package/docs/api/functions/toRefkey.md +18 -0
  322. package/docs/api/functions/toRefs.md +20 -0
  323. package/docs/api/functions/traverseOutput.md +21 -0
  324. package/docs/api/functions/unresolvedRefkey.md +18 -0
  325. package/docs/api/functions/untrack.md +18 -0
  326. package/docs/api/functions/useContext.md +18 -0
  327. package/docs/api/functions/useFormatOptions.md +18 -0
  328. package/docs/api/functions/useMemberContext.md +17 -0
  329. package/docs/api/functions/useMemberScope.md +17 -0
  330. package/docs/api/functions/writeOutput.md +21 -0
  331. package/docs/api/index.md +9 -0
  332. package/docs/api/testing/functions/createTestWrapper.md +70 -0
  333. package/docs/api/testing/functions/d.md +21 -0
  334. package/docs/api/testing/functions/dedent.md +18 -0
  335. package/docs/api/testing/functions/index.md +6 -0
  336. package/docs/api/testing/functions/renderToString.md +20 -0
  337. package/docs/api/testing/index.md +4 -0
  338. package/docs/api/testing/types/TestWrapper.md +10 -0
  339. package/docs/api/testing/types/ToRenderToOptions.md +24 -0
  340. package/docs/api/testing/types/index.md +4 -0
  341. package/docs/api/types/AlignIntrinsicElement.md +5 -0
  342. package/docs/api/types/AppendRegionProps.md +5 -0
  343. package/docs/api/types/BaseListProps.md +21 -0
  344. package/docs/api/types/BasePartProps.md +10 -0
  345. package/docs/api/types/BasicScope.md +15 -0
  346. package/docs/api/types/BasicSymbol.md +18 -0
  347. package/docs/api/types/Binder.md +18 -0
  348. package/docs/api/types/BinderOptions.md +7 -0
  349. package/docs/api/types/BrIntrinsicElement.md +5 -0
  350. package/docs/api/types/BreakParentIntrinsicElement.md +5 -0
  351. package/docs/api/types/Child.md +5 -0
  352. package/docs/api/types/Children.md +5 -0
  353. package/docs/api/types/ChildrenOptions.md +7 -0
  354. package/docs/api/types/CommonFormatOptions.md +8 -0
  355. package/docs/api/types/Component.md +8 -0
  356. package/docs/api/types/ComponentContext.md +11 -0
  357. package/docs/api/types/ComponentCreator.md +11 -0
  358. package/docs/api/types/ComponentDefinition.md +7 -0
  359. package/docs/api/types/ContentOutputFile.md +10 -0
  360. package/docs/api/types/ContentSlot.md +12 -0
  361. package/docs/api/types/Context.md +19 -0
  362. package/docs/api/types/ContextProviderProps.md +8 -0
  363. package/docs/api/types/CopyFileContext.md +8 -0
  364. package/docs/api/types/CopyOutputFile.md +9 -0
  365. package/docs/api/types/CustomContext.md +10 -0
  366. package/docs/api/types/CustomContextChildrenCallback.md +5 -0
  367. package/docs/api/types/DeclarationProps.md +5 -0
  368. package/docs/api/types/DedentIntrinsicElement.md +5 -0
  369. package/docs/api/types/DedentToRootIntrinsicElement.md +5 -0
  370. package/docs/api/types/Diagnostic.md +11 -0
  371. package/docs/api/types/DiagnosticHandle.md +7 -0
  372. package/docs/api/types/DiagnosticInput.md +10 -0
  373. package/docs/api/types/DiagnosticSeverity.md +5 -0
  374. package/docs/api/types/DiagnosticStackEntry.md +9 -0
  375. package/docs/api/types/DiagnosticsCollector.md +8 -0
  376. package/docs/api/types/Disposable_2.md +7 -0
  377. package/docs/api/types/EffectDebugOptions.md +8 -0
  378. package/docs/api/types/EffectOptions.md +7 -0
  379. package/docs/api/types/ElementCache.md +5 -0
  380. package/docs/api/types/ElementCacheKey.md +5 -0
  381. package/docs/api/types/FillIntrinsicElement.md +5 -0
  382. package/docs/api/types/ForCallbackArgs.md +5 -0
  383. package/docs/api/types/ForSupportedCollections.md +5 -0
  384. package/docs/api/types/GroupIntrinsicElement.md +5 -0
  385. package/docs/api/types/HardlineIntrinsicElement.md +5 -0
  386. package/docs/api/types/HbrIntrinsicElement.md +5 -0
  387. package/docs/api/types/IfBreakIntrinsicElement.md +5 -0
  388. package/docs/api/types/IndentIfBreakIntrinsicElement.md +5 -0
  389. package/docs/api/types/IndentIntrinsicElement.md +5 -0
  390. package/docs/api/types/IntrinsicElement.md +5 -0
  391. package/docs/api/types/IntrinsicElementBase.md +9 -0
  392. package/docs/api/types/IntrinsicElements.md +26 -0
  393. package/docs/api/types/JoinOptions.md +9 -0
  394. package/docs/api/types/LbrIntrinsicElement.md +5 -0
  395. package/docs/api/types/LibrarySymbolReference.md +13 -0
  396. package/docs/api/types/LineIntrinsicElement.md +5 -0
  397. package/docs/api/types/LineSuffixBoundaryIntrinsicElement.md +5 -0
  398. package/docs/api/types/LineSuffixIntrinsicElement.md +5 -0
  399. package/docs/api/types/LiterallineIntrinsicElement.md +5 -0
  400. package/docs/api/types/MakeChildrenOptional.md +7 -0
  401. package/docs/api/types/MarkAsRootIntrinsicElement.md +5 -0
  402. package/docs/api/types/MatchProps.md +9 -0
  403. package/docs/api/types/MemberDeclarationProps.md +5 -0
  404. package/docs/api/types/MemberDescriptor.md +10 -0
  405. package/docs/api/types/MemberRefkey.md +10 -0
  406. package/docs/api/types/MemberResolutionContext.md +10 -0
  407. package/docs/api/types/MemberResolver.md +32 -0
  408. package/docs/api/types/MemberScopeProps.md +5 -0
  409. package/docs/api/types/Metadata.md +5 -0
  410. package/docs/api/types/NameConflictResolver.md +27 -0
  411. package/docs/api/types/NamePolicy.md +8 -0
  412. package/docs/api/types/NamePolicyGetter.md +9 -0
  413. package/docs/api/types/Namekey.md +10 -0
  414. package/docs/api/types/NamekeyOptions.md +8 -0
  415. package/docs/api/types/OnReactiveSetAddCallback.md +5 -0
  416. package/docs/api/types/OnReactiveSetDeleteCallback.md +5 -0
  417. package/docs/api/types/OutputDeclarationSpace.md +13 -0
  418. package/docs/api/types/OutputDirectory.md +59 -0
  419. package/docs/api/types/OutputFile.md +5 -0
  420. package/docs/api/types/OutputFileBase.md +8 -0
  421. package/docs/api/types/OutputMemberSpace.md +13 -0
  422. package/docs/api/types/OutputScope.md +33 -0
  423. package/docs/api/types/OutputScopeOptions.md +9 -0
  424. package/docs/api/types/OutputSpace.md +7 -0
  425. package/docs/api/types/OutputSymbol.md +76 -0
  426. package/docs/api/types/OutputSymbolOptions.md +16 -0
  427. package/docs/api/types/OutputVisitor.md +10 -0
  428. package/docs/api/types/PrintHook.md +10 -0
  429. package/docs/api/types/PrintTreeOptions.md +11 -0
  430. package/docs/api/types/Props.md +5 -0
  431. package/docs/api/types/ReactiveUnionSet.md +20 -0
  432. package/docs/api/types/ReactiveUnionSetOptions.md +8 -0
  433. package/docs/api/types/Refkey.md +5 -0
  434. package/docs/api/types/Refkeyable.md +5 -0
  435. package/docs/api/types/RefkeyableObject.md +7 -0
  436. package/docs/api/types/RenderableObject.md +9 -0
  437. package/docs/api/types/RenderedTextTree.md +5 -0
  438. package/docs/api/types/ResolutionResult.md +39 -0
  439. package/docs/api/types/ResolveDeclarationByKeyOptions.md +7 -0
  440. package/docs/api/types/Resource.md +11 -0
  441. package/docs/api/types/RootOptions.md +7 -0
  442. package/docs/api/types/SbrIntrinsicElement.md +5 -0
  443. package/docs/api/types/ScopeProps.md +5 -0
  444. package/docs/api/types/SoftlineIntrinsicElement.md +5 -0
  445. package/docs/api/types/SourceLocation.md +9 -0
  446. package/docs/api/types/SplitProps.md +12 -0
  447. package/docs/api/types/StcComponentCreator.md +9 -0
  448. package/docs/api/types/StcSignature.md +5 -0
  449. package/docs/api/types/StiComponentCreator.md +9 -0
  450. package/docs/api/types/StiSignature.md +7 -0
  451. package/docs/api/types/SymbolCreator.md +15 -0
  452. package/docs/api/types/SymbolRefkey.md +9 -0
  453. package/docs/api/types/SymbolSlot.md +12 -0
  454. package/docs/api/types/SymbolTable.md +15 -0
  455. package/docs/api/types/TakeSymbolCallback.md +7 -0
  456. package/docs/api/types/TakeSymbolsCallback.md +7 -0
  457. package/docs/api/types/Tap.md +11 -0
  458. package/docs/api/types/TapHandler.md +9 -0
  459. package/docs/api/types/Tapper.md +9 -0
  460. package/docs/api/types/TemplateVariableProps.md +5 -0
  461. package/docs/api/types/index.md +122 -0
  462. package/docs/api/variables/FormatOptions.md +5 -0
  463. package/docs/api/variables/Match.md +7 -0
  464. package/docs/api/variables/REFKEYABLE.md +5 -0
  465. package/docs/api/variables/RENDERABLE.md +5 -0
  466. package/docs/api/variables/TO_SYMBOL.md +39 -0
  467. package/docs/api/variables/contextsByKey.md +5 -0
  468. package/docs/api/variables/index.md +11 -0
  469. package/docs/api/variables/intrinsicElementKey.md +5 -0
  470. package/docs/api/variables/matchTag.md +5 -0
  471. package/docs/api/variables/printHookTag.md +7 -0
  472. package/docs/components.md +97 -0
  473. package/docs/context.md +67 -0
  474. package/docs/control-flow.md +5 -0
  475. package/docs/debugging.md +105 -0
  476. package/docs/formatting.md +99 -0
  477. package/docs/guides/language-package-guide.md +593 -0
  478. package/docs/guides/references-and-refkeys.md +210 -0
  479. package/docs/guides/style-guide.md +244 -0
  480. package/docs/index.md +22 -0
  481. package/docs/reactivity.md +68 -0
  482. package/docs/rendering.md +41 -0
  483. package/docs/symbols-and-scopes.md +180 -0
  484. package/package.json +8 -4
  485. package/src/binder.ts +107 -3
  486. package/src/components/Block.tsx +12 -0
  487. package/src/components/List.tsx +11 -1
  488. package/src/components/MemberDeclaration.tsx +6 -6
  489. package/src/components/MemberName.tsx +6 -0
  490. package/src/components/MemberScope.tsx +5 -0
  491. package/src/components/Output.tsx +4 -1
  492. package/src/components/Scope.tsx +6 -0
  493. package/src/components/SourceFile.tsx +22 -2
  494. package/src/context/binder.ts +4 -0
  495. package/src/context/format-options.ts +14 -1
  496. package/src/context/scope.ts +4 -0
  497. package/src/context/source-directory.ts +9 -0
  498. package/src/debug/cli.ts +3 -2
  499. package/src/debug/source-map.browser.ts +30 -0
  500. package/src/debug/trace.ts +7 -6
  501. package/src/host/node-host.browser.ts +23 -0
  502. package/src/host/node-host.ts +22 -0
  503. package/src/library-symbol-reference.ts +52 -0
  504. package/src/name-policy.ts +30 -3
  505. package/src/reactivity.ts +15 -0
  506. package/src/render-stack.ts +4 -3
  507. package/src/render.ts +2 -0
  508. package/src/symbols/output-scope.ts +33 -1
  509. package/src/symbols/output-space.ts +13 -0
  510. package/src/symbols/output-symbol.ts +93 -12
  511. package/src/symbols/symbol-slot.test.tsx +28 -1
  512. package/src/symbols/symbol-slot.tsx +8 -0
  513. package/src/write-output.ts +6 -5
  514. package/temp/api-testing.json +673 -0
  515. package/temp/api.json +48 -47
  516. package/test/browser-build.test.ts +71 -78
  517. package/testing/create-test-wrapper.tsx +81 -2
  518. package/testing/extend-expect.ts +22 -1
  519. package/testing/index.ts +1 -1
  520. package/testing/render.ts +9 -0
  521. package/testing/vitest.d.ts +3 -8
package/temp/api.json CHANGED
@@ -1296,7 +1296,7 @@
1296
1296
  {
1297
1297
  "kind": "PropertySignature",
1298
1298
  "canonicalReference": "@alloy-js/core!BaseListProps#enderPunctuation:member",
1299
- "docComment": "/**\n * Place the join punctuation at the end, but without a line break.\n */\n",
1299
+ "docComment": "/**\n * Place the join punctuation at the end, without a line break. The punctuation\n * is emitted unconditionally in flat and broken modes.\n *\n * To add trailing punctuation only in broken mode, use `ender` with `<ifBreak>`\n * inside a `<group>` with a non-hardline joiner (e.g. `line`):\n *\n * ```tsx\n * <group>\n * <List comma line ender={<ifBreak>,</ifBreak>}>...</List>\n * </group>\n * ```\n *\n */\n",
1300
1300
  "excerptTokens": [
1301
1301
  {
1302
1302
  "kind": "Content",
@@ -2526,7 +2526,7 @@
2526
2526
  {
2527
2527
  "kind": "Function",
2528
2528
  "canonicalReference": "@alloy-js/core!Block:function(1)",
2529
- "docComment": "/**\n * Create an indented block of source text. The block has `opener` text which is\n * added prior to the block, which defaults to `\"{\"`, and `closer` text which is\n * added after the block, which defaults to `\"}\"`.\n */\n",
2529
+ "docComment": "/**\n * Create an indented block of source text. The block has `opener` text which is\n * added prior to the block, which defaults to `\"{\"`, and `closer` text which is\n * added after the block, which defaults to `\"}\"`.\n *\n * @remarks\n *\n *\n *\n * When `children` is empty, `Block` renders as `{}` (opener immediately followed\n * by closer) with no indented content — no explicit empty check is needed before\n * passing children.\n *\n * @example\n * ```tsx\n * // Safe even when props.members is empty — renders `{}`\n * <Block>{props.members}</Block>\n * ```\n *\n */\n",
2530
2530
  "excerptTokens": [
2531
2531
  {
2532
2532
  "kind": "Content",
@@ -5537,7 +5537,7 @@
5537
5537
  {
5538
5538
  "kind": "Function",
5539
5539
  "canonicalReference": "@alloy-js/core!createFormatOptionsContextFor:function(1)",
5540
- "docComment": "/**\n * Create a format options context for a specific file type\n */\n",
5540
+ "docComment": "/**\n * Create a format options context for a specific file type. Returns a\n * `Provider` component and a `useFormatOptions` hook.\n *\n * @remarks\n *\n *\n *\n * Merge precedence: `defaults` (lowest) → Provider `value` → `overrides`\n * argument to `useFormatOptions()` (highest). Undefined override values are\n * ignored.\n */\n",
5541
5541
  "excerptTokens": [
5542
5542
  {
5543
5543
  "kind": "Content",
@@ -5900,7 +5900,7 @@
5900
5900
  {
5901
5901
  "kind": "Function",
5902
5902
  "canonicalReference": "@alloy-js/core!createNamePolicy:function(1)",
5903
- "docComment": "",
5903
+ "docComment": "/**\n * Creates a name policy that transforms symbol names based on element kind.\n *\n * @remarks\n *\n *\n * `element` identifies the kind of declaration (e.g., `\"value\"`, `\"type\"`).\n * The set of valid element strings is defined by the language package.\n *\n * When `element` is `undefined` (outside a declaration context), {@link NamePolicy.getName}\n * and {@link NamePolicy.for} short-circuit and return the original name unchanged — the\n * namer callback is **not** invoked. The namer therefore always receives a defined `T`.\n * This means names outside a declaration context cannot be transformed by the policy.\n *\n * @example\n * ```ts\n * const policy = createNamePolicy((name, element) => {\n * if (element === \"value\") return toCamelCase(name);\n * if (element === \"type\") return toPascalCase(name);\n * return name;\n * });\n * <Output namePolicy={policy}>...</Output>\n * ```\n *\n */\n",
5904
5904
  "excerptTokens": [
5905
5905
  {
5906
5906
  "kind": "Content",
@@ -5916,7 +5916,7 @@
5916
5916
  },
5917
5917
  {
5918
5918
  "kind": "Content",
5919
- "text": "(name: string, elements: T) => string"
5919
+ "text": "(name: string, element: T) => string"
5920
5920
  },
5921
5921
  {
5922
5922
  "kind": "Content",
@@ -6280,7 +6280,7 @@
6280
6280
  {
6281
6281
  "kind": "Function",
6282
6282
  "canonicalReference": "@alloy-js/core!createScope:function(1)",
6283
- "docComment": "",
6283
+ "docComment": "/**\n * Construct a scope instance and register it with devtools. Prefer this over\n * calling `new` directly so that debugging tools can track the scope.\n *\n * @remarks\n *\n *\n *\n * Inside a component, obtain the current scope with `useScope()` and pass it\n * as the `parentScope` constructor argument so the new scope is wired into\n * the scope tree.\n *\n * @param ctor - The scope subclass constructor.\n *\n * @param args - Positional arguments forwarded directly to the scope\n * constructor; see {@link OutputScope} for the base-class constructor\n * signature.\n *\n * @example\n * ```tsx\n * function MyScope(props) {\n * const parentScope = useScope();\n * const scope = createScope(MyScope, \"scope-name\", parentScope);\n * return <Scope value={scope}>{props.children}</Scope>;\n * }\n * ```\n *\n */\n",
6284
6284
  "excerptTokens": [
6285
6285
  {
6286
6286
  "kind": "Content",
@@ -6541,7 +6541,7 @@
6541
6541
  {
6542
6542
  "kind": "Function",
6543
6543
  "canonicalReference": "@alloy-js/core!createSymbol:function(1)",
6544
- "docComment": "",
6544
+ "docComment": "/**\n * Construct a symbol instance and register it with devtools. Prefer this over\n * calling `new` directly so that debugging tools can track the symbol.\n *\n * @remarks\n *\n *\n *\n * Binder registration (via `useBinder()` + `notifySymbolCreated()`) happens\n * inside the `OutputSymbol` constructor regardless of whether you use\n * `createSymbol` or `new`. This helper only adds devtools registration.\n *\n * @param ctor - The symbol subclass constructor.\n *\n * @param args - Arguments forwarded to the constructor.\n */\n",
6545
6545
  "excerptTokens": [
6546
6546
  {
6547
6547
  "kind": "Content",
@@ -12274,7 +12274,7 @@
12274
12274
  {
12275
12275
  "kind": "Interface",
12276
12276
  "canonicalReference": "@alloy-js/core!LibrarySymbolReference:interface",
12277
- "docComment": "",
12277
+ "docComment": "/**\n * An object that acts as a lazy reference to an external library symbol.\n * Implements {@link REFKEYABLE} and `[TO_SYMBOL]()`.\n *\n * Use {@link isLibrarySymbolReference} to test whether an unknown value is a\n * library symbol reference.\n */\n",
12278
12278
  "excerptTokens": [
12279
12279
  {
12280
12280
  "kind": "Content",
@@ -13334,7 +13334,7 @@
13334
13334
  {
13335
13335
  "kind": "Function",
13336
13336
  "canonicalReference": "@alloy-js/core!MemberDeclaration:function(1)",
13337
- "docComment": "/**\n * Declares a symbol in the current member scope for this component's children.\n *\n * @remarks\n *\n *\n *\n * This component must be called in one of two ways: with a name and an optional\n * refkey, or else passing in the symbol. When called with a name and refkey, a\n * symbol will be created in the current scope (provided by\n * {@link MemberDeclarationContext}) with that name and refkey. If a refkey is not\n * provided, `refkey(props.name)` is used.\n *\n * When called with a symbol, that symbol is merely exposed via\n * {@link MemberDeclarationContext}. It is assumed that the caller of this component\n * has created the symbol with the `createSymbol` API on the\n * {@link BinderContext}.\n *\n * @see\n *\n * {@link BinderContext}\n */\n",
13337
+ "docComment": "/**\n * Declares a symbol in the current member scope for this component's children.\n *\n * @remarks\n *\n *\n *\n * This component must be called in one of two ways: with a name and an optional\n * refkey, or else passing in the symbol. When called with a name and refkey, a\n * `BasicSymbol` will be created in the current member space. When called with a\n * `name`, the owning scope must be a `BasicScope`; for custom scope/symbol\n * types, pass a pre-created `symbol` instead.\n *\n * When called with a symbol, that symbol is merely exposed via\n * {@link MemberDeclarationContext} (not {@link DeclarationContext}). Use\n * {@link MemberName} (not `<Name />`) to render the declared member's name.\n *\n * @see\n *\n * {@link BinderContext}\n *\n * @see\n *\n * {@link MemberName}\n */\n",
13338
13338
  "excerptTokens": [
13339
13339
  {
13340
13340
  "kind": "Content",
@@ -13779,7 +13779,7 @@
13779
13779
  {
13780
13780
  "kind": "Function",
13781
13781
  "canonicalReference": "@alloy-js/core!MemberName:function(1)",
13782
- "docComment": "",
13782
+ "docComment": "/**\n * Renders the name of the current member declaration from\n * {@link MemberDeclarationContext}. Use this inside a\n * {@link MemberDeclaration} component instead of `<Name />`, which reads from\n * the top-level {@link DeclarationContext}.\n */\n",
13783
13783
  "excerptTokens": [
13784
13784
  {
13785
13785
  "kind": "Content",
@@ -14079,7 +14079,7 @@
14079
14079
  {
14080
14080
  "kind": "Interface",
14081
14081
  "canonicalReference": "@alloy-js/core!MemberResolver:interface",
14082
- "docComment": "",
14082
+ "docComment": "/**\n * A callback that performs access-control filtering during member resolution.\n *\n * @remarks\n *\n *\n *\n * When provided to {@link ResolveDeclarationByKeyOptions}, it entirely replaces\n * the default checks (ownership assertion and `isMemberSymbol` assertion).\n *\n * **Contract:**\n * - **Return `void`** to accept the member.\n * - **Throw an error** to reject the member — the error propagates to the caller,\n * matching the behavior of the default checks.\n *\n * @example\n * ```ts\n * const resolver: MemberResolver<MyScope, MySymbol> = (owner, member, ctx) => {\n * if (member.isPrivate && !ctx.isMemberAccess) {\n * throw new Error(`${member.name} is not accessible here`);\n * }\n * };\n * ```\n *\n * @see\n *\n * {@link MemberResolutionContext} for available context properties.\n */\n",
14083
14083
  "excerptTokens": [
14084
14084
  {
14085
14085
  "kind": "Content",
@@ -14219,7 +14219,7 @@
14219
14219
  {
14220
14220
  "kind": "Function",
14221
14221
  "canonicalReference": "@alloy-js/core!MemberScope:function(1)",
14222
- "docComment": "/**\n * Declare a member scope, which is a lexical scope whose symbols are provided\n * by the owner symbol.\n *\n * @remarks\n *\n *\n *\n * This is used to create members of a symbol, e.g. for class members and the\n * like. In some languages, this scope may provide symbols which are can be\n * referenced lexically, but in other languages, these members may not be in\n * scope and instead must be referenced via the owner symbol itself.\n */\n",
14222
+ "docComment": "/**\n * Declare a member scope, which is a lexical scope whose symbols are provided\n * by the owner symbol.\n *\n * @remarks\n *\n *\n *\n * This is used to create members of a symbol, e.g. for class members and the\n * like. In some languages, this scope may provide symbols which are can be\n * referenced lexically, but in other languages, these members may not be in\n * scope and instead must be referenced via the owner symbol itself.\n *\n * When called with `name` (without `value`), this delegates to `<Scope>` which\n * creates a `BasicScope`. The same restriction applies: the parent scope must\n * be a `BasicScope`. For custom scope types, create your scope and pass it via\n * the `value` prop.\n */\n",
14223
14223
  "excerptTokens": [
14224
14224
  {
14225
14225
  "kind": "Content",
@@ -14509,7 +14509,7 @@
14509
14509
  {
14510
14510
  "kind": "Function",
14511
14511
  "canonicalReference": "@alloy-js/core!memo:function(1)",
14512
- "docComment": "",
14512
+ "docComment": "/**\n * Returns a getter caching the result of `fn`. Re-evaluates when reactive\n * dependencies change. See the [Reactivity docs](../../reactivity.md) for details.\n *\n * @param fn - Function to memoize.\n *\n * @param equal - Skip updates when value is unchanged.\n *\n * @param name - Debug label for traces.\n *\n * @returns A zero-argument getter returning the cached value.\n *\n * @example\n * ```ts\n * const fullName = memo(() => `${first.value} ${last.value}`);\n * fullName(); // cached; re-evaluates when first or last changes\n * ```\n *\n */\n",
14513
14513
  "excerptTokens": [
14514
14514
  {
14515
14515
  "kind": "Content",
@@ -15040,7 +15040,7 @@
15040
15040
  {
15041
15041
  "kind": "Interface",
15042
15042
  "canonicalReference": "@alloy-js/core!NameConflictResolver:interface",
15043
- "docComment": "",
15043
+ "docComment": "/**\n * A callable interface invoked by the binder when two or more symbols in the\n * same scope share a name. The resolver mutates symbol names to eliminate\n * conflicts (e.g., appending `_2`, `_3`).\n *\n * @remarks\n *\n *\n * The resolver is called with the shared `name` and all symbols in the scope\n * that have that original name. Rename a symbol by assigning to `symbol.name`.\n * Symbols with `ignoreNameConflict: true` are excluded. The default resolver\n * keeps the first symbol unchanged and renames subsequent ones\n * `originalName + \"_2\"`, `originalName + \"_3\"`, etc.\n *\n * Assigned names pass through the active name policy before being stored;\n * design suffixes to produce the correct final name after policy\n * transformation, or set `ignoreNamePolicy` on the symbol after resolution.\n *\n * Conflict detection is keyed on `originalName`\n * (see {@link OutputSymbol.originalName}). Symbols that differ in original\n * name but normalize to the same policy-applied name are never detected as\n * conflicting.\n *\n * @example\n * ```ts\n * const resolver: NameConflictResolver = (name, symbols) => {\n * for (let i = 1; i < symbols.length; i++) {\n * symbols[i].name = symbols[i].originalName + \"_\" + (i + 1);\n * }\n * };\n * ```\n *\n */\n",
15044
15044
  "excerptTokens": [
15045
15045
  {
15046
15046
  "kind": "Content",
@@ -15410,7 +15410,7 @@
15410
15410
  {
15411
15411
  "kind": "MethodSignature",
15412
15412
  "canonicalReference": "@alloy-js/core!NamePolicy#for:member(1)",
15413
- "docComment": "/**\n * Get a function that takes a name and applies the naming policy to it.\n */\n",
15413
+ "docComment": "/**\n * Get a function that takes a name and applies the naming policy to it.\n * When `element` is `undefined`, returns an identity function.\n */\n",
15414
15414
  "excerptTokens": [
15415
15415
  {
15416
15416
  "kind": "Content",
@@ -15456,7 +15456,7 @@
15456
15456
  {
15457
15457
  "kind": "MethodSignature",
15458
15458
  "canonicalReference": "@alloy-js/core!NamePolicy#getName:member(1)",
15459
- "docComment": "/**\n * Apply the language policy to the provided name for the provided element\n * type.\n */\n",
15459
+ "docComment": "/**\n * Apply the language policy to the provided name for the provided element type.\n * When `element` is `undefined`, returns `originalName` unchanged.\n */\n",
15460
15460
  "excerptTokens": [
15461
15461
  {
15462
15462
  "kind": "Content",
@@ -15557,7 +15557,7 @@
15557
15557
  {
15558
15558
  "kind": "Interface",
15559
15559
  "canonicalReference": "@alloy-js/core!NamePolicyGetter:interface",
15560
- "docComment": "",
15560
+ "docComment": "/**\n * A function that transforms a name according to a naming policy for a\n * specific element kind. Obtained from {@link NamePolicy.for}.\n */\n",
15561
15561
  "excerptTokens": [
15562
15562
  {
15563
15563
  "kind": "Content",
@@ -15845,7 +15845,7 @@
15845
15845
  {
15846
15846
  "kind": "Class",
15847
15847
  "canonicalReference": "@alloy-js/core!OutputDeclarationSpace:class",
15848
- "docComment": "",
15848
+ "docComment": "/**\n * A symbol table attached to an {@link OutputScope}. Holds lexical declarations\n * visible within that scope (e.g., \"types\" or \"values\" in a TypeScript module).\n */\n",
15849
15849
  "excerptTokens": [
15850
15850
  {
15851
15851
  "kind": "Content",
@@ -16101,7 +16101,7 @@
16101
16101
  {
16102
16102
  "kind": "PropertySignature",
16103
16103
  "canonicalReference": "@alloy-js/core!OutputDirectory#path:member",
16104
- "docComment": "",
16104
+ "docComment": "/**\n * Full path from the output root, e.g. `\"generated-client/src\"`. Do not prepend parent directory paths when walking the tree.\n */\n",
16105
16105
  "excerptTokens": [
16106
16106
  {
16107
16107
  "kind": "Content",
@@ -16209,7 +16209,7 @@
16209
16209
  {
16210
16210
  "kind": "PropertySignature",
16211
16211
  "canonicalReference": "@alloy-js/core!OutputFileBase#path:member",
16212
- "docComment": "",
16212
+ "docComment": "/**\n * Full path from the output root, e.g. `\"generated-client/src/models.ext\"`. Do not prepend parent directory paths when walking the tree.\n */\n",
16213
16213
  "excerptTokens": [
16214
16214
  {
16215
16215
  "kind": "Content",
@@ -16239,7 +16239,7 @@
16239
16239
  {
16240
16240
  "kind": "Class",
16241
16241
  "canonicalReference": "@alloy-js/core!OutputMemberSpace:class",
16242
- "docComment": "",
16242
+ "docComment": "/**\n * A symbol table attached to an {@link OutputSymbol}. Holds member declarations\n * belonging to that symbol (e.g., \"static\" or \"instance\" members of a class).\n */\n",
16243
16243
  "excerptTokens": [
16244
16244
  {
16245
16245
  "kind": "Content",
@@ -16519,15 +16519,16 @@
16519
16519
  {
16520
16520
  "kind": "PropertySignature",
16521
16521
  "canonicalReference": "@alloy-js/core!OutputProps#nameConflictResolver:member",
16522
- "docComment": "/**\n * Policy for handling multiple symbols declared with the same name.\n */\n",
16522
+ "docComment": "/**\n * Policy for handling multiple symbols declared with the same name.\n *\n * @see\n *\n * {@link NameConflictResolver}\n */\n",
16523
16523
  "excerptTokens": [
16524
16524
  {
16525
16525
  "kind": "Content",
16526
16526
  "text": "nameConflictResolver?: "
16527
16527
  },
16528
16528
  {
16529
- "kind": "Content",
16530
- "text": "(name: string, symbols: any[]) => void"
16529
+ "kind": "Reference",
16530
+ "text": "NameConflictResolver",
16531
+ "canonicalReference": "@alloy-js/core!NameConflictResolver:interface"
16531
16532
  },
16532
16533
  {
16533
16534
  "kind": "Content",
@@ -16681,7 +16682,7 @@
16681
16682
  {
16682
16683
  "kind": "Constructor",
16683
16684
  "canonicalReference": "@alloy-js/core!OutputScope:constructor(1)",
16684
- "docComment": "/**\n * Constructs a new instance of the `OutputScope` class\n */\n",
16685
+ "docComment": "/**\n * Subclasses must forward all three positional arguments to `super`. See\n * {@link createScope} for the preferred instantiation path.\n *\n * @param name - A descriptive name for this scope (used in debugging and\n * diagnostics).\n *\n * @param parentScope - The parent scope in the scope tree, or `undefined`\n * for root scopes. Inside a component, obtain this via `useScope()`.\n *\n * @param options - Additional scope options; see {@link OutputScopeOptions}.\n *\n * @example\n * ```ts\n * class MyScope extends OutputScope {\n * constructor(\n * name: string,\n * parent: OutputScope | undefined,\n * options?: OutputScopeOptions,\n * ) {\n * super(name, parent, options);\n * }\n * }\n *\n * // Inside a component:\n * const scope = createScope(MyScope, \"my-scope\", useScope());\n * ```\n *\n */\n",
16685
16686
  "excerptTokens": [
16686
16687
  {
16687
16688
  "kind": "Content",
@@ -16865,7 +16866,7 @@
16865
16866
  {
16866
16867
  "kind": "Property",
16867
16868
  "canonicalReference": "@alloy-js/core!OutputScope.declarationSpaces:member",
16868
- "docComment": "",
16869
+ "docComment": "/**\n * The declaration space keys for this scope type. Subclasses override this\n * to declare which declaration spaces are created on construction (e.g.,\n * `[\"types\", \"values\"]`).\n */\n",
16869
16870
  "excerptTokens": [
16870
16871
  {
16871
16872
  "kind": "Content",
@@ -17134,7 +17135,7 @@
17134
17135
  {
17135
17136
  "kind": "Method",
17136
17137
  "canonicalReference": "@alloy-js/core!OutputScope#spaceFor:member(1)",
17137
- "docComment": "/**\n * Get the declaration space for the given key.\n */\n",
17138
+ "docComment": "/**\n * Get the declaration space for the given key (e.g., `\"types\"`, `\"values\"`).\n * Returns `undefined` when no space with that key exists on this scope.\n */\n",
17138
17139
  "excerptTokens": [
17139
17140
  {
17140
17141
  "kind": "Content",
@@ -17362,7 +17363,7 @@
17362
17363
  {
17363
17364
  "kind": "TypeAlias",
17364
17365
  "canonicalReference": "@alloy-js/core!OutputSpace:type",
17365
- "docComment": "",
17366
+ "docComment": "/**\n * A symbol table that belongs to either a scope (declaration space) or a symbol\n * (member space).\n */\n",
17366
17367
  "excerptTokens": [
17367
17368
  {
17368
17369
  "kind": "Content",
@@ -17398,7 +17399,7 @@
17398
17399
  {
17399
17400
  "kind": "Class",
17400
17401
  "canonicalReference": "@alloy-js/core!OutputSymbol:class",
17401
- "docComment": "/**\n * An output symbol is a named entity that can be referenced in your output\n * code.\n *\n * @remarks\n *\n *\n *\n * This class is the base implementation of symbol. Most languages will have\n * subtypes that provide additional metadata. Symbols are reactive values, so\n * you can observe changes to their properties in a reactive context.\n */\n",
17402
+ "docComment": "/**\n * An output symbol is a named entity that can be referenced in your output\n * code.\n *\n * @remarks\n *\n *\n *\n * This is an abstract base class. Language packages must subclass it and\n * implement the abstract {@link OutputSymbol.copy | copy()} method, which\n * creates a clone that tracks the original's name and flags.\n *\n * Subtypes typically add language-specific properties (e.g., accessibility,\n * static/abstract flags). Symbols are reactive values, so you can observe\n * changes to their properties in a reactive context.\n *\n * To construct a scopeless external library symbol — one that resolves via\n * refkey but does not appear in any declaration space — pass `undefined` as\n * the `spaces` constructor argument and supply `{ binder }` in `options`.\n * See {@link OutputSymbolOptions} (`binder` option) and {@link TO_SYMBOL}.\n *\n * @example\n *\n *\n *\n * ```ts\n * import { createSymbol, OutputSymbol, OutputSpace } from \"@alloy-js/core\";\n *\n * class MySymbol extends OutputSymbol {\n * copy() {\n * // getCopyOptions() already includes binder\n * const opts = this.getCopyOptions();\n * const sym = createSymbol(MySymbol, this.name, undefined, opts);\n * this.initializeCopy(sym);\n * return sym;\n * }\n * }\n *\n * // name: string | Namekey; spaces: OutputSpace | OutputSpace[] | undefined; options: OutputSymbolOptions\n * const sym = createSymbol(MySymbol, namekey, scope.symbols, { binder });\n *\n * // Construct a scopeless external library symbol (resolves via refkey only):\n * const extSym = createSymbol(MySymbol, namekey, undefined, { binder });\n * ```\n *\n */\n",
17402
17403
  "excerptTokens": [
17403
17404
  {
17404
17405
  "kind": "Content",
@@ -17493,7 +17494,7 @@
17493
17494
  {
17494
17495
  "kind": "Constructor",
17495
17496
  "canonicalReference": "@alloy-js/core!OutputSymbol:constructor(1)",
17496
- "docComment": "/**\n * Constructs a new instance of the `OutputSymbol` class\n */\n",
17497
+ "docComment": "/**\n * Constructs a new instance of the `OutputSymbol` class\n *\n * @param name - The symbol name, or a {@link Namekey} carrying name and\n * options (e.g., `ignoreNamePolicy`).\n *\n * @param spaces - The declaration or member space(s) this symbol belongs to.\n * Pass `undefined` for scopeless external library symbols (see `binder` option).\n *\n * @param options - Additional symbol options (binder, refkeys, metadata,\n * type, name policy, etc.).\n */\n",
17497
17498
  "excerptTokens": [
17498
17499
  {
17499
17500
  "kind": "Content",
@@ -17647,7 +17648,7 @@
17647
17648
  {
17648
17649
  "kind": "Method",
17649
17650
  "canonicalReference": "@alloy-js/core!OutputSymbol#copy:member(1)",
17650
- "docComment": "/**\n * Makes a copy of this symbol which will update the name and flags\n * of the clone when the original symbol is updated.\n *\n * @remarks\n *\n *\n *\n * This is used to create a symbol that is a copy of this symbol, but\n * with a different scope. Changes to the copy will not affect the\n * original symbol, and changes to the original symbol's name and flags\n * will overwrite the copy's name and flags.\n *\n * @param newScope - The scope to use for the copy.\n */\n",
17651
+ "docComment": "/**\n * Create a clone of this symbol whose name and flags reactively track the\n * original.\n *\n * @remarks\n *\n *\n *\n * Called by `SymbolTable.copyTo` during scope/space transfers.\n * Subclasses implement cloning logic and call `getCopyOptions` for\n * base options and `initializeCopy` to wire up member copying and\n * name tracking.\n *\n * **Space registration contract:** The returned clone must not be registered\n * in any space on exit. `copyToSpace()` calls this method and assigns the\n * space afterward.\n */\n",
17651
17652
  "excerptTokens": [
17652
17653
  {
17653
17654
  "kind": "Content",
@@ -17728,7 +17729,7 @@
17728
17729
  {
17729
17730
  "kind": "Method",
17730
17731
  "canonicalReference": "@alloy-js/core!OutputSymbol#copyToSpace:member(1)",
17731
- "docComment": "",
17732
+ "docComment": "/**\n * Copy this symbol into the given space. Calls {@link OutputSymbol.copy} and places\n * the result in `space`, then returns the copy.\n *\n * @param space - The space to place the copy in.\n *\n * @returns The copy of this symbol, now belonging to `space`.\n */\n",
17732
17733
  "excerptTokens": [
17733
17734
  {
17734
17735
  "kind": "Content",
@@ -18054,7 +18055,7 @@
18054
18055
  {
18055
18056
  "kind": "Method",
18056
18057
  "canonicalReference": "@alloy-js/core!OutputSymbol#initializeCopy:member(1)",
18057
- "docComment": "",
18058
+ "docComment": "/**\n * Wires up reactive member-space copying and name tracking from this symbol\n * to its `copy`.\n *\n * @remarks\n *\n *\n *\n * Iterates each member space and calls `copyTo` on the corresponding space\n * on `copy`. Then installs a reactive watcher so that any future change to\n * `this.name` is immediately mirrored onto `copy.name`.\n *\n * **Must be called by every `copy()` override** before the override returns.\n * Pair with `getCopyOptions` to supply the base constructor options.\n */\n",
18058
18059
  "excerptTokens": [
18059
18060
  {
18060
18061
  "kind": "Content",
@@ -18341,7 +18342,7 @@
18341
18342
  {
18342
18343
  "kind": "Property",
18343
18344
  "canonicalReference": "@alloy-js/core!OutputSymbol.memberSpaces:member",
18344
- "docComment": "",
18345
+ "docComment": "/**\n * The member space keys for this symbol type. Subclasses override this to\n * declare which member spaces are created on construction (e.g.,\n * `[\"static\", \"instance\"]`).\n */\n",
18345
18346
  "excerptTokens": [
18346
18347
  {
18347
18348
  "kind": "Content",
@@ -18495,7 +18496,7 @@
18495
18496
  {
18496
18497
  "kind": "Property",
18497
18498
  "canonicalReference": "@alloy-js/core!OutputSymbol#name:member",
18498
- "docComment": "/**\n * The name of this symbol.\n *\n *\n * @reactive\n */\n",
18499
+ "docComment": "/**\n * The name of this symbol. Assigning to this property applies the active\n * name policy (unless `ignoreNamePolicy` is true) before storing the value.\n *\n *\n * @reactive\n */\n",
18499
18500
  "excerptTokens": [
18500
18501
  {
18501
18502
  "kind": "Content",
@@ -18953,7 +18954,7 @@
18953
18954
  {
18954
18955
  "kind": "PropertySignature",
18955
18956
  "canonicalReference": "@alloy-js/core!OutputSymbolOptions#binder:member",
18956
- "docComment": "/**\n * The binder instance associated with this symbol. Symbol updates and changes\n * will be reported to this binder. This binder will be able to find this\n * symbol via its refkey and other means. Without a binder, this symbol will\n * be unbound, which means it cannot be referenced by refkey.\n */\n",
18957
+ "docComment": "/**\n * The binder instance associated with this symbol. Symbol updates and changes\n * will be reported to this binder. This binder will be able to find this\n * symbol via its refkey and other means. Without a binder, this symbol will\n * be unbound, which means it cannot be referenced by refkey.\n *\n * @remarks\n *\n *\n *\n * When constructing an external library symbol, pass `{ binder }` here to\n * ensure the symbol is registered with the binder. See {@link TO_SYMBOL} for\n * the full implementation protocol.\n */\n",
18957
18958
  "excerptTokens": [
18958
18959
  {
18959
18960
  "kind": "Content",
@@ -19035,7 +19036,7 @@
19035
19036
  {
19036
19037
  "kind": "PropertySignature",
19037
19038
  "canonicalReference": "@alloy-js/core!OutputSymbolOptions#lazyMemberInitializer:member",
19038
- "docComment": "/**\n * Provide a function which lazy-initializes members when an enumeration of members are needed.\n */\n",
19039
+ "docComment": "/**\n * Provide a function which lazy-initializes members the first time\n * `resolveMemberByName()` is called on this symbol. Called at most once.\n *\n * @remarks\n *\n *\n *\n * Only `resolveMemberByName()` triggers this callback — iterating\n * `OutputMemberSpace` directly does not. The callback fires regardless of\n * whether the symbol belongs to any scope, so it is safe to use on scopeless\n * external library symbols.\n */\n",
19039
19040
  "excerptTokens": [
19040
19041
  {
19041
19042
  "kind": "Content",
@@ -21781,7 +21782,7 @@
21781
21782
  {
21782
21783
  "kind": "Interface",
21783
21784
  "canonicalReference": "@alloy-js/core!ResolutionResult:interface",
21784
- "docComment": "/**\n * A successful resolution of a refkey.\n *\n * @example\n *\n *\n *\n * Let's say we have the following scopes and symbols:\n *\n * ```\n * scope: global scope\n * ├── scope: namespace scope 1\n * │ └── symbol: foo\n * │ └── static members\n * │ └── symbol: bar\n * └── scope: namespace scope 2\n * └── (resolve bar from here)\n * ```\n *\n *\n * When we resolve the refkey for `bar` from within `namespace scope 2`, we will get the following\n * resolution result:\n *\n * * **targetDeclaration**: symbol bar, the symbol we resolved.\n * * **commonScope**: global scope, because this is the most specific scope that contains both the declaration and the reference.\n * * **pathUp**: [namespace scope 2], because this is the scope between the reference and the common scope.\n * * **pathDown**: [namespace scope 1], because this is the scope between the common scope and the declaration\n * * **memberPath**: [foo, bar], because we resolved a member symbol and these are the symbols that lead from the base declaration to the member symbol.\n */\n",
21785
+ "docComment": "/**\n * A successful resolution of a refkey.\n *\n * @example\n *\n *\n *\n * Let's say we have the following scopes and symbols:\n *\n * ```\n * scope: global scope\n * ├── scope: namespace scope 1\n * │ └── symbol: foo\n * │ └── static members\n * │ └── symbol: bar\n * └── scope: namespace scope 2\n * └── (resolve bar from here)\n * ```\n *\n *\n * When we resolve the refkey for `bar` from within `namespace scope 2`, we will get the following\n * resolution result:\n *\n * * **targetDeclaration**: symbol bar, the symbol we resolved.\n * * **commonScope**: global scope, because this is the most specific scope that contains both the declaration and the reference.\n * * **pathUp**: [namespace scope 2], because this is the scope between the reference and the common scope.\n * * **pathDown**: [namespace scope 1], because this is the scope between the common scope and the declaration\n * * **memberPath**: [bar]\n * * **lexicalDeclaration**: foo\n * For deeper chains (e.g., foo.bar.baz where bar and baz are member symbols, foo is not): memberPath = [bar, baz], lexicalDeclaration = foo.\n */\n",
21785
21786
  "excerptTokens": [
21786
21787
  {
21787
21788
  "kind": "Content",
@@ -21946,7 +21947,7 @@
21946
21947
  {
21947
21948
  "kind": "PropertySignature",
21948
21949
  "canonicalReference": "@alloy-js/core!ResolutionResult#memberPath:member",
21949
- "docComment": "/**\n * When resolving a member symbol, this is the path of symbols that lead from\n * the lexical declaration to the member symbol.\n */\n",
21950
+ "docComment": "/**\n * Member symbols from the lexical declaration (exclusive) to the resolved symbol\n * (inclusive). Empty when resolving a non-member symbol.\n */\n",
21950
21951
  "excerptTokens": [
21951
21952
  {
21952
21953
  "kind": "Content",
@@ -22554,7 +22555,7 @@
22554
22555
  {
22555
22556
  "kind": "Function",
22556
22557
  "canonicalReference": "@alloy-js/core!Scope:function(1)",
22557
- "docComment": "/**\n * Declare a scope for this component's children. Any symbols and scopes\n * declared in the children of this component will be in this scope.\n *\n * @see\n *\n * {@link ScopeContext}\n */\n",
22558
+ "docComment": "/**\n * Declare a scope for this component's children. Any symbols and scopes\n * declared in the children of this component will be in this scope.\n *\n * @remarks\n *\n *\n *\n * When called with `name` (without `value`), this creates a `BasicScope`. The\n * parent scope must also be a `BasicScope`; for custom scope types, create your\n * scope and pass it via the `value` prop instead.\n *\n * @see\n *\n * {@link ScopeContext}\n */\n",
22558
22559
  "excerptTokens": [
22559
22560
  {
22560
22561
  "kind": "Content",
@@ -23424,7 +23425,7 @@
23424
23425
  {
23425
23426
  "kind": "Variable",
23426
23427
  "canonicalReference": "@alloy-js/core!SourceDirectoryContext:var",
23427
- "docComment": "",
23428
+ "docComment": "/**\n * Always provided by `<Output>` — `useContext(SourceDirectoryContext)` is\n * never `undefined` inside an `<Output>` tree. At the root of the tree,\n * `path` equals the `basePath` prop on `<Output>` (default `\"./\"`); nested\n * `<SourceDirectory>` components update `path` relative to their parent.\n *\n * @see\n *\n * {@link Output}\n *\n * @see\n *\n * {@link SourceDirectory}\n */\n",
23428
23429
  "excerptTokens": [
23429
23430
  {
23430
23431
  "kind": "Content",
@@ -23783,7 +23784,7 @@
23783
23784
  {
23784
23785
  "kind": "PropertySignature",
23785
23786
  "canonicalReference": "@alloy-js/core!SourceFileProps#filetype:member",
23786
- "docComment": "/**\n * The type of contents in this file.\n */\n",
23787
+ "docComment": "/**\n * The type of contents in this file.\n *\n * @remarks\n *\n *\n * This is a metadata hint only. It does not trigger formatting or content\n * processing. The value is forwarded to debug tooling and the\n * `ContentOutputFile` output metadata.\n */\n",
23787
23788
  "excerptTokens": [
23788
23789
  {
23789
23790
  "kind": "Content",
@@ -23810,7 +23811,7 @@
23810
23811
  {
23811
23812
  "kind": "PropertySignature",
23812
23813
  "canonicalReference": "@alloy-js/core!SourceFileProps#header:member",
23813
- "docComment": "/**\n * The header of the file. This is rendered before the contents of the file.\n * This is useful for adding license headers or other metadata to the file.\n */\n",
23814
+ "docComment": "/**\n * Content rendered before the file body, separated from it by a hard line\n * break. The separator is emitted whenever `header` is not `undefined` —\n * including when it is an empty string or a component that renders nothing.\n * To suppress both the header and the separator, omit this prop entirely.\n *\n * @example\n * ```tsx\n * // Omitting `header` suppresses both header and separator:\n * <SourceFile filetype=\"txt\" path=\"output/data.txt\">\n * {children}\n * </SourceFile>\n *\n * // An empty string still emits the separator newline:\n * <SourceFile filetype=\"txt\" path=\"output/data.txt\" header=\"\">\n * {children}\n * </SourceFile>\n * ```\n *\n */\n",
23814
23815
  "excerptTokens": [
23815
23816
  {
23816
23817
  "kind": "Content",
@@ -25039,7 +25040,7 @@
25039
25040
  {
25040
25041
  "kind": "Interface",
25041
25042
  "canonicalReference": "@alloy-js/core!SymbolCreator:interface",
25042
- "docComment": "",
25043
+ "docComment": "/**\n * An object that can register symbols into a binder. Pass instances to the\n * `externals` prop of `<Output>` to make library symbols resolvable.\n *\n * @remarks\n *\n *\n * `SymbolCreator` is a low-level core mechanism for eager symbol registration.\n * The recommended pattern for language packages is lazy self-registration:\n * implement `[TO_SYMBOL]()` on descriptors to call `useBinder()`, create and\n * cache symbols per binder via a `WeakMap`, and register them into the\n * appropriate scope automatically. This approach does not require `externals`.\n * See the C# package's `createLibrary()` for a reference implementation.\n *\n * See {@link TO_SYMBOL} and {@link REFKEYABLE}.\n */\n",
25043
25044
  "excerptTokens": [
25044
25045
  {
25045
25046
  "kind": "Content",
@@ -26869,7 +26870,7 @@
26869
26870
  {
26870
26871
  "kind": "Variable",
26871
26872
  "canonicalReference": "@alloy-js/core!TO_SYMBOL:var",
26872
- "docComment": "",
26873
+ "docComment": "/**\n * Well-known symbol for the lazy-symbol-creation protocol used by external\n * library descriptors. Objects implementing `[TO_SYMBOL]()` are recognized as\n * {@link LibrarySymbolReference} values that can be passed anywhere a refkey\n * is accepted.\n *\n * @remarks\n *\n *\n *\n * Implement `[TO_SYMBOL]()` on a descriptor object to register it as a\n * referenceable library symbol. Inside the method:\n *\n * 1. Call {@link useBinder} to get the current binder context.\n * 2. Look up (or create) the symbol for that binder in a\n * `WeakMap<object, OutputSymbol>` (use a sentinel object for the\n * no-binder case, since `WeakMap` keys must be objects).\n * 3. On first creation, construct the symbol and register it into the\n * appropriate space for your library, passing `{ binder }`\n * (see {@link OutputSymbolOptions.binder}).\n *\n * The method is called by language package code each time the descriptor is\n * used as a reference (e.g. inside `ref()`). It is NOT called by the binder\n * itself.\n *\n * @example\n *\n *\n *\n * ```ts\n * const defaultKey = {};\n * const symbols = new WeakMap<object, MySymbol>();\n * const descriptor: LibrarySymbolReference = {\n * [REFKEYABLE]() {\n * return descriptor[TO_SYMBOL]().refkeys[0];\n * },\n * [TO_SYMBOL]() {\n * const binder = useBinder();\n * const key = binder ?? defaultKey;\n * let sym = symbols.get(key);\n * if (!sym) {\n * sym = new MySymbol(\"SomeType\", space, { binder });\n * symbols.set(key, sym);\n * }\n * return sym;\n * },\n * };\n * ```\n *\n */\n",
26873
26874
  "excerptTokens": [
26874
26875
  {
26875
26876
  "kind": "Content",
@@ -27487,7 +27488,7 @@
27487
27488
  {
27488
27489
  "kind": "Function",
27489
27490
  "canonicalReference": "@alloy-js/core!useBinder:function(1)",
27490
- "docComment": "",
27491
+ "docComment": "/**\n * Returns the current {@link Binder} from context, or `undefined` if no\n * binder is available. The binder is provided by the {@link Output} component.\n */\n",
27491
27492
  "excerptTokens": [
27492
27493
  {
27493
27494
  "kind": "Content",
@@ -27767,7 +27768,7 @@
27767
27768
  {
27768
27769
  "kind": "Function",
27769
27770
  "canonicalReference": "@alloy-js/core!useScope:function(1)",
27770
- "docComment": "",
27771
+ "docComment": "/**\n * Returns the current {@link OutputScope} from context. Must be called inside\n * a component that is a descendant of a `<Scope>` provider.\n */\n",
27771
27772
  "excerptTokens": [
27772
27773
  {
27773
27774
  "kind": "Content",
@@ -1,91 +1,84 @@
1
- import { execSync } from "child_process";
2
1
  import { existsSync, mkdirSync, rmSync, writeFileSync } from "fs";
3
2
  import { join } from "path";
3
+ import { build, type Rolldown } from "vite";
4
4
  import { afterAll, beforeAll, describe, expect, it } from "vitest";
5
5
 
6
- const testDir = join(__dirname, ".temp", "vite-test-project");
6
+ const tempDir = join(__dirname, ".temp", "browser-build-test");
7
+ const entryFile = join(tempDir, "entry.js");
7
8
 
8
- describe("Browser Build Test", () => {
9
- beforeAll(() => {
10
- // Cleanup previous runs
11
- if (existsSync(testDir)) {
12
- rmSync(testDir, { recursive: true, force: true });
13
- }
9
+ /**
10
+ * Bundles `@alloy-js/core` for the browser using Vite and returns
11
+ * the concatenated output code.
12
+ *
13
+ * Uses the `browser` export condition from the package exports map,
14
+ * which resolves to the compiled browser entry. This requires the
15
+ * package to be built first (the CI pipeline and `pnpm build` handle
16
+ * this automatically).
17
+ */
18
+ async function bundleForBrowser(): Promise<string> {
19
+ const result = await build({
20
+ configFile: false,
21
+ logLevel: "silent",
22
+ resolve: {
23
+ conditions: ["browser", "import"],
24
+ },
25
+ // Disable automatic process.env replacement so we can detect leaks
26
+ define: {},
27
+ build: {
28
+ write: false,
29
+ minify: false,
30
+ rollupOptions: {
31
+ input: entryFile,
32
+ output: { format: "es" },
33
+ // Disable tree-shaking so we catch process.* references in ANY
34
+ // code path, even if it would be removed in a production build.
35
+ treeshake: false,
36
+ external: (id) => {
37
+ // Bundle @alloy-js packages — these are what we're validating
38
+ if (id.startsWith("@alloy-js/")) return false;
39
+ // Bundle relative/absolute imports (intra-package)
40
+ if (id.startsWith(".") || id.startsWith("/")) return false;
41
+ // Externalize third-party deps (vue, pathe, picocolors, …)
42
+ return true;
43
+ },
44
+ },
45
+ },
46
+ });
14
47
 
15
- // Create a temporary Vite project
16
- mkdirSync(testDir, { recursive: true });
48
+ const output = (
49
+ Array.isArray(result) ?
50
+ result[0]
51
+ : result) as Rolldown.RolldownOutput;
52
+ const chunks = output.output.filter(
53
+ (o): o is Rolldown.OutputChunk => o.type === "chunk",
54
+ );
55
+ return chunks.map((c) => c.code).join("\n");
56
+ }
17
57
 
18
- execSync("npm init -y", { cwd: testDir });
19
- execSync("npm install vite", { cwd: testDir });
20
- execSync("npm install ../../..", { cwd: testDir });
58
+ describe("browser build", () => {
59
+ beforeAll(() => {
60
+ if (existsSync(tempDir)) {
61
+ rmSync(tempDir, { recursive: true, force: true });
62
+ }
63
+ mkdirSync(tempDir, { recursive: true });
64
+ writeFileSync(entryFile, 'export * from "@alloy-js/core";\n');
65
+ });
21
66
 
22
- // Create a minimal Vite app
23
- writeFileSync(
24
- join(testDir, "index.js"),
25
- `
26
- import { writeOutput } from "@alloy-js/core";
27
- console.log("Alloy-js core imported successfully!", writeOutput);
28
- `,
29
- );
67
+ afterAll(() => {
68
+ if (existsSync(tempDir)) {
69
+ rmSync(tempDir, { recursive: true, force: true });
70
+ }
71
+ });
30
72
 
31
- writeFileSync(
32
- join(testDir, "vite.config.js"),
33
- `
34
- import { defineConfig } from "vite";
35
-
36
- export default defineConfig({
37
- build: {
38
- outDir: "dist",
39
- target: "esnext",
40
- }
41
- });
42
- `,
43
- );
73
+ it("should bundle for browser without Node.js polyfills", async () => {
74
+ const code = await bundleForBrowser();
44
75
 
45
- // Create an index.html file
46
- writeFileSync(
47
- join(testDir, "index.html"),
48
- `
49
- <!DOCTYPE html>
50
- <html lang="en">
51
- <head>
52
- <meta charset="UTF-8">
53
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
54
- <title>Vite Test</title>
55
- </head>
56
- <body>
57
- <script type="module" src="/index.js"></script>
58
- </body>
59
- </html>
60
- `,
61
- );
76
+ // The browser bundle must not reference the Node.js `process` global.
77
+ // If this fails, a file is using process.env / process.cwd / etc.
78
+ // without going through host/node-host.ts (or another browser-overridden module).
79
+ expect(code).not.toMatch(/\bprocess\./);
62
80
 
63
- writeFileSync(
64
- join(testDir, "package.json"),
65
- JSON.stringify(
66
- {
67
- type: "module",
68
- scripts: {
69
- build: "vite build",
70
- },
71
- },
72
- null,
73
- 2,
74
- ),
75
- );
81
+ // Should not contain static require("node:…") calls
82
+ expect(code).not.toMatch(/require\(\s*["']node:/);
76
83
  }, 30_000);
77
-
78
- it("Vite should build successfully", () => {
79
- // Run Vite build process and wait for completion
80
- expect(() => {
81
- execSync("npm run build", { cwd: testDir, stdio: "inherit" });
82
- }).not.toThrow();
83
- }, 10000);
84
-
85
- afterAll(() => {
86
- // Ensure testDir exists before attempting to remove it
87
- if (existsSync(testDir)) {
88
- rmSync(testDir, { recursive: true, force: true });
89
- }
90
- });
91
84
  });