polen 0.9.1-next.1 → 0.10.0-next.10
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.d.ts.map +1 -1
- package/build/api/schema/data-sources/schema-directory/schema-directory.js +3 -2
- 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/lib/vite-virtual/debug.d.ts +1 -1
- package/build/lib/vite-virtual/debug.d.ts.map +1 -1
- package/build/lib/vite-virtual/debug.js +1 -1
- package/build/lib/vite-virtual/debug.js.map +1 -1
- 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 +2 -2
- package/build/singletons/debug.d.ts.map +1 -1
- package/build/singletons/debug.js +2 -2
- package/build/singletons/debug.js.map +1 -1
- 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 +1 -1
- 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/root.d.ts.map +1 -1
- package/build/template/routes/root.jsx +66 -53
- 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 +42 -28
- 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 +3 -2
- 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/lib/vite-virtual/debug.ts +1 -1
- package/src/project-data.ts +0 -1
- package/src/sandbox.ts +20 -0
- package/src/singletons/debug.ts +2 -2
- 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 +8 -8
- package/src/template/contexts/ThemeContext.tsx +60 -0
- package/src/template/routes/root.tsx +85 -74
- package/src/template/server/app.ts +2 -27
- package/build/lib/debug/debug.d.ts +0 -13
- package/build/lib/debug/debug.d.ts.map +0 -1
- package/build/lib/debug/debug.js +0 -86
- package/build/lib/debug/debug.js.map +0 -1
- package/build/lib/debug/environment-variable.d.ts +0 -6
- package/build/lib/debug/environment-variable.d.ts.map +0 -1
- package/build/lib/debug/environment-variable.js +0 -48
- package/build/lib/debug/environment-variable.js.map +0 -1
- package/build/lib/debug/index.d.ts +0 -2
- package/build/lib/debug/index.d.ts.map +0 -1
- package/build/lib/debug/index.js +0 -2
- package/build/lib/debug/index.js.map +0 -1
- 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/debug/debug.ts +0 -120
- package/src/lib/debug/environment-variable.ts +0 -56
- package/src/lib/debug/index.ts +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
@@ -0,0 +1,196 @@
|
|
1
|
+
import { parse as semverParse } from '@vltpkg/semver'
|
2
|
+
import type { SimpleGit } from 'simple-git'
|
3
|
+
import { beforeEach, describe, expect, it, type Mock, vi } from 'vitest'
|
4
|
+
import { VersionHistory } from './index.ts'
|
5
|
+
|
6
|
+
// Mock the simple-git module
|
7
|
+
vi.mock('simple-git', () => ({
|
8
|
+
simpleGit: vi.fn(),
|
9
|
+
}))
|
10
|
+
|
11
|
+
describe('VersionHistory', () => {
|
12
|
+
describe('parseSemver', () => {
|
13
|
+
it('parses standard semver tags', () => {
|
14
|
+
const version = VersionHistory.parseSemver('1.2.3')
|
15
|
+
expect(version).not.toBeNull()
|
16
|
+
expect(version?.major).toBe(1)
|
17
|
+
expect(version?.minor).toBe(2)
|
18
|
+
expect(version?.patch).toBe(3)
|
19
|
+
expect(version?.prerelease).toBeUndefined()
|
20
|
+
})
|
21
|
+
|
22
|
+
it('parses semver tags with v prefix', () => {
|
23
|
+
const version = VersionHistory.parseSemver('v1.2.3')
|
24
|
+
expect(version).not.toBeNull()
|
25
|
+
expect(version?.major).toBe(1)
|
26
|
+
expect(version?.minor).toBe(2)
|
27
|
+
expect(version?.patch).toBe(3)
|
28
|
+
})
|
29
|
+
|
30
|
+
it('parses prerelease versions', () => {
|
31
|
+
const version = VersionHistory.parseSemver('1.2.3-beta.1')
|
32
|
+
expect(version).not.toBeNull()
|
33
|
+
expect(version?.major).toBe(1)
|
34
|
+
expect(version?.minor).toBe(2)
|
35
|
+
expect(version?.patch).toBe(3)
|
36
|
+
expect(version?.prerelease).toEqual(['beta', 1])
|
37
|
+
})
|
38
|
+
|
39
|
+
it('returns null for invalid semver', () => {
|
40
|
+
expect(VersionHistory.parseSemver('not-a-version')).toBeNull()
|
41
|
+
expect(VersionHistory.parseSemver('1.2')).toBeNull()
|
42
|
+
expect(VersionHistory.parseSemver('latest')).toBeNull()
|
43
|
+
})
|
44
|
+
})
|
45
|
+
|
46
|
+
describe('isSemverTag', () => {
|
47
|
+
it('identifies valid semver tags', () => {
|
48
|
+
expect(VersionHistory.isSemverTag('1.2.3')).toBe(true)
|
49
|
+
expect(VersionHistory.isSemverTag('v1.2.3')).toBe(true)
|
50
|
+
expect(VersionHistory.isSemverTag('1.0.0-beta.1')).toBe(true)
|
51
|
+
expect(VersionHistory.isSemverTag('0.0.1')).toBe(true)
|
52
|
+
})
|
53
|
+
|
54
|
+
it('rejects invalid semver tags', () => {
|
55
|
+
expect(VersionHistory.isSemverTag('latest')).toBe(false)
|
56
|
+
expect(VersionHistory.isSemverTag('next')).toBe(false)
|
57
|
+
expect(VersionHistory.isSemverTag('1.2')).toBe(false)
|
58
|
+
expect(VersionHistory.isSemverTag('v1.2')).toBe(false)
|
59
|
+
expect(VersionHistory.isSemverTag('not-a-version')).toBe(false)
|
60
|
+
})
|
61
|
+
})
|
62
|
+
|
63
|
+
describe('isPrerelease', () => {
|
64
|
+
it('identifies prerelease versions', () => {
|
65
|
+
expect(VersionHistory.isPrerelease('1.0.0-beta.1')).toBe(true)
|
66
|
+
expect(VersionHistory.isPrerelease('2.0.0-next.5')).toBe(true)
|
67
|
+
expect(VersionHistory.isPrerelease('3.0.0-alpha')).toBe(true)
|
68
|
+
})
|
69
|
+
|
70
|
+
it('identifies stable versions', () => {
|
71
|
+
expect(VersionHistory.isPrerelease('1.0.0')).toBe(false)
|
72
|
+
expect(VersionHistory.isPrerelease('v2.3.4')).toBe(false)
|
73
|
+
})
|
74
|
+
})
|
75
|
+
|
76
|
+
describe('version sorting', () => {
|
77
|
+
it('sorts versions correctly', () => {
|
78
|
+
const versions = [
|
79
|
+
{ semver: semverParse('1.0.0')!, isPrerelease: false },
|
80
|
+
{ semver: semverParse('2.0.0')!, isPrerelease: false },
|
81
|
+
{ semver: semverParse('1.1.0')!, isPrerelease: false },
|
82
|
+
{ semver: semverParse('1.0.1')!, isPrerelease: false },
|
83
|
+
{ semver: semverParse('2.0.0-beta.1')!, isPrerelease: true },
|
84
|
+
]
|
85
|
+
|
86
|
+
const sorted = [...versions].sort((a, b) => {
|
87
|
+
// Reverse comparison for descending order
|
88
|
+
return b.semver.compare(a.semver)
|
89
|
+
})
|
90
|
+
|
91
|
+
expect(sorted[0]!.semver.toString()).toBe('2.0.0')
|
92
|
+
expect(sorted[1]!.semver.toString()).toBe('2.0.0-beta.1')
|
93
|
+
expect(sorted[2]!.semver.toString()).toBe('1.1.0')
|
94
|
+
expect(sorted[3]!.semver.toString()).toBe('1.0.1')
|
95
|
+
expect(sorted[4]!.semver.toString()).toBe('1.0.0')
|
96
|
+
})
|
97
|
+
})
|
98
|
+
|
99
|
+
describe('getCurrentDevelopmentCycle', () => {
|
100
|
+
let mockGit: {
|
101
|
+
tags: Mock
|
102
|
+
show: Mock
|
103
|
+
revparse: Mock
|
104
|
+
tag: Mock
|
105
|
+
}
|
106
|
+
|
107
|
+
beforeEach(async () => {
|
108
|
+
vi.clearAllMocks()
|
109
|
+
|
110
|
+
mockGit = {
|
111
|
+
tags: vi.fn(),
|
112
|
+
show: vi.fn(),
|
113
|
+
revparse: vi.fn(),
|
114
|
+
tag: vi.fn(),
|
115
|
+
}
|
116
|
+
|
117
|
+
// Mock the simpleGit function to return our mock git instance
|
118
|
+
const { simpleGit } = await import('simple-git')
|
119
|
+
vi.mocked(simpleGit).mockReturnValue(mockGit as unknown as SimpleGit)
|
120
|
+
})
|
121
|
+
|
122
|
+
it('returns latest stable and newer prereleases', async () => {
|
123
|
+
// Mock git tags
|
124
|
+
mockGit.tags.mockResolvedValue({
|
125
|
+
all: ['1.0.0', '1.1.0', '1.2.0', '2.0.0-beta.1', '2.0.0-beta.2', '2.0.0'],
|
126
|
+
})
|
127
|
+
|
128
|
+
// Mock git show for each tag
|
129
|
+
const mockDates = {
|
130
|
+
'1.0.0': '1234567890',
|
131
|
+
'1.1.0': '1234567900',
|
132
|
+
'1.2.0': '1234567910',
|
133
|
+
'2.0.0-beta.1': '1234567920',
|
134
|
+
'2.0.0-beta.2': '1234567930',
|
135
|
+
'2.0.0': '1234567940',
|
136
|
+
}
|
137
|
+
|
138
|
+
mockGit.show.mockImplementation((args: string[]) => {
|
139
|
+
const tag = args[0]?.replace('^{commit}', '') || ''
|
140
|
+
const timestamp = mockDates[tag as keyof typeof mockDates]
|
141
|
+
return Promise.resolve(`abc123 ${timestamp}`)
|
142
|
+
})
|
143
|
+
|
144
|
+
const cycle = await VersionHistory.getCurrentDevelopmentCycle()
|
145
|
+
|
146
|
+
expect(cycle.stable?.git.tag).toBe('2.0.0')
|
147
|
+
expect(cycle.prereleases).toHaveLength(0) // No prereleases after stable version 2.0.0
|
148
|
+
expect(cycle.all).toHaveLength(1) // Just the stable version
|
149
|
+
})
|
150
|
+
|
151
|
+
it('includes prereleases newer than latest stable', async () => {
|
152
|
+
// Mock git tags
|
153
|
+
mockGit.tags.mockResolvedValue({
|
154
|
+
all: ['1.0.0', '1.1.0', '2.0.0-beta.1', '2.0.0-beta.2'],
|
155
|
+
})
|
156
|
+
|
157
|
+
// Mock git show for each tag
|
158
|
+
const mockDates = {
|
159
|
+
'1.0.0': '1234567890',
|
160
|
+
'1.1.0': '1234567900',
|
161
|
+
'2.0.0-beta.1': '1234567910',
|
162
|
+
'2.0.0-beta.2': '1234567920',
|
163
|
+
}
|
164
|
+
|
165
|
+
mockGit.show.mockImplementation((args: string[]) => {
|
166
|
+
const tag = args[0]?.replace('^{commit}', '') || ''
|
167
|
+
const timestamp = mockDates[tag as keyof typeof mockDates]
|
168
|
+
return Promise.resolve(`abc123 ${timestamp}`)
|
169
|
+
})
|
170
|
+
|
171
|
+
const cycle = await VersionHistory.getCurrentDevelopmentCycle()
|
172
|
+
|
173
|
+
expect(cycle.stable?.git.tag).toBe('1.1.0') // Latest stable version
|
174
|
+
expect(cycle.prereleases).toHaveLength(2) // Prereleases newer than stable
|
175
|
+
expect(cycle.prereleases[0]?.git.tag).toBe('2.0.0-beta.2')
|
176
|
+
expect(cycle.prereleases[1]?.git.tag).toBe('2.0.0-beta.1')
|
177
|
+
expect(cycle.all).toHaveLength(3) // Stable + 2 prereleases
|
178
|
+
})
|
179
|
+
|
180
|
+
it('returns all versions as prereleases when no stable version exists', async () => {
|
181
|
+
// Mock git tags with only prereleases
|
182
|
+
mockGit.tags.mockResolvedValue({
|
183
|
+
all: ['0.1.0-alpha.1', '0.1.0-alpha.2', '0.1.0-beta.1'],
|
184
|
+
})
|
185
|
+
|
186
|
+
// Mock git show for each tag
|
187
|
+
mockGit.show.mockImplementation(() => Promise.resolve('abc123 1234567890'))
|
188
|
+
|
189
|
+
const cycle = await VersionHistory.getCurrentDevelopmentCycle()
|
190
|
+
|
191
|
+
expect(cycle.stable).toBeNull()
|
192
|
+
expect(cycle.prereleases).toHaveLength(3)
|
193
|
+
expect(cycle.all).toHaveLength(3)
|
194
|
+
})
|
195
|
+
})
|
196
|
+
})
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/**
|
2
|
+
* Version history types
|
3
|
+
*/
|
4
|
+
|
5
|
+
import type { Version as Semver } from '@vltpkg/semver'
|
6
|
+
|
7
|
+
export interface Version {
|
8
|
+
/**
|
9
|
+
* Git-related information for this version
|
10
|
+
*/
|
11
|
+
git: {
|
12
|
+
/**
|
13
|
+
* The git tag name for this version (e.g., "1.2.3" or "2.0.0-beta.1")
|
14
|
+
*/
|
15
|
+
tag: string
|
16
|
+
/**
|
17
|
+
* The full git commit SHA associated with this version tag
|
18
|
+
*/
|
19
|
+
sha: string
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* The date when this version tag was created
|
23
|
+
*/
|
24
|
+
date: Date
|
25
|
+
/**
|
26
|
+
* Whether this version is a prerelease (contains -alpha, -beta, -rc, etc.)
|
27
|
+
*/
|
28
|
+
isPrerelease: boolean
|
29
|
+
/**
|
30
|
+
* Parsed semver object containing major, minor, patch, and prerelease info
|
31
|
+
*/
|
32
|
+
semver: Semver
|
33
|
+
}
|
34
|
+
|
35
|
+
export interface DistTagInfo {
|
36
|
+
name: string
|
37
|
+
commit: string
|
38
|
+
semverTag?: string
|
39
|
+
}
|
40
|
+
|
41
|
+
export interface DevelopmentCycle {
|
42
|
+
stable: Version | null
|
43
|
+
prereleases: Version[]
|
44
|
+
all: Version[]
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Complete registry of all versions and dist-tags in the repository
|
49
|
+
*/
|
50
|
+
export interface VersionCatalog {
|
51
|
+
/**
|
52
|
+
* All dist-tags mapped to their corresponding versions
|
53
|
+
*/
|
54
|
+
distTags: {
|
55
|
+
latest?: Version
|
56
|
+
next?: Version
|
57
|
+
[tagName: string]: Version | undefined
|
58
|
+
}
|
59
|
+
/**
|
60
|
+
* All versions sorted by semver (newest first)
|
61
|
+
*/
|
62
|
+
versions: Version[]
|
63
|
+
/**
|
64
|
+
* Quick access to commonly needed subsets
|
65
|
+
*/
|
66
|
+
stable: Version[]
|
67
|
+
prerelease: Version[]
|
68
|
+
}
|
@@ -0,0 +1,293 @@
|
|
1
|
+
import {
|
2
|
+
compare as semverCompare,
|
3
|
+
parse as semverParse,
|
4
|
+
prerelease as semverPrerelease,
|
5
|
+
type Version as SemverVersion,
|
6
|
+
} from '@vltpkg/semver'
|
7
|
+
import { type SimpleGit, simpleGit } from 'simple-git'
|
8
|
+
import type { DevelopmentCycle, DistTagInfo, Version, VersionCatalog } from './types.ts'
|
9
|
+
|
10
|
+
export type { DevelopmentCycle, DistTagInfo, Version, VersionCatalog } from './types.ts'
|
11
|
+
|
12
|
+
// Helper to get git instance
|
13
|
+
function getGit(repoPath: string = process.cwd()): SimpleGit {
|
14
|
+
return simpleGit(repoPath)
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Parse a semver string into a Version object
|
19
|
+
*/
|
20
|
+
export function parseSemver(tag: string): SemverVersion | null {
|
21
|
+
return semverParse(tag) || null
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Check if a tag is a semver tag
|
26
|
+
*/
|
27
|
+
export function isSemverTag(tag: string): boolean {
|
28
|
+
return semverParse(tag) !== undefined
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Check if a version is a prerelease
|
33
|
+
*/
|
34
|
+
export function isPrerelease(tag: string): boolean {
|
35
|
+
const prereleaseArray = semverPrerelease(tag)
|
36
|
+
return prereleaseArray !== undefined && prereleaseArray.length > 0
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Check if a version is stable (not a prerelease)
|
41
|
+
*/
|
42
|
+
export function isStableVersion(tag: string): boolean {
|
43
|
+
return !isPrerelease(tag)
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Get the deployment path for a version
|
48
|
+
* Stable versions go to /latest/, prereleases go to /[version]/
|
49
|
+
*/
|
50
|
+
export function getDeploymentPath(version: string, prefix: string = '/polen'): string {
|
51
|
+
const isStable = isStableVersion(version)
|
52
|
+
return isStable ? `${prefix}/latest/` : `${prefix}/${version}/`
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Get all versions from the repository
|
57
|
+
*/
|
58
|
+
export async function getVersions(repoPath?: string): Promise<Version[]> {
|
59
|
+
const git = getGit(repoPath)
|
60
|
+
const tags = await git.tags()
|
61
|
+
const versions: Version[] = []
|
62
|
+
|
63
|
+
for (const tag of tags.all) {
|
64
|
+
if (!isSemverTag(tag)) continue
|
65
|
+
|
66
|
+
const semver = parseSemver(tag)
|
67
|
+
if (!semver) continue
|
68
|
+
|
69
|
+
try {
|
70
|
+
const tagInfo = await git.show([`${tag}^{commit}`, `--format=%H %at`])
|
71
|
+
const [commit, timestamp] = tagInfo.trim().split(' ')
|
72
|
+
|
73
|
+
if (!commit) continue
|
74
|
+
|
75
|
+
versions.push({
|
76
|
+
git: {
|
77
|
+
tag,
|
78
|
+
sha: commit,
|
79
|
+
},
|
80
|
+
date: new Date(parseInt(timestamp || '0', 10) * 1000),
|
81
|
+
isPrerelease: isPrerelease(tag),
|
82
|
+
semver,
|
83
|
+
})
|
84
|
+
} catch (e) {
|
85
|
+
// Skip tags that can't be resolved
|
86
|
+
console.warn(`Failed to get info for tag ${tag}:`, e)
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
// Sort by semver (newest first) - reverse of semverCompare
|
91
|
+
return versions.sort((a, b) => semverCompare(b.semver, a.semver))
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Get dist-tag information (latest, next, etc.)
|
96
|
+
*/
|
97
|
+
export async function getDistTag(tagName: string, repoPath?: string): Promise<DistTagInfo | null> {
|
98
|
+
const git = getGit(repoPath)
|
99
|
+
try {
|
100
|
+
const commit = await git.revparse([tagName])
|
101
|
+
|
102
|
+
// Find semver tag at this commit
|
103
|
+
const tags = await git.tag([`--points-at`, commit])
|
104
|
+
const semverTags = tags.split('\n').filter(isSemverTag)
|
105
|
+
|
106
|
+
return {
|
107
|
+
name: tagName,
|
108
|
+
commit: commit.trim(),
|
109
|
+
semverTag: semverTags[0],
|
110
|
+
}
|
111
|
+
} catch (e) {
|
112
|
+
return null
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
/**
|
117
|
+
* Get the 'latest' dist-tag
|
118
|
+
*/
|
119
|
+
export async function getDistTagLatest(repoPath?: string): Promise<DistTagInfo | null> {
|
120
|
+
return getDistTag('latest', repoPath)
|
121
|
+
}
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Get all dist-tags
|
125
|
+
*/
|
126
|
+
export async function getDistTags(repoPath?: string): Promise<DistTagInfo[]> {
|
127
|
+
const commonDistTags = ['latest', 'next', 'beta', 'alpha', 'canary']
|
128
|
+
const distTags: DistTagInfo[] = []
|
129
|
+
|
130
|
+
for (const tag of commonDistTags) {
|
131
|
+
const info = await getDistTag(tag, repoPath)
|
132
|
+
if (info) {
|
133
|
+
distTags.push(info)
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
return distTags
|
138
|
+
}
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Get the latest stable version
|
142
|
+
*/
|
143
|
+
export async function getLatestStableVersion(repoPath?: string): Promise<Version | null> {
|
144
|
+
const versions = await getVersions(repoPath)
|
145
|
+
return versions.find(v => !v.isPrerelease) || null
|
146
|
+
}
|
147
|
+
|
148
|
+
/**
|
149
|
+
* Get the latest prerelease version
|
150
|
+
*/
|
151
|
+
export async function getLatestPrereleaseVersion(repoPath?: string): Promise<Version | null> {
|
152
|
+
const versions = await getVersions(repoPath)
|
153
|
+
return versions.find(v => v.isPrerelease) || null
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Get version at a specific commit
|
158
|
+
*/
|
159
|
+
export async function getVersionAtCommit(commit: string, repoPath?: string): Promise<Version | null> {
|
160
|
+
const git = getGit(repoPath)
|
161
|
+
const tags = await git.tag([`--points-at`, commit])
|
162
|
+
const semverTags = tags.split('\n').filter(isSemverTag)
|
163
|
+
|
164
|
+
if (semverTags.length === 0) return null
|
165
|
+
|
166
|
+
// Get full info for the first semver tag
|
167
|
+
const versions = await getVersions(repoPath)
|
168
|
+
return versions.find(v => v.git.tag === semverTags[0]) || null
|
169
|
+
}
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Get deployment history for demos (versions that should have demos)
|
173
|
+
*/
|
174
|
+
export async function getDeploymentHistory(minimumVersion?: string, repoPath?: string): Promise<Version[]> {
|
175
|
+
const versions = await getVersions(repoPath)
|
176
|
+
|
177
|
+
if (!minimumVersion) return versions
|
178
|
+
|
179
|
+
const minSemver = parseSemver(minimumVersion)
|
180
|
+
if (!minSemver) return versions
|
181
|
+
|
182
|
+
return versions.filter(v => semverCompare(v.semver, minSemver) >= 0)
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Get the current development cycle: latest stable + all newer prereleases
|
187
|
+
*/
|
188
|
+
export async function getCurrentDevelopmentCycle(repoPath?: string): Promise<DevelopmentCycle> {
|
189
|
+
const latestStable = await getLatestStableVersion(repoPath)
|
190
|
+
if (!latestStable) {
|
191
|
+
// No stable version yet, return all versions as prereleases
|
192
|
+
const allVersions = await getVersions(repoPath)
|
193
|
+
return {
|
194
|
+
stable: null,
|
195
|
+
prereleases: allVersions,
|
196
|
+
all: allVersions,
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
const allVersions = await getVersions(repoPath)
|
201
|
+
const prereleases = allVersions.filter(
|
202
|
+
v => v.isPrerelease && semverCompare(v.semver, latestStable.semver) > 0,
|
203
|
+
)
|
204
|
+
|
205
|
+
return {
|
206
|
+
stable: latestStable,
|
207
|
+
prereleases,
|
208
|
+
all: [latestStable, ...prereleases],
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Get versions since a specific version (inclusive)
|
214
|
+
*/
|
215
|
+
export async function getVersionsSince(
|
216
|
+
sinceVersion: string,
|
217
|
+
skipVersions: string[] = [],
|
218
|
+
repoPath?: string,
|
219
|
+
): Promise<Version[]> {
|
220
|
+
const sinceSemver = parseSemver(sinceVersion)
|
221
|
+
if (!sinceSemver) {
|
222
|
+
throw new Error(`Invalid version: ${sinceVersion}`)
|
223
|
+
}
|
224
|
+
|
225
|
+
const allVersions = await getVersions(repoPath)
|
226
|
+
return allVersions.filter(v => {
|
227
|
+
// Skip if in skip list
|
228
|
+
if (skipVersions.includes(v.git.tag)) return false
|
229
|
+
// Include if >= sinceVersion
|
230
|
+
return semverCompare(v.semver, sinceSemver) >= 0
|
231
|
+
})
|
232
|
+
}
|
233
|
+
|
234
|
+
/**
|
235
|
+
* Get all prereleases from past development cycles
|
236
|
+
*
|
237
|
+
* A development cycle is the set of prereleases between stable versions.
|
238
|
+
* This returns all prereleases that are not part of the current development cycle.
|
239
|
+
*
|
240
|
+
* Note: This only returns prereleases. Stable versions are not part of development cycles.
|
241
|
+
*/
|
242
|
+
export async function getPastDevelopmentCycles(repoPath?: string): Promise<Version[]> {
|
243
|
+
const allVersions = await getVersions(repoPath)
|
244
|
+
const currentCycle = await getCurrentDevelopmentCycle(repoPath)
|
245
|
+
const currentCycleTags = new Set(currentCycle.all.map(v => v.git.tag))
|
246
|
+
|
247
|
+
// Return prereleases not in the current cycle
|
248
|
+
return allVersions.filter(v => {
|
249
|
+
return v.isPrerelease && !currentCycleTags.has(v.git.tag)
|
250
|
+
})
|
251
|
+
}
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Get a complete registry of all versions and dist-tags
|
255
|
+
*/
|
256
|
+
export async function getVersionCatalog(repoPath?: string): Promise<VersionCatalog> {
|
257
|
+
const [allVersions, distTagInfos] = await Promise.all([
|
258
|
+
getVersions(repoPath),
|
259
|
+
getDistTags(repoPath),
|
260
|
+
])
|
261
|
+
|
262
|
+
// Map dist-tags to versions
|
263
|
+
const distTags: VersionCatalog['distTags'] = {}
|
264
|
+
for (const tagInfo of distTagInfos) {
|
265
|
+
if (tagInfo.semverTag) {
|
266
|
+
const version = allVersions.find(v => v.git.tag === tagInfo.semverTag)
|
267
|
+
if (version) {
|
268
|
+
distTags[tagInfo.name] = version
|
269
|
+
}
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
273
|
+
// Separate stable and prerelease versions
|
274
|
+
const stable = allVersions.filter(v => !v.isPrerelease)
|
275
|
+
const prerelease = allVersions.filter(v => v.isPrerelease)
|
276
|
+
|
277
|
+
return {
|
278
|
+
distTags,
|
279
|
+
versions: allVersions,
|
280
|
+
stable,
|
281
|
+
prerelease,
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
// Legacy class export for backward compatibility
|
286
|
+
// TODO: Remove this once all usages are migrated
|
287
|
+
export class VersionHistory {
|
288
|
+
static parseSemver = parseSemver
|
289
|
+
static isSemverTag = isSemverTag
|
290
|
+
static isPrerelease = isPrerelease
|
291
|
+
static isStableVersion = isStableVersion
|
292
|
+
static getDeploymentPath = getDeploymentPath
|
293
|
+
}
|
package/src/project-data.ts
CHANGED
package/src/sandbox.ts
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import { filePathToRouteLogical } from '#lib/file-router/scan'
|
2
|
+
import { Path } from '@wollybeard/kit'
|
3
|
+
|
4
|
+
// Test parsing of numbered directory
|
5
|
+
const testPath1 = Path.parse('a/10_b/index.md')
|
6
|
+
const logical1 = filePathToRouteLogical(testPath1)
|
7
|
+
console.log('Path 1:', testPath1)
|
8
|
+
console.log('Logical 1:', logical1)
|
9
|
+
|
10
|
+
// Test parsing of numbered file
|
11
|
+
const testPath2 = Path.parse('a/10_b/g.md')
|
12
|
+
const logical2 = filePathToRouteLogical(testPath2)
|
13
|
+
console.log('\nPath 2:', testPath2)
|
14
|
+
console.log('Logical 2:', logical2)
|
15
|
+
|
16
|
+
// Test directory structure
|
17
|
+
const testPath3 = Path.parse('a/30_d/index.md')
|
18
|
+
const logical3 = filePathToRouteLogical(testPath3)
|
19
|
+
console.log('\nPath 3:', testPath3)
|
20
|
+
console.log('Logical 3:', logical3)
|
package/src/singletons/debug.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { Debug } from '
|
1
|
+
import { Debug } from '@wollybeard/kit'
|
2
2
|
|
3
|
-
export const
|
3
|
+
export const debugPolen = Debug.create(`polen`)
|
@@ -0,0 +1,96 @@
|
|
1
|
+
import type { Content } from '#api/content/$'
|
2
|
+
import { Cross2Icon, HamburgerMenuIcon } from '@radix-ui/react-icons'
|
3
|
+
import { Box, Flex, IconButton, Text } from '@radix-ui/themes'
|
4
|
+
import { useEffect } from 'react'
|
5
|
+
import { Sidebar } from '../components/sidebar/Sidebar.tsx'
|
6
|
+
|
7
|
+
export interface HamburgerMenuProps {
|
8
|
+
isOpen: boolean
|
9
|
+
onToggle: () => void
|
10
|
+
onClose: () => void
|
11
|
+
sidebarData: Content.Item[]
|
12
|
+
}
|
13
|
+
|
14
|
+
export const HamburgerMenu: React.FC<HamburgerMenuProps> = ({
|
15
|
+
isOpen,
|
16
|
+
onToggle,
|
17
|
+
onClose,
|
18
|
+
sidebarData,
|
19
|
+
}) => {
|
20
|
+
// Prevent body scroll when mobile menu is open
|
21
|
+
useEffect(() => {
|
22
|
+
if (isOpen) {
|
23
|
+
document.body.style.overflow = 'hidden'
|
24
|
+
} else {
|
25
|
+
document.body.style.overflow = ''
|
26
|
+
}
|
27
|
+
|
28
|
+
// Cleanup
|
29
|
+
return () => {
|
30
|
+
document.body.style.overflow = ''
|
31
|
+
}
|
32
|
+
}, [isOpen])
|
33
|
+
|
34
|
+
return (
|
35
|
+
<>
|
36
|
+
{/* Mobile menu button - show on mobile/tablet, hide on desktop */}
|
37
|
+
<Box display={{ initial: 'block', xs: 'block', sm: 'block', md: 'none', lg: 'none', xl: 'none' }}>
|
38
|
+
<IconButton
|
39
|
+
size='2'
|
40
|
+
variant='ghost'
|
41
|
+
onClick={onToggle}
|
42
|
+
aria-label='Toggle navigation menu'
|
43
|
+
>
|
44
|
+
{isOpen ? <Cross2Icon width='18' height='18' /> : <HamburgerMenuIcon width='18' height='18' />}
|
45
|
+
</IconButton>
|
46
|
+
</Box>
|
47
|
+
|
48
|
+
{/* Mobile Sidebar Drawer */}
|
49
|
+
{isOpen && (
|
50
|
+
<>
|
51
|
+
{/* Backdrop */}
|
52
|
+
<Box
|
53
|
+
position='fixed'
|
54
|
+
inset='0'
|
55
|
+
style={{
|
56
|
+
backgroundColor: 'var(--black-a9)',
|
57
|
+
zIndex: 50,
|
58
|
+
}}
|
59
|
+
onClick={onClose}
|
60
|
+
display={{ initial: 'block', xs: 'block', sm: 'block', md: 'none', lg: 'none', xl: 'none' }}
|
61
|
+
/>
|
62
|
+
|
63
|
+
{/* Drawer */}
|
64
|
+
<Box
|
65
|
+
position='fixed'
|
66
|
+
top='0'
|
67
|
+
left='0'
|
68
|
+
bottom='0'
|
69
|
+
width='280px'
|
70
|
+
style={{
|
71
|
+
backgroundColor: 'var(--color-background)',
|
72
|
+
boxShadow: 'var(--shadow-6)',
|
73
|
+
zIndex: 100,
|
74
|
+
overflowY: 'auto',
|
75
|
+
}}
|
76
|
+
p='4'
|
77
|
+
display={{ initial: 'block', xs: 'block', sm: 'block', md: 'none', lg: 'none', xl: 'none' }}
|
78
|
+
>
|
79
|
+
<Flex justify='between' align='center' mb='4'>
|
80
|
+
<Text size='5' weight='bold'>Navigation</Text>
|
81
|
+
<IconButton
|
82
|
+
size='2'
|
83
|
+
variant='ghost'
|
84
|
+
onClick={onClose}
|
85
|
+
aria-label='Close navigation menu'
|
86
|
+
>
|
87
|
+
<Cross2Icon width='18' height='18' />
|
88
|
+
</IconButton>
|
89
|
+
</Flex>
|
90
|
+
<Sidebar data={sidebarData} />
|
91
|
+
</Box>
|
92
|
+
</>
|
93
|
+
)}
|
94
|
+
</>
|
95
|
+
)
|
96
|
+
}
|