@alloy-js/core 0.23.0-dev.9 → 0.24.0-dev.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.
- package/CHANGELOG.md +34 -0
- package/api-extractor.json +1 -8
- package/api-extractor.testing.json +19 -0
- package/dist/dev/src/binder.js +595 -0
- package/dist/dev/src/binder.js.map +1 -0
- package/dist/dev/src/code.js +181 -0
- package/dist/dev/src/code.js.map +1 -0
- package/dist/dev/src/components/AccessExpression.js +230 -0
- package/dist/dev/src/components/AccessExpression.js.map +1 -0
- package/dist/dev/src/components/AccessExpression.test.js +237 -0
- package/dist/dev/src/components/AccessExpression.test.js.map +1 -0
- package/dist/dev/src/components/AppendFile.js +246 -0
- package/dist/dev/src/components/AppendFile.js.map +1 -0
- package/dist/dev/src/components/Block.js +78 -0
- package/dist/dev/src/components/Block.js.map +1 -0
- package/dist/dev/src/components/CopyFile.js +16 -0
- package/dist/dev/src/components/CopyFile.js.map +1 -0
- package/dist/dev/src/components/Declaration.js +70 -0
- package/dist/dev/src/components/Declaration.js.map +1 -0
- package/dist/dev/src/components/For.js +40 -0
- package/dist/dev/src/components/For.js.map +1 -0
- package/dist/dev/src/components/Indent.js +37 -0
- package/dist/dev/src/components/Indent.js.map +1 -0
- package/dist/dev/src/components/List.js +29 -0
- package/dist/dev/src/components/List.js.map +1 -0
- package/dist/dev/src/components/MemberDeclaration.js +70 -0
- package/dist/dev/src/components/MemberDeclaration.js.map +1 -0
- package/dist/dev/src/components/MemberName.js +18 -0
- package/dist/dev/src/components/MemberName.js.map +1 -0
- package/dist/dev/src/components/MemberScope.js +62 -0
- package/dist/dev/src/components/MemberScope.js.map +1 -0
- package/dist/dev/src/components/Name.js +11 -0
- package/dist/dev/src/components/Name.js.map +1 -0
- package/dist/dev/src/components/Output.js +72 -0
- package/dist/dev/src/components/Output.js.map +1 -0
- package/dist/dev/src/components/Prose.js +32 -0
- package/dist/dev/src/components/Prose.js.map +1 -0
- package/dist/dev/src/components/ReferenceOrContent.js +12 -0
- package/dist/dev/src/components/ReferenceOrContent.js.map +1 -0
- package/dist/dev/src/components/Scope.js +56 -0
- package/dist/dev/src/components/Scope.js.map +1 -0
- package/dist/dev/src/components/Show.js +4 -0
- package/dist/dev/src/components/Show.js.map +1 -0
- package/dist/dev/src/components/SourceDirectory.js +41 -0
- package/dist/dev/src/components/SourceDirectory.js.map +1 -0
- package/dist/dev/src/components/SourceFile.js +52 -0
- package/dist/dev/src/components/SourceFile.js.map +1 -0
- package/dist/dev/src/components/StatementList.js +20 -0
- package/dist/dev/src/components/StatementList.js.map +1 -0
- package/dist/dev/src/components/Switch.js +42 -0
- package/dist/dev/src/components/Switch.js.map +1 -0
- package/dist/dev/src/components/TemplateFile.js +153 -0
- package/dist/dev/src/components/TemplateFile.js.map +1 -0
- package/dist/dev/src/components/UpdateFile.js +71 -0
- package/dist/dev/src/components/UpdateFile.js.map +1 -0
- package/dist/dev/src/components/Wrap.js +18 -0
- package/dist/dev/src/components/Wrap.js.map +1 -0
- package/dist/dev/src/components/index.js +25 -0
- package/dist/dev/src/components/index.js.map +1 -0
- package/dist/dev/src/components/stc/index.js +27 -0
- package/dist/dev/src/components/stc/index.js.map +1 -0
- package/dist/dev/src/components/stc/sti.js +10 -0
- package/dist/dev/src/components/stc/sti.js.map +1 -0
- package/dist/dev/src/content-slot.js +78 -0
- package/dist/dev/src/content-slot.js.map +1 -0
- package/dist/dev/src/content-slot.test.js +89 -0
- package/dist/dev/src/content-slot.test.js.map +1 -0
- package/dist/dev/src/context/assignment.js +46 -0
- package/dist/dev/src/context/assignment.js.map +1 -0
- package/dist/dev/src/context/binder.js +17 -0
- package/dist/dev/src/context/binder.js.map +1 -0
- package/dist/dev/src/context/declaration.js +3 -0
- package/dist/dev/src/context/declaration.js.map +1 -0
- package/dist/dev/src/context/format-options.js +45 -0
- package/dist/dev/src/context/format-options.js.map +1 -0
- package/dist/dev/src/context/index.js +11 -0
- package/dist/dev/src/context/index.js.map +1 -0
- package/dist/dev/src/context/member-declaration.js +11 -0
- package/dist/dev/src/context/member-declaration.js.map +1 -0
- package/dist/dev/src/context/member-scope.js +12 -0
- package/dist/dev/src/context/member-scope.js.map +1 -0
- package/dist/dev/src/context/name-policy.js +13 -0
- package/dist/dev/src/context/name-policy.js.map +1 -0
- package/dist/dev/src/context/scope.js +18 -0
- package/dist/dev/src/context/scope.js.map +1 -0
- package/dist/dev/src/context/source-directory.js +12 -0
- package/dist/dev/src/context/source-directory.js.map +1 -0
- package/dist/dev/src/context/source-file.js +3 -0
- package/dist/dev/src/context/source-file.js.map +1 -0
- package/dist/dev/src/context.js +47 -0
- package/dist/dev/src/context.js.map +1 -0
- package/dist/dev/src/debug/cli.js +164 -0
- package/dist/dev/src/debug/cli.js.map +1 -0
- package/dist/dev/src/debug/diagnostics-broadcast.test.js +100 -0
- package/dist/dev/src/debug/diagnostics-broadcast.test.js.map +1 -0
- package/dist/dev/src/debug/diagnostics.test.js +50 -0
- package/dist/dev/src/debug/diagnostics.test.js.map +1 -0
- package/dist/dev/src/debug/effects.js +293 -0
- package/dist/dev/src/debug/effects.js.map +1 -0
- package/dist/dev/src/debug/effects.test.js +280 -0
- package/dist/dev/src/debug/effects.test.js.map +1 -0
- package/dist/dev/src/debug/files.js +29 -0
- package/dist/dev/src/debug/files.js.map +1 -0
- package/dist/dev/src/debug/files.test.js +78 -0
- package/dist/dev/src/debug/files.test.js.map +1 -0
- package/dist/dev/src/debug/index.js +71 -0
- package/dist/dev/src/debug/index.js.map +1 -0
- package/dist/dev/src/debug/message-format.test.js +836 -0
- package/dist/dev/src/debug/message-format.test.js.map +1 -0
- package/dist/dev/src/debug/render-tree-orphans.test.js +365 -0
- package/dist/dev/src/debug/render-tree-orphans.test.js.map +1 -0
- package/dist/dev/src/debug/render.js +479 -0
- package/dist/dev/src/debug/render.js.map +1 -0
- package/dist/dev/src/debug/render.test.js +363 -0
- package/dist/dev/src/debug/render.test.js.map +1 -0
- package/dist/dev/src/debug/serialize.js +70 -0
- package/dist/dev/src/debug/serialize.js.map +1 -0
- package/dist/dev/src/debug/source-map.browser.js +24 -0
- package/dist/dev/src/debug/source-map.browser.js.map +1 -0
- package/dist/dev/src/debug/source-map.js +111 -0
- package/dist/dev/src/debug/source-map.js.map +1 -0
- package/dist/dev/src/debug/symbols.js +196 -0
- package/dist/dev/src/debug/symbols.js.map +1 -0
- package/dist/dev/src/debug/symbols.test.js +93 -0
- package/dist/dev/src/debug/symbols.test.js.map +1 -0
- package/dist/dev/src/debug/trace-writer.js +674 -0
- package/dist/dev/src/debug/trace-writer.js.map +1 -0
- package/dist/dev/src/debug/trace.js +460 -0
- package/dist/dev/src/debug/trace.js.map +1 -0
- package/dist/dev/src/devtools/devtools-protocol.js +2 -0
- package/dist/dev/src/devtools/devtools-protocol.js.map +1 -0
- package/dist/dev/src/devtools/devtools-server.browser.js +36 -0
- package/dist/dev/src/devtools/devtools-server.browser.js.map +1 -0
- package/dist/dev/src/devtools/devtools-server.js +458 -0
- package/dist/dev/src/devtools/devtools-server.js.map +1 -0
- package/dist/dev/src/devtools/devtools-transport.js +114 -0
- package/dist/dev/src/devtools/devtools-transport.js.map +1 -0
- package/dist/dev/src/devtools-entry.browser.js +2 -0
- package/dist/dev/src/devtools-entry.browser.js.map +1 -0
- package/dist/dev/src/devtools-entry.js +2 -0
- package/dist/dev/src/devtools-entry.js.map +1 -0
- package/dist/dev/src/diagnostics.js +97 -0
- package/dist/dev/src/diagnostics.js.map +1 -0
- package/dist/dev/src/host/alloy-host.browser.js +32 -0
- package/dist/dev/src/host/alloy-host.browser.js.map +1 -0
- package/dist/dev/src/host/alloy-host.js +144 -0
- package/dist/dev/src/host/alloy-host.js.map +1 -0
- package/dist/dev/src/host/interface.js +2 -0
- package/dist/dev/src/host/interface.js.map +1 -0
- package/dist/dev/src/host/node-host.browser.js +21 -0
- package/dist/dev/src/host/node-host.browser.js.map +1 -0
- package/dist/dev/src/host/node-host.js +20 -0
- package/dist/dev/src/host/node-host.js.map +1 -0
- package/dist/dev/src/index.browser.js +3 -0
- package/dist/dev/src/index.browser.js.map +1 -0
- package/dist/dev/src/index.js +27 -0
- package/dist/dev/src/index.js.map +1 -0
- package/dist/dev/src/inspect.browser.js +6 -0
- package/dist/dev/src/inspect.browser.js.map +1 -0
- package/dist/dev/src/inspect.js +2 -0
- package/dist/dev/src/inspect.js.map +1 -0
- package/dist/dev/src/jsx-runtime.js +17 -0
- package/dist/dev/src/jsx-runtime.js.map +1 -0
- package/dist/dev/src/library-symbol-reference.js +59 -0
- package/dist/dev/src/library-symbol-reference.js.map +1 -0
- package/dist/dev/src/name-policy.js +51 -0
- package/dist/dev/src/name-policy.js.map +1 -0
- package/dist/dev/src/pretty-string/pretty-string.js +100 -0
- package/dist/dev/src/pretty-string/pretty-string.js.map +1 -0
- package/dist/dev/src/pretty-string/pretty-string.test.js +38 -0
- package/dist/dev/src/pretty-string/pretty-string.test.js.map +1 -0
- package/dist/dev/src/print-hook.js +10 -0
- package/dist/dev/src/print-hook.js.map +1 -0
- package/dist/dev/src/props-combinators.js +109 -0
- package/dist/dev/src/props-combinators.js.map +1 -0
- package/dist/dev/src/reactive-union-set.js +213 -0
- package/dist/dev/src/reactive-union-set.js.map +1 -0
- package/dist/dev/src/reactivity.js +452 -0
- package/dist/dev/src/reactivity.js.map +1 -0
- package/dist/dev/src/refkey.js +167 -0
- package/dist/dev/src/refkey.js.map +1 -0
- package/dist/dev/src/render-stack.js +252 -0
- package/dist/dev/src/render-stack.js.map +1 -0
- package/dist/dev/src/render.js +872 -0
- package/dist/dev/src/render.js.map +1 -0
- package/dist/dev/src/resource.js +124 -0
- package/dist/dev/src/resource.js.map +1 -0
- package/dist/dev/src/runtime/component.js +41 -0
- package/dist/dev/src/runtime/component.js.map +1 -0
- package/dist/dev/src/runtime/intrinsic.js +12 -0
- package/dist/dev/src/runtime/intrinsic.js.map +1 -0
- package/dist/dev/src/scheduler.js +217 -0
- package/dist/dev/src/scheduler.js.map +1 -0
- package/dist/dev/src/stc.js +40 -0
- package/dist/dev/src/stc.js.map +1 -0
- package/dist/dev/src/sti.js +31 -0
- package/dist/dev/src/sti.js.map +1 -0
- package/dist/dev/src/symbols/basic-scope.js +21 -0
- package/dist/dev/src/symbols/basic-scope.js.map +1 -0
- package/dist/dev/src/symbols/basic-symbol.js +34 -0
- package/dist/dev/src/symbols/basic-symbol.js.map +1 -0
- package/dist/dev/src/symbols/decl.js +26 -0
- package/dist/dev/src/symbols/decl.js.map +1 -0
- package/dist/dev/src/symbols/index.js +10 -0
- package/dist/dev/src/symbols/index.js.map +1 -0
- package/dist/dev/src/symbols/output-scope.js +235 -0
- package/dist/dev/src/symbols/output-scope.js.map +1 -0
- package/dist/dev/src/symbols/output-space.js +51 -0
- package/dist/dev/src/symbols/output-space.js.map +1 -0
- package/dist/dev/src/symbols/output-symbol.js +644 -0
- package/dist/dev/src/symbols/output-symbol.js.map +1 -0
- package/dist/dev/src/symbols/symbol-flow.js +106 -0
- package/dist/dev/src/symbols/symbol-flow.js.map +1 -0
- package/dist/dev/src/symbols/symbol-slot.js +75 -0
- package/dist/dev/src/symbols/symbol-slot.js.map +1 -0
- package/dist/dev/src/symbols/symbol-slot.test.js +68 -0
- package/dist/dev/src/symbols/symbol-slot.test.js.map +1 -0
- package/dist/dev/src/symbols/symbol-table.js +103 -0
- package/dist/dev/src/symbols/symbol-table.js.map +1 -0
- package/dist/dev/src/tap.js +109 -0
- package/dist/dev/src/tap.js.map +1 -0
- package/dist/dev/src/trace.js +2 -0
- package/dist/dev/src/trace.js.map +1 -0
- package/dist/dev/src/tracer.js +180 -0
- package/dist/dev/src/tracer.js.map +1 -0
- package/dist/dev/src/utils.js +487 -0
- package/dist/dev/src/utils.js.map +1 -0
- package/dist/dev/src/write-output.js +48 -0
- package/dist/dev/src/write-output.js.map +1 -0
- package/dist/dev/test/browser-build.test.js +85 -0
- package/dist/dev/test/browser-build.test.js.map +1 -0
- package/dist/dev/test/children.test.js +44 -0
- package/dist/dev/test/children.test.js.map +1 -0
- package/dist/dev/test/components/append-file.test.js +394 -0
- package/dist/dev/test/components/append-file.test.js.map +1 -0
- package/dist/dev/test/components/block.test.js +83 -0
- package/dist/dev/test/components/block.test.js.map +1 -0
- package/dist/dev/test/components/copy-file.test.js +119 -0
- package/dist/dev/test/components/copy-file.test.js.map +1 -0
- package/dist/dev/test/components/declaration.test.js +40 -0
- package/dist/dev/test/components/declaration.test.js.map +1 -0
- package/dist/dev/test/components/list.test.js +250 -0
- package/dist/dev/test/components/list.test.js.map +1 -0
- package/dist/dev/test/components/prose.test.js +42 -0
- package/dist/dev/test/components/prose.test.js.map +1 -0
- package/dist/dev/test/components/reference-or-content.test.js +246 -0
- package/dist/dev/test/components/reference-or-content.test.js.map +1 -0
- package/dist/dev/test/components/source-file.test.js +271 -0
- package/dist/dev/test/components/source-file.test.js.map +1 -0
- package/dist/dev/test/components/template-file.test.js +200 -0
- package/dist/dev/test/components/template-file.test.js.map +1 -0
- package/dist/dev/test/components/update-file.test.js +210 -0
- package/dist/dev/test/components/update-file.test.js.map +1 -0
- package/dist/dev/test/components/wrap.test.js +48 -0
- package/dist/dev/test/components/wrap.test.js.map +1 -0
- package/dist/dev/test/control-flow/for.test.js +318 -0
- package/dist/dev/test/control-flow/for.test.js.map +1 -0
- package/dist/dev/test/control-flow/match.test.js +112 -0
- package/dist/dev/test/control-flow/match.test.js.map +1 -0
- package/dist/dev/test/control-flow/show.test.js +38 -0
- package/dist/dev/test/control-flow/show.test.js.map +1 -0
- package/dist/dev/test/lazy-isempty.test.js +121 -0
- package/dist/dev/test/lazy-isempty.test.js.map +1 -0
- package/dist/dev/test/name-policy.test.js +28 -0
- package/dist/dev/test/name-policy.test.js.map +1 -0
- package/dist/dev/test/props-with-defaults.test.js +94 -0
- package/dist/dev/test/props-with-defaults.test.js.map +1 -0
- package/dist/dev/test/reactive-union-set-disposers.test.js +98 -0
- package/dist/dev/test/reactive-union-set-disposers.test.js.map +1 -0
- package/dist/dev/test/reactive-union-set.test.js +171 -0
- package/dist/dev/test/reactive-union-set.test.js.map +1 -0
- package/dist/dev/test/reactivity/circular-reactives.test.js +62 -0
- package/dist/dev/test/reactivity/circular-reactives.test.js.map +1 -0
- package/dist/dev/test/reactivity/cleanup.test.js +96 -0
- package/dist/dev/test/reactivity/cleanup.test.js.map +1 -0
- package/dist/dev/test/reactivity/memo.test.js +17 -0
- package/dist/dev/test/reactivity/memo.test.js.map +1 -0
- package/dist/dev/test/reactivity/ref-rendering.test.js +38 -0
- package/dist/dev/test/reactivity/ref-rendering.test.js.map +1 -0
- package/dist/dev/test/reactivity/shallow-reactive.test.js +56 -0
- package/dist/dev/test/reactivity/shallow-reactive.test.js.map +1 -0
- package/dist/dev/test/reactivity/test.test.js +74 -0
- package/dist/dev/test/reactivity/test.test.js.map +1 -0
- package/dist/dev/test/reactivity/untrack.test.js +27 -0
- package/dist/dev/test/reactivity/untrack.test.js.map +1 -0
- package/dist/dev/test/refkey.test.js +36 -0
- package/dist/dev/test/refkey.test.js.map +1 -0
- package/dist/dev/test/rendering/basic.test.js +194 -0
- package/dist/dev/test/rendering/basic.test.js.map +1 -0
- package/dist/dev/test/rendering/code.test.js +64 -0
- package/dist/dev/test/rendering/code.test.js.map +1 -0
- package/dist/dev/test/rendering/formatting.test.js +797 -0
- package/dist/dev/test/rendering/formatting.test.js.map +1 -0
- package/dist/dev/test/rendering/indent.test.js +183 -0
- package/dist/dev/test/rendering/indent.test.js.map +1 -0
- package/dist/dev/test/rendering/memoization.test.js +37 -0
- package/dist/dev/test/rendering/memoization.test.js.map +1 -0
- package/dist/dev/test/rendering/print-render-stack.test.js +287 -0
- package/dist/dev/test/rendering/print-render-stack.test.js.map +1 -0
- package/dist/dev/test/rendering/refkeys.test.js +37 -0
- package/dist/dev/test/rendering/refkeys.test.js.map +1 -0
- package/dist/dev/test/scheduler-extended.test.js +96 -0
- package/dist/dev/test/scheduler-extended.test.js.map +1 -0
- package/dist/dev/test/scheduler.test.js +46 -0
- package/dist/dev/test/scheduler.test.js.map +1 -0
- package/dist/dev/test/split-props.test.js +78 -0
- package/dist/dev/test/split-props.test.js.map +1 -0
- package/dist/dev/test/stc.test.js +35 -0
- package/dist/dev/test/stc.test.js.map +1 -0
- package/dist/dev/test/symbols/deconflicted-name.test.js +120 -0
- package/dist/dev/test/symbols/deconflicted-name.test.js.map +1 -0
- package/dist/dev/test/symbols/output-scope.test.js +221 -0
- package/dist/dev/test/symbols/output-scope.test.js.map +1 -0
- package/dist/dev/test/symbols/output-symbol.test.js +202 -0
- package/dist/dev/test/symbols/output-symbol.test.js.map +1 -0
- package/dist/dev/test/symbols/resolution.test.js +487 -0
- package/dist/dev/test/symbols/resolution.test.js.map +1 -0
- package/dist/dev/test/symbols/symbol-table.test.js +15 -0
- package/dist/dev/test/symbols/symbol-table.test.js.map +1 -0
- package/dist/dev/test/symbols/utils.js +26 -0
- package/dist/dev/test/symbols/utils.js.map +1 -0
- package/dist/dev/test/utils.test.js +317 -0
- package/dist/dev/test/utils.test.js.map +1 -0
- package/dist/dev/testing/create-test-wrapper.js +130 -0
- package/dist/dev/testing/create-test-wrapper.js.map +1 -0
- package/dist/dev/testing/devtools-utils.js +162 -0
- package/dist/dev/testing/devtools-utils.js.map +1 -0
- package/dist/dev/testing/extend-expect.js +187 -0
- package/dist/dev/testing/extend-expect.js.map +1 -0
- package/dist/dev/testing/extend-expect.test.js +234 -0
- package/dist/dev/testing/extend-expect.test.js.map +1 -0
- package/dist/dev/testing/index.js +4 -0
- package/dist/dev/testing/index.js.map +1 -0
- package/dist/dev/testing/render.js +34 -0
- package/dist/dev/testing/render.js.map +1 -0
- package/dist/dev/testing/vitest.d.js +14 -0
- package/dist/dev/testing/vitest.d.js.map +1 -0
- package/dist/devtools/index.html +29 -17
- package/dist/src/binder.d.ts +107 -3
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +113 -1
- package/dist/src/binder.js.map +1 -1
- package/dist/src/components/AccessExpression.d.ts +78 -0
- package/dist/src/components/AccessExpression.d.ts.map +1 -0
- package/dist/src/components/AccessExpression.js +218 -0
- package/dist/src/components/AccessExpression.js.map +1 -0
- package/dist/src/components/AccessExpression.test.d.ts +2 -0
- package/dist/src/components/AccessExpression.test.d.ts.map +1 -0
- package/dist/src/components/AccessExpression.test.js +137 -0
- package/dist/src/components/AccessExpression.test.js.map +1 -0
- package/dist/src/components/Block.d.ts +12 -0
- package/dist/src/components/Block.d.ts.map +1 -1
- package/dist/src/components/Block.js +12 -0
- package/dist/src/components/Block.js.map +1 -1
- package/dist/src/components/For.d.ts.map +1 -1
- package/dist/src/components/For.js +1 -1
- package/dist/src/components/For.js.map +1 -1
- package/dist/src/components/List.d.ts +11 -1
- package/dist/src/components/List.d.ts.map +1 -1
- package/dist/src/components/List.js +1 -1
- package/dist/src/components/List.js.map +1 -1
- package/dist/src/components/MemberDeclaration.d.ts +6 -6
- package/dist/src/components/MemberDeclaration.js +6 -6
- package/dist/src/components/MemberName.d.ts +6 -0
- package/dist/src/components/MemberName.d.ts.map +1 -1
- package/dist/src/components/MemberName.js +7 -0
- package/dist/src/components/MemberName.js.map +1 -1
- package/dist/src/components/MemberScope.d.ts +5 -0
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/MemberScope.js +5 -0
- package/dist/src/components/MemberScope.js.map +1 -1
- package/dist/src/components/Output.d.ts +4 -2
- package/dist/src/components/Output.d.ts.map +1 -1
- package/dist/src/components/Output.js.map +1 -1
- package/dist/src/components/Scope.d.ts +6 -0
- package/dist/src/components/Scope.d.ts.map +1 -1
- package/dist/src/components/Scope.js +6 -0
- package/dist/src/components/Scope.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +22 -2
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/Switch.d.ts.map +1 -1
- package/dist/src/components/Switch.js +1 -1
- package/dist/src/components/Switch.js.map +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/context/binder.d.ts +4 -0
- package/dist/src/context/binder.d.ts.map +1 -1
- package/dist/src/context/binder.js +5 -0
- package/dist/src/context/binder.js.map +1 -1
- package/dist/src/context/format-options.d.ts +14 -1
- package/dist/src/context/format-options.d.ts.map +1 -1
- package/dist/src/context/format-options.js +14 -1
- package/dist/src/context/format-options.js.map +1 -1
- package/dist/src/context/scope.d.ts +4 -0
- package/dist/src/context/scope.d.ts.map +1 -1
- package/dist/src/context/scope.js +5 -0
- package/dist/src/context/scope.js.map +1 -1
- package/dist/src/context/source-directory.d.ts +9 -0
- package/dist/src/context/source-directory.d.ts.map +1 -1
- package/dist/src/context/source-directory.js +9 -0
- package/dist/src/context/source-directory.js.map +1 -1
- package/dist/src/debug/cli.d.ts.map +1 -1
- package/dist/src/debug/cli.js +3 -2
- package/dist/src/debug/cli.js.map +1 -1
- package/dist/src/debug/diagnostics-broadcast.test.d.ts +2 -0
- package/dist/src/debug/diagnostics-broadcast.test.d.ts.map +1 -0
- package/dist/src/debug/diagnostics-broadcast.test.js +100 -0
- package/dist/src/debug/diagnostics-broadcast.test.js.map +1 -0
- package/dist/src/debug/diagnostics.test.js +3 -2
- package/dist/src/debug/diagnostics.test.js.map +1 -1
- package/dist/src/debug/effects.d.ts +12 -4
- package/dist/src/debug/effects.d.ts.map +1 -1
- package/dist/src/debug/effects.js +119 -54
- package/dist/src/debug/effects.js.map +1 -1
- package/dist/src/debug/effects.test.js +213 -41
- package/dist/src/debug/effects.test.js.map +1 -1
- package/dist/src/debug/files.d.ts.map +1 -1
- package/dist/src/debug/files.js +7 -18
- package/dist/src/debug/files.js.map +1 -1
- package/dist/src/debug/files.test.js +13 -36
- package/dist/src/debug/files.test.js.map +1 -1
- package/dist/src/debug/index.d.ts +4 -2
- package/dist/src/debug/index.d.ts.map +1 -1
- package/dist/src/debug/index.js +4 -2
- package/dist/src/debug/index.js.map +1 -1
- package/dist/src/debug/message-format.test.d.ts +2 -0
- package/dist/src/debug/message-format.test.d.ts.map +1 -0
- package/dist/src/debug/message-format.test.js +700 -0
- package/dist/src/debug/message-format.test.js.map +1 -0
- package/dist/src/debug/render-tree-orphans.test.d.ts +2 -0
- package/dist/src/debug/render-tree-orphans.test.d.ts.map +1 -0
- package/dist/src/debug/render-tree-orphans.test.js +297 -0
- package/dist/src/debug/render-tree-orphans.test.js.map +1 -0
- package/dist/src/debug/render.d.ts.map +1 -1
- package/dist/src/debug/render.js +91 -131
- package/dist/src/debug/render.js.map +1 -1
- package/dist/src/debug/render.test.js +91 -128
- package/dist/src/debug/render.test.js.map +1 -1
- package/dist/src/debug/source-map.browser.d.ts +16 -0
- package/dist/src/debug/source-map.browser.d.ts.map +1 -0
- package/dist/src/debug/source-map.browser.js +24 -0
- package/dist/src/debug/source-map.browser.js.map +1 -0
- package/dist/src/debug/source-map.d.ts +22 -0
- package/dist/src/debug/source-map.d.ts.map +1 -0
- package/dist/src/debug/source-map.js +111 -0
- package/dist/src/debug/source-map.js.map +1 -0
- package/dist/src/debug/symbols.d.ts +6 -5
- package/dist/src/debug/symbols.d.ts.map +1 -1
- package/dist/src/debug/symbols.js +46 -23
- package/dist/src/debug/symbols.js.map +1 -1
- package/dist/src/debug/symbols.test.js +15 -26
- package/dist/src/debug/symbols.test.js.map +1 -1
- package/dist/src/debug/trace-writer.d.ts +56 -0
- package/dist/src/debug/trace-writer.d.ts.map +1 -0
- package/dist/src/debug/trace-writer.js +674 -0
- package/dist/src/debug/trace-writer.js.map +1 -0
- package/dist/src/debug/trace.d.ts +10 -10
- package/dist/src/debug/trace.d.ts.map +1 -1
- package/dist/src/debug/trace.js +41 -24
- package/dist/src/debug/trace.js.map +1 -1
- package/dist/src/devtools/devtools-protocol.d.ts +318 -161
- package/dist/src/devtools/devtools-protocol.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.browser.d.ts +1 -5
- package/dist/src/devtools/devtools-server.browser.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.browser.js +3 -3
- package/dist/src/devtools/devtools-server.browser.js.map +1 -1
- package/dist/src/devtools/devtools-server.d.ts +5 -6
- package/dist/src/devtools/devtools-server.d.ts.map +1 -1
- package/dist/src/devtools/devtools-server.js +227 -25
- package/dist/src/devtools/devtools-server.js.map +1 -1
- package/dist/src/devtools/devtools-transport.d.ts +2 -2
- package/dist/src/devtools/devtools-transport.d.ts.map +1 -1
- package/dist/src/devtools/devtools-transport.js +2 -2
- package/dist/src/devtools/devtools-transport.js.map +1 -1
- package/dist/src/devtools-entry.browser.d.ts +1 -1
- package/dist/src/devtools-entry.browser.d.ts.map +1 -1
- package/dist/src/devtools-entry.browser.js.map +1 -1
- package/dist/src/devtools-entry.d.ts +1 -1
- package/dist/src/devtools-entry.d.ts.map +1 -1
- package/dist/src/devtools-entry.js.map +1 -1
- package/dist/src/diagnostics.d.ts +1 -1
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +27 -19
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/host/node-host.browser.d.ts +11 -0
- package/dist/src/host/node-host.browser.d.ts.map +1 -0
- package/dist/src/host/node-host.browser.js +21 -0
- package/dist/src/host/node-host.browser.js.map +1 -0
- package/dist/src/host/node-host.d.ts +11 -0
- package/dist/src/host/node-host.d.ts.map +1 -0
- package/dist/src/host/node-host.js +20 -0
- package/dist/src/host/node-host.js.map +1 -0
- package/dist/src/library-symbol-reference.d.ts +52 -0
- package/dist/src/library-symbol-reference.d.ts.map +1 -1
- package/dist/src/library-symbol-reference.js +54 -0
- package/dist/src/library-symbol-reference.js.map +1 -1
- package/dist/src/name-policy.d.ts +30 -3
- package/dist/src/name-policy.d.ts.map +1 -1
- package/dist/src/name-policy.js +27 -0
- package/dist/src/name-policy.js.map +1 -1
- package/dist/src/reactivity.d.ts +28 -2
- package/dist/src/reactivity.d.ts.map +1 -1
- package/dist/src/reactivity.js +154 -45
- package/dist/src/reactivity.js.map +1 -1
- package/dist/src/render-stack.d.ts.map +1 -1
- package/dist/src/render-stack.js +4 -3
- package/dist/src/render-stack.js.map +1 -1
- package/dist/src/render.d.ts +2 -0
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js +84 -30
- package/dist/src/render.js.map +1 -1
- package/dist/src/scheduler.d.ts +5 -0
- package/dist/src/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler.js +94 -23
- package/dist/src/scheduler.js.map +1 -1
- package/dist/src/symbols/output-scope.d.ts +33 -1
- package/dist/src/symbols/output-scope.d.ts.map +1 -1
- package/dist/src/symbols/output-scope.js +34 -1
- package/dist/src/symbols/output-scope.js.map +1 -1
- package/dist/src/symbols/output-space.d.ts +12 -0
- package/dist/src/symbols/output-space.d.ts.map +1 -1
- package/dist/src/symbols/output-space.js +15 -0
- package/dist/src/symbols/output-space.js.map +1 -1
- package/dist/src/symbols/output-symbol.d.ts +128 -12
- package/dist/src/symbols/output-symbol.d.ts.map +1 -1
- package/dist/src/symbols/output-symbol.js +158 -18
- package/dist/src/symbols/output-symbol.js.map +1 -1
- package/dist/src/symbols/symbol-slot.d.ts.map +1 -1
- package/dist/src/symbols/symbol-slot.js +7 -0
- package/dist/src/symbols/symbol-slot.js.map +1 -1
- package/dist/src/symbols/symbol-slot.test.js +18 -1
- package/dist/src/symbols/symbol-slot.test.js.map +1 -1
- package/dist/src/symbols/symbol-table.d.ts.map +1 -1
- package/dist/src/symbols/symbol-table.js +13 -3
- package/dist/src/symbols/symbol-table.js.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +11 -5
- package/dist/src/utils.js.map +1 -1
- package/dist/src/write-output.d.ts.map +1 -1
- package/dist/src/write-output.js +6 -5
- package/dist/src/write-output.js.map +1 -1
- package/dist/test/browser-build.test.js +66 -67
- package/dist/test/browser-build.test.js.map +1 -1
- package/dist/test/reactivity/shallow-reactive.test.js +4 -0
- package/dist/test/reactivity/shallow-reactive.test.js.map +1 -1
- package/dist/test/symbols/deconflicted-name.test.d.ts +2 -0
- package/dist/test/symbols/deconflicted-name.test.d.ts.map +1 -0
- package/dist/test/symbols/deconflicted-name.test.js +120 -0
- package/dist/test/symbols/deconflicted-name.test.js.map +1 -0
- package/dist/test/symbols/output-scope.test.js +41 -0
- package/dist/test/symbols/output-scope.test.js.map +1 -1
- package/dist/testing/create-test-wrapper.d.ts +75 -2
- package/dist/testing/create-test-wrapper.d.ts.map +1 -1
- package/dist/testing/create-test-wrapper.js +55 -1
- package/dist/testing/create-test-wrapper.js.map +1 -1
- package/dist/testing/devtools-utils.d.ts +12 -3
- package/dist/testing/devtools-utils.d.ts.map +1 -1
- package/dist/testing/devtools-utils.js +26 -4
- package/dist/testing/devtools-utils.js.map +1 -1
- package/dist/testing/extend-expect.d.ts +26 -0
- package/dist/testing/extend-expect.d.ts.map +1 -1
- package/dist/testing/extend-expect.js +20 -0
- package/dist/testing/extend-expect.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/render.d.ts +9 -0
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/testing/render.js +11 -0
- package/dist/testing/render.js.map +1 -1
- package/dist/testing/vitest.d.js +12 -0
- package/dist/testing/vitest.d.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/AppendRegion.md +83 -0
- package/docs/api/components/Block.md +49 -0
- package/docs/api/components/CopyFile.md +26 -0
- package/docs/api/components/Declaration.md +85 -0
- package/docs/api/components/For.md +91 -0
- package/docs/api/components/Indent.md +40 -0
- package/docs/api/components/List.md +68 -0
- package/docs/api/components/MemberDeclaration.md +89 -0
- package/docs/api/components/MemberName.md +21 -0
- package/docs/api/components/MemberScope.md +81 -0
- package/docs/api/components/Name.md +19 -0
- package/docs/api/components/Output.md +62 -0
- package/docs/api/components/Prose.md +29 -0
- package/docs/api/components/ReferenceOrContent.md +28 -0
- package/docs/api/components/Scope.md +83 -0
- package/docs/api/components/Show.md +32 -0
- package/docs/api/components/SourceDirectory.md +28 -0
- package/docs/api/components/SourceFile.md +60 -0
- package/docs/api/components/StatementList.md +29 -0
- package/docs/api/components/Switch.md +42 -0
- package/docs/api/components/TemplateFile.md +71 -0
- package/docs/api/components/TemplateVariable.md +57 -0
- package/docs/api/components/UpdateFile.md +56 -0
- package/docs/api/components/Wrap.md +40 -0
- package/docs/api/components/createAccessExpression.md +55 -0
- package/docs/api/components/index.md +27 -0
- package/docs/api/contexts/Assignment-context.md +43 -0
- package/docs/api/contexts/Binder-context.md +22 -0
- package/docs/api/contexts/Declaration-context.md +15 -0
- package/docs/api/contexts/Member-context.md +17 -0
- package/docs/api/contexts/MemberDeclaration-context.md +24 -0
- package/docs/api/contexts/NamePolicy-context.md +18 -0
- package/docs/api/contexts/Scope-context.md +20 -0
- package/docs/api/contexts/SourceDirectory-context.md +26 -0
- package/docs/api/contexts/SourceFile-context.md +19 -0
- package/docs/api/contexts/index.md +11 -0
- package/docs/api/functions/attachDiagnosticsCollector.md +18 -0
- package/docs/api/functions/baseListPropsToMapJoinArgs.md +20 -0
- package/docs/api/functions/children.md +27 -0
- package/docs/api/functions/childrenArray.md +25 -0
- package/docs/api/functions/code.md +25 -0
- package/docs/api/functions/computed.md +18 -0
- package/docs/api/functions/createComponent.md +20 -0
- package/docs/api/functions/createContentSlot.md +33 -0
- package/docs/api/functions/createContext.md +19 -0
- package/docs/api/functions/createCustomContext.md +18 -0
- package/docs/api/functions/createDeclarationTap.md +20 -0
- package/docs/api/functions/createFileResource.md +35 -0
- package/docs/api/functions/createFormatOptionsContextFor.md +28 -0
- package/docs/api/functions/createIntrinsic.md +19 -0
- package/docs/api/functions/createMemberTap.md +20 -0
- package/docs/api/functions/createNamePolicy.md +37 -0
- package/docs/api/functions/createNamedContext.md +19 -0
- package/docs/api/functions/createOutputBinder.md +24 -0
- package/docs/api/functions/createRenderTreeHook.md +19 -0
- package/docs/api/functions/createResource.md +77 -0
- package/docs/api/functions/createScope.md +35 -0
- package/docs/api/functions/createScopeTap.md +20 -0
- package/docs/api/functions/createSourceFileTap.md +20 -0
- package/docs/api/functions/createSymbol.md +25 -0
- package/docs/api/functions/createSymbolSlot.md +19 -0
- package/docs/api/functions/createTap.md +55 -0
- package/docs/api/functions/decl.md +20 -0
- package/docs/api/functions/defaultProps.md +21 -0
- package/docs/api/functions/effect.md +26 -0
- package/docs/api/functions/emitDiagnostic.md +18 -0
- package/docs/api/functions/emitSymbol.md +18 -0
- package/docs/api/functions/ensureIsEmpty.md +20 -0
- package/docs/api/functions/findCurrentEffectId.md +19 -0
- package/docs/api/functions/findKeyedChild.md +19 -0
- package/docs/api/functions/findKeyedChildren.md +19 -0
- package/docs/api/functions/findUnkeyedChildren.md +18 -0
- package/docs/api/functions/formatReactivePropertyLabel.md +21 -0
- package/docs/api/functions/getAssignmentSymbol.md +19 -0
- package/docs/api/functions/getContext.md +17 -0
- package/docs/api/functions/getContextForRenderNode.md +18 -0
- package/docs/api/functions/getDiagnosticsForTree.md +18 -0
- package/docs/api/functions/getEffectDebugId.md +18 -0
- package/docs/api/functions/getElementCache.md +17 -0
- package/docs/api/functions/getReactiveCreationLocation.md +18 -0
- package/docs/api/functions/getSymbolCreator.md +18 -0
- package/docs/api/functions/getSymbolCreatorSymbol.md +17 -0
- package/docs/api/functions/index.md +105 -0
- package/docs/api/functions/inspectRefkey.md +18 -0
- package/docs/api/functions/instantiateTakenMembersTo.md +20 -0
- package/docs/api/functions/isComponentCreator.md +19 -0
- package/docs/api/functions/isCustomContext.md +18 -0
- package/docs/api/functions/isIntrinsicElement.md +18 -0
- package/docs/api/functions/isKeyedChild.md +18 -0
- package/docs/api/functions/isLibrarySymbolReference.md +18 -0
- package/docs/api/functions/isMemberRefkey.md +18 -0
- package/docs/api/functions/isNamekey.md +18 -0
- package/docs/api/functions/isPrintHook.md +18 -0
- package/docs/api/functions/isRefkey.md +18 -0
- package/docs/api/functions/isRefkeyable.md +18 -0
- package/docs/api/functions/isRenderableObject.md +20 -0
- package/docs/api/functions/isSymbolRefkey.md +18 -0
- package/docs/api/functions/join.md +33 -0
- package/docs/api/functions/mapJoin.md +106 -0
- package/docs/api/functions/memberRefkey.md +27 -0
- package/docs/api/functions/memo.md +29 -0
- package/docs/api/functions/mergeProps.md +64 -0
- package/docs/api/functions/moveTakenMembersTo.md +18 -0
- package/docs/api/functions/namekey.md +41 -0
- package/docs/api/functions/nextReactiveId.md +19 -0
- package/docs/api/functions/notifyContentState.md +17 -0
- package/docs/api/functions/onCleanup.md +26 -0
- package/docs/api/functions/printTree.md +31 -0
- package/docs/api/functions/reactivePropertyRefId.md +21 -0
- package/docs/api/functions/ref.md +21 -0
- package/docs/api/functions/refId.md +18 -0
- package/docs/api/functions/refkey.md +24 -0
- package/docs/api/functions/render.md +31 -0
- package/docs/api/functions/renderAsync.md +31 -0
- package/docs/api/functions/renderTree.md +18 -0
- package/docs/api/functions/reportDiagnostics.md +18 -0
- package/docs/api/functions/resetRefIdCounter.md +17 -0
- package/docs/api/functions/resolve.md +31 -0
- package/docs/api/functions/root.md +25 -0
- package/docs/api/functions/shallowReactive.md +18 -0
- package/docs/api/functions/shallowRef.md +21 -0
- package/docs/api/functions/sourceFilesForTree.md +31 -0
- package/docs/api/functions/splitProps.md +19 -0
- package/docs/api/functions/stc.md +18 -0
- package/docs/api/functions/sti.md +18 -0
- package/docs/api/functions/symbolForRefkey.md +24 -0
- package/docs/api/functions/taggedComponent.md +19 -0
- package/docs/api/functions/takeSymbols.md +18 -0
- package/docs/api/functions/text.md +19 -0
- package/docs/api/functions/toRef.md +20 -0
- package/docs/api/functions/toRefkey.md +18 -0
- package/docs/api/functions/toRefs.md +20 -0
- package/docs/api/functions/traverseOutput.md +21 -0
- package/docs/api/functions/unresolvedRefkey.md +18 -0
- package/docs/api/functions/untrack.md +18 -0
- package/docs/api/functions/useContext.md +18 -0
- package/docs/api/functions/useFormatOptions.md +18 -0
- package/docs/api/functions/useMemberContext.md +17 -0
- package/docs/api/functions/useMemberScope.md +17 -0
- package/docs/api/functions/writeOutput.md +21 -0
- package/docs/api/index.md +9 -0
- package/docs/api/testing/functions/createTestWrapper.md +70 -0
- package/docs/api/testing/functions/d.md +21 -0
- package/docs/api/testing/functions/dedent.md +18 -0
- package/docs/api/testing/functions/index.md +6 -0
- package/docs/api/testing/functions/renderToString.md +20 -0
- package/docs/api/testing/index.md +4 -0
- package/docs/api/testing/types/TestWrapper.md +10 -0
- package/docs/api/testing/types/ToRenderToOptions.md +24 -0
- package/docs/api/testing/types/index.md +4 -0
- package/docs/api/types/AlignIntrinsicElement.md +5 -0
- package/docs/api/types/AppendRegionProps.md +5 -0
- package/docs/api/types/BaseListProps.md +21 -0
- package/docs/api/types/BasePartProps.md +10 -0
- package/docs/api/types/BasicScope.md +15 -0
- package/docs/api/types/BasicSymbol.md +18 -0
- package/docs/api/types/Binder.md +18 -0
- package/docs/api/types/BinderOptions.md +7 -0
- package/docs/api/types/BrIntrinsicElement.md +5 -0
- package/docs/api/types/BreakParentIntrinsicElement.md +5 -0
- package/docs/api/types/Child.md +5 -0
- package/docs/api/types/Children.md +5 -0
- package/docs/api/types/ChildrenOptions.md +7 -0
- package/docs/api/types/CommonFormatOptions.md +8 -0
- package/docs/api/types/Component.md +8 -0
- package/docs/api/types/ComponentContext.md +11 -0
- package/docs/api/types/ComponentCreator.md +11 -0
- package/docs/api/types/ComponentDefinition.md +7 -0
- package/docs/api/types/ContentOutputFile.md +10 -0
- package/docs/api/types/ContentSlot.md +12 -0
- package/docs/api/types/Context.md +19 -0
- package/docs/api/types/ContextProviderProps.md +8 -0
- package/docs/api/types/CopyFileContext.md +8 -0
- package/docs/api/types/CopyOutputFile.md +9 -0
- package/docs/api/types/CustomContext.md +10 -0
- package/docs/api/types/CustomContextChildrenCallback.md +5 -0
- package/docs/api/types/DeclarationProps.md +5 -0
- package/docs/api/types/DedentIntrinsicElement.md +5 -0
- package/docs/api/types/DedentToRootIntrinsicElement.md +5 -0
- package/docs/api/types/Diagnostic.md +11 -0
- package/docs/api/types/DiagnosticHandle.md +7 -0
- package/docs/api/types/DiagnosticInput.md +10 -0
- package/docs/api/types/DiagnosticSeverity.md +5 -0
- package/docs/api/types/DiagnosticStackEntry.md +9 -0
- package/docs/api/types/DiagnosticsCollector.md +8 -0
- package/docs/api/types/Disposable_2.md +7 -0
- package/docs/api/types/EffectDebugOptions.md +8 -0
- package/docs/api/types/EffectOptions.md +7 -0
- package/docs/api/types/ElementCache.md +5 -0
- package/docs/api/types/ElementCacheKey.md +5 -0
- package/docs/api/types/FillIntrinsicElement.md +5 -0
- package/docs/api/types/ForCallbackArgs.md +5 -0
- package/docs/api/types/ForSupportedCollections.md +5 -0
- package/docs/api/types/GroupIntrinsicElement.md +5 -0
- package/docs/api/types/HardlineIntrinsicElement.md +5 -0
- package/docs/api/types/HbrIntrinsicElement.md +5 -0
- package/docs/api/types/IfBreakIntrinsicElement.md +5 -0
- package/docs/api/types/IndentIfBreakIntrinsicElement.md +5 -0
- package/docs/api/types/IndentIntrinsicElement.md +5 -0
- package/docs/api/types/IntrinsicElement.md +5 -0
- package/docs/api/types/IntrinsicElementBase.md +9 -0
- package/docs/api/types/IntrinsicElements.md +26 -0
- package/docs/api/types/JoinOptions.md +9 -0
- package/docs/api/types/LbrIntrinsicElement.md +5 -0
- package/docs/api/types/LibrarySymbolReference.md +13 -0
- package/docs/api/types/LineIntrinsicElement.md +5 -0
- package/docs/api/types/LineSuffixBoundaryIntrinsicElement.md +5 -0
- package/docs/api/types/LineSuffixIntrinsicElement.md +5 -0
- package/docs/api/types/LiterallineIntrinsicElement.md +5 -0
- package/docs/api/types/MakeChildrenOptional.md +7 -0
- package/docs/api/types/MarkAsRootIntrinsicElement.md +5 -0
- package/docs/api/types/MatchProps.md +9 -0
- package/docs/api/types/MemberDeclarationProps.md +5 -0
- package/docs/api/types/MemberDescriptor.md +10 -0
- package/docs/api/types/MemberRefkey.md +10 -0
- package/docs/api/types/MemberResolutionContext.md +10 -0
- package/docs/api/types/MemberResolver.md +32 -0
- package/docs/api/types/MemberScopeProps.md +5 -0
- package/docs/api/types/Metadata.md +5 -0
- package/docs/api/types/NameConflictResolver.md +27 -0
- package/docs/api/types/NamePolicy.md +8 -0
- package/docs/api/types/NamePolicyGetter.md +9 -0
- package/docs/api/types/Namekey.md +10 -0
- package/docs/api/types/NamekeyOptions.md +8 -0
- package/docs/api/types/OnReactiveSetAddCallback.md +5 -0
- package/docs/api/types/OnReactiveSetDeleteCallback.md +5 -0
- package/docs/api/types/OutputDeclarationSpace.md +13 -0
- package/docs/api/types/OutputDirectory.md +59 -0
- package/docs/api/types/OutputFile.md +5 -0
- package/docs/api/types/OutputFileBase.md +8 -0
- package/docs/api/types/OutputMemberSpace.md +13 -0
- package/docs/api/types/OutputScope.md +33 -0
- package/docs/api/types/OutputScopeOptions.md +9 -0
- package/docs/api/types/OutputSpace.md +7 -0
- package/docs/api/types/OutputSymbol.md +78 -0
- package/docs/api/types/OutputSymbolOptions.md +16 -0
- package/docs/api/types/OutputVisitor.md +10 -0
- package/docs/api/types/PrintHook.md +10 -0
- package/docs/api/types/PrintTreeOptions.md +11 -0
- package/docs/api/types/Props.md +5 -0
- package/docs/api/types/ReactiveUnionSet.md +20 -0
- package/docs/api/types/ReactiveUnionSetOptions.md +8 -0
- package/docs/api/types/Refkey.md +5 -0
- package/docs/api/types/Refkeyable.md +5 -0
- package/docs/api/types/RefkeyableObject.md +7 -0
- package/docs/api/types/RenderableObject.md +9 -0
- package/docs/api/types/RenderedTextTree.md +5 -0
- package/docs/api/types/ResolutionResult.md +39 -0
- package/docs/api/types/ResolveDeclarationByKeyOptions.md +7 -0
- package/docs/api/types/Resource.md +11 -0
- package/docs/api/types/RootOptions.md +7 -0
- package/docs/api/types/SbrIntrinsicElement.md +5 -0
- package/docs/api/types/ScopeProps.md +5 -0
- package/docs/api/types/SoftlineIntrinsicElement.md +5 -0
- package/docs/api/types/SourceLocation.md +9 -0
- package/docs/api/types/SplitProps.md +12 -0
- package/docs/api/types/StcComponentCreator.md +9 -0
- package/docs/api/types/StcSignature.md +5 -0
- package/docs/api/types/StiComponentCreator.md +9 -0
- package/docs/api/types/StiSignature.md +7 -0
- package/docs/api/types/SymbolCreator.md +15 -0
- package/docs/api/types/SymbolRefkey.md +9 -0
- package/docs/api/types/SymbolSlot.md +12 -0
- package/docs/api/types/SymbolTable.md +15 -0
- package/docs/api/types/TakeSymbolCallback.md +7 -0
- package/docs/api/types/TakeSymbolsCallback.md +7 -0
- package/docs/api/types/Tap.md +11 -0
- package/docs/api/types/TapHandler.md +9 -0
- package/docs/api/types/Tapper.md +9 -0
- package/docs/api/types/TemplateVariableProps.md +5 -0
- package/docs/api/types/index.md +122 -0
- package/docs/api/variables/FormatOptions.md +5 -0
- package/docs/api/variables/Match.md +7 -0
- package/docs/api/variables/REFKEYABLE.md +5 -0
- package/docs/api/variables/RENDERABLE.md +5 -0
- package/docs/api/variables/TO_SYMBOL.md +39 -0
- package/docs/api/variables/contextsByKey.md +5 -0
- package/docs/api/variables/index.md +11 -0
- package/docs/api/variables/intrinsicElementKey.md +5 -0
- package/docs/api/variables/matchTag.md +5 -0
- package/docs/api/variables/printHookTag.md +7 -0
- package/docs/components.md +97 -0
- package/docs/context.md +67 -0
- package/docs/control-flow.md +5 -0
- package/docs/debugging.md +105 -0
- package/docs/formatting.md +99 -0
- package/docs/guides/language-package-guide.md +593 -0
- package/docs/guides/references-and-refkeys.md +210 -0
- package/docs/guides/style-guide.md +244 -0
- package/docs/index.md +22 -0
- package/docs/reactivity.md +68 -0
- package/docs/rendering.md +41 -0
- package/docs/symbols-and-scopes.md +180 -0
- package/package.json +15 -5
- package/src/binder.ts +154 -41
- package/src/components/AccessExpression.test.tsx +132 -0
- package/src/components/AccessExpression.tsx +344 -0
- package/src/components/Block.tsx +12 -0
- package/src/components/For.tsx +14 -10
- package/src/components/List.tsx +18 -5
- package/src/components/MemberDeclaration.tsx +6 -6
- package/src/components/MemberName.tsx +6 -0
- package/src/components/MemberScope.tsx +5 -0
- package/src/components/Output.tsx +4 -1
- package/src/components/Scope.tsx +6 -0
- package/src/components/SourceFile.tsx +22 -2
- package/src/components/Switch.tsx +11 -7
- package/src/components/index.tsx +1 -0
- package/src/context/binder.ts +4 -0
- package/src/context/format-options.ts +14 -1
- package/src/context/scope.ts +4 -0
- package/src/context/source-directory.ts +9 -0
- package/src/debug/cli.ts +3 -2
- package/src/debug/diagnostics-broadcast.test.tsx +98 -0
- package/src/debug/diagnostics.test.tsx +3 -2
- package/src/debug/effects.test.tsx +248 -36
- package/src/debug/effects.ts +198 -64
- package/src/debug/files.test.tsx +15 -35
- package/src/debug/files.ts +11 -11
- package/src/debug/index.ts +4 -0
- package/src/debug/message-format.test.tsx +759 -0
- package/src/debug/render-tree-orphans.test.tsx +344 -0
- package/src/debug/render.test.tsx +96 -118
- package/src/debug/render.ts +196 -125
- package/src/debug/source-map.browser.ts +30 -0
- package/src/debug/source-map.ts +135 -0
- package/src/debug/symbols.test.tsx +19 -20
- package/src/debug/symbols.ts +106 -23
- package/src/debug/trace-writer.ts +984 -0
- package/src/debug/trace.ts +46 -32
- package/src/devtools/devtools-protocol.ts +361 -176
- package/src/devtools/devtools-server.browser.ts +4 -9
- package/src/devtools/devtools-server.ts +226 -33
- package/src/devtools/devtools-transport.ts +4 -4
- package/src/devtools-entry.browser.ts +11 -15
- package/src/devtools-entry.ts +9 -15
- package/src/diagnostics.ts +44 -22
- package/src/host/node-host.browser.ts +23 -0
- package/src/host/node-host.ts +22 -0
- package/src/library-symbol-reference.ts +52 -0
- package/src/name-policy.ts +30 -3
- package/src/reactivity.ts +179 -55
- package/src/render-stack.ts +4 -3
- package/src/render.ts +106 -30
- package/src/scheduler.ts +145 -26
- package/src/symbols/output-scope.ts +33 -1
- package/src/symbols/output-space.ts +13 -0
- package/src/symbols/output-symbol.ts +185 -22
- package/src/symbols/symbol-slot.test.tsx +28 -1
- package/src/symbols/symbol-slot.tsx +8 -0
- package/src/symbols/symbol-table.ts +13 -3
- package/src/utils.tsx +7 -4
- package/src/write-output.ts +6 -5
- package/temp/api-testing.json +673 -0
- package/temp/api.json +895 -73
- package/test/browser-build.test.ts +71 -78
- package/test/reactivity/shallow-reactive.test.tsx +4 -0
- package/test/symbols/deconflicted-name.test.ts +120 -0
- package/test/symbols/output-scope.test.ts +38 -0
- package/testing/create-test-wrapper.tsx +81 -2
- package/testing/devtools-utils.ts +46 -4
- package/testing/extend-expect.ts +22 -1
- package/testing/index.ts +1 -1
- package/testing/render.ts +9 -0
- package/testing/vitest.d.ts +18 -3
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
childrenArray,
|
|
4
|
+
ComponentCreator,
|
|
5
|
+
ComponentDefinition,
|
|
6
|
+
computed,
|
|
7
|
+
isComponentCreator,
|
|
8
|
+
OutputSymbol,
|
|
9
|
+
Refkeyable,
|
|
10
|
+
symbolForRefkey,
|
|
11
|
+
takeSymbols,
|
|
12
|
+
} from "../index.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Base props that all language-specific Part components must include.
|
|
16
|
+
* Language packages extend this with additional props.
|
|
17
|
+
*/
|
|
18
|
+
export interface BasePartProps {
|
|
19
|
+
refkey?: Refkeyable;
|
|
20
|
+
symbol?: OutputSymbol;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Configuration for creating a language-specific access expression component.
|
|
25
|
+
*
|
|
26
|
+
* @typeParam TPartProps - The Part component's props type (extends BasePartProps)
|
|
27
|
+
* @typeParam TPart - The descriptor type that formatPart receives
|
|
28
|
+
*/
|
|
29
|
+
export interface AccessExpressionConfig<
|
|
30
|
+
TPartProps extends BasePartProps,
|
|
31
|
+
TPart,
|
|
32
|
+
> {
|
|
33
|
+
/**
|
|
34
|
+
* Convert Part props + resolved symbol into a plain descriptor object.
|
|
35
|
+
* Called once per Part during children processing. The returned descriptor
|
|
36
|
+
* is wrapped in a computed + getter delegation for reactive optimization.
|
|
37
|
+
*/
|
|
38
|
+
createDescriptor(
|
|
39
|
+
props: TPartProps,
|
|
40
|
+
symbol: OutputSymbol | undefined,
|
|
41
|
+
first: boolean,
|
|
42
|
+
): TPart;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Extract the base content from the first part (the leftmost identifier).
|
|
46
|
+
*/
|
|
47
|
+
getBase(part: TPart): Children;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Format a non-first part given its descriptor and the previous part.
|
|
51
|
+
* Returns JSX children for that segment (e.g., `.foo`, `?.bar`, `[idx]`, `(args)`).
|
|
52
|
+
* `inCallChain` is true when rendering inside a chunked call chain.
|
|
53
|
+
*/
|
|
54
|
+
formatPart(part: TPart, prevPart: TPart, inCallChain: boolean): Children;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Identify which parts are function calls, for call chain detection.
|
|
58
|
+
* When provided, the factory uses the chunked call chain algorithm
|
|
59
|
+
* (line breaks after each call group) when more than one call is detected.
|
|
60
|
+
* When omitted, the expression is always formatted linearly.
|
|
61
|
+
*/
|
|
62
|
+
isCallPart?(part: TPart): boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Additional check for whether call chain formatting should be used.
|
|
66
|
+
* Called only when `isCallPart` is provided and more than one call is detected.
|
|
67
|
+
* Return false to force linear formatting (e.g., TypeScript disables call
|
|
68
|
+
* chains when any part has `await`).
|
|
69
|
+
* Defaults to `() => true`.
|
|
70
|
+
*/
|
|
71
|
+
canUseCallChains?(parts: TPart[]): boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Post-process the accumulated expression after each part in linear
|
|
75
|
+
* (non-call-chain) mode. Use this for language-specific wrapping like
|
|
76
|
+
* TypeScript's `await` which wraps the entire expression so far.
|
|
77
|
+
* Defaults to identity (returns expression unchanged).
|
|
78
|
+
*/
|
|
79
|
+
wrapPartResult?(
|
|
80
|
+
expression: Children,
|
|
81
|
+
part: TPart,
|
|
82
|
+
index: number,
|
|
83
|
+
isLast: boolean,
|
|
84
|
+
): Children;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Create a language-specific access/member expression component pair.
|
|
89
|
+
*
|
|
90
|
+
* Returns `{ Expression, Part }` where:
|
|
91
|
+
* - `Expression` is the main component that collects Part children and renders the chain
|
|
92
|
+
* - `Part` is a no-op component whose props are consumed by Expression
|
|
93
|
+
*
|
|
94
|
+
* The factory handles:
|
|
95
|
+
* - Children collection and Part filtering
|
|
96
|
+
* - Symbol resolution (refkey → symbol via binder, single computed per part)
|
|
97
|
+
* - Reactive optimization (getter delegation over single computed per part)
|
|
98
|
+
* - Flattening nested Expression instances
|
|
99
|
+
* - `takeSymbols()` to prevent symbol leakage
|
|
100
|
+
* - Call chain detection and chunked formatting algorithm
|
|
101
|
+
*/
|
|
102
|
+
export function createAccessExpression<
|
|
103
|
+
TPartProps extends BasePartProps,
|
|
104
|
+
TPart extends Record<string, unknown>,
|
|
105
|
+
>(config: AccessExpressionConfig<TPartProps, TPart>) {
|
|
106
|
+
// Additional component references to match during flattening.
|
|
107
|
+
// Used when the wrapper function (e.g. MemberExpression) differs
|
|
108
|
+
// from the inner Expression function.
|
|
109
|
+
const outerComponents: ComponentDefinition<any>[] = [];
|
|
110
|
+
|
|
111
|
+
function Expression(props: { children: Children }): Children {
|
|
112
|
+
const children = flattenExpression(childrenArray(() => props.children));
|
|
113
|
+
const parts = collectParts(children);
|
|
114
|
+
takeSymbols();
|
|
115
|
+
|
|
116
|
+
if (parts.length === 0) {
|
|
117
|
+
return <></>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const { isCallPart, canUseCallChains } = config;
|
|
121
|
+
|
|
122
|
+
if (!isCallPart) {
|
|
123
|
+
return formatLinear(config, parts);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const isCallChain = computed(() => {
|
|
127
|
+
if (canUseCallChains && !canUseCallChains(parts)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
let callCount = 0;
|
|
131
|
+
for (const part of parts) {
|
|
132
|
+
if (isCallPart(part)) callCount++;
|
|
133
|
+
}
|
|
134
|
+
return callCount > 1;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
return () => {
|
|
138
|
+
return isCallChain.value ?
|
|
139
|
+
formatCallChain(config, parts)
|
|
140
|
+
: formatLinear(config, parts);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function Part(_props: TPartProps) {
|
|
145
|
+
// No-op — props are consumed by the parent Expression component.
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function isExpressionComponent(child: unknown): boolean {
|
|
149
|
+
if (isComponentCreator(child, Expression)) return true;
|
|
150
|
+
for (const comp of outerComponents) {
|
|
151
|
+
if (isComponentCreator(child, comp as any)) return true;
|
|
152
|
+
}
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function flattenExpression(children: Children[]): Children[] {
|
|
157
|
+
const flattened: Children[] = [];
|
|
158
|
+
for (const child of children) {
|
|
159
|
+
if (isExpressionComponent(child)) {
|
|
160
|
+
flattened.push(
|
|
161
|
+
...flattenExpression(
|
|
162
|
+
childrenArray(() => (child as ComponentCreator).props.children),
|
|
163
|
+
),
|
|
164
|
+
);
|
|
165
|
+
} else {
|
|
166
|
+
flattened.push(child);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return flattened;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function collectParts(children: Children[]): TPart[] {
|
|
173
|
+
const parts: TPart[] = [];
|
|
174
|
+
for (const child of children) {
|
|
175
|
+
if (!isComponentCreator(child, Part)) continue;
|
|
176
|
+
const partProps = child.props as TPartProps;
|
|
177
|
+
const first = parts.length === 0;
|
|
178
|
+
|
|
179
|
+
const symbolSource = computed(() => {
|
|
180
|
+
if (partProps.refkey) {
|
|
181
|
+
return symbolForRefkey(partProps.refkey).value;
|
|
182
|
+
} else if (partProps.symbol) {
|
|
183
|
+
return partProps.symbol;
|
|
184
|
+
}
|
|
185
|
+
return undefined;
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
const desc = computed(() =>
|
|
189
|
+
config.createDescriptor(partProps, symbolSource.value, first),
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
// Create getter-delegation object for reactive optimization.
|
|
193
|
+
// Property access on this object tracks the single `desc` computed.
|
|
194
|
+
const keys = Object.keys(
|
|
195
|
+
config.createDescriptor(partProps, undefined, first),
|
|
196
|
+
);
|
|
197
|
+
const proxy: Record<string, unknown> = {};
|
|
198
|
+
for (const key of keys) {
|
|
199
|
+
Object.defineProperty(proxy, key, {
|
|
200
|
+
get() {
|
|
201
|
+
return (desc.value as Record<string, unknown>)[key];
|
|
202
|
+
},
|
|
203
|
+
enumerable: true,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
parts.push(proxy as TPart);
|
|
208
|
+
}
|
|
209
|
+
return parts;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Register an outer wrapper component for flattening support.
|
|
214
|
+
* Call this after creating the wrapper function:
|
|
215
|
+
* `registerOuterComponent(MemberExpression);`
|
|
216
|
+
*/
|
|
217
|
+
function registerOuterComponent(component: ComponentDefinition<any>) {
|
|
218
|
+
outerComponents.push(component);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return { Expression, Part, registerOuterComponent };
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Format parts linearly (no call chain grouping).
|
|
226
|
+
*/
|
|
227
|
+
function formatLinear<TPartProps extends BasePartProps, TPart>(
|
|
228
|
+
config: AccessExpressionConfig<TPartProps, TPart>,
|
|
229
|
+
parts: TPart[],
|
|
230
|
+
): Children {
|
|
231
|
+
return computed(() => {
|
|
232
|
+
let expression: Children = [];
|
|
233
|
+
|
|
234
|
+
for (let i = 0; i < parts.length; i++) {
|
|
235
|
+
const part = parts[i];
|
|
236
|
+
|
|
237
|
+
if (i === 0) {
|
|
238
|
+
(expression as Children[]).push(config.getBase(part));
|
|
239
|
+
} else {
|
|
240
|
+
const prevPart = parts[i - 1];
|
|
241
|
+
const partExpr = config.formatPart(part, prevPart, false);
|
|
242
|
+
|
|
243
|
+
if (Array.isArray(expression)) {
|
|
244
|
+
expression.push(partExpr);
|
|
245
|
+
} else {
|
|
246
|
+
expression = (
|
|
247
|
+
<>
|
|
248
|
+
{expression}
|
|
249
|
+
{partExpr}
|
|
250
|
+
</>
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (config.wrapPartResult) {
|
|
256
|
+
expression = config.wrapPartResult(
|
|
257
|
+
expression,
|
|
258
|
+
part,
|
|
259
|
+
i,
|
|
260
|
+
i === parts.length - 1,
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return expression;
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Format parts as a call chain with indented line breaks at call boundaries.
|
|
271
|
+
*/
|
|
272
|
+
function formatCallChain<TPartProps extends BasePartProps, TPart>(
|
|
273
|
+
config: AccessExpressionConfig<TPartProps, TPart>,
|
|
274
|
+
parts: TPart[],
|
|
275
|
+
): Children {
|
|
276
|
+
return computed(() => {
|
|
277
|
+
const expression: Children[] = [];
|
|
278
|
+
const chunks: TPart[][] = [];
|
|
279
|
+
let pi = 0;
|
|
280
|
+
|
|
281
|
+
function pushPart() {
|
|
282
|
+
chunks.at(-1)!.push(parts[pi]);
|
|
283
|
+
pi++;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function pushChunk() {
|
|
287
|
+
chunks.push([]);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// First chunk: take parts up to and including the first call
|
|
291
|
+
pushChunk();
|
|
292
|
+
while (
|
|
293
|
+
pi < parts.length &&
|
|
294
|
+
(pi === parts.length - 1 ||
|
|
295
|
+
chunks.at(-1)!.length === 0 ||
|
|
296
|
+
!config.isCallPart!(parts[pi + 1]))
|
|
297
|
+
) {
|
|
298
|
+
pushPart();
|
|
299
|
+
if (config.isCallPart!(chunks.at(-1)!.at(-1)!)) {
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Remaining chunks: collect non-call parts then call parts
|
|
305
|
+
while (pi < parts.length) {
|
|
306
|
+
pushChunk();
|
|
307
|
+
while (pi < parts.length && !config.isCallPart!(parts[pi])) {
|
|
308
|
+
pushPart();
|
|
309
|
+
}
|
|
310
|
+
while (pi < parts.length && config.isCallPart!(parts[pi])) {
|
|
311
|
+
pushPart();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
for (let ci = 0; ci < chunks.length; ci++) {
|
|
316
|
+
const chunk = chunks[ci];
|
|
317
|
+
const chunkExpr = [];
|
|
318
|
+
for (let cpi = 0; cpi < chunk.length; cpi++) {
|
|
319
|
+
if (ci === 0 && cpi === 0) {
|
|
320
|
+
chunkExpr.push(config.getBase(chunk[0]));
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
const part = chunk[cpi];
|
|
324
|
+
const prevPart = cpi === 0 ? chunks[ci - 1].at(-1)! : chunk[cpi - 1];
|
|
325
|
+
chunkExpr.push(config.formatPart(part, prevPart, true));
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
expression.push(
|
|
329
|
+
ci === 0 ? chunkExpr : (
|
|
330
|
+
<>
|
|
331
|
+
<sbr />
|
|
332
|
+
{chunkExpr}
|
|
333
|
+
</>
|
|
334
|
+
),
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return (
|
|
339
|
+
<group>
|
|
340
|
+
<indent>{expression}</indent>
|
|
341
|
+
</group>
|
|
342
|
+
);
|
|
343
|
+
});
|
|
344
|
+
}
|
package/src/components/Block.tsx
CHANGED
|
@@ -31,6 +31,18 @@ export interface BlockProps {
|
|
|
31
31
|
* Create an indented block of source text. The block has `opener` text which is
|
|
32
32
|
* added prior to the block, which defaults to `"{"`, and `closer` text which is
|
|
33
33
|
* added after the block, which defaults to `"}"`.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
*
|
|
37
|
+
* When `children` is empty, `Block` renders as `{}` (opener immediately followed
|
|
38
|
+
* by closer) with no indented content — no explicit empty check is needed before
|
|
39
|
+
* passing children.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Safe even when props.members is empty — renders `{}`
|
|
44
|
+
* <Block>{props.members}</Block>
|
|
45
|
+
* ```
|
|
34
46
|
*/
|
|
35
47
|
export function Block(props: BlockProps) {
|
|
36
48
|
const ContentSlot = createContentSlot();
|
package/src/components/For.tsx
CHANGED
|
@@ -80,15 +80,19 @@ export function For<
|
|
|
80
80
|
const cb = props.children;
|
|
81
81
|
const options = baseListPropsToMapJoinArgs(props);
|
|
82
82
|
options.skipFalsy = props.skipFalsy;
|
|
83
|
-
return memo(
|
|
84
|
-
|
|
83
|
+
return memo(
|
|
84
|
+
() => {
|
|
85
|
+
const maybeRef = props.each;
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
return (mapJoin as any)(
|
|
88
|
+
typeof maybeRef === "function" ? maybeRef : (
|
|
89
|
+
() => (isRef(maybeRef) ? maybeRef.value : maybeRef)
|
|
90
|
+
),
|
|
91
|
+
cb,
|
|
92
|
+
options,
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
undefined,
|
|
96
|
+
"For",
|
|
97
|
+
);
|
|
94
98
|
}
|
package/src/components/List.tsx
CHANGED
|
@@ -39,7 +39,17 @@ export interface BaseListProps {
|
|
|
39
39
|
ender?: Children;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Place the join punctuation at the end,
|
|
42
|
+
* Place the join punctuation at the end, without a line break. The punctuation
|
|
43
|
+
* is emitted unconditionally in flat and broken modes.
|
|
44
|
+
*
|
|
45
|
+
* To add trailing punctuation only in broken mode, use `ender` with `<ifBreak>`
|
|
46
|
+
* inside a `<group>` with a non-hardline joiner (e.g. `line`):
|
|
47
|
+
*
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <group>
|
|
50
|
+
* <List comma line ender={<ifBreak>,</ifBreak>}>...</List>
|
|
51
|
+
* </group>
|
|
52
|
+
* ```
|
|
43
53
|
*/
|
|
44
54
|
enderPunctuation?: boolean;
|
|
45
55
|
}
|
|
@@ -57,10 +67,13 @@ export interface ListProps extends BaseListProps {
|
|
|
57
67
|
*/
|
|
58
68
|
export function List(props: ListProps) {
|
|
59
69
|
const [rest, forProps] = splitProps(props, ["children"]);
|
|
60
|
-
const resolvedChildren = memo(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
const resolvedChildren = memo(
|
|
71
|
+
() =>
|
|
72
|
+
childrenArray(() => rest.children, {
|
|
73
|
+
preserveFragments: true,
|
|
74
|
+
}),
|
|
75
|
+
undefined,
|
|
76
|
+
"List:children",
|
|
64
77
|
);
|
|
65
78
|
return (
|
|
66
79
|
<For each={resolvedChildren} {...forProps} skipFalsy>
|
|
@@ -60,16 +60,16 @@ export type MemberDeclarationProps =
|
|
|
60
60
|
*
|
|
61
61
|
* This component must be called in one of two ways: with a name and an optional
|
|
62
62
|
* refkey, or else passing in the symbol. When called with a name and refkey, a
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
* `BasicSymbol` will be created in the current member space. When called with a
|
|
64
|
+
* `name`, the owning scope must be a `BasicScope`; for custom scope/symbol
|
|
65
|
+
* types, pass a pre-created `symbol` instead.
|
|
66
66
|
*
|
|
67
67
|
* When called with a symbol, that symbol is merely exposed via
|
|
68
|
-
* {@link MemberDeclarationContext}
|
|
69
|
-
*
|
|
70
|
-
* {@link BinderContext}.
|
|
68
|
+
* {@link MemberDeclarationContext} (not {@link DeclarationContext}). Use
|
|
69
|
+
* {@link MemberName} (not `<Name />`) to render the declared member's name.
|
|
71
70
|
*
|
|
72
71
|
* @see {@link BinderContext}
|
|
72
|
+
* @see {@link MemberName}
|
|
73
73
|
*/
|
|
74
74
|
export function MemberDeclaration(props: MemberDeclarationProps) {
|
|
75
75
|
const binder = useContext(BinderContext);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { useContext } from "../context.js";
|
|
2
2
|
import { MemberDeclarationContext } from "../context/member-declaration.js";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Renders the name of the current member declaration from
|
|
6
|
+
* {@link MemberDeclarationContext}. Use this inside a
|
|
7
|
+
* {@link MemberDeclaration} component instead of `<Name />`, which reads from
|
|
8
|
+
* the top-level {@link DeclarationContext}.
|
|
9
|
+
*/
|
|
4
10
|
export function MemberName() {
|
|
5
11
|
const declSymbol = useContext(MemberDeclarationContext);
|
|
6
12
|
if (!declSymbol) {
|
|
@@ -56,6 +56,11 @@ export type MemberScopeProps =
|
|
|
56
56
|
* like. In some languages, this scope may provide symbols which are can be
|
|
57
57
|
* referenced lexically, but in other languages, these members may not be in
|
|
58
58
|
* scope and instead must be referenced via the owner symbol itself.
|
|
59
|
+
*
|
|
60
|
+
* When called with `name` (without `value`), this delegates to `<Scope>` which
|
|
61
|
+
* creates a `BasicScope`. The same restriction applies: the parent scope must
|
|
62
|
+
* be a `BasicScope`. For custom scope types, create your scope and pass it via
|
|
63
|
+
* the `value` prop.
|
|
59
64
|
*/
|
|
60
65
|
export function MemberScope(props: MemberScopeProps) {
|
|
61
66
|
if ("value" in props) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createOutputBinder,
|
|
3
3
|
getSymbolCreator,
|
|
4
|
+
NameConflictResolver,
|
|
4
5
|
SymbolCreator,
|
|
5
6
|
} from "../binder.js";
|
|
6
7
|
import { BinderContext } from "../context/binder.js";
|
|
@@ -28,8 +29,10 @@ export interface OutputProps extends PrintTreeOptions {
|
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* Policy for handling multiple symbols declared with the same name.
|
|
32
|
+
*
|
|
33
|
+
* @see {@link NameConflictResolver}
|
|
31
34
|
*/
|
|
32
|
-
nameConflictResolver?:
|
|
35
|
+
nameConflictResolver?: NameConflictResolver;
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
38
|
* The base path for the output contents. Defaults to "."
|
package/src/components/Scope.tsx
CHANGED
|
@@ -47,6 +47,12 @@ export type ScopeProps = ScopePropsWithValue | ScopePropsWithInfo;
|
|
|
47
47
|
* Declare a scope for this component's children. Any symbols and scopes
|
|
48
48
|
* declared in the children of this component will be in this scope.
|
|
49
49
|
*
|
|
50
|
+
* @remarks
|
|
51
|
+
*
|
|
52
|
+
* When called with `name` (without `value`), this creates a `BasicScope`. The
|
|
53
|
+
* parent scope must also be a `BasicScope`; for custom scope types, create your
|
|
54
|
+
* scope and pass it via the `value` prop instead.
|
|
55
|
+
*
|
|
50
56
|
* @see {@link ScopeContext}
|
|
51
57
|
*/
|
|
52
58
|
export function Scope(props: ScopeProps) {
|
|
@@ -17,6 +17,11 @@ export interface SourceFileProps extends PrintTreeOptions {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The type of contents in this file.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* This is a metadata hint only. It does not trigger formatting or content
|
|
23
|
+
* processing. The value is forwarded to debug tooling and the
|
|
24
|
+
* `ContentOutputFile` output metadata.
|
|
20
25
|
*/
|
|
21
26
|
filetype: string;
|
|
22
27
|
|
|
@@ -28,8 +33,23 @@ export interface SourceFileProps extends PrintTreeOptions {
|
|
|
28
33
|
*/
|
|
29
34
|
reference?: ComponentDefinition<{ refkey: Refkey }>;
|
|
30
35
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
36
|
+
* Content rendered before the file body, separated from it by a hard line
|
|
37
|
+
* break. The separator is emitted whenever `header` is not `undefined` —
|
|
38
|
+
* including when it is an empty string or a component that renders nothing.
|
|
39
|
+
* To suppress both the header and the separator, omit this prop entirely.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Omitting `header` suppresses both header and separator:
|
|
44
|
+
* <SourceFile filetype="txt" path="output/data.txt">
|
|
45
|
+
* {children}
|
|
46
|
+
* </SourceFile>
|
|
47
|
+
*
|
|
48
|
+
* // An empty string still emits the separator newline:
|
|
49
|
+
* <SourceFile filetype="txt" path="output/data.txt" header="">
|
|
50
|
+
* {children}
|
|
51
|
+
* </SourceFile>
|
|
52
|
+
* ```
|
|
33
53
|
*/
|
|
34
54
|
header?: Children;
|
|
35
55
|
}
|
|
@@ -27,15 +27,19 @@ export function Switch(props: SwitchProps) {
|
|
|
27
27
|
const children = childrenArray(() => props.children);
|
|
28
28
|
const matches = findKeyedChildren(children, matchTag);
|
|
29
29
|
|
|
30
|
-
return memo(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return memo(
|
|
31
|
+
() => {
|
|
32
|
+
for (const match of matches) {
|
|
33
|
+
if (match.props.when || match.props.else) {
|
|
34
|
+
return match.props.children;
|
|
35
|
+
}
|
|
34
36
|
}
|
|
35
|
-
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
return undefined;
|
|
39
|
+
},
|
|
40
|
+
undefined,
|
|
41
|
+
"Switch",
|
|
42
|
+
);
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
export interface MatchProps {
|
package/src/components/index.tsx
CHANGED
package/src/context/binder.ts
CHANGED
|
@@ -14,6 +14,10 @@ import type { Output } from "../components/Output.js";
|
|
|
14
14
|
export const BinderContext: ComponentContext<Binder> =
|
|
15
15
|
createNamedContext("Binder");
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Returns the current {@link Binder} from context, or `undefined` if no
|
|
19
|
+
* binder is available. The binder is provided by the {@link Output} component.
|
|
20
|
+
*/
|
|
17
21
|
export function useBinder() {
|
|
18
22
|
return useContext(BinderContext);
|
|
19
23
|
}
|
|
@@ -3,10 +3,23 @@ import { PrintTreeOptions } from "../render.js";
|
|
|
3
3
|
|
|
4
4
|
export interface CommonFormatOptions extends PrintTreeOptions {}
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Base format options provider and consumer for all file types. Language
|
|
8
|
+
* packages create their own via {@link createFormatOptionsContextFor}.
|
|
9
|
+
*/
|
|
6
10
|
export const { Provider: FormatOptions, useFormatOptions } =
|
|
7
11
|
createFormatOptionsContextFor<CommonFormatOptions>("*");
|
|
8
12
|
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Create a format options context for a specific file type. Returns a
|
|
15
|
+
* `Provider` component and a `useFormatOptions` hook.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
*
|
|
19
|
+
* Merge precedence: `defaults` (lowest) → Provider `value` → `overrides`
|
|
20
|
+
* argument to `useFormatOptions()` (highest). Undefined override values are
|
|
21
|
+
* ignored.
|
|
22
|
+
*/
|
|
10
23
|
export function createFormatOptionsContextFor<T>(
|
|
11
24
|
filetype: string,
|
|
12
25
|
defaults?: T,
|
package/src/context/scope.ts
CHANGED
|
@@ -8,6 +8,10 @@ import type { OutputScope } from "../symbols/output-scope.js";
|
|
|
8
8
|
export const ScopeContext: ComponentContext<OutputScope> =
|
|
9
9
|
createNamedContext("Scope");
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Returns the current {@link OutputScope} from context. Must be called inside
|
|
13
|
+
* a component that is a descendant of a `<Scope>` provider.
|
|
14
|
+
*/
|
|
11
15
|
export function useScope() {
|
|
12
16
|
return useContext(ScopeContext)!;
|
|
13
17
|
}
|
|
@@ -9,5 +9,14 @@ export interface SourceDirectoryContext {
|
|
|
9
9
|
path: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Always provided by `<Output>` — `useContext(SourceDirectoryContext)` is
|
|
14
|
+
* never `undefined` inside an `<Output>` tree. At the root of the tree,
|
|
15
|
+
* `path` equals the `basePath` prop on `<Output>` (default `"./"`); nested
|
|
16
|
+
* `<SourceDirectory>` components update `path` relative to their parent.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link Output}
|
|
19
|
+
* @see {@link SourceDirectory}
|
|
20
|
+
*/
|
|
12
21
|
export const SourceDirectoryContext: ComponentContext<SourceDirectoryContext> =
|
|
13
22
|
createNamedContext("SourceDirectory");
|
package/src/debug/cli.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Table from "cli-table3";
|
|
2
2
|
import pc from "picocolors";
|
|
3
3
|
import { contextsByKey } from "../context.js";
|
|
4
|
+
import { stdoutWrite } from "../host/node-host.js";
|
|
4
5
|
import { getContext, untrack } from "../reactivity.js";
|
|
5
6
|
import { isReactiveTarget } from "./effects.js";
|
|
6
7
|
|
|
@@ -143,7 +144,7 @@ export function debugStack() {
|
|
|
143
144
|
currentContext.componentOwner &&
|
|
144
145
|
currentContext.componentOwner.component.name !== "Provider"
|
|
145
146
|
) {
|
|
146
|
-
|
|
147
|
+
stdoutWrite(
|
|
147
148
|
style.component.name(currentContext.componentOwner.component.name) +
|
|
148
149
|
"\n",
|
|
149
150
|
);
|
|
@@ -164,7 +165,7 @@ export function debugStack() {
|
|
|
164
165
|
: pc.gray("(none)"),
|
|
165
166
|
]);
|
|
166
167
|
|
|
167
|
-
|
|
168
|
+
stdoutWrite(table.toString() + "\n\n");
|
|
168
169
|
foundContexts = [];
|
|
169
170
|
}
|
|
170
171
|
|