fuzor 0.4.0 → 0.5.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/README.md +36 -88
- package/dist/boundaries.d.ts +5 -0
- package/dist/boundaries.d.ts.map +1 -0
- package/dist/boundaries.js +5 -0
- package/dist/boundaries.js.map +1 -0
- package/dist/browser.d.ts +4 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +4 -0
- package/dist/browser.js.map +1 -0
- package/dist/build-output.d.ts +18 -0
- package/dist/build-output.d.ts.map +1 -0
- package/dist/build-output.js +91 -0
- package/dist/build-output.js.map +1 -0
- package/dist/cli.js +388 -34
- package/dist/cli.js.map +1 -1
- package/dist/compiler/api-routes.d.ts +14 -0
- package/dist/compiler/api-routes.d.ts.map +1 -0
- package/dist/compiler/api-routes.js +66 -0
- package/dist/compiler/api-routes.js.map +1 -0
- package/dist/compiler/base-links.d.ts +7 -0
- package/dist/compiler/base-links.d.ts.map +1 -0
- package/dist/compiler/base-links.js +40 -0
- package/dist/compiler/base-links.js.map +1 -0
- package/dist/compiler/data-document.d.ts +9 -0
- package/dist/compiler/data-document.d.ts.map +1 -0
- package/dist/compiler/data-document.js +21 -0
- package/dist/compiler/data-document.js.map +1 -0
- package/dist/compiler/docs.d.ts +6 -0
- package/dist/compiler/docs.d.ts.map +1 -0
- package/dist/compiler/docs.js +1131 -0
- package/dist/compiler/docs.js.map +1 -0
- package/dist/compiler/highlight.d.ts +13 -0
- package/dist/compiler/highlight.d.ts.map +1 -0
- package/dist/compiler/highlight.js +44 -0
- package/dist/compiler/highlight.js.map +1 -0
- package/dist/compiler/index.d.ts +132 -4
- package/dist/compiler/index.d.ts.map +1 -1
- package/dist/compiler/index.js +845 -48
- package/dist/compiler/index.js.map +1 -1
- package/dist/compiler/inline-assets.d.ts +6 -0
- package/dist/compiler/inline-assets.d.ts.map +1 -0
- package/dist/compiler/inline-assets.js +61 -0
- package/dist/compiler/inline-assets.js.map +1 -0
- package/dist/compiler/inline-modules.d.ts +7 -0
- package/dist/compiler/inline-modules.d.ts.map +1 -0
- package/dist/compiler/inline-modules.js +77 -0
- package/dist/compiler/inline-modules.js.map +1 -0
- package/dist/compiler/island-modules.d.ts +8 -0
- package/dist/compiler/island-modules.d.ts.map +1 -0
- package/dist/compiler/island-modules.js +42 -0
- package/dist/compiler/island-modules.js.map +1 -0
- package/dist/compiler/islands.d.ts +24 -3
- package/dist/compiler/islands.d.ts.map +1 -1
- package/dist/compiler/islands.js +50 -12
- package/dist/compiler/islands.js.map +1 -1
- package/dist/compiler/links.d.ts +37 -0
- package/dist/compiler/links.d.ts.map +1 -0
- package/dist/compiler/links.js +112 -0
- package/dist/compiler/links.js.map +1 -0
- package/dist/compiler/markdown.d.ts +17 -0
- package/dist/compiler/markdown.d.ts.map +1 -0
- package/dist/compiler/markdown.js +92 -0
- package/dist/compiler/markdown.js.map +1 -0
- package/dist/compiler/metadata.d.ts +37 -0
- package/dist/compiler/metadata.d.ts.map +1 -0
- package/dist/compiler/metadata.js +81 -0
- package/dist/compiler/metadata.js.map +1 -0
- package/dist/compiler/native-scripts.d.ts +13 -0
- package/dist/compiler/native-scripts.d.ts.map +1 -0
- package/dist/compiler/native-scripts.js +137 -0
- package/dist/compiler/native-scripts.js.map +1 -0
- package/dist/compiler/page-scripts.d.ts +36 -0
- package/dist/compiler/page-scripts.d.ts.map +1 -0
- package/dist/compiler/page-scripts.js +158 -0
- package/dist/compiler/page-scripts.js.map +1 -0
- package/dist/compiler/route-policy.d.ts +17 -0
- package/dist/compiler/route-policy.d.ts.map +1 -0
- package/dist/compiler/route-policy.js +68 -0
- package/dist/compiler/route-policy.js.map +1 -0
- package/dist/compiler/search.d.ts +13 -0
- package/dist/compiler/search.d.ts.map +1 -0
- package/dist/compiler/search.js +24 -0
- package/dist/compiler/search.js.map +1 -0
- package/dist/compiler/server-modules.d.ts +3 -0
- package/dist/compiler/server-modules.d.ts.map +1 -0
- package/dist/compiler/server-modules.js +31 -0
- package/dist/compiler/server-modules.js.map +1 -0
- package/dist/compiler/static-analysis.d.ts +20 -0
- package/dist/compiler/static-analysis.d.ts.map +1 -0
- package/dist/compiler/static-analysis.js +130 -0
- package/dist/compiler/static-analysis.js.map +1 -0
- package/dist/create-delegate.d.ts +17 -0
- package/dist/create-delegate.d.ts.map +1 -0
- package/dist/create-delegate.js +48 -0
- package/dist/create-delegate.js.map +1 -0
- package/dist/electron.d.ts +5 -0
- package/dist/electron.d.ts.map +1 -0
- package/dist/electron.js +32 -0
- package/dist/electron.js.map +1 -0
- package/dist/html-escape.d.ts +16 -0
- package/dist/html-escape.d.ts.map +1 -0
- package/dist/html-escape.js +26 -0
- package/dist/html-escape.js.map +1 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/islands/hydration.d.ts +7 -0
- package/dist/islands/hydration.d.ts.map +1 -0
- package/dist/islands/hydration.js +12 -0
- package/dist/islands/hydration.js.map +1 -0
- package/dist/islands/react.d.ts +9 -2
- package/dist/islands/react.d.ts.map +1 -1
- package/dist/islands/react.js +73 -14
- package/dist/islands/react.js.map +1 -1
- package/dist/islands/solid.d.ts.map +1 -1
- package/dist/islands/solid.js +10 -1
- package/dist/islands/solid.js.map +1 -1
- package/dist/islands/vue.d.ts.map +1 -1
- package/dist/islands/vue.js +15 -3
- package/dist/islands/vue.js.map +1 -1
- package/dist/module-specifiers.d.ts +5 -0
- package/dist/module-specifiers.d.ts.map +1 -0
- package/dist/module-specifiers.js +80 -0
- package/dist/module-specifiers.js.map +1 -0
- package/dist/route-path.d.ts +33 -0
- package/dist/route-path.d.ts.map +1 -0
- package/dist/route-path.js +81 -0
- package/dist/route-path.js.map +1 -0
- package/dist/route-patterns.d.ts +8 -0
- package/dist/route-patterns.d.ts.map +1 -0
- package/dist/route-patterns.js +84 -0
- package/dist/route-patterns.js.map +1 -0
- package/dist/runtime/activation.d.ts +29 -0
- package/dist/runtime/activation.d.ts.map +1 -0
- package/dist/runtime/activation.js +236 -0
- package/dist/runtime/activation.js.map +1 -0
- package/dist/runtime/browser-navigation.d.ts +20 -0
- package/dist/runtime/browser-navigation.d.ts.map +1 -0
- package/dist/runtime/browser-navigation.js +138 -0
- package/dist/runtime/browser-navigation.js.map +1 -0
- package/dist/runtime/browser-support.d.ts +20 -0
- package/dist/runtime/browser-support.d.ts.map +1 -0
- package/dist/runtime/browser-support.js +39 -0
- package/dist/runtime/browser-support.js.map +1 -0
- package/dist/runtime/capacitor.d.ts +43 -0
- package/dist/runtime/capacitor.d.ts.map +1 -0
- package/dist/runtime/capacitor.js +84 -0
- package/dist/runtime/capacitor.js.map +1 -0
- package/dist/runtime/client-routes.d.ts +4 -0
- package/dist/runtime/client-routes.d.ts.map +1 -0
- package/dist/runtime/client-routes.js +3 -0
- package/dist/runtime/client-routes.js.map +1 -0
- package/dist/runtime/coordinated-navigation.d.ts +7 -0
- package/dist/runtime/coordinated-navigation.d.ts.map +1 -0
- package/dist/runtime/coordinated-navigation.js +50 -0
- package/dist/runtime/coordinated-navigation.js.map +1 -0
- package/dist/runtime/coordinator.d.ts +32 -0
- package/dist/runtime/coordinator.d.ts.map +1 -0
- package/dist/runtime/coordinator.js +115 -0
- package/dist/runtime/coordinator.js.map +1 -0
- package/dist/runtime/data.d.ts +25 -0
- package/dist/runtime/data.d.ts.map +1 -0
- package/dist/runtime/data.js +115 -0
- package/dist/runtime/data.js.map +1 -0
- package/dist/runtime/docs-search.d.ts +13 -0
- package/dist/runtime/docs-search.d.ts.map +1 -0
- package/dist/runtime/docs-search.js +205 -0
- package/dist/runtime/docs-search.js.map +1 -0
- package/dist/runtime/docs-ui.d.ts +7 -0
- package/dist/runtime/docs-ui.d.ts.map +1 -0
- package/dist/runtime/docs-ui.js +85 -0
- package/dist/runtime/docs-ui.js.map +1 -0
- package/dist/runtime/document-navigation.d.ts +9 -0
- package/dist/runtime/document-navigation.d.ts.map +1 -0
- package/dist/runtime/document-navigation.js +27 -0
- package/dist/runtime/document-navigation.js.map +1 -0
- package/dist/runtime/dom-renderer.d.ts +36 -0
- package/dist/runtime/dom-renderer.d.ts.map +1 -0
- package/dist/runtime/dom-renderer.js +173 -0
- package/dist/runtime/dom-renderer.js.map +1 -0
- package/dist/runtime/hash-navigation.d.ts +12 -0
- package/dist/runtime/hash-navigation.d.ts.map +1 -0
- package/dist/runtime/hash-navigation.js +26 -0
- package/dist/runtime/hash-navigation.js.map +1 -0
- package/dist/runtime/history-navigation.d.ts +17 -0
- package/dist/runtime/history-navigation.d.ts.map +1 -0
- package/dist/runtime/history-navigation.js +172 -0
- package/dist/runtime/history-navigation.js.map +1 -0
- package/dist/runtime/href.d.ts +16 -0
- package/dist/runtime/href.d.ts.map +1 -0
- package/dist/runtime/href.js +38 -0
- package/dist/runtime/href.js.map +1 -0
- package/dist/runtime/index.d.ts +73 -26
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +33 -118
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/initial-route.d.ts +8 -0
- package/dist/runtime/initial-route.d.ts.map +1 -0
- package/dist/runtime/initial-route.js +72 -0
- package/dist/runtime/initial-route.js.map +1 -0
- package/dist/runtime/islands.d.ts +19 -5
- package/dist/runtime/islands.d.ts.map +1 -1
- package/dist/runtime/islands.js +15 -41
- package/dist/runtime/islands.js.map +1 -1
- package/dist/runtime/loading.d.ts +12 -0
- package/dist/runtime/loading.d.ts.map +1 -0
- package/dist/runtime/loading.js +43 -0
- package/dist/runtime/loading.js.map +1 -0
- package/dist/runtime/memory-navigation.d.ts +16 -0
- package/dist/runtime/memory-navigation.d.ts.map +1 -0
- package/dist/runtime/memory-navigation.js +98 -0
- package/dist/runtime/memory-navigation.js.map +1 -0
- package/dist/runtime/native.d.ts +108 -0
- package/dist/runtime/native.d.ts.map +1 -0
- package/dist/runtime/native.js +378 -0
- package/dist/runtime/native.js.map +1 -0
- package/dist/runtime/navigation-atom.d.ts +21 -0
- package/dist/runtime/navigation-atom.d.ts.map +1 -0
- package/dist/runtime/navigation-atom.js +76 -0
- package/dist/runtime/navigation-atom.js.map +1 -0
- package/dist/runtime/navigation.d.ts +61 -0
- package/dist/runtime/navigation.d.ts.map +1 -0
- package/dist/runtime/navigation.js +11 -0
- package/dist/runtime/navigation.js.map +1 -0
- package/dist/runtime/page-scripts.d.ts +54 -0
- package/dist/runtime/page-scripts.d.ts.map +1 -0
- package/dist/runtime/page-scripts.js +207 -0
- package/dist/runtime/page-scripts.js.map +1 -0
- package/dist/runtime/route-matches.d.ts +17 -0
- package/dist/runtime/route-matches.d.ts.map +1 -0
- package/dist/runtime/route-matches.js +50 -0
- package/dist/runtime/route-matches.js.map +1 -0
- package/dist/runtime/router-embedded.d.ts +28 -0
- package/dist/runtime/router-embedded.d.ts.map +1 -0
- package/dist/runtime/router-embedded.js +12 -0
- package/dist/runtime/router-embedded.js.map +1 -0
- package/dist/runtime/router-navigation-api.d.ts +28 -0
- package/dist/runtime/router-navigation-api.d.ts.map +1 -0
- package/dist/runtime/router-navigation-api.js +13 -0
- package/dist/runtime/router-navigation-api.js.map +1 -0
- package/dist/runtime/router.d.ts +137 -0
- package/dist/runtime/router.d.ts.map +1 -0
- package/dist/runtime/router.js +678 -0
- package/dist/runtime/router.js.map +1 -0
- package/dist/runtime/stale-deployment.d.ts +7 -0
- package/dist/runtime/stale-deployment.d.ts.map +1 -0
- package/dist/runtime/stale-deployment.js +30 -0
- package/dist/runtime/stale-deployment.js.map +1 -0
- package/dist/runtime/user-input.d.ts +25 -0
- package/dist/runtime/user-input.d.ts.map +1 -0
- package/dist/runtime/user-input.js +81 -0
- package/dist/runtime/user-input.js.map +1 -0
- package/dist/runtimes.d.ts +43 -0
- package/dist/runtimes.d.ts.map +1 -0
- package/dist/runtimes.js +152 -0
- package/dist/runtimes.js.map +1 -0
- package/dist/server/node.d.ts +47 -2
- package/dist/server/node.d.ts.map +1 -1
- package/dist/server/node.js +185 -23
- package/dist/server/node.js.map +1 -1
- package/dist/server/static.d.ts +11 -0
- package/dist/server/static.d.ts.map +1 -0
- package/dist/server/static.js +61 -0
- package/dist/server/static.js.map +1 -0
- package/dist/server-api.d.ts +73 -0
- package/dist/server-api.d.ts.map +1 -0
- package/dist/server-api.js +171 -0
- package/dist/server-api.js.map +1 -0
- package/dist/server-components/browser.d.ts +75 -0
- package/dist/server-components/browser.d.ts.map +1 -0
- package/dist/server-components/browser.js +558 -0
- package/dist/server-components/browser.js.map +1 -0
- package/dist/server-components/closures.d.ts +21 -0
- package/dist/server-components/closures.d.ts.map +1 -0
- package/dist/server-components/closures.js +192 -0
- package/dist/server-components/closures.js.map +1 -0
- package/dist/server-components/compiler.d.ts +6 -0
- package/dist/server-components/compiler.d.ts.map +1 -0
- package/dist/server-components/compiler.js +118 -0
- package/dist/server-components/compiler.js.map +1 -0
- package/dist/server-components/environment.d.ts +3 -0
- package/dist/server-components/environment.d.ts.map +1 -0
- package/dist/server-components/environment.js +11 -0
- package/dist/server-components/environment.js.map +1 -0
- package/dist/server-components/navigation.d.ts +10 -0
- package/dist/server-components/navigation.d.ts.map +1 -0
- package/dist/server-components/navigation.js +105 -0
- package/dist/server-components/navigation.js.map +1 -0
- package/dist/server-components/protocol.d.ts +77 -0
- package/dist/server-components/protocol.d.ts.map +1 -0
- package/dist/server-components/protocol.js +110 -0
- package/dist/server-components/protocol.js.map +1 -0
- package/dist/server-components/references.d.ts +22 -0
- package/dist/server-components/references.d.ts.map +1 -0
- package/dist/server-components/references.js +94 -0
- package/dist/server-components/references.js.map +1 -0
- package/dist/server-components/server.d.ts +78 -0
- package/dist/server-components/server.d.ts.map +1 -0
- package/dist/server-components/server.js +278 -0
- package/dist/server-components/server.js.map +1 -0
- package/dist/server-components/stream.d.ts +15 -0
- package/dist/server-components/stream.d.ts.map +1 -0
- package/dist/server-components/stream.js +72 -0
- package/dist/server-components/stream.js.map +1 -0
- package/dist/server-cookies.d.ts +41 -0
- package/dist/server-cookies.d.ts.map +1 -0
- package/dist/server-cookies.js +120 -0
- package/dist/server-cookies.js.map +1 -0
- package/dist/server-data.d.ts +51 -0
- package/dist/server-data.d.ts.map +1 -0
- package/dist/server-data.js +37 -0
- package/dist/server-data.js.map +1 -0
- package/dist/server.d.ts +57 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +244 -13
- package/dist/server.js.map +1 -1
- package/dist/ui/behaviors/accordion.d.ts +14 -0
- package/dist/ui/behaviors/accordion.d.ts.map +1 -0
- package/dist/ui/behaviors/accordion.js +149 -0
- package/dist/ui/behaviors/accordion.js.map +1 -0
- package/dist/ui/behaviors/catalogue.d.ts +63 -0
- package/dist/ui/behaviors/catalogue.d.ts.map +1 -0
- package/dist/ui/behaviors/catalogue.js +284 -0
- package/dist/ui/behaviors/catalogue.js.map +1 -0
- package/dist/ui/behaviors/collapsible.d.ts +26 -0
- package/dist/ui/behaviors/collapsible.d.ts.map +1 -0
- package/dist/ui/behaviors/collapsible.js +145 -0
- package/dist/ui/behaviors/collapsible.js.map +1 -0
- package/dist/ui/behaviors/dialog.d.ts +16 -0
- package/dist/ui/behaviors/dialog.d.ts.map +1 -0
- package/dist/ui/behaviors/dialog.js +225 -0
- package/dist/ui/behaviors/dialog.js.map +1 -0
- package/dist/ui/behaviors/lifecycle.d.ts +15 -0
- package/dist/ui/behaviors/lifecycle.d.ts.map +1 -0
- package/dist/ui/behaviors/lifecycle.js +51 -0
- package/dist/ui/behaviors/lifecycle.js.map +1 -0
- package/dist/ui/behaviors/menu.d.ts +15 -0
- package/dist/ui/behaviors/menu.d.ts.map +1 -0
- package/dist/ui/behaviors/menu.js +162 -0
- package/dist/ui/behaviors/menu.js.map +1 -0
- package/dist/ui/behaviors/ownership.d.ts +7 -0
- package/dist/ui/behaviors/ownership.d.ts.map +1 -0
- package/dist/ui/behaviors/ownership.js +16 -0
- package/dist/ui/behaviors/ownership.js.map +1 -0
- package/dist/ui/behaviors/popover.d.ts +16 -0
- package/dist/ui/behaviors/popover.d.ts.map +1 -0
- package/dist/ui/behaviors/popover.js +90 -0
- package/dist/ui/behaviors/popover.js.map +1 -0
- package/dist/ui/behaviors/select.d.ts +37 -0
- package/dist/ui/behaviors/select.d.ts.map +1 -0
- package/dist/ui/behaviors/select.js +261 -0
- package/dist/ui/behaviors/select.js.map +1 -0
- package/dist/ui/behaviors/switch.d.ts +43 -0
- package/dist/ui/behaviors/switch.d.ts.map +1 -0
- package/dist/ui/behaviors/switch.js +269 -0
- package/dist/ui/behaviors/switch.js.map +1 -0
- package/dist/ui/behaviors/tabs.d.ts +4 -0
- package/dist/ui/behaviors/tabs.d.ts.map +1 -0
- package/dist/ui/behaviors/tabs.js +121 -0
- package/dist/ui/behaviors/tabs.js.map +1 -0
- package/dist/ui/behaviors/toolbar.d.ts +4 -0
- package/dist/ui/behaviors/toolbar.d.ts.map +1 -0
- package/dist/ui/behaviors/toolbar.js +81 -0
- package/dist/ui/behaviors/toolbar.js.map +1 -0
- package/dist/ui/behaviors/tooltip.d.ts +16 -0
- package/dist/ui/behaviors/tooltip.d.ts.map +1 -0
- package/dist/ui/behaviors/tooltip.js +91 -0
- package/dist/ui/behaviors/tooltip.js.map +1 -0
- package/dist/ui/behaviors/types.d.ts +51 -0
- package/dist/ui/behaviors/types.d.ts.map +1 -0
- package/dist/ui/behaviors/types.js +2 -0
- package/dist/ui/behaviors/types.js.map +1 -0
- package/dist/ui/catalogue-loaders.d.ts +4 -0
- package/dist/ui/catalogue-loaders.d.ts.map +1 -0
- package/dist/ui/catalogue-loaders.js +45 -0
- package/dist/ui/catalogue-loaders.js.map +1 -0
- package/dist/ui/catalogue.d.ts +465 -0
- package/dist/ui/catalogue.d.ts.map +1 -0
- package/dist/ui/catalogue.js +1570 -0
- package/dist/ui/catalogue.js.map +1 -0
- package/dist/ui/checkpoints.d.ts +20 -0
- package/dist/ui/checkpoints.d.ts.map +1 -0
- package/dist/ui/checkpoints.js +118 -0
- package/dist/ui/checkpoints.js.map +1 -0
- package/dist/ui/components/accordion/accordion.d.ts +22 -0
- package/dist/ui/components/accordion/accordion.d.ts.map +1 -0
- package/dist/ui/components/accordion/accordion.js +47 -0
- package/dist/ui/components/accordion/accordion.js.map +1 -0
- package/dist/ui/components/accordion/index.d.ts +2 -0
- package/dist/ui/components/accordion/index.d.ts.map +1 -0
- package/dist/ui/components/accordion/index.js +2 -0
- package/dist/ui/components/accordion/index.js.map +1 -0
- package/dist/ui/components/angle-slider/index.d.ts +5 -0
- package/dist/ui/components/angle-slider/index.d.ts.map +1 -0
- package/dist/ui/components/angle-slider/index.js +7 -0
- package/dist/ui/components/angle-slider/index.js.map +1 -0
- package/dist/ui/components/async-list/index.d.ts +5 -0
- package/dist/ui/components/async-list/index.d.ts.map +1 -0
- package/dist/ui/components/async-list/index.js +7 -0
- package/dist/ui/components/async-list/index.js.map +1 -0
- package/dist/ui/components/avatar/index.d.ts +5 -0
- package/dist/ui/components/avatar/index.d.ts.map +1 -0
- package/dist/ui/components/avatar/index.js +7 -0
- package/dist/ui/components/avatar/index.js.map +1 -0
- package/dist/ui/components/badge/badge.d.ts +6 -0
- package/dist/ui/components/badge/badge.d.ts.map +1 -0
- package/dist/ui/components/badge/badge.js +11 -0
- package/dist/ui/components/badge/badge.js.map +1 -0
- package/dist/ui/components/badge/index.d.ts +2 -0
- package/dist/ui/components/badge/index.d.ts.map +1 -0
- package/dist/ui/components/badge/index.js +2 -0
- package/dist/ui/components/badge/index.js.map +1 -0
- package/dist/ui/components/button/button.d.ts +26 -0
- package/dist/ui/components/button/button.d.ts.map +1 -0
- package/dist/ui/components/button/button.js +116 -0
- package/dist/ui/components/button/button.js.map +1 -0
- package/dist/ui/components/button/index.d.ts +2 -0
- package/dist/ui/components/button/index.d.ts.map +1 -0
- package/dist/ui/components/button/index.js +2 -0
- package/dist/ui/components/button/index.js.map +1 -0
- package/dist/ui/components/card/card.d.ts +21 -0
- package/dist/ui/components/card/card.d.ts.map +1 -0
- package/dist/ui/components/card/card.js +41 -0
- package/dist/ui/components/card/card.js.map +1 -0
- package/dist/ui/components/card/index.d.ts +2 -0
- package/dist/ui/components/card/index.d.ts.map +1 -0
- package/dist/ui/components/card/index.js +2 -0
- package/dist/ui/components/card/index.js.map +1 -0
- package/dist/ui/components/carousel/index.d.ts +5 -0
- package/dist/ui/components/carousel/index.d.ts.map +1 -0
- package/dist/ui/components/carousel/index.js +7 -0
- package/dist/ui/components/carousel/index.js.map +1 -0
- package/dist/ui/components/cascade-select/index.d.ts +7 -0
- package/dist/ui/components/cascade-select/index.d.ts.map +1 -0
- package/dist/ui/components/cascade-select/index.js +8 -0
- package/dist/ui/components/cascade-select/index.js.map +1 -0
- package/dist/ui/components/checkbox/index.d.ts +5 -0
- package/dist/ui/components/checkbox/index.d.ts.map +1 -0
- package/dist/ui/components/checkbox/index.js +7 -0
- package/dist/ui/components/checkbox/index.js.map +1 -0
- package/dist/ui/components/clipboard/index.d.ts +5 -0
- package/dist/ui/components/clipboard/index.d.ts.map +1 -0
- package/dist/ui/components/clipboard/index.js +7 -0
- package/dist/ui/components/clipboard/index.js.map +1 -0
- package/dist/ui/components/collapsible/collapsible.d.ts +21 -0
- package/dist/ui/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/ui/components/collapsible/collapsible.js +39 -0
- package/dist/ui/components/collapsible/collapsible.js.map +1 -0
- package/dist/ui/components/collapsible/index.d.ts +2 -0
- package/dist/ui/components/collapsible/index.d.ts.map +1 -0
- package/dist/ui/components/collapsible/index.js +2 -0
- package/dist/ui/components/collapsible/index.js.map +1 -0
- package/dist/ui/components/color-picker/index.d.ts +7 -0
- package/dist/ui/components/color-picker/index.d.ts.map +1 -0
- package/dist/ui/components/color-picker/index.js +8 -0
- package/dist/ui/components/color-picker/index.js.map +1 -0
- package/dist/ui/components/combobox/index.d.ts +7 -0
- package/dist/ui/components/combobox/index.d.ts.map +1 -0
- package/dist/ui/components/combobox/index.js +8 -0
- package/dist/ui/components/combobox/index.js.map +1 -0
- package/dist/ui/components/date-input/index.d.ts +7 -0
- package/dist/ui/components/date-input/index.d.ts.map +1 -0
- package/dist/ui/components/date-input/index.js +8 -0
- package/dist/ui/components/date-input/index.js.map +1 -0
- package/dist/ui/components/date-picker/index.d.ts +7 -0
- package/dist/ui/components/date-picker/index.d.ts.map +1 -0
- package/dist/ui/components/date-picker/index.js +8 -0
- package/dist/ui/components/date-picker/index.js.map +1 -0
- package/dist/ui/components/dialog/dialog.d.ts +44 -0
- package/dist/ui/components/dialog/dialog.d.ts.map +1 -0
- package/dist/ui/components/dialog/dialog.js +105 -0
- package/dist/ui/components/dialog/dialog.js.map +1 -0
- package/dist/ui/components/dialog/index.d.ts +2 -0
- package/dist/ui/components/dialog/index.d.ts.map +1 -0
- package/dist/ui/components/dialog/index.js +2 -0
- package/dist/ui/components/dialog/index.js.map +1 -0
- package/dist/ui/components/drawer/index.d.ts +5 -0
- package/dist/ui/components/drawer/index.d.ts.map +1 -0
- package/dist/ui/components/drawer/index.js +7 -0
- package/dist/ui/components/drawer/index.js.map +1 -0
- package/dist/ui/components/editable/index.d.ts +5 -0
- package/dist/ui/components/editable/index.d.ts.map +1 -0
- package/dist/ui/components/editable/index.js +7 -0
- package/dist/ui/components/editable/index.js.map +1 -0
- package/dist/ui/components/file-upload/index.d.ts +5 -0
- package/dist/ui/components/file-upload/index.d.ts.map +1 -0
- package/dist/ui/components/file-upload/index.js +7 -0
- package/dist/ui/components/file-upload/index.js.map +1 -0
- package/dist/ui/components/floating-panel/index.d.ts +5 -0
- package/dist/ui/components/floating-panel/index.d.ts.map +1 -0
- package/dist/ui/components/floating-panel/index.js +7 -0
- package/dist/ui/components/floating-panel/index.js.map +1 -0
- package/dist/ui/components/hover-card/index.d.ts +5 -0
- package/dist/ui/components/hover-card/index.d.ts.map +1 -0
- package/dist/ui/components/hover-card/index.js +7 -0
- package/dist/ui/components/hover-card/index.js.map +1 -0
- package/dist/ui/components/image-cropper/index.d.ts +5 -0
- package/dist/ui/components/image-cropper/index.d.ts.map +1 -0
- package/dist/ui/components/image-cropper/index.js +7 -0
- package/dist/ui/components/image-cropper/index.js.map +1 -0
- package/dist/ui/components/index.d.ts +61 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +186 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/components/layout/box.d.ts +11 -0
- package/dist/ui/components/layout/box.d.ts.map +1 -0
- package/dist/ui/components/layout/box.js +44 -0
- package/dist/ui/components/layout/box.js.map +1 -0
- package/dist/ui/components/layout/container.d.ts +9 -0
- package/dist/ui/components/layout/container.d.ts.map +1 -0
- package/dist/ui/components/layout/container.js +38 -0
- package/dist/ui/components/layout/container.js.map +1 -0
- package/dist/ui/components/layout/flex.d.ts +10 -0
- package/dist/ui/components/layout/flex.d.ts.map +1 -0
- package/dist/ui/components/layout/flex.js +53 -0
- package/dist/ui/components/layout/flex.js.map +1 -0
- package/dist/ui/components/layout/grid.d.ts +10 -0
- package/dist/ui/components/layout/grid.d.ts.map +1 -0
- package/dist/ui/components/layout/grid.js +47 -0
- package/dist/ui/components/layout/grid.js.map +1 -0
- package/dist/ui/components/layout/index.d.ts +6 -0
- package/dist/ui/components/layout/index.d.ts.map +1 -0
- package/dist/ui/components/layout/index.js +6 -0
- package/dist/ui/components/layout/index.js.map +1 -0
- package/dist/ui/components/layout/stack.d.ts +9 -0
- package/dist/ui/components/layout/stack.d.ts.map +1 -0
- package/dist/ui/components/layout/stack.js +37 -0
- package/dist/ui/components/layout/stack.js.map +1 -0
- package/dist/ui/components/listbox/index.d.ts +8 -0
- package/dist/ui/components/listbox/index.d.ts.map +1 -0
- package/dist/ui/components/listbox/index.js +9 -0
- package/dist/ui/components/listbox/index.js.map +1 -0
- package/dist/ui/components/marquee/index.d.ts +5 -0
- package/dist/ui/components/marquee/index.d.ts.map +1 -0
- package/dist/ui/components/marquee/index.js +7 -0
- package/dist/ui/components/marquee/index.js.map +1 -0
- package/dist/ui/components/menu/index.d.ts +2 -0
- package/dist/ui/components/menu/index.d.ts.map +1 -0
- package/dist/ui/components/menu/index.js +2 -0
- package/dist/ui/components/menu/index.js.map +1 -0
- package/dist/ui/components/menu/menu.d.ts +23 -0
- package/dist/ui/components/menu/menu.d.ts.map +1 -0
- package/dist/ui/components/menu/menu.js +45 -0
- package/dist/ui/components/menu/menu.js.map +1 -0
- package/dist/ui/components/navigation/breadcrumbs.d.ts +19 -0
- package/dist/ui/components/navigation/breadcrumbs.d.ts.map +1 -0
- package/dist/ui/components/navigation/breadcrumbs.js +90 -0
- package/dist/ui/components/navigation/breadcrumbs.js.map +1 -0
- package/dist/ui/components/navigation/index.d.ts +6 -0
- package/dist/ui/components/navigation/index.d.ts.map +1 -0
- package/dist/ui/components/navigation/index.js +6 -0
- package/dist/ui/components/navigation/index.js.map +1 -0
- package/dist/ui/components/navigation/prose.d.ts +6 -0
- package/dist/ui/components/navigation/prose.d.ts.map +1 -0
- package/dist/ui/components/navigation/prose.js +11 -0
- package/dist/ui/components/navigation/prose.js.map +1 -0
- package/dist/ui/components/navigation/sidebar.d.ts +10 -0
- package/dist/ui/components/navigation/sidebar.d.ts.map +1 -0
- package/dist/ui/components/navigation/sidebar.js +35 -0
- package/dist/ui/components/navigation/sidebar.js.map +1 -0
- package/dist/ui/components/navigation/toc.d.ts +11 -0
- package/dist/ui/components/navigation/toc.d.ts.map +1 -0
- package/dist/ui/components/navigation/toc.js +82 -0
- package/dist/ui/components/navigation/toc.js.map +1 -0
- package/dist/ui/components/navigation-menu/index.d.ts +5 -0
- package/dist/ui/components/navigation-menu/index.d.ts.map +1 -0
- package/dist/ui/components/navigation-menu/index.js +7 -0
- package/dist/ui/components/navigation-menu/index.js.map +1 -0
- package/dist/ui/components/number-input/index.d.ts +5 -0
- package/dist/ui/components/number-input/index.d.ts.map +1 -0
- package/dist/ui/components/number-input/index.js +7 -0
- package/dist/ui/components/number-input/index.js.map +1 -0
- package/dist/ui/components/pagination/index.d.ts +5 -0
- package/dist/ui/components/pagination/index.d.ts.map +1 -0
- package/dist/ui/components/pagination/index.js +7 -0
- package/dist/ui/components/pagination/index.js.map +1 -0
- package/dist/ui/components/password-input/index.d.ts +5 -0
- package/dist/ui/components/password-input/index.d.ts.map +1 -0
- package/dist/ui/components/password-input/index.js +7 -0
- package/dist/ui/components/password-input/index.js.map +1 -0
- package/dist/ui/components/pin-input/index.d.ts +5 -0
- package/dist/ui/components/pin-input/index.d.ts.map +1 -0
- package/dist/ui/components/pin-input/index.js +7 -0
- package/dist/ui/components/pin-input/index.js.map +1 -0
- package/dist/ui/components/popover/index.d.ts +2 -0
- package/dist/ui/components/popover/index.d.ts.map +1 -0
- package/dist/ui/components/popover/index.js +2 -0
- package/dist/ui/components/popover/index.js.map +1 -0
- package/dist/ui/components/popover/popover.d.ts +14 -0
- package/dist/ui/components/popover/popover.d.ts.map +1 -0
- package/dist/ui/components/popover/popover.js +22 -0
- package/dist/ui/components/popover/popover.js.map +1 -0
- package/dist/ui/components/presence/index.d.ts +5 -0
- package/dist/ui/components/presence/index.d.ts.map +1 -0
- package/dist/ui/components/presence/index.js +7 -0
- package/dist/ui/components/presence/index.js.map +1 -0
- package/dist/ui/components/progress/index.d.ts +5 -0
- package/dist/ui/components/progress/index.d.ts.map +1 -0
- package/dist/ui/components/progress/index.js +7 -0
- package/dist/ui/components/progress/index.js.map +1 -0
- package/dist/ui/components/qr-code/index.d.ts +5 -0
- package/dist/ui/components/qr-code/index.d.ts.map +1 -0
- package/dist/ui/components/qr-code/index.js +7 -0
- package/dist/ui/components/qr-code/index.js.map +1 -0
- package/dist/ui/components/radio-group/index.d.ts +5 -0
- package/dist/ui/components/radio-group/index.d.ts.map +1 -0
- package/dist/ui/components/radio-group/index.js +7 -0
- package/dist/ui/components/radio-group/index.js.map +1 -0
- package/dist/ui/components/rating-group/index.d.ts +5 -0
- package/dist/ui/components/rating-group/index.d.ts.map +1 -0
- package/dist/ui/components/rating-group/index.js +7 -0
- package/dist/ui/components/rating-group/index.js.map +1 -0
- package/dist/ui/components/resize-handle/index.d.ts +2 -0
- package/dist/ui/components/resize-handle/index.d.ts.map +1 -0
- package/dist/ui/components/resize-handle/index.js +2 -0
- package/dist/ui/components/resize-handle/index.js.map +1 -0
- package/dist/ui/components/resize-handle/resize-handle.d.ts +39 -0
- package/dist/ui/components/resize-handle/resize-handle.d.ts.map +1 -0
- package/dist/ui/components/resize-handle/resize-handle.js +170 -0
- package/dist/ui/components/resize-handle/resize-handle.js.map +1 -0
- package/dist/ui/components/scroll-area/index.d.ts +5 -0
- package/dist/ui/components/scroll-area/index.d.ts.map +1 -0
- package/dist/ui/components/scroll-area/index.js +7 -0
- package/dist/ui/components/scroll-area/index.js.map +1 -0
- package/dist/ui/components/select/index.d.ts +2 -0
- package/dist/ui/components/select/index.d.ts.map +1 -0
- package/dist/ui/components/select/index.js +2 -0
- package/dist/ui/components/select/index.js.map +1 -0
- package/dist/ui/components/select/select.d.ts +40 -0
- package/dist/ui/components/select/select.d.ts.map +1 -0
- package/dist/ui/components/select/select.js +57 -0
- package/dist/ui/components/select/select.js.map +1 -0
- package/dist/ui/components/separator/index.d.ts +2 -0
- package/dist/ui/components/separator/index.d.ts.map +1 -0
- package/dist/ui/components/separator/index.js +2 -0
- package/dist/ui/components/separator/index.js.map +1 -0
- package/dist/ui/components/separator/separator.d.ts +9 -0
- package/dist/ui/components/separator/separator.d.ts.map +1 -0
- package/dist/ui/components/separator/separator.js +27 -0
- package/dist/ui/components/separator/separator.js.map +1 -0
- package/dist/ui/components/signature-pad/index.d.ts +5 -0
- package/dist/ui/components/signature-pad/index.d.ts.map +1 -0
- package/dist/ui/components/signature-pad/index.js +7 -0
- package/dist/ui/components/signature-pad/index.js.map +1 -0
- package/dist/ui/components/slider/index.d.ts +5 -0
- package/dist/ui/components/slider/index.d.ts.map +1 -0
- package/dist/ui/components/slider/index.js +7 -0
- package/dist/ui/components/slider/index.js.map +1 -0
- package/dist/ui/components/splitter/index.d.ts +5 -0
- package/dist/ui/components/splitter/index.d.ts.map +1 -0
- package/dist/ui/components/splitter/index.js +7 -0
- package/dist/ui/components/splitter/index.js.map +1 -0
- package/dist/ui/components/steps/index.d.ts +5 -0
- package/dist/ui/components/steps/index.d.ts.map +1 -0
- package/dist/ui/components/steps/index.js +7 -0
- package/dist/ui/components/steps/index.js.map +1 -0
- package/dist/ui/components/switch/index.d.ts +2 -0
- package/dist/ui/components/switch/index.d.ts.map +1 -0
- package/dist/ui/components/switch/index.js +2 -0
- package/dist/ui/components/switch/index.js.map +1 -0
- package/dist/ui/components/switch/switch.d.ts +48 -0
- package/dist/ui/components/switch/switch.d.ts.map +1 -0
- package/dist/ui/components/switch/switch.js +64 -0
- package/dist/ui/components/switch/switch.js.map +1 -0
- package/dist/ui/components/tabs/index.d.ts +2 -0
- package/dist/ui/components/tabs/index.d.ts.map +1 -0
- package/dist/ui/components/tabs/index.js +2 -0
- package/dist/ui/components/tabs/index.js.map +1 -0
- package/dist/ui/components/tabs/tabs.d.ts +22 -0
- package/dist/ui/components/tabs/tabs.d.ts.map +1 -0
- package/dist/ui/components/tabs/tabs.js +89 -0
- package/dist/ui/components/tabs/tabs.js.map +1 -0
- package/dist/ui/components/tags-input/index.d.ts +5 -0
- package/dist/ui/components/tags-input/index.d.ts.map +1 -0
- package/dist/ui/components/tags-input/index.js +7 -0
- package/dist/ui/components/tags-input/index.js.map +1 -0
- package/dist/ui/components/timer/index.d.ts +7 -0
- package/dist/ui/components/timer/index.d.ts.map +1 -0
- package/dist/ui/components/timer/index.js +8 -0
- package/dist/ui/components/timer/index.js.map +1 -0
- package/dist/ui/components/toast/index.d.ts +7 -0
- package/dist/ui/components/toast/index.d.ts.map +1 -0
- package/dist/ui/components/toast/index.js +8 -0
- package/dist/ui/components/toast/index.js.map +1 -0
- package/dist/ui/components/toc/index.d.ts +5 -0
- package/dist/ui/components/toc/index.d.ts.map +1 -0
- package/dist/ui/components/toc/index.js +7 -0
- package/dist/ui/components/toc/index.js.map +1 -0
- package/dist/ui/components/toggle/index.d.ts +5 -0
- package/dist/ui/components/toggle/index.d.ts.map +1 -0
- package/dist/ui/components/toggle/index.js +7 -0
- package/dist/ui/components/toggle/index.js.map +1 -0
- package/dist/ui/components/toggle-group/index.d.ts +5 -0
- package/dist/ui/components/toggle-group/index.d.ts.map +1 -0
- package/dist/ui/components/toggle-group/index.js +7 -0
- package/dist/ui/components/toggle-group/index.js.map +1 -0
- package/dist/ui/components/toolbar/index.d.ts +11 -0
- package/dist/ui/components/toolbar/index.d.ts.map +1 -0
- package/dist/ui/components/toolbar/index.js +18 -0
- package/dist/ui/components/toolbar/index.js.map +1 -0
- package/dist/ui/components/tooltip/index.d.ts +2 -0
- package/dist/ui/components/tooltip/index.d.ts.map +1 -0
- package/dist/ui/components/tooltip/index.js +2 -0
- package/dist/ui/components/tooltip/index.js.map +1 -0
- package/dist/ui/components/tooltip/tooltip.d.ts +14 -0
- package/dist/ui/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/ui/components/tooltip/tooltip.js +22 -0
- package/dist/ui/components/tooltip/tooltip.js.map +1 -0
- package/dist/ui/components/tour/index.d.ts +5 -0
- package/dist/ui/components/tour/index.d.ts.map +1 -0
- package/dist/ui/components/tour/index.js +7 -0
- package/dist/ui/components/tour/index.js.map +1 -0
- package/dist/ui/components/tree-view/index.d.ts +7 -0
- package/dist/ui/components/tree-view/index.d.ts.map +1 -0
- package/dist/ui/components/tree-view/index.js +8 -0
- package/dist/ui/components/tree-view/index.js.map +1 -0
- package/dist/ui/core/button-behavior.d.ts +3 -0
- package/dist/ui/core/button-behavior.d.ts.map +1 -0
- package/dist/ui/core/button-behavior.js +50 -0
- package/dist/ui/core/button-behavior.js.map +1 -0
- package/dist/ui/core/catalogue-element.d.ts +6 -0
- package/dist/ui/core/catalogue-element.d.ts.map +1 -0
- package/dist/ui/core/catalogue-element.js +28 -0
- package/dist/ui/core/catalogue-element.js.map +1 -0
- package/dist/ui/core/component-styles.d.ts +2 -0
- package/dist/ui/core/component-styles.d.ts.map +1 -0
- package/dist/ui/core/component-styles.js +77 -0
- package/dist/ui/core/component-styles.js.map +1 -0
- package/dist/ui/core/element.d.ts +12 -0
- package/dist/ui/core/element.d.ts.map +1 -0
- package/dist/ui/core/element.js +57 -0
- package/dist/ui/core/element.js.map +1 -0
- package/dist/ui/core/events.d.ts +6 -0
- package/dist/ui/core/events.d.ts.map +1 -0
- package/dist/ui/core/events.js +13 -0
- package/dist/ui/core/events.js.map +1 -0
- package/dist/ui/core/form-control.d.ts +4 -0
- package/dist/ui/core/form-control.d.ts.map +1 -0
- package/dist/ui/core/form-control.js +25 -0
- package/dist/ui/core/form-control.js.map +1 -0
- package/dist/ui/core/index.d.ts +5 -0
- package/dist/ui/core/index.d.ts.map +1 -0
- package/dist/ui/core/index.js +5 -0
- package/dist/ui/core/index.js.map +1 -0
- package/dist/ui/core/layout-styles.d.ts +2 -0
- package/dist/ui/core/layout-styles.d.ts.map +1 -0
- package/dist/ui/core/layout-styles.js +58 -0
- package/dist/ui/core/layout-styles.js.map +1 -0
- package/dist/ui/core/machine-checkpoints.d.ts +6 -0
- package/dist/ui/core/machine-checkpoints.d.ts.map +1 -0
- package/dist/ui/core/machine-checkpoints.js +47 -0
- package/dist/ui/core/machine-checkpoints.js.map +1 -0
- package/dist/ui/core/machine-clock.d.ts +16 -0
- package/dist/ui/core/machine-clock.d.ts.map +1 -0
- package/dist/ui/core/machine-clock.js +89 -0
- package/dist/ui/core/machine-clock.js.map +1 -0
- package/dist/ui/core/machine-codec.d.ts +29 -0
- package/dist/ui/core/machine-codec.d.ts.map +1 -0
- package/dist/ui/core/machine-codec.js +217 -0
- package/dist/ui/core/machine-codec.js.map +1 -0
- package/dist/ui/core/machine-profiles.d.ts +437 -0
- package/dist/ui/core/machine-profiles.d.ts.map +1 -0
- package/dist/ui/core/machine-profiles.js +1175 -0
- package/dist/ui/core/machine-profiles.js.map +1 -0
- package/dist/ui/core/machine-resources.d.ts +6 -0
- package/dist/ui/core/machine-resources.d.ts.map +1 -0
- package/dist/ui/core/machine-resources.js +46 -0
- package/dist/ui/core/machine-resources.js.map +1 -0
- package/dist/ui/core/machine.d.ts +29 -0
- package/dist/ui/core/machine.d.ts.map +1 -0
- package/dist/ui/core/machine.js +111 -0
- package/dist/ui/core/machine.js.map +1 -0
- package/dist/ui/core/parts.d.ts +4 -0
- package/dist/ui/core/parts.d.ts.map +1 -0
- package/dist/ui/core/parts.js +33 -0
- package/dist/ui/core/parts.js.map +1 -0
- package/dist/ui/core/portal.d.ts +11 -0
- package/dist/ui/core/portal.d.ts.map +1 -0
- package/dist/ui/core/portal.js +71 -0
- package/dist/ui/core/portal.js.map +1 -0
- package/dist/ui/core/public-machine.d.ts +4 -0
- package/dist/ui/core/public-machine.d.ts.map +1 -0
- package/dist/ui/core/public-machine.js +26 -0
- package/dist/ui/core/public-machine.js.map +1 -0
- package/dist/ui/core/resumable-machine.d.ts +13 -0
- package/dist/ui/core/resumable-machine.d.ts.map +1 -0
- package/dist/ui/core/resumable-machine.js +336 -0
- package/dist/ui/core/resumable-machine.js.map +1 -0
- package/dist/ui/drivers/bulma.d.ts +3 -0
- package/dist/ui/drivers/bulma.d.ts.map +1 -0
- package/dist/ui/drivers/bulma.js +249 -0
- package/dist/ui/drivers/bulma.js.map +1 -0
- package/dist/ui/drivers/daisyui.d.ts +9 -0
- package/dist/ui/drivers/daisyui.d.ts.map +1 -0
- package/dist/ui/drivers/daisyui.js +107 -0
- package/dist/ui/drivers/daisyui.js.map +1 -0
- package/dist/ui/drivers/index.d.ts +7 -0
- package/dist/ui/drivers/index.d.ts.map +1 -0
- package/dist/ui/drivers/index.js +7 -0
- package/dist/ui/drivers/index.js.map +1 -0
- package/dist/ui/drivers/registry.d.ts +11 -0
- package/dist/ui/drivers/registry.d.ts.map +1 -0
- package/dist/ui/drivers/registry.js +109 -0
- package/dist/ui/drivers/registry.js.map +1 -0
- package/dist/ui/drivers/shadcn.d.ts +3 -0
- package/dist/ui/drivers/shadcn.d.ts.map +1 -0
- package/dist/ui/drivers/shadcn.js +288 -0
- package/dist/ui/drivers/shadcn.js.map +1 -0
- package/dist/ui/drivers/types.d.ts +43 -0
- package/dist/ui/drivers/types.d.ts.map +1 -0
- package/dist/ui/drivers/types.js +2 -0
- package/dist/ui/drivers/types.js.map +1 -0
- package/dist/ui/drivers/unstyled.d.ts +3 -0
- package/dist/ui/drivers/unstyled.d.ts.map +1 -0
- package/dist/ui/drivers/unstyled.js +226 -0
- package/dist/ui/drivers/unstyled.js.map +1 -0
- package/dist/ui/engine.d.ts +24 -0
- package/dist/ui/engine.d.ts.map +1 -0
- package/dist/ui/engine.js +22 -0
- package/dist/ui/engine.js.map +1 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/machine-state.d.ts +349 -0
- package/dist/ui/machine-state.d.ts.map +1 -0
- package/dist/ui/machine-state.js +105 -0
- package/dist/ui/machine-state.js.map +1 -0
- package/dist/ui/presentation.d.ts +7 -0
- package/dist/ui/presentation.d.ts.map +1 -0
- package/dist/ui/presentation.js +21 -0
- package/dist/ui/presentation.js.map +1 -0
- package/dist/ui/render.d.ts +18 -0
- package/dist/ui/render.d.ts.map +1 -0
- package/dist/ui/render.js +31 -0
- package/dist/ui/render.js.map +1 -0
- package/dist/ui/resume.d.ts +28 -0
- package/dist/ui/resume.d.ts.map +1 -0
- package/dist/ui/resume.js +417 -0
- package/dist/ui/resume.js.map +1 -0
- package/dist/ui/server.d.ts +9 -0
- package/dist/ui/server.d.ts.map +1 -0
- package/dist/ui/server.js +6 -0
- package/dist/ui/server.js.map +1 -0
- package/dist/ui/state.d.ts +24 -0
- package/dist/ui/state.d.ts.map +1 -0
- package/dist/ui/state.js +64 -0
- package/dist/ui/state.js.map +1 -0
- package/dist/ui-server.d.ts +2 -0
- package/dist/ui-server.d.ts.map +1 -0
- package/dist/ui-server.js +2 -0
- package/dist/ui-server.js.map +1 -0
- package/dist/ui.d.ts +2 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -0
- package/dist/vite-environments.d.ts +27 -0
- package/dist/vite-environments.d.ts.map +1 -0
- package/dist/vite-environments.js +63 -0
- package/dist/vite-environments.js.map +1 -0
- package/dist/vite.d.ts +120 -2
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +1292 -196
- package/dist/vite.js.map +1 -1
- package/dist/workflow/browser.d.ts +7 -0
- package/dist/workflow/browser.d.ts.map +1 -0
- package/dist/workflow/browser.js +60 -0
- package/dist/workflow/browser.js.map +1 -0
- package/dist/workflow/compiler.d.ts +8 -0
- package/dist/workflow/compiler.d.ts.map +1 -0
- package/dist/workflow/compiler.js +122 -0
- package/dist/workflow/compiler.js.map +1 -0
- package/dist/workflow/http.d.ts +20 -0
- package/dist/workflow/http.d.ts.map +1 -0
- package/dist/workflow/http.js +68 -0
- package/dist/workflow/http.js.map +1 -0
- package/dist/workflow/index.d.ts +46 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +91 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/journal.d.ts +9 -0
- package/dist/workflow/journal.d.ts.map +1 -0
- package/dist/workflow/journal.js +18 -0
- package/dist/workflow/journal.js.map +1 -0
- package/dist/workflow/node.d.ts +6 -0
- package/dist/workflow/node.d.ts.map +1 -0
- package/dist/workflow/node.js +24 -0
- package/dist/workflow/node.js.map +1 -0
- package/dist/workflow/operation.d.ts +23 -0
- package/dist/workflow/operation.d.ts.map +1 -0
- package/dist/workflow/operation.js +65 -0
- package/dist/workflow/operation.js.map +1 -0
- package/dist/workflow/protocol.d.ts +36 -0
- package/dist/workflow/protocol.d.ts.map +1 -0
- package/dist/workflow/protocol.js +45 -0
- package/dist/workflow/protocol.js.map +1 -0
- package/package.json +158 -23
- package/dist/create.d.ts +0 -21
- package/dist/create.d.ts.map +0 -1
- package/dist/create.js +0 -111
- package/dist/create.js.map +0 -1
- package/dist/runtime/atom.d.ts +0 -10
- package/dist/runtime/atom.d.ts.map +0 -1
- package/dist/runtime/atom.js +0 -38
- package/dist/runtime/atom.js.map +0 -1
- package/templates/basic/README.md +0 -18
- package/templates/basic/_gitignore +0 -3
- package/templates/basic/components/app-badge.html +0 -1
- package/templates/basic/index.html +0 -12
- package/templates/basic/islands/counter.ts +0 -13
- package/templates/basic/package.json +0 -23
- package/templates/basic/pages/about/index.html +0 -5
- package/templates/basic/pages/docs/index.md +0 -9
- package/templates/basic/pages/index.html +0 -9
- package/templates/basic/pages/layout.html +0 -8
- package/templates/basic/pnpm-workspace.yaml +0 -5
- package/templates/basic/server.mjs +0 -11
- package/templates/basic/style.css +0 -1
- package/templates/basic/tsconfig.json +0 -13
- package/templates/basic/vite.config.ts +0 -4
package/dist/compiler/index.js
CHANGED
|
@@ -1,12 +1,447 @@
|
|
|
1
|
+
import { parseRoutePolicy, resolveRoutePolicies } from './route-policy.js';
|
|
2
|
+
import { markComponentScriptSources, markPageScriptSources } from "./page-scripts.js";
|
|
3
|
+
import { parseRouteMetadata, validateRouteMetadata } from "./metadata.js";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
1
5
|
import { readdir, readFile, stat } from "node:fs/promises";
|
|
6
|
+
import { readFileSync } from "node:fs";
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
2
8
|
import path from "node:path";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
9
|
+
import * as Context from "effect/Context";
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Layer from "effect/Layer";
|
|
12
|
+
import * as Schema from "effect/Schema";
|
|
13
|
+
import { routeKey, routeKeyFromSegments } from "../route-path.js";
|
|
14
|
+
import { compileMarkdown } from "./markdown.js";
|
|
15
|
+
import { pageText } from "./search.js";
|
|
16
|
+
import { createCodeHighlighter } from "./highlight.js";
|
|
17
|
+
import { collectAnchors, validateMarkdownLinks } from "./links.js";
|
|
18
|
+
export { compileMarkdown } from "./markdown.js";
|
|
6
19
|
import { parseFragment } from "parse5";
|
|
20
|
+
import { isDocsDir, officialDocsLayout } from "./docs.js";
|
|
21
|
+
export { isDocsDir, officialDocsLayout } from "./docs.js";
|
|
22
|
+
const compilerVersion = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version;
|
|
23
|
+
const digest = (...parts) => {
|
|
24
|
+
const hash = createHash("sha1");
|
|
25
|
+
for (const part of parts)
|
|
26
|
+
hash.update(`${part.length}:`).update(part);
|
|
27
|
+
return hash.digest("base64url");
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Reuses per-page work between compilations of the same project, for dev servers and watch builds. Keys cover
|
|
31
|
+
* the compiler version, the options that change output and the page's own inputs (its text, layouts, route
|
|
32
|
+
* parameters, server module); entries also record what they read along the way (components by name, named
|
|
33
|
+
* layouts) and are only reused while those are unchanged. A completed compilation drops entries it did not use.
|
|
34
|
+
* The cache lives in memory; a fresh process compiles everything.
|
|
35
|
+
*/
|
|
36
|
+
export class CompileCache {
|
|
37
|
+
entries = new Map();
|
|
38
|
+
used = new Set();
|
|
39
|
+
hits = 0;
|
|
40
|
+
misses = 0;
|
|
41
|
+
/** Hits and misses of the latest compilation. */
|
|
42
|
+
stats() { return { hits: this.hits, misses: this.misses, entries: this.entries.size }; }
|
|
43
|
+
/** @internal */
|
|
44
|
+
begin() { this.used = new Set(); this.hits = 0; this.misses = 0; }
|
|
45
|
+
/** @internal */
|
|
46
|
+
lookup(key, current) {
|
|
47
|
+
const entry = this.entries.get(key);
|
|
48
|
+
if (entry)
|
|
49
|
+
for (const [dependency, value] of entry.dependencies) {
|
|
50
|
+
if (current(dependency) !== value) {
|
|
51
|
+
this.entries.delete(key);
|
|
52
|
+
this.misses++;
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (!entry) {
|
|
57
|
+
this.misses++;
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
this.used.add(key);
|
|
61
|
+
this.hits++;
|
|
62
|
+
return entry.value;
|
|
63
|
+
}
|
|
64
|
+
/** @internal */
|
|
65
|
+
store(key, value, dependencies = new Map()) {
|
|
66
|
+
this.entries.set(key, { value, dependencies });
|
|
67
|
+
this.used.add(key);
|
|
68
|
+
}
|
|
69
|
+
/** @internal */
|
|
70
|
+
complete() { for (const key of this.entries.keys())
|
|
71
|
+
if (!this.used.has(key))
|
|
72
|
+
this.entries.delete(key); }
|
|
73
|
+
}
|
|
74
|
+
/** Validates redirects against compiled routes and collapses chains. */
|
|
75
|
+
export function resolveRedirects(redirects, routes) {
|
|
76
|
+
const table = new Map();
|
|
77
|
+
for (const [from, to] of Object.entries(redirects)) {
|
|
78
|
+
const source = from.startsWith("/") && !from.startsWith("//") ? routeKey(new URL(from, "http://fuzor.local").pathname) : undefined;
|
|
79
|
+
if (!source || /[?#]/.test(from))
|
|
80
|
+
throw new Error(`Redirect source ${JSON.stringify(from)} must be a path such as "/old/".`);
|
|
81
|
+
if (routes.has(source))
|
|
82
|
+
throw new Error(`Redirect source ${from} is also a compiled route; remove the page or the redirect.`);
|
|
83
|
+
if (table.has(source))
|
|
84
|
+
throw new Error(`Redirect source ${from} is listed twice.`);
|
|
85
|
+
if (/^https?:\/\//i.test(to)) {
|
|
86
|
+
new URL(to);
|
|
87
|
+
table.set(source, to);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (!to.startsWith("/") || to.startsWith("//"))
|
|
91
|
+
throw new Error(`Redirect target for ${from} must start with "/" or be an absolute HTTP(S) URL.`);
|
|
92
|
+
table.set(source, to);
|
|
93
|
+
}
|
|
94
|
+
const resolved = {};
|
|
95
|
+
for (const source of table.keys()) {
|
|
96
|
+
const seen = [source];
|
|
97
|
+
let target = table.get(source);
|
|
98
|
+
for (;;) {
|
|
99
|
+
if (/^https?:\/\//i.test(target))
|
|
100
|
+
break;
|
|
101
|
+
const url = new URL(target, "http://fuzor.local");
|
|
102
|
+
const key = routeKey(url.pathname);
|
|
103
|
+
if (key !== undefined && table.has(key)) {
|
|
104
|
+
if (seen.includes(key))
|
|
105
|
+
throw new Error(`Redirect loop: ${[...seen, key].join(" -> ")}`);
|
|
106
|
+
seen.push(key);
|
|
107
|
+
const next = new URL(table.get(key), "http://fuzor.local");
|
|
108
|
+
// Query and hash on the earlier hop win, like browsers following a chain of Location headers.
|
|
109
|
+
target = /^https?:\/\//i.test(table.get(key)) ? table.get(key) : `${next.pathname}${url.search || next.search}${url.hash || next.hash}`;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (key === undefined || !routes.has(key))
|
|
113
|
+
throw new Error(`Redirect ${source} -> ${target} does not reach a compiled route.`);
|
|
114
|
+
target = `${key}${url.search}${url.hash}`;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
resolved[source] = target;
|
|
118
|
+
}
|
|
119
|
+
return resolved;
|
|
120
|
+
}
|
|
121
|
+
const pathsModules = ["paths.ts", "paths.mts", "paths.js", "paths.mjs"];
|
|
122
|
+
export const serverModules = ["server.ts", "server.mts", "server.js", "server.mjs"];
|
|
123
|
+
/** `<fuzor-data name="user.name">fallback</fuzor-data>` slots require a server data module for the page. */
|
|
124
|
+
function checkDataSlots(html, hasServerData, source) {
|
|
125
|
+
const visit = (node) => {
|
|
126
|
+
if (!("tagName" in node))
|
|
127
|
+
return;
|
|
128
|
+
if (node.tagName === "fuzor-data") {
|
|
129
|
+
const snippet = snippetOf(html, node.sourceCodeLocation);
|
|
130
|
+
const name = node.attrs.find(attribute => attribute.name === "name")?.value;
|
|
131
|
+
if (!name || !/^[A-Za-z_$][\w$]*(?:\.(?:[A-Za-z_$][\w$]*|\d+))*$/.test(name))
|
|
132
|
+
throw new SnippetError(`${source}: <fuzor-data> needs a name such as "user.name" or "items.0.title".`, snippet);
|
|
133
|
+
if (!node.sourceCodeLocation?.endTag)
|
|
134
|
+
throw new SnippetError(`${source}: <fuzor-data> must have a closing tag.`, snippet);
|
|
135
|
+
if (!hasServerData)
|
|
136
|
+
throw new SnippetError(`${source}: <fuzor-data name="${name}"> needs a server.ts module next to the page's index file.`, snippet);
|
|
137
|
+
}
|
|
138
|
+
for (const child of node.childNodes)
|
|
139
|
+
visit(child);
|
|
140
|
+
if (node.tagName === "template")
|
|
141
|
+
for (const child of node.content.childNodes)
|
|
142
|
+
visit(child);
|
|
143
|
+
};
|
|
144
|
+
parseFragment(html, { sourceCodeLocationInfo: true }).childNodes.forEach(visit);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* `<fuzor-loading delay min>` indicators show while an island's code downloads (inside `<fuzor-island>`) or while
|
|
148
|
+
* the page's server data loads (anywhere else, on pages with `server.ts`). They are output hidden with
|
|
149
|
+
* `role="status"`, so pages without JavaScript never show them.
|
|
150
|
+
*/
|
|
151
|
+
function compileLoading(html, hasServerData, source) {
|
|
152
|
+
if (!/<fuzor-loading\b/i.test(html))
|
|
153
|
+
return html;
|
|
154
|
+
const replacements = [];
|
|
155
|
+
const visit = (node, island) => {
|
|
156
|
+
if (!("tagName" in node))
|
|
157
|
+
return;
|
|
158
|
+
if (node.tagName === "fuzor-loading") {
|
|
159
|
+
const location = node.sourceCodeLocation;
|
|
160
|
+
const snippet = snippetOf(html, location);
|
|
161
|
+
if (!location?.startTag || !location.endTag)
|
|
162
|
+
throw new SnippetError(`${source}: <fuzor-loading> must have a closing tag.`, snippet);
|
|
163
|
+
for (const attribute of node.attrs) {
|
|
164
|
+
if (["delay", "min"].includes(attribute.name)) {
|
|
165
|
+
if (!/^\d+$/.test(attribute.value))
|
|
166
|
+
throw new SnippetError(`${source}: <fuzor-loading ${attribute.name}> must be a number of milliseconds.`, snippet);
|
|
167
|
+
}
|
|
168
|
+
else if (!["class", "id", "style", "role", "aria-label", "aria-live", "hidden"].includes(attribute.name)) {
|
|
169
|
+
throw new SnippetError(`${source}: <fuzor-loading> does not accept ${attribute.name}; use delay, min, class, id, style or ARIA attributes.`, snippet);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (island && node.parentNode !== island)
|
|
173
|
+
throw new SnippetError(`${source}: <fuzor-loading> must be a direct child of its activation host.`, snippet);
|
|
174
|
+
if (!island && !hasServerData)
|
|
175
|
+
throw new SnippetError(`${source}: <fuzor-loading> shows while an island loads (put it inside <fuzor-island>) or while server data loads (the page needs server.ts).`, snippet);
|
|
176
|
+
const added = `${node.attrs.some(attribute => attribute.name === "hidden") ? "" : " hidden"}${node.attrs.some(attribute => attribute.name === "role") ? "" : ' role="status"'}`;
|
|
177
|
+
if (added)
|
|
178
|
+
replacements.push({ start: location.startTag.endOffset - 1, end: location.startTag.endOffset - 1, value: added });
|
|
179
|
+
}
|
|
180
|
+
const inside = ["fuzor-island"].includes(node.tagName) ? node : island;
|
|
181
|
+
for (const child of node.childNodes)
|
|
182
|
+
visit(child, inside);
|
|
183
|
+
if (node.tagName === "template")
|
|
184
|
+
for (const child of node.content.childNodes)
|
|
185
|
+
visit(child, inside);
|
|
186
|
+
};
|
|
187
|
+
parseFragment(html, { sourceCodeLocationInfo: true }).childNodes.forEach(node => visit(node, undefined));
|
|
188
|
+
for (const replacement of replacements.sort((a, b) => b.start - a.start)) {
|
|
189
|
+
html = html.slice(0, replacement.start) + replacement.value + html.slice(replacement.end);
|
|
190
|
+
}
|
|
191
|
+
return html;
|
|
192
|
+
}
|
|
193
|
+
function parseSegment(name) {
|
|
194
|
+
if (!name.includes("[") && !name.includes("]"))
|
|
195
|
+
return { kind: "static", value: name };
|
|
196
|
+
const match = /^\[(\.\.\.)?([a-zA-Z_][a-zA-Z0-9_]*)\]$/.exec(name);
|
|
197
|
+
if (!match)
|
|
198
|
+
return `Invalid dynamic folder name "${name}". Use [name] or [...name] with a letter, digit or underscore name.`;
|
|
199
|
+
return { kind: match[1] ? "rest" : "param", name: match[2] };
|
|
200
|
+
}
|
|
201
|
+
export function patternOf(segments) {
|
|
202
|
+
const parts = segments.map(segment => segment.kind === "static" ? encodeURIComponent(segment.value.normalize("NFC")) : segment.kind === "param" ? `[${segment.name}]` : `[...${segment.name}]`);
|
|
203
|
+
return parts.length ? `/${parts.join("/")}/` : "/";
|
|
204
|
+
}
|
|
205
|
+
function replaceParams(html, params) {
|
|
206
|
+
const fragment = parseFragment(html, { sourceCodeLocationInfo: true });
|
|
207
|
+
const replacements = [];
|
|
208
|
+
const visit = (node) => {
|
|
209
|
+
if (!("tagName" in node))
|
|
210
|
+
return;
|
|
211
|
+
if (node.tagName === "fuzor-param") {
|
|
212
|
+
const location = node.sourceCodeLocation;
|
|
213
|
+
const name = node.attrs.find(attribute => attribute.name === "name")?.value;
|
|
214
|
+
const snippet = snippetOf(html, location);
|
|
215
|
+
if (!location?.endTag)
|
|
216
|
+
throw new SnippetError("<fuzor-param> must have a closing tag.", snippet);
|
|
217
|
+
if (!params)
|
|
218
|
+
throw new SnippetError("<fuzor-param> is only available in dynamic route folders.", snippet);
|
|
219
|
+
if (!name || !Object.hasOwn(params, name))
|
|
220
|
+
throw new SnippetError(`Unknown route parameter ${JSON.stringify(name ?? "")}. Available: ${Object.keys(params).join(", ")}.`, snippet);
|
|
221
|
+
const value = params[name].replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
222
|
+
replacements.push({ start: location.startOffset, end: location.endOffset, value });
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
for (const child of node.childNodes)
|
|
226
|
+
visit(child);
|
|
227
|
+
if (node.tagName === "template")
|
|
228
|
+
for (const child of node.content.childNodes)
|
|
229
|
+
visit(child);
|
|
230
|
+
};
|
|
231
|
+
for (const node of fragment.childNodes)
|
|
232
|
+
visit(node);
|
|
233
|
+
for (const replacement of replacements.sort((a, b) => b.start - a.start)) {
|
|
234
|
+
html = html.slice(0, replacement.start) + replacement.value + html.slice(replacement.end);
|
|
235
|
+
}
|
|
236
|
+
return html;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* `<fuzor-nav scope="/docs/" label="Documentation"></fuzor-nav>` becomes navigation for every route below
|
|
240
|
+
* `scope`, ordered by `order` metadata (pages without it last), then link text, then path. Pages with a
|
|
241
|
+
* `navGroup` are listed under group headings in order of first appearance. The current page is marked
|
|
242
|
+
* with `aria-current="page"`.
|
|
243
|
+
*/
|
|
244
|
+
function compileNav(html, current, routes, labels, source) {
|
|
245
|
+
if (!/<fuzor-nav\b/i.test(html))
|
|
246
|
+
return html;
|
|
247
|
+
const escapeText = (value) => value.replaceAll("&", "&").replaceAll("<", "<");
|
|
248
|
+
const escapeAttr = (value) => escapeText(value).replaceAll('"', """);
|
|
249
|
+
const compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
250
|
+
const fragment = parseFragment(html, { sourceCodeLocationInfo: true });
|
|
251
|
+
const replacements = [];
|
|
252
|
+
const visit = (node) => {
|
|
253
|
+
if (!("tagName" in node))
|
|
254
|
+
return;
|
|
255
|
+
if (node.tagName === "fuzor-nav") {
|
|
256
|
+
const location = node.sourceCodeLocation;
|
|
257
|
+
if (!location?.endTag)
|
|
258
|
+
throw new SnippetError(`${source}: <fuzor-nav> must have a closing tag.`, snippetOf(html, location));
|
|
259
|
+
const scopeValue = node.attrs.find(attribute => attribute.name === "scope")?.value ?? "/";
|
|
260
|
+
const scope = routeKey(scopeValue);
|
|
261
|
+
if (!scope || !scopeValue.startsWith("/"))
|
|
262
|
+
throw new SnippetError(`${source}: <fuzor-nav scope="${scopeValue}"> must be a path such as "/docs/".`, snippetOf(html, location));
|
|
263
|
+
const label = node.attrs.find(attribute => attribute.name === "label")?.value ?? "Pages";
|
|
264
|
+
const entries = routes.filter(route => route.path.startsWith(scope)).map(route => ({
|
|
265
|
+
route, text: route.metadata?.navTitle ?? labels.get(route.path) ?? route.metadata?.title ?? decodeURIComponent(route.path)
|
|
266
|
+
})).sort((a, b) => {
|
|
267
|
+
const orderA = a.route.metadata?.order ?? Number.POSITIVE_INFINITY;
|
|
268
|
+
const orderB = b.route.metadata?.order ?? Number.POSITIVE_INFINITY;
|
|
269
|
+
return orderA !== orderB ? orderA - orderB : compare(a.text, b.text) || compare(a.route.path, b.route.path);
|
|
270
|
+
});
|
|
271
|
+
const list = (items) => `<ul>${items.map(({ route, text }) => `<li><a href="${escapeAttr(route.path)}"${route.path === current ? ' aria-current="page"' : ""}>${escapeText(text)}</a></li>`).join("")}</ul>`;
|
|
272
|
+
const renderGroups = (items) => {
|
|
273
|
+
const groups = new Map();
|
|
274
|
+
for (const entry of items) {
|
|
275
|
+
const group = entry.route.metadata?.navGroup ?? "";
|
|
276
|
+
groups.set(group, [...(groups.get(group) ?? []), entry]);
|
|
277
|
+
}
|
|
278
|
+
return [...groups].map(([group, grpItems]) => group ? `<p data-fuzor-nav-group>${escapeText(group)}</p>${list(grpItems)}` : list(grpItems)).join("");
|
|
279
|
+
};
|
|
280
|
+
const hasCategories = entries.some(entry => Boolean(entry.route.metadata?.navCategory));
|
|
281
|
+
let navHtml;
|
|
282
|
+
if (!hasCategories) {
|
|
283
|
+
navHtml = `<nav aria-label="${escapeAttr(label)}">${renderGroups(entries)}</nav>`;
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
const categories = new Map();
|
|
287
|
+
for (const entry of entries) {
|
|
288
|
+
const category = entry.route.metadata?.navCategory ?? "General";
|
|
289
|
+
categories.set(category, [...(categories.get(category) ?? []), entry]);
|
|
290
|
+
}
|
|
291
|
+
const activeEntry = entries.find(entry => entry.route.path === current);
|
|
292
|
+
const activeCategory = activeEntry?.route.metadata?.navCategory ?? categories.keys().next().value ?? "General";
|
|
293
|
+
const navId = `fuzor-nav-${replacements.length + 1}`;
|
|
294
|
+
const tabsList = `<fuzor-tabs-list data-part="list" role="tablist" class="docs-category-list" aria-label="${escapeAttr(label)}">${[...categories.keys()].map((cat, index) => `<button type="button" data-part="trigger" data-value="${escapeAttr(cat)}" value="${escapeAttr(cat)}" role="tab" id="${navId}-trigger-${index}" aria-controls="${navId}-panel-${index}" aria-selected="${cat === activeCategory}" tabindex="${cat === activeCategory ? 0 : -1}" class="docs-category-tab"${cat === activeCategory ? ' data-state="active"' : ' data-state="inactive"'}>${escapeText(cat)}</button>`).join("")}</fuzor-tabs-list>`;
|
|
295
|
+
const tabsPanels = [...categories.entries()].map(([cat, catEntries], index) => {
|
|
296
|
+
const isActive = cat === activeCategory;
|
|
297
|
+
return `<fuzor-tabs-content data-part="content" role="tabpanel" id="${navId}-panel-${index}" aria-labelledby="${navId}-trigger-${index}" value="${escapeAttr(cat)}" class="docs-category-content"${isActive ? ' data-state="active"' : ' hidden data-state="inactive"'}><nav aria-label="${escapeAttr(cat)}">${renderGroups(catEntries)}</nav></fuzor-tabs-content>`;
|
|
298
|
+
}).join("");
|
|
299
|
+
const fallback = [...categories].map(([cat, catEntries]) => `<p class="docs-category-heading">${escapeText(cat)}</p><nav aria-label="${escapeAttr(cat)}">${renderGroups(catEntries)}</nav>`).join("");
|
|
300
|
+
navHtml = `<fuzor-tabs id="${navId}" data-fuzor-ui="tabs" value="${escapeAttr(activeCategory)}" defaultValue="${escapeAttr(activeCategory)}" class="docs-category-tabs">${tabsList}${tabsPanels}</fuzor-tabs><noscript><style>.docs-category-tabs { display: none !important; }</style>${fallback}</noscript>`;
|
|
301
|
+
}
|
|
302
|
+
replacements.push({ start: location.startOffset, end: location.endOffset, value: navHtml });
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
for (const child of node.childNodes)
|
|
306
|
+
visit(child);
|
|
307
|
+
if (node.tagName === "template")
|
|
308
|
+
for (const child of node.content.childNodes)
|
|
309
|
+
visit(child);
|
|
310
|
+
};
|
|
311
|
+
fragment.childNodes.forEach(visit);
|
|
312
|
+
for (const replacement of replacements.sort((a, b) => b.start - a.start)) {
|
|
313
|
+
html = html.slice(0, replacement.start) + replacement.value + html.slice(replacement.end);
|
|
314
|
+
}
|
|
315
|
+
return html;
|
|
316
|
+
}
|
|
317
|
+
/** Text of the first `<h1>` in page content, before layouts. */
|
|
318
|
+
function firstHeading(html) {
|
|
319
|
+
let found;
|
|
320
|
+
const text = (node) => "value" in node ? node.value : "childNodes" in node ? node.childNodes.map(text).join("") : "";
|
|
321
|
+
const visit = (node) => {
|
|
322
|
+
if (found !== undefined || !("tagName" in node))
|
|
323
|
+
return;
|
|
324
|
+
if (node.tagName === "h1") {
|
|
325
|
+
found = text(node).replace(/\s+/g, " ").trim();
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
node.childNodes.forEach(visit);
|
|
329
|
+
};
|
|
330
|
+
parseFragment(html).childNodes.forEach(visit);
|
|
331
|
+
return found || undefined;
|
|
332
|
+
}
|
|
333
|
+
const issueText = (error) => (error instanceof Error ? error.message : String(error)).replace(/\s+/g, " ").trim();
|
|
334
|
+
/**
|
|
335
|
+
* Validates a `paths` module result against the dynamic segments of the page that uses it. With a `params`
|
|
336
|
+
* Schema, entries hold decoded values: each is encoded to its URL form, which must decode again, so the
|
|
337
|
+
* values the browser reads back from the URL always satisfy the schema.
|
|
338
|
+
*/
|
|
339
|
+
function readPathEntries(value, dynamic, file, schema) {
|
|
340
|
+
if (!Array.isArray(value))
|
|
341
|
+
throw new Error(`${file} must export default an array of { params } entries, or a function returning one.`);
|
|
342
|
+
const names = dynamic.map(segment => segment.name);
|
|
343
|
+
return value.map((entry, index) => {
|
|
344
|
+
const where = `${file} entry ${index}`;
|
|
345
|
+
if (typeof entry !== "object" || entry === null || typeof entry.params !== "object" || entry.params === null) {
|
|
346
|
+
throw new Error(`${where} must be an object with params.`);
|
|
347
|
+
}
|
|
348
|
+
const { params: given, metadata, ...unknown } = entry;
|
|
349
|
+
if (Object.keys(unknown).length)
|
|
350
|
+
throw new Error(`${where} has unknown fields: ${Object.keys(unknown).join(", ")}.`);
|
|
351
|
+
let raw = given;
|
|
352
|
+
if (schema) {
|
|
353
|
+
try {
|
|
354
|
+
raw = Schema.encodeUnknownSync(schema)(given);
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
throw new Error(`${where}: params do not match the params schema: ${issueText(error)}`);
|
|
358
|
+
}
|
|
359
|
+
if (typeof raw !== "object" || raw === null)
|
|
360
|
+
throw new Error(`${where}: the params schema must encode to an object of strings.`);
|
|
361
|
+
}
|
|
362
|
+
const extra = Object.keys(raw).filter(key => !names.includes(key));
|
|
363
|
+
if (extra.length)
|
|
364
|
+
throw new Error(`${where} has params not in the route: ${extra.join(", ")}.`);
|
|
365
|
+
const params = {};
|
|
366
|
+
const segments = {};
|
|
367
|
+
for (const segment of dynamic) {
|
|
368
|
+
const name = segment.name;
|
|
369
|
+
const value = raw[name];
|
|
370
|
+
if (segment.kind === "param") {
|
|
371
|
+
if (typeof value !== "string" || value === "" || value.includes("/"))
|
|
372
|
+
throw new Error(`${where}: params.${name} must be a non-empty string without "/".`);
|
|
373
|
+
params[name] = value;
|
|
374
|
+
segments[name] = [value];
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
const parts = typeof value === "string" ? value.split("/") : value;
|
|
378
|
+
if (!Array.isArray(parts) || parts.length === 0 || parts.some(part => typeof part !== "string" || part === "" || part.includes("/"))) {
|
|
379
|
+
throw new Error(`${where}: params.${name} must be a non-empty array of path segments or a "a/b" string.`);
|
|
380
|
+
}
|
|
381
|
+
params[name] = parts.join("/");
|
|
382
|
+
segments[name] = parts;
|
|
383
|
+
}
|
|
384
|
+
if ([".", ".."].includes(params[name]))
|
|
385
|
+
throw new Error(`${where}: params.${name} cannot be a dot segment.`);
|
|
386
|
+
}
|
|
387
|
+
if (schema) {
|
|
388
|
+
try {
|
|
389
|
+
Schema.decodeUnknownSync(schema)(params);
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
throw new Error(`${where}: the URL form ${JSON.stringify(params)} does not decode with the params schema: ${issueText(error)}`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return { params, segments, ...(metadata === undefined ? {} : { metadata: validateRouteMetadata(metadata) }) };
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
async function defaultLoadModule(file) {
|
|
399
|
+
try {
|
|
400
|
+
return await import(pathToFileURL(file).href);
|
|
401
|
+
}
|
|
402
|
+
catch (error) {
|
|
403
|
+
if (error.code === "ERR_UNKNOWN_FILE_EXTENSION") {
|
|
404
|
+
throw new Error(`Cannot import ${file} with Node. Compile through fuzorPlugin() or pass a loadModule option.`);
|
|
405
|
+
}
|
|
406
|
+
throw error;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
7
409
|
const slotPattern = /<slot\s*(?:\/\s*>|>\s*<\/slot\s*>)/i;
|
|
8
410
|
export class CompilerError extends Error {
|
|
411
|
+
location;
|
|
9
412
|
_tag = "CompilerError";
|
|
413
|
+
constructor(message, location) {
|
|
414
|
+
super(message);
|
|
415
|
+
this.location = location;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Problems found in assembled HTML (page plus layouts and components) carry the offending opening tag. The
|
|
420
|
+
* compiler finds that tag in the author's files to report a real file, line and column.
|
|
421
|
+
*/
|
|
422
|
+
class SnippetError extends Error {
|
|
423
|
+
snippet;
|
|
424
|
+
constructor(message, snippet) {
|
|
425
|
+
super(message);
|
|
426
|
+
this.snippet = snippet;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
const snippetOf = (html, location) => location ? html.slice(location.startOffset, location.startTag?.endOffset ?? location.endOffset) : "";
|
|
430
|
+
/** Line and column (1-based) of `snippet` in the first source that contains it, preferring `preferred`. */
|
|
431
|
+
export function locateSnippet(sources, snippet, preferred) {
|
|
432
|
+
if (!snippet)
|
|
433
|
+
return undefined;
|
|
434
|
+
const files = preferred && sources.has(preferred) ? [preferred, ...[...sources.keys()].filter(file => file !== preferred)] : [...sources.keys()];
|
|
435
|
+
for (const file of files) {
|
|
436
|
+
const text = sources.get(file);
|
|
437
|
+
const index = text.indexOf(snippet);
|
|
438
|
+
if (index < 0)
|
|
439
|
+
continue;
|
|
440
|
+
const before = text.slice(0, index);
|
|
441
|
+
const line = before.split("\n").length;
|
|
442
|
+
return { file, line, column: index - before.lastIndexOf("\n") };
|
|
443
|
+
}
|
|
444
|
+
return undefined;
|
|
10
445
|
}
|
|
11
446
|
export const CompilerFileSystem = Context.Service("FuzorCompilerFileSystem");
|
|
12
447
|
const io = (label, action) => Effect.tryPromise({ try: action, catch: (error) => new CompilerError(`${label}: ${String(error)}`) });
|
|
@@ -26,7 +461,7 @@ export const CompilerFileSystemLive = Layer.succeed(CompilerFileSystem, {
|
|
|
26
461
|
})
|
|
27
462
|
});
|
|
28
463
|
function routePath(relativeDir) {
|
|
29
|
-
return relativeDir
|
|
464
|
+
return routeKeyFromSegments(relativeDir.split(path.sep));
|
|
30
465
|
}
|
|
31
466
|
function fillSlot(layout, content, label) {
|
|
32
467
|
if (!slotPattern.test(layout)) {
|
|
@@ -47,7 +482,7 @@ function expandComponents(html, components, stack = []) {
|
|
|
47
482
|
throw new Error(`Component cycle: ${[...stack, name].join(" -> ")}`);
|
|
48
483
|
const location = node.sourceCodeLocation;
|
|
49
484
|
if (!location?.startTag || !location.endTag)
|
|
50
|
-
throw new
|
|
485
|
+
throw new SnippetError(`Component <${name}> must have a closing tag.`, snippetOf(html, location));
|
|
51
486
|
const children = html.slice(location.startTag.endOffset, location.endTag.startOffset);
|
|
52
487
|
const nested = expandComponents(children, components, stack);
|
|
53
488
|
const body = slotPattern.test(source) ? fillSlot(source, nested, `Component ${name}`) : source;
|
|
@@ -81,7 +516,7 @@ function compileLinks(html) {
|
|
|
81
516
|
if (node.tagName === "fuzor-link") {
|
|
82
517
|
const location = node.sourceCodeLocation;
|
|
83
518
|
if (!location?.startTag || !location.endTag)
|
|
84
|
-
throw new
|
|
519
|
+
throw new SnippetError("<fuzor-link> must have a closing tag.", snippetOf(html, location));
|
|
85
520
|
const opening = html.slice(location.startTag.startOffset, location.startTag.endOffset)
|
|
86
521
|
.replace(/^<fuzor-link\b/i, "<a data-fuzor-link");
|
|
87
522
|
replacements.push({ start: location.startTag.startOffset, end: location.startTag.endOffset, value: opening });
|
|
@@ -101,21 +536,112 @@ function compileLinks(html) {
|
|
|
101
536
|
}
|
|
102
537
|
return html;
|
|
103
538
|
}
|
|
104
|
-
|
|
539
|
+
const platformComment = /^fuzor:platform(?:\s+(--[a-z][a-z0-9-]*(?:\s+--[a-z][a-z0-9-]*)*))?\s*$/;
|
|
540
|
+
const platformEndComment = /^\/fuzor:platform\s*$/;
|
|
541
|
+
function platformNames(value) {
|
|
542
|
+
return value.split(/\s+/).filter(Boolean).map(name => name.slice(2));
|
|
543
|
+
}
|
|
544
|
+
function platformMatches(selectors, platform) {
|
|
545
|
+
return selectors.includes(platform) || (selectors.includes("native") && (platform === "desktop" || platform === "mobile"));
|
|
546
|
+
}
|
|
547
|
+
/** Selects compile-time platform blocks while keeping the source valid HTML. */
|
|
548
|
+
export function compilePlatformBlocks(html, platform, source, found = new Set()) {
|
|
549
|
+
const fragment = parseFragment(html, { sourceCodeLocationInfo: true });
|
|
550
|
+
const comments = [];
|
|
551
|
+
const visit = (node) => {
|
|
552
|
+
if (node.nodeName === "#comment") {
|
|
553
|
+
const comment = node;
|
|
554
|
+
const location = node.sourceCodeLocation;
|
|
555
|
+
if (location)
|
|
556
|
+
comments.push({ data: comment.data, start: location.startOffset, end: location.endOffset });
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
if ("childNodes" in node)
|
|
560
|
+
for (const child of node.childNodes)
|
|
561
|
+
visit(child);
|
|
562
|
+
if ("tagName" in node && node.tagName === "template") {
|
|
563
|
+
for (const child of node.content.childNodes)
|
|
564
|
+
visit(child);
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
for (const node of fragment.childNodes)
|
|
568
|
+
visit(node);
|
|
569
|
+
const replacements = [];
|
|
570
|
+
const stack = [];
|
|
571
|
+
for (const comment of comments) {
|
|
572
|
+
const opening = platformComment.exec(comment.data);
|
|
573
|
+
if (opening) {
|
|
574
|
+
if (stack.length)
|
|
575
|
+
throw new SnippetError("Platform blocks cannot be nested.", snippetOf(html, { startOffset: comment.start, endOffset: comment.end }));
|
|
576
|
+
const selectors = platformNames(opening[1] ?? "");
|
|
577
|
+
if (!selectors.length)
|
|
578
|
+
throw new SnippetError("Platform blocks need at least one selector such as --desktop.", snippetOf(html, { startOffset: comment.start, endOffset: comment.end }));
|
|
579
|
+
selectors.forEach(selector => found.add(selector));
|
|
580
|
+
stack.push({ selectors, start: comment.start, bodyStart: comment.end });
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
583
|
+
if (platformEndComment.test(comment.data)) {
|
|
584
|
+
const block = stack.pop();
|
|
585
|
+
if (!block)
|
|
586
|
+
throw new SnippetError("Unexpected platform block closing comment.", snippetOf(html, { startOffset: comment.start, endOffset: comment.end }));
|
|
587
|
+
replacements.push({
|
|
588
|
+
start: block.start,
|
|
589
|
+
end: comment.end,
|
|
590
|
+
value: platformMatches(block.selectors, platform) ? html.slice(block.bodyStart, comment.start) : ""
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
if (stack.length)
|
|
595
|
+
throw new SnippetError("Unclosed platform block.", `<!--fuzor:platform --${stack[0].selectors.join(" --")}-->`);
|
|
596
|
+
for (const replacement of replacements.sort((a, b) => b.start - a.start)) {
|
|
597
|
+
html = html.slice(0, replacement.start) + replacement.value + html.slice(replacement.end);
|
|
598
|
+
}
|
|
599
|
+
return html;
|
|
600
|
+
}
|
|
601
|
+
export function compileProjectEffect(root, options = {}) {
|
|
105
602
|
return Effect.gen(function* () {
|
|
106
|
-
const
|
|
603
|
+
const fileSystem = yield* CompilerFileSystem;
|
|
604
|
+
// Every author file read is kept so errors in assembled HTML can point to their real location.
|
|
605
|
+
const sources = new Map();
|
|
606
|
+
const fs = { ...fileSystem, read: file => fileSystem.read(file).pipe(Effect.tap(text => Effect.sync(() => { sources.set(file, text); }))) };
|
|
607
|
+
const failure = (error, source, prefix = "") => {
|
|
608
|
+
const message = `${prefix}${error instanceof Error ? error.message : String(error)}`;
|
|
609
|
+
if (error instanceof CompilerError)
|
|
610
|
+
return error;
|
|
611
|
+
if (error instanceof SnippetError) {
|
|
612
|
+
const location = locateSnippet(sources, error.snippet, source);
|
|
613
|
+
const at = location ? ` (${path.relative(projectRoot, location.file).replaceAll("\\", "/")}:${location.line}:${location.column})` : "";
|
|
614
|
+
return new CompilerError(`${message}${at}`, location ?? (source ? { file: source } : undefined));
|
|
615
|
+
}
|
|
616
|
+
return new CompilerError(message, source ? { file: source } : undefined);
|
|
617
|
+
};
|
|
618
|
+
// YAML reports positions inside the frontmatter block, which starts on the file's second line.
|
|
619
|
+
const frontmatterFailure = (error, source, label = "Frontmatter error") => {
|
|
620
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
621
|
+
const position = /at line (\d+), column (\d+)/.exec(message);
|
|
622
|
+
return new CompilerError(`${label} in ${source}: ${message}`, position ? { file: source, line: Number(position[1]) + 1, column: Number(position[2]) } : { file: source });
|
|
623
|
+
};
|
|
107
624
|
const projectRoot = path.resolve(root);
|
|
625
|
+
const cache = options.cache;
|
|
626
|
+
cache?.begin();
|
|
627
|
+
const optionsKey = JSON.stringify([compilerVersion, options.platform ?? "web", options.markdown?.highlight ?? null]);
|
|
108
628
|
const pagesRoot = path.join(projectRoot, "pages");
|
|
109
629
|
const componentsRoot = path.join(projectRoot, "components");
|
|
110
630
|
const layoutsRoot = path.join(projectRoot, "layouts");
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
631
|
+
const pagesStat = yield* fs.stat(pagesRoot).pipe(Effect.mapError(() => new CompilerError(`${pagesRoot} must be a directory containing index.html or index.md.`)));
|
|
632
|
+
if (!pagesStat.isDirectory())
|
|
633
|
+
yield* Effect.fail(new CompilerError(`${pagesRoot} must be a directory.`));
|
|
634
|
+
// components/ is optional; a file with that name is still a mistake.
|
|
635
|
+
const componentsStat = yield* fs.stat(componentsRoot).pipe(Effect.option);
|
|
636
|
+
if (componentsStat._tag === "Some" && !componentsStat.value.isDirectory())
|
|
637
|
+
yield* Effect.fail(new CompilerError(`${componentsRoot} must be a directory.`));
|
|
638
|
+
const scriptsRoot = path.join(projectRoot, "client");
|
|
639
|
+
const scriptsStat = yield* fs.stat(scriptsRoot).pipe(Effect.option);
|
|
640
|
+
const scriptEntries = scriptsStat._tag === "Some" && scriptsStat.value.isDirectory() ? yield* fs.entries(scriptsRoot) : [];
|
|
641
|
+
const searchFile = scriptEntries.find(entry => entry.isFile() && /^docs-search\.(ts|js)$/.test(entry.name));
|
|
116
642
|
const files = [];
|
|
117
643
|
const components = new Map();
|
|
118
|
-
const componentEntries = yield* fs.entries(componentsRoot);
|
|
644
|
+
const componentEntries = componentsStat._tag === "Some" ? yield* fs.entries(componentsRoot) : [];
|
|
119
645
|
yield* Effect.forEach(componentEntries, (entry) => Effect.gen(function* () {
|
|
120
646
|
if (!entry.isFile() || !entry.name.endsWith(".html"))
|
|
121
647
|
return;
|
|
@@ -124,61 +650,332 @@ export function compileProjectEffect(root) {
|
|
|
124
650
|
yield* Effect.fail(new CompilerError(`Invalid component filename: ${entry.name}. Use kebab-case and reserve fuzor-* for the framework.`));
|
|
125
651
|
}
|
|
126
652
|
const file = path.join(componentsRoot, entry.name);
|
|
127
|
-
|
|
653
|
+
const html = yield* fs.read(file);
|
|
654
|
+
const prepared = yield* Effect.try({ try: () => markComponentScriptSources(html, file), catch: error => new CompilerError(String(error)) });
|
|
655
|
+
components.set(name, prepared);
|
|
128
656
|
files.push(file);
|
|
129
657
|
}), { concurrency: 8, discard: true });
|
|
658
|
+
let rootLayout;
|
|
130
659
|
const routes = [];
|
|
131
|
-
const
|
|
660
|
+
const boundaries = [];
|
|
661
|
+
const markdownContent = new Map();
|
|
662
|
+
const labels = new Map();
|
|
663
|
+
const loadModule = options.loadModule ?? defaultLoadModule;
|
|
664
|
+
const highlightOption = options.markdown?.highlight;
|
|
665
|
+
const platform = options.platform ?? "web";
|
|
666
|
+
const platforms = new Set();
|
|
667
|
+
const highlight = highlightOption ? createCodeHighlighter(highlightOption === true ? {} : highlightOption) : undefined;
|
|
668
|
+
const pathEntries = new Map();
|
|
669
|
+
const namedLayouts = new Map();
|
|
670
|
+
/** Current fingerprint of something a cached page read: `component:<name>` or `layout:<file>`. */
|
|
671
|
+
const currentDependency = (dependency) => {
|
|
672
|
+
if (dependency.startsWith("component:")) {
|
|
673
|
+
const source = components.get(dependency.slice(10));
|
|
674
|
+
return source === undefined ? null : digest(source);
|
|
675
|
+
}
|
|
676
|
+
return namedLayouts.get(dependency.slice(7)) ?? null;
|
|
677
|
+
};
|
|
678
|
+
const assemble = (source, layouts) => Effect.gen(function* () {
|
|
679
|
+
const file = yield* fs.read(source);
|
|
680
|
+
files.push(source);
|
|
681
|
+
const key = cache && digest("assemble", optionsKey, source, file, ...layouts);
|
|
682
|
+
if (cache && key) {
|
|
683
|
+
// Named layouts are only known after parsing; read every named layout a cached entry depends on.
|
|
684
|
+
const entry = cache.lookup(key, currentDependency);
|
|
685
|
+
if (entry) {
|
|
686
|
+
files.push(...entry.files);
|
|
687
|
+
return entry;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
const dependencies = new Map();
|
|
691
|
+
const readComponent = (name) => {
|
|
692
|
+
const value = components.get(name);
|
|
693
|
+
if (name.includes("-"))
|
|
694
|
+
dependencies.set(`component:${name}`, value === undefined ? null : digest(value));
|
|
695
|
+
return value;
|
|
696
|
+
};
|
|
697
|
+
const tracked = { get: readComponent };
|
|
698
|
+
const assembledFiles = [source];
|
|
699
|
+
const compiledMarkdown = source.endsWith(".md") ? yield* Effect.try({
|
|
700
|
+
try: () => compileMarkdown(file, { elements: name => readComponent(name) !== undefined }),
|
|
701
|
+
catch: (error) => frontmatterFailure(error, source, "Markdown error")
|
|
702
|
+
}) : undefined;
|
|
703
|
+
const markdown = compiledMarkdown && highlight ? { ...compiledMarkdown, html: yield* Effect.tryPromise({
|
|
704
|
+
try: () => highlight(compiledMarkdown.html),
|
|
705
|
+
catch: error => new CompilerError(`Highlighting failed in ${source}: ${error instanceof Error ? error.message : String(error)}`, { file: source })
|
|
706
|
+
}) } : compiledMarkdown;
|
|
707
|
+
// HTML pages accept the same YAML frontmatter as Markdown, which is removed from the page body.
|
|
708
|
+
const htmlFrontmatter = markdown ? undefined : /^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(file);
|
|
709
|
+
const raw = markdown ? file : parseRoutePolicy(htmlFrontmatter ? file.slice(htmlFrontmatter[0].length) : file, source, source.startsWith(pagesRoot + path.sep) && path.basename(source) === "index.html").html;
|
|
710
|
+
const metadata = markdown?.metadata ?? (htmlFrontmatter ? yield* Effect.try({
|
|
711
|
+
try: () => parseRouteMetadata(htmlFrontmatter[1]),
|
|
712
|
+
catch: error => frontmatterFailure(error, source)
|
|
713
|
+
}) : {});
|
|
714
|
+
let routeLayouts = layouts;
|
|
715
|
+
if (metadata.layout) {
|
|
716
|
+
const named = path.join(layoutsRoot, `${metadata.layout}.html`);
|
|
717
|
+
if (!(yield* fs.exists(named)))
|
|
718
|
+
return yield* Effect.fail(new CompilerError(`Unknown named layout ${metadata.layout} in ${source}: ${named}`));
|
|
719
|
+
const layoutSource = yield* fs.read(named);
|
|
720
|
+
const html = markPageScriptSources(layoutSource, named);
|
|
721
|
+
files.push(named);
|
|
722
|
+
assembledFiles.push(named);
|
|
723
|
+
namedLayouts.set(named, digest(layoutSource));
|
|
724
|
+
dependencies.set(`layout:${named}`, digest(layoutSource));
|
|
725
|
+
routeLayouts = rootLayout ? [rootLayout, html] : [html];
|
|
726
|
+
}
|
|
727
|
+
const heading = markdown ? markdown.headings.find(entry => entry.level === 1)?.text : firstHeading(raw);
|
|
728
|
+
const html = yield* Effect.try({
|
|
729
|
+
try: () => {
|
|
730
|
+
let content = markPageScriptSources(markdown?.html ?? raw, source);
|
|
731
|
+
for (let index = routeLayouts.length - 1; index >= 0; index--) {
|
|
732
|
+
content = fillSlot(routeLayouts[index], content, `Layout ${index + 1} for ${source}`);
|
|
733
|
+
}
|
|
734
|
+
return compilePlatformBlocks(compileLinks(expandComponents(content, tracked)), platform, source, platforms)
|
|
735
|
+
.replace(/<fuzor-toc\s*>\s*<\/fuzor-toc\s*>/gi, () => markdown?.toc ?? "");
|
|
736
|
+
},
|
|
737
|
+
catch: (error) => failure(error, source, `Compilation failed for ${source}: `)
|
|
738
|
+
});
|
|
739
|
+
const assembled = { html, markdown, heading, raw, metadata, files: assembledFiles };
|
|
740
|
+
if (cache && key)
|
|
741
|
+
cache.store(key, assembled, dependencies);
|
|
742
|
+
return assembled;
|
|
743
|
+
});
|
|
744
|
+
// Existence comes from the folder listing that visit() already has, instead of one stat per candidate file.
|
|
745
|
+
const pageSource = (directory, base, entries) => Effect.gen(function* () {
|
|
746
|
+
const html = path.join(directory, `${base}.html`);
|
|
747
|
+
const md = path.join(directory, `${base}.md`);
|
|
748
|
+
const hasHtml = entries.some(entry => entry.isFile() && entry.name === `${base}.html`);
|
|
749
|
+
const hasMarkdown = entries.some(entry => entry.isFile() && entry.name === `${base}.md`);
|
|
750
|
+
if (hasHtml && hasMarkdown)
|
|
751
|
+
return yield* Effect.fail(new CompilerError(`${directory} has both ${base}.html and ${base}.md.`));
|
|
752
|
+
return hasHtml ? html : hasMarkdown ? md : undefined;
|
|
753
|
+
});
|
|
754
|
+
const visit = (directory, relativeDir, context) => Effect.gen(function* () {
|
|
132
755
|
const entries = yield* fs.entries(directory);
|
|
756
|
+
if (isDocsDir(relativeDir)) {
|
|
757
|
+
for (const entry of entries) {
|
|
758
|
+
if (entry.isFile() && !entry.name.startsWith(".") && !entry.name.endsWith(".md")) {
|
|
759
|
+
return yield* Effect.fail(new CompilerError(`Docs directory only allows Markdown (.md) files. Found "${entry.name}" in ${directory}.`));
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
133
763
|
const layoutFile = path.join(directory, "layout.html");
|
|
134
764
|
const externalLayoutFile = relativeDir ? path.join(layoutsRoot, `${relativeDir}.html`) : "";
|
|
135
|
-
const hasLocalLayout =
|
|
765
|
+
const hasLocalLayout = entries.some(entry => entry.isFile() && entry.name === "layout.html");
|
|
136
766
|
const hasExternalLayout = externalLayoutFile ? yield* fs.exists(externalLayoutFile) : false;
|
|
137
767
|
if (hasLocalLayout && hasExternalLayout) {
|
|
138
768
|
yield* Effect.fail(new CompilerError(`Duplicate layout for /${relativeDir}/: ${layoutFile} and ${externalLayoutFile}`));
|
|
139
769
|
}
|
|
140
770
|
const selectedLayout = hasLocalLayout ? layoutFile : hasExternalLayout ? externalLayoutFile : undefined;
|
|
771
|
+
const docsLayout = relativeDir === "docs" && !selectedLayout ? officialDocsLayout(searchFile ? { searchModule: `/client/${searchFile.name}` } : {}) : undefined;
|
|
141
772
|
const ownLayouts = selectedLayout
|
|
142
|
-
? [...layouts, yield* fs.read(selectedLayout)]
|
|
143
|
-
:
|
|
773
|
+
? [...context.layouts, markPageScriptSources(yield* fs.read(selectedLayout), selectedLayout)]
|
|
774
|
+
: docsLayout
|
|
775
|
+
? [...context.layouts, docsLayout]
|
|
776
|
+
: [...context.layouts];
|
|
144
777
|
if (selectedLayout)
|
|
145
778
|
files.push(selectedLayout);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
yield* Effect.fail(new CompilerError(`${directory} has
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
779
|
+
if (!relativeDir)
|
|
780
|
+
rootLayout = ownLayouts[0];
|
|
781
|
+
const dynamic = context.segments.filter(segment => segment.kind !== "static");
|
|
782
|
+
const pathsFiles = entries.filter(entry => entry.isFile() && pathsModules.includes(entry.name)).map(entry => path.join(directory, entry.name));
|
|
783
|
+
if (pathsFiles.length > 1)
|
|
784
|
+
yield* Effect.fail(new CompilerError(`${directory} has more than one paths module: ${pathsFiles.map(file => path.basename(file)).join(", ")}.`));
|
|
785
|
+
const last = context.segments.at(-1);
|
|
786
|
+
if (pathsFiles.length && !dynamic.length)
|
|
787
|
+
yield* Effect.fail(new CompilerError(`${pathsFiles[0]} is only valid inside a dynamic route folder such as [slug].`));
|
|
788
|
+
// A new dynamic segment needs its own paths module; deeper static folders inherit the nearest one.
|
|
789
|
+
const pathsFile = pathsFiles[0] ?? (last && last.kind !== "static" ? undefined : context.pathsFile);
|
|
790
|
+
if (pathsFile)
|
|
791
|
+
files.push(pathsFile);
|
|
792
|
+
if (last?.kind === "rest" && entries.some(entry => entry.isDirectory() && !entry.name.startsWith("."))) {
|
|
793
|
+
yield* Effect.fail(new CompilerError(`Catch-all folder ${directory} cannot contain subfolders.`));
|
|
794
|
+
}
|
|
795
|
+
const serverFiles = entries.filter(entry => entry.isFile() && serverModules.includes(entry.name)).map(entry => path.join(directory, entry.name));
|
|
796
|
+
if (serverFiles.length > 1)
|
|
797
|
+
yield* Effect.fail(new CompilerError(`${directory} has more than one server module: ${serverFiles.map(file => path.basename(file)).join(", ")}.`));
|
|
798
|
+
const serverData = serverFiles[0];
|
|
799
|
+
const source = yield* pageSource(directory, "index", entries);
|
|
800
|
+
const declaration = source?.endsWith(".html") ? parseRoutePolicy(yield* fs.read(source), source, true).declaration : {};
|
|
801
|
+
const rendering = declaration.rendering ?? context.rendering ?? "static";
|
|
802
|
+
if (serverData && !source)
|
|
803
|
+
yield* Effect.fail(new CompilerError(`${serverData} has no index.html or index.md page to provide data for.`));
|
|
804
|
+
if (serverData)
|
|
805
|
+
files.push(serverData);
|
|
806
|
+
if (source) {
|
|
807
|
+
const { html, markdown, heading, raw, metadata: pageMetadata } = yield* assemble(source, ownLayouts);
|
|
808
|
+
const hasMetadata = Object.keys(pageMetadata).length > 0;
|
|
809
|
+
let paths;
|
|
810
|
+
if (dynamic.length && (pathsFile || rendering !== "request")) {
|
|
811
|
+
if (!pathsFile) {
|
|
812
|
+
return yield* Effect.fail(new CompilerError(`Dynamic route ${patternOf(context.segments)} (${source}) needs a paths module (paths.ts or paths.js) in ${directory} listing its parameters.`));
|
|
813
|
+
}
|
|
814
|
+
let loading = pathEntries.get(pathsFile);
|
|
815
|
+
if (!loading) {
|
|
816
|
+
loading = loadModule(pathsFile).then(async (module) => {
|
|
817
|
+
if (module.params !== undefined && !Schema.isSchema(module.params))
|
|
818
|
+
throw new Error("export const params must be an Effect Schema, such as Schema.Struct({ id: Schema.FiniteFromString })");
|
|
819
|
+
const entries = typeof module.default === "function" ? await module.default() : module.default;
|
|
820
|
+
return { entries, schema: module.params };
|
|
821
|
+
});
|
|
822
|
+
pathEntries.set(pathsFile, loading);
|
|
823
|
+
}
|
|
824
|
+
const value = yield* Effect.tryPromise({ try: () => loading, catch: error => new CompilerError(`Cannot load ${pathsFile}: ${error instanceof Error ? error.message : String(error)}`, { file: pathsFile }) });
|
|
825
|
+
const list = yield* Effect.try({ try: () => readPathEntries(value.entries, dynamic, pathsFile, value.schema), catch: error => new CompilerError(error instanceof Error ? error.message : String(error), { file: pathsFile }) });
|
|
826
|
+
paths = { list, schema: value.schema };
|
|
827
|
+
}
|
|
828
|
+
// Everything below is a function of the assembled page and its route inputs.
|
|
829
|
+
const pageKey = cache && digest("page", compilerVersion, source, html, raw, markdown?.html ?? "\0", heading ?? "\0", JSON.stringify(pageMetadata), serverData ?? "", rendering, patternOf(context.segments), paths ? JSON.stringify(paths.list) : routePath(relativeDir), paths?.schema && pathsFile ? pathsFile : "");
|
|
830
|
+
const cachedPage = pageKey ? cache.lookup(pageKey, currentDependency) : undefined;
|
|
831
|
+
if (cachedPage) {
|
|
832
|
+
routes.push(...cachedPage.routes);
|
|
833
|
+
for (const [route, content] of cachedPage.markdown)
|
|
834
|
+
markdownContent.set(route, content);
|
|
835
|
+
for (const [route, label] of cachedPage.labels)
|
|
836
|
+
labels.set(route, label);
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
const output = { routes: [], markdown: [], labels: [] };
|
|
840
|
+
yield* Effect.try({ try: () => checkDataSlots(html, Boolean(serverData), source), catch: error => failure(error, source) });
|
|
841
|
+
const withLoading = yield* Effect.try({ try: () => compileLoading(html, Boolean(serverData), source), catch: error => failure(error, source) });
|
|
842
|
+
if (!paths) {
|
|
843
|
+
const route = routePath(relativeDir);
|
|
844
|
+
const content = yield* Effect.try({ try: () => dynamic.length && rendering === "request" ? withLoading : replaceParams(withLoading, undefined), catch: error => failure(error, source, `${source}: `) });
|
|
845
|
+
if (markdown)
|
|
846
|
+
output.markdown.push([route, markdown.html]);
|
|
847
|
+
if (heading)
|
|
848
|
+
output.labels.push([route, heading]);
|
|
849
|
+
output.routes.push({ path: route, source, html: content, search: pageText(markdown?.html ?? raw), ...(dynamic.length && rendering === "request" ? { requestPattern: patternOf(context.segments).replace(/\[\.\.\.(\w+)\]/g, ":$1*").replace(/\[(\w+)\]/g, ":$1") } : {}), ...(markdown || hasMetadata ? { metadata: pageMetadata } : {}), ...(serverData ? { serverData } : {}) });
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
for (const entry of paths.list) {
|
|
853
|
+
const concrete = context.segments.flatMap(segment => segment.kind === "static" ? [segment.value] : entry.segments[segment.name]);
|
|
854
|
+
const route = routeKeyFromSegments(concrete);
|
|
855
|
+
const content = yield* Effect.try({ try: () => replaceParams(withLoading, entry.params), catch: error => failure(error, source, `${source}: `) });
|
|
856
|
+
const metadata = markdown || hasMetadata || entry.metadata ? { ...pageMetadata, ...entry.metadata } : undefined;
|
|
857
|
+
if (markdown)
|
|
858
|
+
output.markdown.push([route, markdown.html]);
|
|
859
|
+
const entryRaw = yield* Effect.try({ try: () => replaceParams(raw, entry.params), catch: error => failure(error, source, `${source}: `) });
|
|
860
|
+
const entryHeading = markdown ? heading : firstHeading(entryRaw);
|
|
861
|
+
if (entryHeading)
|
|
862
|
+
output.labels.push([route, entryHeading]);
|
|
863
|
+
output.routes.push({ path: route, source, html: content, search: pageText(markdown?.html ?? entryRaw), pattern: patternOf(context.segments), params: entry.params, ...(paths.schema && pathsFile ? { paramsSchema: pathsFile } : {}), ...(metadata ? { metadata } : {}), ...(serverData ? { serverData } : {}) });
|
|
164
864
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
865
|
+
}
|
|
866
|
+
if (pageKey)
|
|
867
|
+
cache.store(pageKey, output);
|
|
868
|
+
routes.push(...output.routes);
|
|
869
|
+
for (const [route, content] of output.markdown)
|
|
870
|
+
markdownContent.set(route, content);
|
|
871
|
+
for (const [route, label] of output.labels)
|
|
872
|
+
labels.set(route, label);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
for (const kind of ["not-found", "error"]) {
|
|
876
|
+
const boundary = yield* pageSource(directory, kind, entries);
|
|
877
|
+
if (!boundary)
|
|
878
|
+
continue;
|
|
879
|
+
if (dynamic.length)
|
|
880
|
+
return yield* Effect.fail(new CompilerError(`${boundary}: ${kind} pages must be in a static folder.`));
|
|
881
|
+
const { html, markdown, metadata: boundaryMetadata } = yield* assemble(boundary, ownLayouts);
|
|
882
|
+
yield* Effect.try({ try: () => checkDataSlots(html, false, boundary), catch: error => failure(error instanceof Error ? Object.assign(error, { message: `${error.message} Boundary pages cannot use server data.` }) : error, boundary) });
|
|
883
|
+
const content = yield* Effect.try({ try: () => replaceParams(compileLoading(html, false, boundary), undefined), catch: error => failure(error, boundary, `${boundary}: `) });
|
|
884
|
+
boundaries.push({ kind, scope: routePath(relativeDir), source: boundary, html: content, ...(markdown || Object.keys(boundaryMetadata).length ? { metadata: boundaryMetadata } : {}) });
|
|
170
885
|
}
|
|
171
|
-
yield* Effect.forEach(entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")), (entry) =>
|
|
886
|
+
yield* Effect.forEach(entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")), (entry) => Effect.gen(function* () {
|
|
887
|
+
const segment = parseSegment(entry.name);
|
|
888
|
+
if (typeof segment === "string")
|
|
889
|
+
return yield* Effect.fail(new CompilerError(`${path.join(directory, entry.name)}: ${segment}`));
|
|
890
|
+
const names = [...dynamic, segment].filter(item => item.kind !== "static").map(item => item.name);
|
|
891
|
+
if (new Set(names).size !== names.length)
|
|
892
|
+
return yield* Effect.fail(new CompilerError(`${path.join(directory, entry.name)} repeats a route parameter name.`));
|
|
893
|
+
yield* visit(path.join(directory, entry.name), path.join(relativeDir, entry.name), { layouts: ownLayouts, rendering, segments: [...context.segments, segment], ...(pathsFile ? { pathsFile } : {}) });
|
|
894
|
+
}), { concurrency: 8, discard: true });
|
|
172
895
|
});
|
|
173
|
-
|
|
896
|
+
if (cache) {
|
|
897
|
+
// Cached pages check their named layouts against the current files, so fingerprint layouts/ up front.
|
|
898
|
+
const readLayouts = (directory) => Effect.gen(function* () {
|
|
899
|
+
for (const entry of yield* fs.entries(directory)) {
|
|
900
|
+
const file = path.join(directory, entry.name);
|
|
901
|
+
if (entry.isDirectory())
|
|
902
|
+
yield* readLayouts(file);
|
|
903
|
+
else if (entry.isFile() && entry.name.endsWith(".html"))
|
|
904
|
+
namedLayouts.set(file, digest(yield* fs.read(file)));
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
const layoutsStat = yield* fs.stat(layoutsRoot).pipe(Effect.option);
|
|
908
|
+
if (layoutsStat._tag === "Some" && layoutsStat.value.isDirectory())
|
|
909
|
+
yield* readLayouts(layoutsRoot);
|
|
910
|
+
}
|
|
911
|
+
yield* visit(pagesRoot, "", { layouts: [], segments: [] });
|
|
174
912
|
if (!routes.some((route) => route.path === "/")) {
|
|
175
913
|
yield* Effect.fail(new CompilerError(`${pagesRoot} requires index.html or index.md for the root route.`));
|
|
176
914
|
}
|
|
177
|
-
|
|
178
|
-
|
|
915
|
+
// Code-unit order is locale independent; island IDs are derived from this order.
|
|
916
|
+
routes.sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
917
|
+
for (let index = 1; index < routes.length; index++) {
|
|
918
|
+
if (routes[index].path === routes[index - 1].path) {
|
|
919
|
+
yield* Effect.fail(new CompilerError(`Route conflict for ${routes[index].path}: ${routes[index - 1].source} and ${routes[index].source} resolve to the same URL.`));
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
// Generated navigation depends on every route's path, labels and navigation metadata.
|
|
923
|
+
let navKey;
|
|
924
|
+
const navFor = (html, current, source) => {
|
|
925
|
+
if (!cache || !/<fuzor-nav\b/i.test(html))
|
|
926
|
+
return compileNav(html, current, routes, labels, source);
|
|
927
|
+
navKey ??= digest(JSON.stringify(routes.map(route => [route.path, labels.get(route.path) ?? null, route.metadata?.title ?? null, route.metadata?.navTitle ?? null, route.metadata?.navGroup ?? null, route.metadata?.navCategory ?? null, route.metadata?.order ?? null])));
|
|
928
|
+
const key = digest("nav", compilerVersion, navKey, current, html);
|
|
929
|
+
const cached = cache.lookup(key, currentDependency);
|
|
930
|
+
if (cached !== undefined)
|
|
931
|
+
return cached;
|
|
932
|
+
const compiled = compileNav(html, current, routes, labels, source);
|
|
933
|
+
cache.store(key, compiled);
|
|
934
|
+
return compiled;
|
|
935
|
+
};
|
|
936
|
+
const withNav = yield* Effect.try({
|
|
937
|
+
try: () => ({
|
|
938
|
+
routes: routes.map(route => ({ ...route, html: navFor(route.html, route.path, route.source) })),
|
|
939
|
+
boundaries: boundaries.map(boundary => ({ ...boundary, html: navFor(boundary.html, "", boundary.source) }))
|
|
940
|
+
}),
|
|
941
|
+
catch: error => failure(error)
|
|
942
|
+
});
|
|
943
|
+
routes.splice(0, routes.length, ...withNav.routes);
|
|
944
|
+
boundaries.splice(0, boundaries.length, ...withNav.boundaries);
|
|
945
|
+
const linkCheck = options.markdown?.linkCheck ?? "error";
|
|
946
|
+
if (!["error", "warn", "off"].includes(linkCheck)) {
|
|
947
|
+
yield* Effect.fail(new CompilerError(`markdown.linkCheck must be "error", "warn" or "off"; received ${JSON.stringify(linkCheck)}.`));
|
|
948
|
+
}
|
|
949
|
+
const warnings = [];
|
|
950
|
+
if (markdownContent.size && linkCheck !== "off") {
|
|
951
|
+
const shellFile = path.join(projectRoot, "index.html");
|
|
952
|
+
const shellAnchors = (yield* fs.exists(shellFile)) ? collectAnchors(yield* fs.read(shellFile)) : new Set();
|
|
953
|
+
const { problems, assets } = validateMarkdownLinks({ routes, markdown: markdownContent, shellAnchors, ignorePaths: options.markdown?.ignorePaths ?? [] });
|
|
954
|
+
const publicRoot = path.join(projectRoot, "public");
|
|
955
|
+
for (const asset of assets) {
|
|
956
|
+
const file = path.resolve(publicRoot, `.${asset.publicPath}`);
|
|
957
|
+
if (!file.startsWith(publicRoot + path.sep) || !(yield* fs.exists(file)))
|
|
958
|
+
problems.push(asset.problem);
|
|
959
|
+
}
|
|
960
|
+
if (problems.length && linkCheck === "warn")
|
|
961
|
+
warnings.push(...problems.map(problem => `Broken Markdown reference: ${problem}`));
|
|
962
|
+
else if (problems.length) {
|
|
963
|
+
yield* Effect.fail(new CompilerError(`Broken Markdown references:\n${problems.map(problem => ` ${problem}`).join("\n")}\n` +
|
|
964
|
+
`Fix the links, list paths served outside Fuzor in fuzorPlugin({ markdown: { ignorePaths: ["/api/"] } }), or set markdown.linkCheck to "warn" while migrating.`));
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
const redirects = options.redirects ? yield* Effect.try({
|
|
968
|
+
try: () => resolveRedirects(options.redirects, new Set(routes.map(route => route.path))),
|
|
969
|
+
catch: error => new CompilerError(error instanceof Error ? error.message : String(error))
|
|
970
|
+
}) : undefined;
|
|
971
|
+
boundaries.sort((a, b) => a.scope < b.scope ? -1 : a.scope > b.scope ? 1 : a.kind < b.kind ? -1 : 1);
|
|
972
|
+
cache?.complete();
|
|
973
|
+
const policyRoutes = yield* Effect.tryPromise({ try: () => resolveRoutePolicies(routes, files, projectRoot), catch: error => failure(error) });
|
|
974
|
+
return { routes: policyRoutes, ...(redirects && Object.keys(redirects).length ? { redirects } : {}), ...(boundaries.length ? { boundaries } : {}), files: [...new Set(files)].sort(), ...(platforms.size ? { platforms: [...platforms].sort() } : {}), ...(warnings.length ? { warnings } : {}) };
|
|
179
975
|
});
|
|
180
976
|
}
|
|
181
|
-
export function compileProject(root) {
|
|
182
|
-
|
|
977
|
+
export function compileProject(root, options = {}) {
|
|
978
|
+
const { signal, ...compileOptions } = options;
|
|
979
|
+
return Effect.runPromise(compileProjectEffect(root, compileOptions).pipe(Effect.provide(CompilerFileSystemLive)), signal ? { signal } : {});
|
|
183
980
|
}
|
|
184
981
|
//# sourceMappingURL=index.js.map
|