polen 0.9.1-next.2 → 0.10.0-next.11
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 +49 -364
- package/build/api/api.d.ts +1 -0
- package/build/api/api.d.ts.map +1 -1
- package/build/api/api.js +1 -0
- package/build/api/api.js.map +1 -1
- package/build/api/config/configurator.d.ts +9 -1
- package/build/api/config/configurator.d.ts.map +1 -1
- package/build/api/config/configurator.js +18 -6
- package/build/api/config/configurator.js.map +1 -1
- package/build/api/config/load.js +5 -5
- package/build/api/config/load.js.map +1 -1
- package/build/api/config-resolver/resolve.js +2 -2
- package/build/api/config-resolver/resolve.js.map +1 -1
- package/build/api/content/$$.d.ts +7 -0
- package/build/api/content/$$.d.ts.map +1 -0
- package/build/api/content/$$.js +7 -0
- package/build/api/content/$$.js.map +1 -0
- package/build/api/content/$.d.ts +2 -0
- package/build/api/content/$.d.ts.map +1 -0
- package/build/api/content/$.js +2 -0
- package/build/api/content/$.js.map +1 -0
- package/build/api/content/metadata.d.ts +10 -0
- package/build/api/content/metadata.d.ts.map +1 -0
- package/build/api/content/metadata.js +9 -0
- package/build/api/content/metadata.js.map +1 -0
- package/build/api/content/navbar.d.ts +10 -0
- package/build/api/content/navbar.d.ts.map +1 -0
- package/build/api/content/navbar.js +45 -0
- package/build/api/content/navbar.js.map +1 -0
- package/build/api/content/page.d.ts +11 -0
- package/build/api/content/page.d.ts.map +1 -0
- package/build/api/content/page.js +2 -0
- package/build/api/content/page.js.map +1 -0
- package/build/api/content/scan.d.ts +19 -0
- package/build/api/content/scan.d.ts.map +1 -0
- package/build/api/content/scan.js +90 -0
- package/build/api/content/scan.js.map +1 -0
- package/build/api/content/sidebar.d.ts +104 -0
- package/build/api/content/sidebar.d.ts.map +1 -0
- package/build/api/content/sidebar.js +166 -0
- package/build/api/content/sidebar.js.map +1 -0
- package/build/api/content/utils.d.ts +5 -0
- package/build/api/content/utils.d.ts.map +1 -0
- package/build/api/content/utils.js +8 -0
- package/build/api/content/utils.js.map +1 -0
- package/build/api/schema/data-sources/schema-directory/schema-directory.js +1 -1
- package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
- package/build/api/static/index.d.ts +2 -0
- package/build/api/static/index.d.ts.map +1 -0
- package/build/api/static/index.js +2 -0
- package/build/api/static/index.js.map +1 -0
- package/build/api/static/manifest.d.ts +18 -0
- package/build/api/static/manifest.d.ts.map +1 -0
- package/build/api/static/manifest.js +13 -0
- package/build/api/static/manifest.js.map +1 -0
- package/build/api/static/rebase.d.ts +14 -0
- package/build/api/static/rebase.d.ts.map +1 -0
- package/build/api/static/rebase.js +110 -0
- package/build/api/static/rebase.js.map +1 -0
- package/build/api/static/static.d.ts +3 -0
- package/build/api/static/static.d.ts.map +1 -0
- package/build/api/static/static.js +3 -0
- package/build/api/static/static.js.map +1 -0
- package/build/api/vite/plugins/branding/index.d.ts +4 -0
- package/build/api/vite/plugins/branding/index.d.ts.map +1 -0
- package/build/api/vite/plugins/branding/index.js +80 -0
- package/build/api/vite/plugins/branding/index.js.map +1 -0
- package/build/api/vite/plugins/build.d.ts.map +1 -1
- package/build/api/vite/plugins/build.js +22 -1
- package/build/api/vite/plugins/build.js.map +1 -1
- package/build/api/vite/plugins/core.d.ts +2 -2
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +4 -5
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/main.d.ts.map +1 -1
- package/build/api/vite/plugins/main.js +2 -1
- package/build/api/vite/plugins/main.js.map +1 -1
- package/build/api/vite/plugins/pages.d.ts +8 -14
- package/build/api/vite/plugins/pages.d.ts.map +1 -1
- package/build/api/vite/plugins/pages.js +110 -183
- package/build/api/vite/plugins/pages.js.map +1 -1
- package/build/api/vite/plugins/serve.js +5 -5
- package/build/api/vite/plugins/serve.js.map +1 -1
- package/build/cli/_/self-contained-mode.js +5 -5
- package/build/cli/_/self-contained-mode.js.map +1 -1
- package/build/cli/commands/static/$default.d.ts +3 -0
- package/build/cli/commands/static/$default.d.ts.map +1 -0
- package/build/cli/commands/static/$default.js +38 -0
- package/build/cli/commands/static/$default.js.map +1 -0
- package/build/cli/commands/static/rebase.d.ts +2 -0
- package/build/cli/commands/static/rebase.d.ts.map +1 -0
- package/build/cli/commands/static/rebase.js +26 -0
- package/build/cli/commands/static/rebase.js.map +1 -0
- package/build/cli/commands/static.d.ts +3 -0
- package/build/cli/commands/static.d.ts.map +1 -0
- package/build/cli/commands/static.js +5 -0
- package/build/cli/commands/static.js.map +1 -0
- package/build/exports/components.d.ts +2 -0
- package/build/exports/components.d.ts.map +1 -0
- package/build/exports/components.js +2 -0
- package/build/exports/components.js.map +1 -0
- package/build/lib/demos/builder.d.ts +83 -0
- package/build/lib/demos/builder.d.ts.map +1 -0
- package/build/lib/demos/builder.js +237 -0
- package/build/lib/demos/builder.js.map +1 -0
- package/build/lib/demos/config-schema.d.ts +243 -0
- package/build/lib/demos/config-schema.d.ts.map +1 -0
- package/build/lib/demos/config-schema.js +52 -0
- package/build/lib/demos/config-schema.js.map +1 -0
- package/build/lib/demos/config.d.ts +40 -0
- package/build/lib/demos/config.d.ts.map +1 -0
- package/build/lib/demos/config.js +180 -0
- package/build/lib/demos/config.js.map +1 -0
- package/build/lib/demos/index.d.ts +9 -0
- package/build/lib/demos/index.d.ts.map +1 -0
- package/build/lib/demos/index.js +8 -0
- package/build/lib/demos/index.js.map +1 -0
- package/build/lib/demos/ui/components.d.ts +33 -0
- package/build/lib/demos/ui/components.d.ts.map +1 -0
- package/build/lib/demos/ui/components.js +699 -0
- package/build/lib/demos/ui/components.js.map +1 -0
- package/build/lib/demos/ui/data-collector.d.ts +88 -0
- package/build/lib/demos/ui/data-collector.d.ts.map +1 -0
- package/build/lib/demos/ui/data-collector.js +174 -0
- package/build/lib/demos/ui/data-collector.js.map +1 -0
- package/build/lib/demos/ui/landing-page-cli.d.ts +3 -0
- package/build/lib/demos/ui/landing-page-cli.d.ts.map +1 -0
- package/build/lib/demos/ui/landing-page-cli.js +21 -0
- package/build/lib/demos/ui/landing-page-cli.js.map +1 -0
- package/build/lib/demos/ui/landing-page.d.ts +32 -0
- package/build/lib/demos/ui/landing-page.d.ts.map +1 -0
- package/build/lib/demos/ui/landing-page.js +83 -0
- package/build/lib/demos/ui/landing-page.js.map +1 -0
- package/build/lib/demos/ui/page-renderer.d.ts +26 -0
- package/build/lib/demos/ui/page-renderer.d.ts.map +1 -0
- package/build/lib/demos/ui/page-renderer.js +104 -0
- package/build/lib/demos/ui/page-renderer.js.map +1 -0
- package/build/lib/demos/utils.d.ts +14 -0
- package/build/lib/demos/utils.d.ts.map +1 -0
- package/build/lib/demos/utils.js +37 -0
- package/build/lib/demos/utils.js.map +1 -0
- package/build/lib/deployment/$$.d.ts +3 -0
- package/build/lib/deployment/$$.d.ts.map +1 -0
- package/build/lib/deployment/$$.js +3 -0
- package/build/lib/deployment/$$.js.map +1 -0
- package/build/lib/deployment/$.d.ts +2 -0
- package/build/lib/deployment/$.d.ts.map +1 -0
- package/build/lib/deployment/$.js +2 -0
- package/build/lib/deployment/$.js.map +1 -0
- package/build/lib/deployment/metadata.d.ts +32 -0
- package/build/lib/deployment/metadata.d.ts.map +1 -0
- package/build/lib/deployment/metadata.js +37 -0
- package/build/lib/deployment/metadata.js.map +1 -0
- package/build/lib/deployment/path-manager.d.ts +41 -0
- package/build/lib/deployment/path-manager.d.ts.map +1 -0
- package/build/lib/deployment/path-manager.js +157 -0
- package/build/lib/deployment/path-manager.js.map +1 -0
- package/build/lib/file-router/file-router.d.ts +0 -2
- package/build/lib/file-router/file-router.d.ts.map +1 -1
- package/build/lib/file-router/file-router.js +0 -2
- package/build/lib/file-router/file-router.js.map +1 -1
- package/build/lib/file-router/route.d.ts +2 -0
- package/build/lib/file-router/route.d.ts.map +1 -1
- package/build/lib/file-router/route.js.map +1 -1
- package/build/lib/file-router/scan.d.ts.map +1 -1
- package/build/lib/file-router/scan.js +22 -13
- package/build/lib/file-router/scan.js.map +1 -1
- package/build/lib/github-actions/git-controller.d.ts +50 -0
- package/build/lib/github-actions/git-controller.d.ts.map +1 -0
- package/build/lib/github-actions/git-controller.js +90 -0
- package/build/lib/github-actions/git-controller.js.map +1 -0
- package/build/lib/github-actions/github-actions.d.ts +7 -0
- package/build/lib/github-actions/github-actions.d.ts.map +1 -0
- package/build/lib/github-actions/github-actions.js +7 -0
- package/build/lib/github-actions/github-actions.js.map +1 -0
- package/build/lib/github-actions/index.d.ts +2 -0
- package/build/lib/github-actions/index.d.ts.map +1 -0
- package/build/lib/github-actions/index.js +2 -0
- package/build/lib/github-actions/index.js.map +1 -0
- package/build/lib/github-actions/lib/get-pr-deployments.d.ts +12 -0
- package/build/lib/github-actions/lib/get-pr-deployments.d.ts.map +1 -0
- package/build/lib/github-actions/lib/get-pr-deployments.js +51 -0
- package/build/lib/github-actions/lib/get-pr-deployments.js.map +1 -0
- package/build/lib/github-actions/pr-controller.d.ts +39 -0
- package/build/lib/github-actions/pr-controller.d.ts.map +1 -0
- package/build/lib/github-actions/pr-controller.js +122 -0
- package/build/lib/github-actions/pr-controller.js.map +1 -0
- package/build/lib/github-actions/run-step-cli.d.ts +9 -0
- package/build/lib/github-actions/run-step-cli.d.ts.map +1 -0
- package/build/lib/github-actions/run-step-cli.js +71 -0
- package/build/lib/github-actions/run-step-cli.js.map +1 -0
- package/build/lib/github-actions/runner.d.ts +17 -0
- package/build/lib/github-actions/runner.d.ts.map +1 -0
- package/build/lib/github-actions/runner.js +195 -0
- package/build/lib/github-actions/runner.js.map +1 -0
- package/build/lib/github-actions/schemas/context.d.ts +933 -0
- package/build/lib/github-actions/schemas/context.d.ts.map +1 -0
- package/build/lib/github-actions/schemas/context.js +407 -0
- package/build/lib/github-actions/schemas/context.js.map +1 -0
- package/build/lib/github-actions/schemas/index.d.ts +5 -0
- package/build/lib/github-actions/schemas/index.d.ts.map +1 -0
- package/build/lib/github-actions/schemas/index.js +5 -0
- package/build/lib/github-actions/schemas/index.js.map +1 -0
- package/build/lib/github-actions/search-module.d.ts +38 -0
- package/build/lib/github-actions/search-module.d.ts.map +1 -0
- package/build/lib/github-actions/search-module.js +40 -0
- package/build/lib/github-actions/search-module.js.map +1 -0
- package/build/lib/github-actions/step.d.ts +163 -0
- package/build/lib/github-actions/step.d.ts.map +1 -0
- package/build/lib/github-actions/step.js +121 -0
- package/build/lib/github-actions/step.js.map +1 -0
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +5 -3
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/kit-temp.d.ts +54 -0
- package/build/lib/kit-temp.d.ts.map +1 -1
- package/build/lib/kit-temp.js +82 -14
- package/build/lib/kit-temp.js.map +1 -1
- package/build/lib/kit-temp.test-d.d.ts +2 -0
- package/build/lib/kit-temp.test-d.d.ts.map +1 -0
- package/build/lib/kit-temp.test-d.js +75 -0
- package/build/lib/kit-temp.test-d.js.map +1 -0
- package/build/lib/mask/$$.d.ts +3 -0
- package/build/lib/mask/$$.d.ts.map +1 -0
- package/build/lib/mask/$$.js +3 -0
- package/build/lib/mask/$$.js.map +1 -0
- package/build/lib/mask/$.d.ts +2 -0
- package/build/lib/mask/$.d.ts.map +1 -0
- package/build/lib/mask/$.js +2 -0
- package/build/lib/mask/$.js.map +1 -0
- package/build/lib/mask/apply.d.ts +86 -0
- package/build/lib/mask/apply.d.ts.map +1 -0
- package/build/lib/mask/apply.js +86 -0
- package/build/lib/mask/apply.js.map +1 -0
- package/build/lib/mask/mask.d.ts +124 -0
- package/build/lib/mask/mask.d.ts.map +1 -0
- package/build/lib/mask/mask.js +137 -0
- package/build/lib/mask/mask.js.map +1 -0
- package/build/lib/mask/mask.test-d.d.ts +2 -0
- package/build/lib/mask/mask.test-d.d.ts.map +1 -0
- package/build/lib/mask/mask.test-d.js +102 -0
- package/build/lib/mask/mask.test-d.js.map +1 -0
- package/build/lib/mutation-type.d.ts +18 -0
- package/build/lib/mutation-type.d.ts.map +1 -0
- package/build/lib/mutation-type.js +16 -0
- package/build/lib/mutation-type.js.map +1 -0
- package/build/lib/task/$$.d.ts +3 -0
- package/build/lib/task/$$.d.ts.map +1 -0
- package/build/lib/task/$$.js +3 -0
- package/build/lib/task/$$.js.map +1 -0
- package/build/lib/task/$.d.ts +2 -0
- package/build/lib/task/$.d.ts.map +1 -0
- package/build/lib/task/$.js +2 -0
- package/build/lib/task/$.js.map +1 -0
- package/build/lib/task/report.d.ts +28 -0
- package/build/lib/task/report.d.ts.map +1 -0
- package/build/lib/task/report.js +33 -0
- package/build/lib/task/report.js.map +1 -0
- package/build/lib/task/task.d.ts +44 -0
- package/build/lib/task/task.d.ts.map +1 -0
- package/build/lib/task/task.js +63 -0
- package/build/lib/task/task.js.map +1 -0
- package/build/lib/version-history/index.d.ts +3 -0
- package/build/lib/version-history/index.d.ts.map +1 -0
- package/build/lib/version-history/index.js +2 -0
- package/build/lib/version-history/index.js.map +1 -0
- package/build/lib/version-history/types.d.ts +64 -0
- package/build/lib/version-history/types.d.ts.map +1 -0
- package/build/lib/version-history/types.js +5 -0
- package/build/lib/version-history/types.js.map +1 -0
- package/build/lib/version-history/version-history.d.ts +85 -0
- package/build/lib/version-history/version-history.d.ts.map +1 -0
- package/build/lib/version-history/version-history.js +248 -0
- package/build/lib/version-history/version-history.js.map +1 -0
- package/build/project-data.d.ts +0 -1
- package/build/project-data.d.ts.map +1 -1
- package/build/sandbox.d.ts +2 -0
- package/build/sandbox.d.ts.map +1 -0
- package/build/sandbox.js +18 -0
- package/build/sandbox.js.map +1 -0
- package/build/singletons/debug.d.ts +1 -1
- package/build/singletons/debug.d.ts.map +1 -1
- package/build/singletons/debug.js +1 -1
- package/build/singletons/debug.js.map +1 -1
- package/build/template/components/CodeBlockEnhancer.d.ts +2 -0
- package/build/template/components/CodeBlockEnhancer.d.ts.map +1 -0
- package/build/template/components/CodeBlockEnhancer.jsx +175 -0
- package/build/template/components/CodeBlockEnhancer.jsx.map +1 -0
- package/build/template/components/HamburgerMenu.d.ts +9 -0
- package/build/template/components/HamburgerMenu.d.ts.map +1 -0
- package/build/template/components/HamburgerMenu.jsx +53 -0
- package/build/template/components/HamburgerMenu.jsx.map +1 -0
- package/build/template/components/Link.jsx +1 -1
- package/build/template/components/Logo.d.ts +9 -0
- package/build/template/components/Logo.d.ts.map +1 -0
- package/build/template/components/Logo.jsx +29 -0
- package/build/template/components/Logo.jsx.map +1 -0
- package/build/template/components/NotFound.d.ts +2 -0
- package/build/template/components/NotFound.d.ts.map +1 -0
- package/build/template/components/NotFound.jsx +26 -0
- package/build/template/components/NotFound.jsx.map +1 -0
- package/build/template/components/ThemeToggle.d.ts +3 -0
- package/build/template/components/ThemeToggle.d.ts.map +1 -0
- package/build/template/components/ThemeToggle.jsx +10 -0
- package/build/template/components/ThemeToggle.jsx.map +1 -0
- package/build/template/components/content/$$.d.ts +2 -0
- package/build/template/components/content/$$.d.ts.map +1 -0
- package/build/template/components/content/$$.js +2 -0
- package/build/template/components/content/$$.js.map +1 -0
- package/build/template/components/sidebar/Sidebar.d.ts +2 -2
- package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.d.ts +3 -3
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.jsx +3 -3
- package/build/template/components/sidebar/SidebarItem.jsx.map +1 -1
- package/build/template/contexts/ThemeContext.d.ts +12 -0
- package/build/template/contexts/ThemeContext.d.ts.map +1 -0
- package/build/template/contexts/ThemeContext.jsx +41 -0
- package/build/template/contexts/ThemeContext.jsx.map +1 -0
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/reference.jsx +4 -8
- package/build/template/routes/reference.jsx.map +1 -1
- package/build/template/routes/root.d.ts.map +1 -1
- package/build/template/routes/root.jsx +192 -55
- package/build/template/routes/root.jsx.map +1 -1
- package/build/template/server/app.d.ts.map +1 -1
- package/build/template/server/app.js +2 -21
- package/build/template/server/app.js.map +1 -1
- package/package.json +27 -13
- package/src/api/api.ts +1 -0
- package/src/api/config/configurator.ts +28 -6
- package/src/api/config/load.ts +5 -5
- package/src/api/config-resolver/resolve.ts +2 -2
- package/src/api/content/$$.ts +6 -0
- package/src/api/content/$.test.ts +72 -0
- package/src/api/content/$.ts +1 -0
- package/src/api/content/metadata.ts +11 -0
- package/src/api/content/navbar.test.ts +55 -0
- package/src/api/content/navbar.ts +61 -0
- package/src/api/content/page.ts +12 -0
- package/src/api/content/scan.ts +117 -0
- package/src/api/content/sidebar.test.ts +297 -0
- package/src/api/content/sidebar.ts +283 -0
- package/src/api/content/utils.ts +7 -0
- package/src/api/schema/data-sources/schema-directory/schema-directory.ts +1 -1
- package/src/api/singletons/markdown/markdown.test.ts +1 -1
- package/src/api/static/index.ts +1 -0
- package/src/api/static/manifest.test.ts +106 -0
- package/src/api/static/manifest.ts +16 -0
- package/src/api/static/rebase.test.ts +229 -0
- package/src/api/static/rebase.ts +140 -0
- package/src/api/static/static.ts +2 -0
- package/src/api/utils/asset-url/asset-url.test.ts +4 -4
- package/src/api/vite/plugins/branding/index.ts +108 -0
- package/src/api/vite/plugins/build.ts +25 -1
- package/src/api/vite/plugins/core.ts +6 -7
- package/src/api/vite/plugins/main.ts +2 -0
- package/src/api/vite/plugins/pages.ts +131 -207
- package/src/api/vite/plugins/serve.ts +5 -5
- package/src/cli/_/self-contained-mode.ts +5 -5
- package/src/cli/commands/static/$default.ts +43 -0
- package/src/cli/commands/static/rebase.ts +37 -0
- package/src/cli/commands/static.ts +6 -0
- package/src/exports/components.ts +1 -0
- package/src/lib/demos/builder.ts +298 -0
- package/src/lib/demos/config-schema.ts +56 -0
- package/src/lib/demos/config.test.ts +193 -0
- package/src/lib/demos/config.ts +205 -0
- package/src/lib/demos/index.ts +9 -0
- package/src/lib/demos/ui/components.ts +739 -0
- package/src/lib/demos/ui/data-collector.ts +246 -0
- package/src/lib/demos/ui/landing-page-cli.ts +23 -0
- package/src/lib/demos/ui/landing-page.ts +126 -0
- package/src/lib/demos/ui/page-renderer.ts +124 -0
- package/src/lib/demos/utils.ts +43 -0
- package/src/lib/deployment/$$.ts +2 -0
- package/src/lib/deployment/$.test.ts +53 -0
- package/src/lib/deployment/$.ts +1 -0
- package/src/lib/deployment/metadata.ts +40 -0
- package/src/lib/deployment/path-manager.ts +186 -0
- package/src/lib/file-router/file-router.ts +0 -2
- package/src/lib/file-router/linter.test.ts +2 -0
- package/src/lib/file-router/route.ts +2 -0
- package/src/lib/file-router/scan.ts +26 -14
- package/src/lib/github-actions/git-controller.ts +151 -0
- package/src/lib/github-actions/github-actions.ts +6 -0
- package/src/lib/github-actions/index.ts +1 -0
- package/src/lib/github-actions/lib/get-pr-deployments.ts +76 -0
- package/src/lib/github-actions/pr-controller.test.ts +172 -0
- package/src/lib/github-actions/pr-controller.ts +183 -0
- package/src/lib/github-actions/run-step-cli.ts +84 -0
- package/src/lib/github-actions/runner.test.ts +192 -0
- package/src/lib/github-actions/runner.ts +226 -0
- package/src/lib/github-actions/schemas/context.ts +424 -0
- package/src/lib/github-actions/schemas/index.ts +5 -0
- package/src/lib/github-actions/search-module.test.ts +110 -0
- package/src/lib/github-actions/search-module.ts +76 -0
- package/src/lib/github-actions/step.test.ts +149 -0
- package/src/lib/github-actions/step.ts +232 -0
- package/src/lib/helpers.ts +4 -3
- package/src/lib/kit-temp.test-d.ts +115 -0
- package/src/lib/kit-temp.test.ts +127 -0
- package/src/lib/kit-temp.ts +128 -14
- package/src/lib/mask/$$.ts +2 -0
- package/src/lib/mask/$.test.ts +248 -0
- package/src/lib/mask/$.ts +1 -0
- package/src/lib/mask/apply.ts +134 -0
- package/src/lib/mask/mask.test-d.ts +144 -0
- package/src/lib/mask/mask.ts +244 -0
- package/src/lib/mutation-type.ts +20 -0
- package/src/lib/shiki/shiki.test.ts +1 -1
- package/src/lib/task/$$.ts +2 -0
- package/src/lib/task/$.test.ts +209 -0
- package/src/lib/task/$.ts +1 -0
- package/src/lib/task/report.ts +72 -0
- package/src/lib/task/task.ts +112 -0
- package/src/lib/version-history/index.test.ts +196 -0
- package/src/lib/version-history/index.ts +4 -0
- package/src/lib/version-history/types.ts +68 -0
- package/src/lib/version-history/version-history.ts +293 -0
- package/src/project-data.ts +0 -1
- package/src/sandbox.ts +20 -0
- package/src/singletons/debug.ts +1 -1
- package/src/template/components/CodeBlockEnhancer.tsx +192 -0
- package/src/template/components/HamburgerMenu.tsx +96 -0
- package/src/template/components/Link.tsx +1 -1
- package/src/template/components/Logo.tsx +46 -0
- package/src/template/components/NotFound.tsx +28 -0
- package/src/template/components/ThemeToggle.tsx +21 -0
- package/src/template/components/content/$$.ts +1 -0
- package/src/template/components/sidebar/Sidebar.tsx +2 -2
- package/src/template/components/sidebar/SidebarItem.tsx +12 -12
- package/src/template/contexts/ThemeContext.tsx +60 -0
- package/src/template/routes/reference.tsx +4 -8
- package/src/template/routes/root.tsx +216 -76
- package/src/template/server/app.ts +2 -27
- package/build/lib/file-router/scan-tree.d.ts +0 -20
- package/build/lib/file-router/scan-tree.d.ts.map +0 -1
- package/build/lib/file-router/scan-tree.js +0 -158
- package/build/lib/file-router/scan-tree.js.map +0 -1
- package/build/lib/file-router/sidebar/index.d.ts +0 -3
- package/build/lib/file-router/sidebar/index.d.ts.map +0 -1
- package/build/lib/file-router/sidebar/index.js +0 -4
- package/build/lib/file-router/sidebar/index.js.map +0 -1
- package/build/lib/file-router/sidebar/sidebar-tree.d.ts +0 -9
- package/build/lib/file-router/sidebar/sidebar-tree.d.ts.map +0 -1
- package/build/lib/file-router/sidebar/sidebar-tree.js +0 -85
- package/build/lib/file-router/sidebar/sidebar-tree.js.map +0 -1
- package/build/lib/file-router/sidebar/types.d.ts +0 -17
- package/build/lib/file-router/sidebar/types.d.ts.map +0 -1
- package/build/lib/file-router/sidebar/types.js +0 -2
- package/build/lib/file-router/sidebar/types.js.map +0 -1
- package/build/lib/tree/index.d.ts +0 -3
- package/build/lib/tree/index.d.ts.map +0 -1
- package/build/lib/tree/index.js +0 -2
- package/build/lib/tree/index.js.map +0 -1
- package/build/lib/tree/tree.d.ts +0 -62
- package/build/lib/tree/tree.d.ts.map +0 -1
- package/build/lib/tree/tree.js +0 -134
- package/build/lib/tree/tree.js.map +0 -1
- package/src/lib/file-router/scan-tree.test.ts +0 -189
- package/src/lib/file-router/scan-tree.ts +0 -205
- package/src/lib/file-router/sidebar/index.ts +0 -3
- package/src/lib/file-router/sidebar/sidebar-tree.test.ts +0 -123
- package/src/lib/file-router/sidebar/sidebar-tree.ts +0 -110
- package/src/lib/file-router/sidebar/types.ts +0 -19
- package/src/lib/tree/index.ts +0 -2
- package/src/lib/tree/tree.test.ts +0 -117
- package/src/lib/tree/tree.ts +0 -183
@@ -1,24 +1,32 @@
|
|
1
|
-
import {
|
1
|
+
import type { Content } from '#api/content/$'
|
2
2
|
import type { ReactRouter } from '#dep/react-router/index'
|
3
|
+
import { GrafaidOld } from '#lib/grafaid-old/index'
|
3
4
|
import { createRoute } from '#lib/react-router-aid/react-router-aid'
|
4
|
-
import {
|
5
|
-
import { Box, Button, Grid, Heading, Text } from '@radix-ui/themes'
|
5
|
+
import { Box, Grid } from '@radix-ui/themes'
|
6
6
|
import { Flex, Theme } from '@radix-ui/themes'
|
7
7
|
import radixStylesUrl from '@radix-ui/themes/styles.css?url'
|
8
8
|
import { Arr } from '@wollybeard/kit'
|
9
|
+
import { useEffect, useState } from 'react'
|
9
10
|
import { Link as LinkReactRouter } from 'react-router'
|
10
11
|
import { Outlet, ScrollRestoration, useLocation } from 'react-router'
|
12
|
+
import logoSrc from 'virtual:polen/project/assets/logo.svg'
|
11
13
|
import PROJECT_DATA from 'virtual:polen/project/data.jsonsuper'
|
12
14
|
import projectDataNavbar from 'virtual:polen/project/data/navbar.jsonsuper'
|
13
|
-
import
|
14
|
-
import {
|
15
|
+
import projectPagesCatalog from 'virtual:polen/project/data/pages-catalog.jsonsuper'
|
16
|
+
import { routes } from 'virtual:polen/project/routes.jsx'
|
15
17
|
import { templateVariables } from 'virtual:polen/template/variables'
|
16
|
-
import {
|
18
|
+
import { HamburgerMenu } from '../components/HamburgerMenu.tsx'
|
19
|
+
import { Link } from '../components/Link.tsx'
|
20
|
+
import { Logo } from '../components/Logo.tsx'
|
21
|
+
import { NotFound } from '../components/NotFound.tsx'
|
22
|
+
import { CodeBlockEnhancer } from '../components/CodeBlockEnhancer.tsx'
|
17
23
|
import { Sidebar } from '../components/sidebar/Sidebar.tsx'
|
24
|
+
import { ThemeToggle } from '../components/ThemeToggle.tsx'
|
25
|
+
import { ThemeProvider, useTheme } from '../contexts/ThemeContext.tsx'
|
18
26
|
import entryClientUrl from '../entry.client.jsx?url'
|
19
|
-
import { changelog } from './changelog.
|
20
|
-
import { index } from './index.
|
21
|
-
import { reference } from './reference.
|
27
|
+
import { changelog } from './changelog.tsx'
|
28
|
+
import { index } from './index.tsx'
|
29
|
+
import { reference } from './reference.tsx'
|
22
30
|
|
23
31
|
// todo: not needed anymore because not using hono dev vite plugin right?
|
24
32
|
const reactRefreshPreamble = `
|
@@ -39,20 +47,15 @@ export const Component = () => {
|
|
39
47
|
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
40
48
|
<title>{templateVariables.title}</title>
|
41
49
|
{import.meta.env.DEV && <link rel='stylesheet' href={radixStylesUrl} />}
|
42
|
-
<link
|
43
|
-
|
44
|
-
|
45
|
-
sizes='256 x 256'
|
46
|
-
/>
|
47
|
-
<link
|
48
|
-
rel='icon'
|
49
|
-
href={faviconUrl(PROJECT_DATA.faviconPath + `?v=1`, PROJECT_DATA.basePath)}
|
50
|
-
sizes='any'
|
51
|
-
type='image/svg+xml'
|
52
|
-
/>
|
50
|
+
{/* <link rel='icon' type='image/svg+xml' href={assetUrl('/favicon.svg', PROJECT_DATA.basePath)} /> */}
|
51
|
+
{/* <link rel='manifest' href={assetUrl('/manifest.json', PROJECT_DATA.basePath)} /> */}
|
52
|
+
{/* <meta name='theme-color' content='#000000' /> */}
|
53
53
|
</head>
|
54
54
|
<body style={{ margin: 0 }}>
|
55
|
-
<
|
55
|
+
<ThemeProvider>
|
56
|
+
<Layout />
|
57
|
+
<CodeBlockEnhancer />
|
58
|
+
</ThemeProvider>
|
56
59
|
<ScrollRestoration />
|
57
60
|
{import.meta.env.DEV && <script type='module' src={entryClientUrl}></script>}
|
58
61
|
</body>
|
@@ -62,6 +65,13 @@ export const Component = () => {
|
|
62
65
|
|
63
66
|
const Layout = () => {
|
64
67
|
const location = useLocation()
|
68
|
+
const { appearance } = useTheme()
|
69
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
|
70
|
+
|
71
|
+
// Close mobile menu on route change
|
72
|
+
useEffect(() => {
|
73
|
+
setMobileMenuOpen(false)
|
74
|
+
}, [location.pathname])
|
65
75
|
|
66
76
|
// Determine if we should show sidebar based on current path
|
67
77
|
const getCurrentNavPathExp = (): string | null => {
|
@@ -75,97 +85,253 @@ const Layout = () => {
|
|
75
85
|
}
|
76
86
|
|
77
87
|
const currentNavPathExp = getCurrentNavPathExp()
|
78
|
-
const
|
88
|
+
const isReferencePage = currentNavPathExp === '/reference'
|
89
|
+
|
90
|
+
const sidebar = (() => {
|
91
|
+
if (isReferencePage && PROJECT_DATA.schema) {
|
92
|
+
// Build reference sidebar from schema types
|
93
|
+
const schema = PROJECT_DATA.schema.versions[0].after
|
94
|
+
const kindMap = GrafaidOld.getKindMap(schema)
|
95
|
+
|
96
|
+
const sidebarItems: Content.Item[] = []
|
97
|
+
const kindEntries = Object.entries(kindMap.list).filter(([_, types]) => types.length > 0)
|
98
|
+
|
99
|
+
for (const [title, types] of kindEntries) {
|
100
|
+
sidebarItems.push({
|
101
|
+
type: 'ItemSection' as const,
|
102
|
+
title,
|
103
|
+
pathExp: `reference-${title.toLowerCase()}`,
|
104
|
+
isLinkToo: false,
|
105
|
+
links: types.map(type => ({
|
106
|
+
type: 'ItemLink' as const,
|
107
|
+
title: type.name,
|
108
|
+
pathExp: `reference/${type.name}`,
|
109
|
+
})),
|
110
|
+
})
|
111
|
+
}
|
112
|
+
|
113
|
+
return { items: sidebarItems }
|
114
|
+
} else {
|
115
|
+
// Use regular page sidebar
|
116
|
+
return currentNavPathExp ? projectPagesCatalog.sidebarIndex[currentNavPathExp] || null : null
|
117
|
+
}
|
118
|
+
})()
|
119
|
+
|
79
120
|
const isShowSidebar = sidebar && sidebar.items.length > 0
|
80
121
|
|
81
122
|
const header = (
|
82
123
|
<Flex
|
83
124
|
gridArea={'header'}
|
84
125
|
align='center'
|
85
|
-
gap='8'
|
126
|
+
gap={{ initial: '4', md: '8' }}
|
86
127
|
pb='4'
|
87
|
-
mb='8'
|
128
|
+
mb={{ initial: '4', md: '8' }}
|
88
129
|
style={{
|
89
130
|
borderBottom: `1px solid var(--gray-3)`,
|
90
131
|
}}
|
91
132
|
>
|
133
|
+
{/* Mobile menu - only show when sidebar exists */}
|
134
|
+
{isShowSidebar && (
|
135
|
+
<HamburgerMenu
|
136
|
+
isOpen={mobileMenuOpen}
|
137
|
+
onToggle={() => setMobileMenuOpen(!mobileMenuOpen)}
|
138
|
+
onClose={() => setMobileMenuOpen(false)}
|
139
|
+
sidebarData={sidebar.items}
|
140
|
+
/>
|
141
|
+
)}
|
142
|
+
|
92
143
|
<LinkReactRouter
|
93
144
|
to='/'
|
94
145
|
style={{ color: `inherit`, textDecoration: `none` }}
|
95
146
|
>
|
96
|
-
<
|
97
|
-
<
|
98
|
-
|
99
|
-
{templateVariables.title}
|
100
|
-
</Text>
|
101
|
-
</Flex>
|
147
|
+
<Box display={{ initial: 'block', md: 'block' }}>
|
148
|
+
<Logo src={logoSrc} title={templateVariables.title} height={30} showTitle={true} />
|
149
|
+
</Box>
|
102
150
|
</LinkReactRouter>
|
103
|
-
<Flex direction='row' gap='4'>
|
151
|
+
<Flex direction='row' gap='4' style={{ flex: 1 }}>
|
104
152
|
{projectDataNavbar.map((item, key) => (
|
105
153
|
<Link key={key} color='gray' to={item.pathExp}>
|
106
154
|
{item.title}
|
107
155
|
</Link>
|
108
156
|
))}
|
109
157
|
</Flex>
|
158
|
+
<ThemeToggle />
|
110
159
|
</Flex>
|
111
160
|
)
|
112
161
|
|
113
162
|
return (
|
114
|
-
<Theme asChild>
|
163
|
+
<Theme asChild appearance={appearance}>
|
115
164
|
<Grid
|
116
|
-
width={{ initial: 'var(--container-4)' }}
|
117
|
-
|
165
|
+
width={{ initial: '100%', sm: '100%', md: 'var(--container-4)' }}
|
166
|
+
maxWidth='100vw'
|
167
|
+
areas={{
|
168
|
+
initial: "'header' 'content'",
|
169
|
+
sm: "'header' 'content'",
|
170
|
+
md:
|
171
|
+
"'header header header header header header header header' 'sidebar sidebar . content content content content content'",
|
172
|
+
}}
|
118
173
|
rows='min-content auto'
|
119
|
-
columns='repeat(8, 1fr)'
|
120
|
-
gapX='2'
|
121
|
-
my='8'
|
174
|
+
columns={{ initial: '1fr', sm: '1fr', md: 'repeat(8, 1fr)' }}
|
175
|
+
gapX={{ initial: '0', sm: '0', md: '2' }}
|
176
|
+
my={{ initial: '0', sm: '0', md: '8' }}
|
122
177
|
mx='auto'
|
178
|
+
px={{ initial: '4', sm: '4', md: '0' }}
|
179
|
+
py={{ initial: '4', sm: '4', md: '0' }}
|
123
180
|
>
|
124
181
|
<style>
|
125
182
|
{`
|
183
|
+
/* Import Inter font */
|
184
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
185
|
+
|
186
|
+
/* Typography improvements */
|
187
|
+
body {
|
188
|
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
189
|
+
-webkit-font-smoothing: antialiased;
|
190
|
+
-moz-osx-font-smoothing: grayscale;
|
191
|
+
text-rendering: optimizeLegibility;
|
192
|
+
font-feature-settings: 'kern', 'liga', 'calt', 'ss01', 'ss02';
|
193
|
+
}
|
194
|
+
|
195
|
+
/* Improved paragraph spacing */
|
196
|
+
.prose p {
|
197
|
+
line-height: 1.7;
|
198
|
+
margin-bottom: 1.25rem;
|
199
|
+
}
|
200
|
+
|
201
|
+
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
|
202
|
+
font-weight: 600;
|
203
|
+
letter-spacing: -0.02em;
|
204
|
+
margin-top: 2rem;
|
205
|
+
margin-bottom: 1rem;
|
206
|
+
}
|
207
|
+
|
208
|
+
.prose h1 { font-size: 2.25rem; line-height: 1.2; }
|
209
|
+
.prose h2 { font-size: 1.875rem; line-height: 1.3; }
|
210
|
+
.prose h3 { font-size: 1.5rem; line-height: 1.4; }
|
211
|
+
.prose h4 { font-size: 1.25rem; line-height: 1.5; }
|
212
|
+
|
213
|
+
.prose ul, .prose ol {
|
214
|
+
margin-bottom: 1.25rem;
|
215
|
+
padding-left: 1.5rem;
|
216
|
+
}
|
217
|
+
|
218
|
+
.prose li {
|
219
|
+
margin-bottom: 0.5rem;
|
220
|
+
line-height: 1.7;
|
221
|
+
}
|
222
|
+
|
223
|
+
.prose a {
|
224
|
+
color: var(--accent-9);
|
225
|
+
text-decoration: none;
|
226
|
+
border-bottom: 1px solid transparent;
|
227
|
+
transition: border-color 0.2s;
|
228
|
+
}
|
229
|
+
|
230
|
+
.prose a:hover {
|
231
|
+
border-bottom-color: var(--accent-9);
|
232
|
+
}
|
233
|
+
|
234
|
+
.prose blockquote {
|
235
|
+
border-left: 4px solid var(--accent-6);
|
236
|
+
padding-left: 1rem;
|
237
|
+
margin-left: 0;
|
238
|
+
font-style: italic;
|
239
|
+
color: var(--gray-11);
|
240
|
+
}
|
241
|
+
|
242
|
+
/* Responsive container fixes */
|
243
|
+
@media (max-width: 768px) {
|
244
|
+
body {
|
245
|
+
overflow-x: hidden;
|
246
|
+
}
|
247
|
+
}
|
248
|
+
|
249
|
+
/* Ensure proper centering on all screen sizes */
|
250
|
+
.rt-Grid {
|
251
|
+
box-sizing: border-box;
|
252
|
+
}
|
253
|
+
|
126
254
|
/* Shiki code blocks */
|
127
255
|
pre.shiki {
|
128
|
-
margin:
|
256
|
+
margin: 0;
|
129
257
|
padding: 1rem;
|
130
258
|
border-radius: 8px;
|
131
259
|
overflow-x: auto;
|
132
260
|
font-size: 14px;
|
133
261
|
line-height: 1.6;
|
134
262
|
background-color: #f6f8fa;
|
263
|
+
border: 1px solid var(--gray-4);
|
135
264
|
}
|
136
|
-
|
265
|
+
|
137
266
|
/* Light mode: use --shiki-light CSS variables from inline styles */
|
138
267
|
pre.shiki span {
|
139
268
|
color: var(--shiki-light);
|
140
269
|
}
|
141
|
-
|
270
|
+
|
142
271
|
/* Dark mode - Radix Themes uses [data-is-root-theme="dark"] */
|
143
272
|
[data-is-root-theme="dark"] pre.shiki {
|
144
273
|
background-color: #1a1b26;
|
274
|
+
border-color: var(--gray-7);
|
145
275
|
}
|
146
|
-
|
276
|
+
|
147
277
|
[data-is-root-theme="dark"] pre.shiki span {
|
148
278
|
color: var(--shiki-dark);
|
149
279
|
}
|
150
|
-
|
280
|
+
|
151
281
|
pre.shiki code {
|
152
282
|
font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
|
153
283
|
background: transparent;
|
154
284
|
display: block;
|
155
285
|
}
|
286
|
+
|
287
|
+
/* Inline code */
|
288
|
+
.prose code:not(pre code) {
|
289
|
+
background-color: var(--gray-3);
|
290
|
+
padding: 0.125rem 0.25rem;
|
291
|
+
border-radius: 0.25rem;
|
292
|
+
font-size: 0.875em;
|
293
|
+
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
294
|
+
}
|
295
|
+
|
296
|
+
/* Tables */
|
297
|
+
.prose table {
|
298
|
+
width: 100%;
|
299
|
+
border-collapse: collapse;
|
300
|
+
margin-bottom: 1.5rem;
|
301
|
+
}
|
302
|
+
|
303
|
+
.prose th {
|
304
|
+
background-color: var(--gray-3);
|
305
|
+
font-weight: 600;
|
306
|
+
text-align: left;
|
307
|
+
padding: 0.75rem;
|
308
|
+
border-bottom: 2px solid var(--gray-5);
|
309
|
+
}
|
310
|
+
|
311
|
+
.prose td {
|
312
|
+
padding: 0.75rem;
|
313
|
+
border-bottom: 1px solid var(--gray-4);
|
314
|
+
}
|
315
|
+
|
316
|
+
.prose tbody tr:last-child td {
|
317
|
+
border-bottom: none;
|
318
|
+
}
|
156
319
|
`}
|
157
320
|
</style>
|
158
321
|
{header}
|
322
|
+
|
323
|
+
{/* Desktop Sidebar */}
|
159
324
|
{isShowSidebar && (
|
160
|
-
<
|
325
|
+
<Box
|
326
|
+
display={{ initial: 'none', xs: 'none', sm: 'none', md: 'block' }}
|
161
327
|
gridColumn='1 / 3'
|
162
328
|
gridRow='2 / auto'
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
/>
|
329
|
+
>
|
330
|
+
<Sidebar data={sidebar.items} />
|
331
|
+
</Box>
|
167
332
|
)}
|
168
|
-
|
333
|
+
|
334
|
+
<Box gridArea='content / content / auto / 8' className="prose">
|
169
335
|
<Outlet />
|
170
336
|
</Box>
|
171
337
|
</Grid>
|
@@ -175,7 +341,7 @@ const Layout = () => {
|
|
175
341
|
|
176
342
|
const children: ReactRouter.RouteObject[] = [
|
177
343
|
index,
|
178
|
-
...
|
344
|
+
...routes,
|
179
345
|
]
|
180
346
|
|
181
347
|
//
|
@@ -201,36 +367,10 @@ if (PROJECT_DATA.schema) {
|
|
201
367
|
//
|
202
368
|
//
|
203
369
|
|
204
|
-
const NotFoundComponent = () => {
|
205
|
-
return (
|
206
|
-
<Flex direction='column' align='center' gap='6' style={{ textAlign: `center`, paddingTop: `4rem` }}>
|
207
|
-
<Heading size='9' style={{ color: `var(--gray-12)` }}>404</Heading>
|
208
|
-
<Box>
|
209
|
-
<Heading size='5' mb='2'>Page Not Found</Heading>
|
210
|
-
<Text size='3' color='gray'>
|
211
|
-
The page you're looking for doesn't exist or has been moved.
|
212
|
-
</Text>
|
213
|
-
</Box>
|
214
|
-
<Flex gap='3'>
|
215
|
-
<LinkReactRouter to='/'>
|
216
|
-
<Button variant='soft' size='3'>
|
217
|
-
Go Home
|
218
|
-
</Button>
|
219
|
-
</LinkReactRouter>
|
220
|
-
<LinkReactRouter to='/reference'>
|
221
|
-
<Button variant='outline' size='3'>
|
222
|
-
View API Reference
|
223
|
-
</Button>
|
224
|
-
</LinkReactRouter>
|
225
|
-
</Flex>
|
226
|
-
</Flex>
|
227
|
-
)
|
228
|
-
}
|
229
|
-
|
230
370
|
const notFoundRoute = createRoute({
|
231
371
|
id: `*_not_found`,
|
232
372
|
path: `*`,
|
233
|
-
Component:
|
373
|
+
Component: NotFound,
|
234
374
|
handle: {
|
235
375
|
statusCode: 404,
|
236
376
|
},
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import { Hono } from '#dep/hono/index'
|
2
|
-
// import { Hono } from '../../dep/hono/index.ts'
|
3
|
-
|
4
2
|
import { AppleTouchIcon } from '#lib/apple-touch-icon/index'
|
5
3
|
import { Favicon } from '#lib/favicon/index'
|
6
4
|
import { serveStatic } from '@hono/node-server/serve-static'
|
7
|
-
import {
|
5
|
+
import { Http } from '@wollybeard/kit'
|
8
6
|
import PROJECT_DATA from 'virtual:polen/project/data.jsonsuper'
|
9
7
|
import { renderPage } from './render-page.jsx'
|
10
8
|
import { view } from './view.ts'
|
@@ -18,36 +16,13 @@ if (__BUILDING__) {
|
|
18
16
|
)
|
19
17
|
}
|
20
18
|
|
21
|
-
app.
|
19
|
+
app.all(`*`, async (ctx) => {
|
22
20
|
const staticHandlerContext = await view.query(ctx.req.raw)
|
23
21
|
|
24
22
|
if (staticHandlerContext instanceof Response) {
|
25
23
|
return staticHandlerContext
|
26
24
|
}
|
27
25
|
|
28
|
-
if (
|
29
|
-
ctx.req.path.includes(PROJECT_DATA.faviconPath)
|
30
|
-
|| ctx.req.path.includes(PROJECT_DATA.faviconPath.replace(`.svg`, `.ico`))
|
31
|
-
) {
|
32
|
-
const path = ctx.req.path === PROJECT_DATA.faviconPath
|
33
|
-
? PROJECT_DATA.faviconPath
|
34
|
-
: PROJECT_DATA.faviconPath.replace(`.svg`, `.ico`)
|
35
|
-
const faviconPath = Path.join(import.meta.dirname, `../../assets`, path)
|
36
|
-
const favicon = await Fs.read(faviconPath)
|
37
|
-
return new Response(favicon, {
|
38
|
-
headers: [
|
39
|
-
Http.Headers.contentType(
|
40
|
-
path.endsWith(`.ico`) ? `image/x-icon` : `image/svg+xml`,
|
41
|
-
),
|
42
|
-
Http.Headers.responseCacheControl({
|
43
|
-
visibility: `public`,
|
44
|
-
maxAge: 31536000,
|
45
|
-
immutable: true,
|
46
|
-
}),
|
47
|
-
],
|
48
|
-
})
|
49
|
-
}
|
50
|
-
|
51
26
|
if (Favicon.fileNamePattern.test(ctx.req.path)) {
|
52
27
|
return Http.Response.notFound
|
53
28
|
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { type TreeNode } from '#lib/tree/index';
|
2
|
-
import type { Diagnostic } from './linter.ts';
|
3
|
-
import type { Route } from './route.ts';
|
4
|
-
export type RouteTreeNodeType = 'directory' | 'file';
|
5
|
-
export interface RouteTreeNodeValue {
|
6
|
-
name: string;
|
7
|
-
order?: number;
|
8
|
-
type: RouteTreeNodeType;
|
9
|
-
route?: Route;
|
10
|
-
}
|
11
|
-
export type RouteTreeNode = TreeNode<RouteTreeNodeValue>;
|
12
|
-
export interface ScanTreeResult {
|
13
|
-
routeTree: RouteTreeNode;
|
14
|
-
diagnostics: Diagnostic[];
|
15
|
-
}
|
16
|
-
export declare const scanTree: (parameters: {
|
17
|
-
dir: string;
|
18
|
-
glob?: string;
|
19
|
-
}) => Promise<ScanTreeResult>;
|
20
|
-
//# sourceMappingURL=scan-tree.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scan-tree.d.ts","sourceRoot":"","sources":["../../../src/lib/file-router/scan-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAa,MAAM,YAAY,CAAA;AAMlD,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,MAAM,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,iBAAiB,CAAA;IACvB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAA;AAExD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,aAAa,CAAA;IACxB,WAAW,EAAE,UAAU,EAAE,CAAA;CAC1B;AAkID,eAAO,MAAM,QAAQ,GAAU,YAAY;IACzC,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,KAAG,OAAO,CAAC,cAAc,CAoBzB,CAAA"}
|
@@ -1,158 +0,0 @@
|
|
1
|
-
import { TinyGlobby } from '#dep/tiny-globby/index';
|
2
|
-
import { Tree } from '#lib/tree/index';
|
3
|
-
import { Path, Str } from '@wollybeard/kit';
|
4
|
-
//
|
5
|
-
// Constants
|
6
|
-
//
|
7
|
-
const conventions = {
|
8
|
-
index: {
|
9
|
-
name: `index`,
|
10
|
-
},
|
11
|
-
numberedPrefix: {
|
12
|
-
pattern: Str.pattern(/^(?<order>\d+)[_-](?<name>.+)$/),
|
13
|
-
},
|
14
|
-
};
|
15
|
-
//
|
16
|
-
// Helpers
|
17
|
-
//
|
18
|
-
const parseSegment = (segment) => {
|
19
|
-
const match = Str.match(segment, conventions.numberedPrefix.pattern);
|
20
|
-
if (match) {
|
21
|
-
return {
|
22
|
-
name: match.groups.name,
|
23
|
-
order: parseInt(match.groups.order, 10),
|
24
|
-
};
|
25
|
-
}
|
26
|
-
return { name: segment };
|
27
|
-
};
|
28
|
-
const buildRouteTreeFromPaths = async (paths, rootDir) => {
|
29
|
-
// Root node (represents the pages directory itself)
|
30
|
-
const root = Tree.node({
|
31
|
-
name: 'root',
|
32
|
-
type: 'directory',
|
33
|
-
});
|
34
|
-
// Process each file path
|
35
|
-
for (const filePath of paths) {
|
36
|
-
const relativePath = Path.relative(rootDir, filePath);
|
37
|
-
// Split the path into segments
|
38
|
-
const segments = relativePath.split(Path.sep).filter(s => s.length > 0);
|
39
|
-
if (segments.length === 0)
|
40
|
-
continue; // Skip root directory
|
41
|
-
// Navigate/create path in tree
|
42
|
-
let currentNode = root;
|
43
|
-
for (let i = 0; i < segments.length; i++) {
|
44
|
-
const segment = segments[i];
|
45
|
-
const isLast = i === segments.length - 1;
|
46
|
-
// Parse segment for ordering
|
47
|
-
let segmentName = segment;
|
48
|
-
// Strip extension for files
|
49
|
-
if (isLast && (segment.endsWith('.md') || segment.endsWith('.mdx'))) {
|
50
|
-
segmentName = segment.replace(/\.(md|mdx)$/, '');
|
51
|
-
}
|
52
|
-
const parsed = parseSegment(segmentName);
|
53
|
-
// Find existing child
|
54
|
-
const existingChildIndex = currentNode.children.findIndex(child => child.value.name === parsed.name);
|
55
|
-
let childNode = existingChildIndex >= 0 ? currentNode.children[existingChildIndex] : undefined;
|
56
|
-
if (!childNode) {
|
57
|
-
// Create new node
|
58
|
-
if (isLast) {
|
59
|
-
// This is a file
|
60
|
-
const route = filePathToRoute(filePath, rootDir);
|
61
|
-
childNode = Tree.node({
|
62
|
-
name: parsed.name,
|
63
|
-
order: parsed.order,
|
64
|
-
type: 'file',
|
65
|
-
route,
|
66
|
-
});
|
67
|
-
}
|
68
|
-
else {
|
69
|
-
// This is a directory (implicit from file path)
|
70
|
-
childNode = Tree.node({
|
71
|
-
name: parsed.name,
|
72
|
-
order: parsed.order,
|
73
|
-
type: 'directory',
|
74
|
-
});
|
75
|
-
}
|
76
|
-
currentNode.children.push(childNode);
|
77
|
-
}
|
78
|
-
else if (isLast && childNode.value.type === 'file') {
|
79
|
-
// Handle collision for files with same name
|
80
|
-
// If new file has higher or equal order, replace the existing one (last wins for ties)
|
81
|
-
if (parsed.order !== undefined
|
82
|
-
&& (childNode.value.order === undefined || parsed.order >= childNode.value.order)) {
|
83
|
-
const route = filePathToRoute(filePath, rootDir);
|
84
|
-
const newNode = Tree.node({
|
85
|
-
name: parsed.name,
|
86
|
-
order: parsed.order,
|
87
|
-
type: 'file',
|
88
|
-
route,
|
89
|
-
});
|
90
|
-
currentNode.children[existingChildIndex] = newNode;
|
91
|
-
childNode = newNode;
|
92
|
-
}
|
93
|
-
// Otherwise keep the existing node (when existing has higher order)
|
94
|
-
}
|
95
|
-
currentNode = childNode;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
// Sort the tree
|
99
|
-
return sortRouteTree(root);
|
100
|
-
};
|
101
|
-
const sortRouteTree = (tree) => {
|
102
|
-
return Tree.sort(tree, (a, b) => {
|
103
|
-
// If both have orders, sort by order
|
104
|
-
if (a.order !== undefined && b.order !== undefined) {
|
105
|
-
return a.order - b.order;
|
106
|
-
}
|
107
|
-
// If only one has order, it comes first
|
108
|
-
if (a.order !== undefined)
|
109
|
-
return -1;
|
110
|
-
if (b.order !== undefined)
|
111
|
-
return 1;
|
112
|
-
// Otherwise sort alphabetically
|
113
|
-
return a.name.localeCompare(b.name);
|
114
|
-
});
|
115
|
-
};
|
116
|
-
//
|
117
|
-
// Main scan function
|
118
|
-
//
|
119
|
-
export const scanTree = async (parameters) => {
|
120
|
-
const { dir, glob = `**/*` } = parameters;
|
121
|
-
// Get all files
|
122
|
-
const filePaths = await TinyGlobby.glob(glob, {
|
123
|
-
absolute: true,
|
124
|
-
cwd: dir,
|
125
|
-
onlyFiles: true,
|
126
|
-
});
|
127
|
-
// Build tree structure (directories will be created implicitly)
|
128
|
-
const routeTree = await buildRouteTreeFromPaths(filePaths, dir);
|
129
|
-
// TODO: Implement tree-based linting
|
130
|
-
const diagnostics = [];
|
131
|
-
return {
|
132
|
-
routeTree,
|
133
|
-
diagnostics,
|
134
|
-
};
|
135
|
-
};
|
136
|
-
// Reuse existing route creation logic
|
137
|
-
const filePathToRoute = (filePathExpression, rootDir) => {
|
138
|
-
const file = {
|
139
|
-
path: {
|
140
|
-
absolute: Path.parse(filePathExpression),
|
141
|
-
relative: Path.parse(Path.relative(rootDir, filePathExpression)),
|
142
|
-
},
|
143
|
-
};
|
144
|
-
const dirPath = Str.split(Str.removeSurrounding(file.path.relative.dir, Path.sep), Path.sep);
|
145
|
-
// Parse numbered prefix from filename
|
146
|
-
const prefixMatch = file.path.relative.name.match(conventions.numberedPrefix.pattern);
|
147
|
-
const order = prefixMatch?.groups?.[`order`] ? parseInt(prefixMatch.groups[`order`], 10) : undefined;
|
148
|
-
const nameWithoutPrefix = prefixMatch?.groups?.[`name`] ?? file.path.relative.name;
|
149
|
-
const logical = {
|
150
|
-
path: nameWithoutPrefix === conventions.index.name ? dirPath : dirPath.concat(nameWithoutPrefix),
|
151
|
-
order,
|
152
|
-
};
|
153
|
-
return {
|
154
|
-
logical,
|
155
|
-
file,
|
156
|
-
};
|
157
|
-
};
|
158
|
-
//# sourceMappingURL=scan-tree.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"scan-tree.js","sourceRoot":"","sources":["../../../src/lib/file-router/scan-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAiB,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAwB3C,EAAE;AACF,YAAY;AACZ,EAAE;AAEF,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;KACd;IACD,cAAc,EAAE;QACd,OAAO,EAAE,GAAG,CAAC,OAAO,CAAgC,gCAAgC,CAAC;KACtF;CACF,CAAA;AAED,EAAE;AACF,UAAU;AACV,EAAE;AAEF,MAAM,YAAY,GAAG,CAAC,OAAe,EAAoC,EAAE;IACzE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,cA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AQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IACrF,MAAM,KAAK,GAAG,WAAW,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACpG,MAAM,iBAAiB,GAAG,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAA;IAElF,MAAM,OAAO,GAAG;QACd,IAAI,EAAE,iBAAiB,KAAK,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;QAChG,KAAK;KACN,CAAA;IAED,OAAO;QACL,OAAO;QACP,IAAI;KACL,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/file-router/sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAEhD,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/file-router/sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,8DAA8D;AAC9D,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAA"}
|