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,9 +1,9 @@
|
|
1
1
|
import type { Vite } from '#dep/vite/index'
|
2
2
|
import { assertPathAbsolute } from '#lib/kit-temp'
|
3
|
+
import { type PackagePaths, packagePaths } from '#package-paths'
|
3
4
|
import { Path } from '@wollybeard/kit'
|
4
5
|
import { z } from 'zod'
|
5
6
|
import type { SchemaAugmentation } from '../../api/schema-augmentation/index.ts'
|
6
|
-
import { type PackagePaths, packagePaths } from '../../package-paths.ts'
|
7
7
|
import type { Schema } from '../schema/index.ts'
|
8
8
|
|
9
9
|
export const BuildArchitectureEnum = {
|
@@ -124,7 +124,13 @@ export interface TemplateVariables {
|
|
124
124
|
|
125
125
|
const buildPaths = (rootDir: string): Config[`paths`] => {
|
126
126
|
if (!Path.isAbsolute(rootDir)) throw new Error(`Root dir path must be absolute: ${rootDir}`)
|
127
|
-
const
|
127
|
+
const rootAbsolute = Path.ensureAbsoluteWith(rootDir)
|
128
|
+
|
129
|
+
const buildAbsolutePath = rootAbsolute(`build`)
|
130
|
+
const buildAbsolute = Path.ensureAbsoluteWith(buildAbsolutePath)
|
131
|
+
|
132
|
+
const publicAbsolutePath = rootAbsolute(`public`)
|
133
|
+
const publicAbsolute = Path.ensureAbsoluteWith(publicAbsolutePath)
|
128
134
|
return {
|
129
135
|
project: {
|
130
136
|
rootDir,
|
@@ -137,14 +143,22 @@ const buildPaths = (rootDir: string): Config[`paths`] => {
|
|
137
143
|
},
|
138
144
|
},
|
139
145
|
pages: `pages`,
|
146
|
+
public: {
|
147
|
+
root: 'public',
|
148
|
+
logo: 'logo.svg',
|
149
|
+
},
|
140
150
|
},
|
141
151
|
absolute: {
|
152
|
+
pages: rootAbsolute(`pages`),
|
142
153
|
build: {
|
143
|
-
root:
|
144
|
-
serverEntrypoint:
|
145
|
-
assets:
|
154
|
+
root: buildAbsolute('.'),
|
155
|
+
serverEntrypoint: buildAbsolute(`app.js`),
|
156
|
+
assets: buildAbsolute(`assets`),
|
157
|
+
},
|
158
|
+
public: {
|
159
|
+
root: publicAbsolute('.'),
|
160
|
+
logo: publicAbsolute('logo.svg'),
|
146
161
|
},
|
147
|
-
pages: ensureAbsolute(`pages`),
|
148
162
|
},
|
149
163
|
},
|
150
164
|
framework: packagePaths,
|
@@ -178,6 +192,10 @@ export interface Config {
|
|
178
192
|
}
|
179
193
|
}
|
180
194
|
pages: string
|
195
|
+
public: {
|
196
|
+
root: string
|
197
|
+
logo: string
|
198
|
+
}
|
181
199
|
}
|
182
200
|
absolute: {
|
183
201
|
build: {
|
@@ -186,6 +204,10 @@ export interface Config {
|
|
186
204
|
serverEntrypoint: string
|
187
205
|
}
|
188
206
|
pages: string
|
207
|
+
public: {
|
208
|
+
root: string
|
209
|
+
logo: string
|
210
|
+
}
|
189
211
|
}
|
190
212
|
}
|
191
213
|
framework: PackagePaths
|
package/src/api/config/load.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { SelfContainedModeHooksData } from '#cli/_/self-contained-mode'
|
2
2
|
import { assertOptionalPathAbsolute, pickFirstPathExisting } from '#lib/kit-temp'
|
3
3
|
import { packagePaths } from '#package-paths'
|
4
|
-
import {
|
4
|
+
import { debugPolen } from '#singletons/debug'
|
5
5
|
import type { Prom } from '@wollybeard/kit'
|
6
6
|
import { Path } from '@wollybeard/kit'
|
7
7
|
import * as Module from 'node:module'
|
@@ -20,7 +20,7 @@ export interface LoadOptions {
|
|
20
20
|
let isSelfContainedModeRegistered = false
|
21
21
|
|
22
22
|
export const load = async (options: LoadOptions): Promise<ConfigInput> => {
|
23
|
-
const
|
23
|
+
const debug = debugPolen.sub(`load`)
|
24
24
|
assertOptionalPathAbsolute(options.dir)
|
25
25
|
|
26
26
|
//
|
@@ -35,7 +35,7 @@ export const load = async (options: LoadOptions): Promise<ConfigInput> => {
|
|
35
35
|
const initializeData: SelfContainedModeHooksData = {
|
36
36
|
projectDirPathExp: options.dir,
|
37
37
|
}
|
38
|
-
|
38
|
+
debug(`register node module hooks`, { data: initializeData })
|
39
39
|
// TODO: would be simpler to use sync hooks
|
40
40
|
// https://nodejs.org/api/module.html#synchronous-hooks-accepted-by-moduleregisterhooks
|
41
41
|
// Requires NodeJS 22.15+ -- which is not working with PW until its next release.
|
@@ -67,7 +67,7 @@ export const load = async (options: LoadOptions): Promise<ConfigInput> => {
|
|
67
67
|
// eslint-disable-next-line
|
68
68
|
module = await import(filePath)
|
69
69
|
}
|
70
|
-
|
70
|
+
debug(`imported config module`)
|
71
71
|
|
72
72
|
// // Use dynamic import with file URL to support Windows
|
73
73
|
// const configUrl = pathToFileURL(configPath).href
|
@@ -97,7 +97,7 @@ export const load = async (options: LoadOptions): Promise<ConfigInput> => {
|
|
97
97
|
configInput.advanced.isSelfContainedMode = true
|
98
98
|
}
|
99
99
|
|
100
|
-
|
100
|
+
debug(`loaded config input`, configInput)
|
101
101
|
|
102
102
|
return configInput
|
103
103
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { debugPolen } from '#singletons/debug'
|
2
2
|
import { type ConfigInput, normalizeInput } from '../config/configurator.ts'
|
3
3
|
import { load, type LoadOptions } from '../config/load.ts'
|
4
4
|
import { mergeInputs } from '../config/merge.ts'
|
@@ -12,7 +12,7 @@ export const fromFile = async (options: ResolveFromFileOptions): Promise<ViteUse
|
|
12
12
|
const configInput = await load(options)
|
13
13
|
const configInputMerged = mergeInputs(configInput, options.overrides)
|
14
14
|
const config = await fromMemory(configInputMerged, options.dir)
|
15
|
-
|
15
|
+
debugPolen(`resolved config`, config)
|
16
16
|
return config
|
17
17
|
}
|
18
18
|
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import { Fs, Path } from '@wollybeard/kit'
|
2
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
3
|
+
import { Content } from './$.ts'
|
4
|
+
|
5
|
+
describe('content', () => {
|
6
|
+
let testDir: string
|
7
|
+
|
8
|
+
beforeEach(async () => {
|
9
|
+
testDir = await Fs.makeTemporaryDirectory()
|
10
|
+
})
|
11
|
+
|
12
|
+
afterEach(async () => {
|
13
|
+
if (testDir && await Fs.exists(testDir)) {
|
14
|
+
await Fs.remove(testDir)
|
15
|
+
}
|
16
|
+
})
|
17
|
+
|
18
|
+
describe('MetadataSchema', () => {
|
19
|
+
test('validates metadata correctly', () => {
|
20
|
+
const valid = Content.MetadataSchema.safeParse({
|
21
|
+
description: 'Test page description',
|
22
|
+
hidden: true,
|
23
|
+
})
|
24
|
+
expect(valid.success).toBe(true)
|
25
|
+
expect(valid.data).toEqual({
|
26
|
+
description: 'Test page description',
|
27
|
+
hidden: true,
|
28
|
+
})
|
29
|
+
})
|
30
|
+
|
31
|
+
test('applies default values', () => {
|
32
|
+
const result = Content.MetadataSchema.safeParse({
|
33
|
+
description: 'Just a description',
|
34
|
+
})
|
35
|
+
expect(result.success).toBe(true)
|
36
|
+
expect(result.data?.hidden).toBe(false)
|
37
|
+
})
|
38
|
+
|
39
|
+
test('rejects invalid values', () => {
|
40
|
+
const result = Content.MetadataSchema.safeParse({
|
41
|
+
hidden: 'not a boolean',
|
42
|
+
invalid_field: 123,
|
43
|
+
})
|
44
|
+
expect(result.success).toBe(false)
|
45
|
+
})
|
46
|
+
})
|
47
|
+
|
48
|
+
describe('scan', () => {
|
49
|
+
test('scans directory and extracts metadata', async () => {
|
50
|
+
const filePath = Path.join(testDir, 'page.md')
|
51
|
+
await Fs.write({
|
52
|
+
path: filePath,
|
53
|
+
content: `---
|
54
|
+
description: Page description
|
55
|
+
---
|
56
|
+
Content`,
|
57
|
+
})
|
58
|
+
|
59
|
+
const result = await Content.scan({
|
60
|
+
dir: testDir,
|
61
|
+
glob: '**/*.md',
|
62
|
+
})
|
63
|
+
|
64
|
+
expect(result.list).toHaveLength(1)
|
65
|
+
expect(result.list[0]?.metadata).toEqual({
|
66
|
+
description: 'Page description',
|
67
|
+
hidden: false,
|
68
|
+
})
|
69
|
+
expect(result.diagnostics).toEqual([])
|
70
|
+
})
|
71
|
+
})
|
72
|
+
})
|
@@ -0,0 +1 @@
|
|
1
|
+
export * as Content from './$$.ts'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { z } from 'zod/v4'
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Schema for validating front matter content
|
5
|
+
*/
|
6
|
+
export const MetadataSchema = z.object({
|
7
|
+
description: z.string().optional(),
|
8
|
+
hidden: z.boolean().default(false),
|
9
|
+
})
|
10
|
+
|
11
|
+
export type Metadata = z.infer<typeof MetadataSchema>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
2
|
+
import { createNavbar } from './navbar.ts'
|
3
|
+
import type { Page } from './page.ts'
|
4
|
+
|
5
|
+
const createPage = (path: string[], fileName = 'index', hidden = false): Page => ({
|
6
|
+
route: {
|
7
|
+
id: path.join('/'),
|
8
|
+
parentId: path.length > 1 ? path.slice(0, -1).join('/') : null,
|
9
|
+
logical: { path },
|
10
|
+
file: {
|
11
|
+
path: {
|
12
|
+
absolute: { root: '/', dir: `/pages/${path.join('/')}`, base: `${fileName}.md`, ext: '.md', name: fileName },
|
13
|
+
relative: { root: '', dir: path.join('/'), base: `${fileName}.md`, ext: '.md', name: fileName },
|
14
|
+
},
|
15
|
+
},
|
16
|
+
},
|
17
|
+
metadata: { description: undefined, hidden },
|
18
|
+
})
|
19
|
+
|
20
|
+
describe('createNavbar', () => {
|
21
|
+
it('returns empty for empty input', () => {
|
22
|
+
expect(createNavbar([])).toEqual([])
|
23
|
+
})
|
24
|
+
|
25
|
+
it('excludes hidden pages', () => {
|
26
|
+
const pages = [createPage(['visible'], 'index', false), createPage(['hidden'], 'index', true)]
|
27
|
+
const result = createNavbar(pages)
|
28
|
+
expect(result).toEqual([{ pathExp: '/visible', title: 'Visible' }])
|
29
|
+
})
|
30
|
+
|
31
|
+
it('includes directories with index pages', () => {
|
32
|
+
const pages = [createPage(['guide'], 'index'), createPage(['guide', 'intro'], 'intro')]
|
33
|
+
const result = createNavbar(pages)
|
34
|
+
expect(result).toEqual([{ pathExp: '/guide', title: 'Guide' }])
|
35
|
+
})
|
36
|
+
|
37
|
+
it('excludes directories without index pages', () => {
|
38
|
+
const pages = [createPage(['guide', 'intro'], 'intro')]
|
39
|
+
const result = createNavbar(pages)
|
40
|
+
expect(result).toEqual([])
|
41
|
+
})
|
42
|
+
|
43
|
+
it('includes single top-level pages', () => {
|
44
|
+
const pages = [createPage(['about'], 'about')]
|
45
|
+
const result = createNavbar(pages)
|
46
|
+
expect(result).toEqual([{ pathExp: '/about', title: 'About' }])
|
47
|
+
})
|
48
|
+
|
49
|
+
it('sorts results alphabetically', () => {
|
50
|
+
const pages = [createPage(['zebra'], 'zebra'), createPage(['alpha'], 'alpha')]
|
51
|
+
const result = createNavbar(pages)
|
52
|
+
expect(result[0]!.title).toBe('Alpha')
|
53
|
+
expect(result[1]!.title).toBe('Zebra')
|
54
|
+
})
|
55
|
+
})
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { Str } from '@wollybeard/kit'
|
2
|
+
import type { Page } from './page.ts'
|
3
|
+
|
4
|
+
export interface NavbarItem {
|
5
|
+
pathExp: string
|
6
|
+
title: string
|
7
|
+
}
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Generate navbar items from a list of pages
|
11
|
+
*/
|
12
|
+
export const createNavbar = (pages: Page[]): NavbarItem[] => {
|
13
|
+
const navbarItems: NavbarItem[] = []
|
14
|
+
|
15
|
+
// Group pages by their top-level directory/segment
|
16
|
+
const topLevelGroups = new Map<string, Page[]>()
|
17
|
+
|
18
|
+
pages.forEach(page => {
|
19
|
+
// Skip hidden pages
|
20
|
+
if (page.metadata.hidden) return
|
21
|
+
|
22
|
+
const firstSegment = page.route.logical.path[0]
|
23
|
+
if (firstSegment) {
|
24
|
+
if (!topLevelGroups.has(firstSegment)) {
|
25
|
+
topLevelGroups.set(firstSegment, [])
|
26
|
+
}
|
27
|
+
topLevelGroups.get(firstSegment)!.push(page)
|
28
|
+
}
|
29
|
+
})
|
30
|
+
|
31
|
+
// Add each top-level group to navbar
|
32
|
+
topLevelGroups.forEach((pages, segment) => {
|
33
|
+
// For directories, check if there's an index page
|
34
|
+
const indexPage = pages.find(p =>
|
35
|
+
p.route.logical.path.length === 1
|
36
|
+
&& p.route.file.path.relative.name === 'index'
|
37
|
+
)
|
38
|
+
|
39
|
+
// For single non-index files at top level
|
40
|
+
const singlePage = pages.length === 1 && pages[0]!.route.logical.path.length === 1
|
41
|
+
&& pages[0]!.route.file.path.relative.name !== 'index'
|
42
|
+
|
43
|
+
// Include in navbar if:
|
44
|
+
// 1. It's a directory with an index page, OR
|
45
|
+
// 2. It's a single top-level page (not index)
|
46
|
+
if (indexPage || singlePage) {
|
47
|
+
const title = Str.titlizeSlug(segment)
|
48
|
+
const pathExp = `/${segment}`
|
49
|
+
|
50
|
+
navbarItems.push({
|
51
|
+
pathExp,
|
52
|
+
title,
|
53
|
+
})
|
54
|
+
}
|
55
|
+
})
|
56
|
+
|
57
|
+
// Sort navbar items alphabetically for consistency
|
58
|
+
navbarItems.sort((a, b) => a.title.localeCompare(b.title))
|
59
|
+
|
60
|
+
return navbarItems
|
61
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { FileRouter } from '#lib/file-router/index'
|
2
|
+
import type { Metadata } from './metadata.ts'
|
3
|
+
|
4
|
+
export type { Metadata }
|
5
|
+
|
6
|
+
/**
|
7
|
+
* A route with its associated metadata
|
8
|
+
*/
|
9
|
+
export interface Page {
|
10
|
+
route: FileRouter.Route
|
11
|
+
metadata: Metadata
|
12
|
+
}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import { FileRouter } from '#lib/file-router/index'
|
2
|
+
import { Fs, Path, Tree } from '@wollybeard/kit'
|
3
|
+
import matter from 'gray-matter'
|
4
|
+
import { MetadataSchema } from './metadata.ts'
|
5
|
+
import type { Page } from './page.ts'
|
6
|
+
|
7
|
+
export interface ScanResult {
|
8
|
+
list: Page[]
|
9
|
+
tree: Tree.Tree<Page>
|
10
|
+
diagnostics: FileRouter.Diagnostic[]
|
11
|
+
}
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Scan a directory for pages and extract metadata from their front matter
|
15
|
+
* By default, hidden pages are filtered out from both the pages list and route tree.
|
16
|
+
*/
|
17
|
+
export const scan = async (options: {
|
18
|
+
dir: string
|
19
|
+
glob?: string
|
20
|
+
/** Include hidden pages in the result (useful for debugging or admin interfaces) */
|
21
|
+
includeHidden?: boolean
|
22
|
+
}): Promise<ScanResult> => {
|
23
|
+
// Scan for routes
|
24
|
+
const routeScanResult = await FileRouter.scan({
|
25
|
+
dir: options.dir,
|
26
|
+
glob: options.glob ?? '**/*.{md,mdx}',
|
27
|
+
})
|
28
|
+
|
29
|
+
// Create pages with metadata (id/parentId now come from route)
|
30
|
+
const allPages = await Promise.all(
|
31
|
+
routeScanResult.routes.map(route => readRoute(route)),
|
32
|
+
)
|
33
|
+
|
34
|
+
// Apply filtering if needed
|
35
|
+
const pages = options.includeHidden
|
36
|
+
? allPages
|
37
|
+
: allPages.filter(page => !page.metadata.hidden)
|
38
|
+
|
39
|
+
// Build tree from pages using Tree.fromList
|
40
|
+
// Transform pages to include id/parentId at the top level for Tree.fromList
|
41
|
+
const pagesWithIds = pages.map(page => ({
|
42
|
+
...page,
|
43
|
+
id: page.route.id,
|
44
|
+
parentId: page.route.parentId,
|
45
|
+
}))
|
46
|
+
|
47
|
+
// Handle cases where there might be multiple root nodes
|
48
|
+
// If all pages are at root level (no parentId), create a virtual root
|
49
|
+
const hasMultipleRoots = pagesWithIds.filter(p => !p.parentId).length > 1
|
50
|
+
|
51
|
+
let tree: Tree.Tree<Page>
|
52
|
+
if (hasMultipleRoots) {
|
53
|
+
// Create a virtual root node to hold all root-level pages
|
54
|
+
const virtualRoot: Page & { id: string; parentId: null } = {
|
55
|
+
route: {
|
56
|
+
id: '__virtual_root__',
|
57
|
+
parentId: null,
|
58
|
+
file: {
|
59
|
+
path: {
|
60
|
+
absolute: Path.parse(''),
|
61
|
+
relative: Path.parse(''),
|
62
|
+
},
|
63
|
+
},
|
64
|
+
logical: {
|
65
|
+
path: [],
|
66
|
+
},
|
67
|
+
},
|
68
|
+
metadata: { hidden: true },
|
69
|
+
id: '__virtual_root__',
|
70
|
+
parentId: null,
|
71
|
+
}
|
72
|
+
|
73
|
+
// Update pages to have virtual root as parent if they don't have one
|
74
|
+
const pagesWithVirtualRoot = pagesWithIds.map(page => ({
|
75
|
+
...page,
|
76
|
+
parentId: page.parentId || '__virtual_root__',
|
77
|
+
}))
|
78
|
+
|
79
|
+
tree = Tree.fromList([virtualRoot, ...pagesWithVirtualRoot])
|
80
|
+
} else {
|
81
|
+
tree = Tree.fromList(pagesWithIds)
|
82
|
+
}
|
83
|
+
|
84
|
+
return {
|
85
|
+
list: pages,
|
86
|
+
tree,
|
87
|
+
diagnostics: routeScanResult.diagnostics,
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Read a single route file and extract metadata from its front matter
|
93
|
+
*/
|
94
|
+
const readRoute = async (route: FileRouter.Route): Promise<Page> => {
|
95
|
+
const filePath = Path.format(route.file.path.absolute)
|
96
|
+
const fileContent = await Fs.read(filePath)
|
97
|
+
|
98
|
+
// Empty files still get default metadata (not hidden by default)
|
99
|
+
// This allows placeholder pages to exist in the navigation
|
100
|
+
if (!fileContent) {
|
101
|
+
return { route, metadata: { hidden: false } }
|
102
|
+
}
|
103
|
+
|
104
|
+
// Parse front matter
|
105
|
+
const { data } = matter(fileContent)
|
106
|
+
|
107
|
+
// Validate and parse the data
|
108
|
+
const parsed = MetadataSchema.safeParse(data)
|
109
|
+
|
110
|
+
if (!parsed.success) {
|
111
|
+
// Log warning but continue with defaults
|
112
|
+
console.warn(`Invalid front matter in ${filePath}:`, parsed.error.issues)
|
113
|
+
}
|
114
|
+
|
115
|
+
const metadata = parsed.success ? parsed.data : { hidden: false }
|
116
|
+
return { route, metadata }
|
117
|
+
}
|