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
@@ -1,36 +1,34 @@
|
|
1
1
|
import type { Config } from '#api/config/index'
|
2
|
+
import { Content } from '#api/content/$'
|
3
|
+
import { createNavbar } from '#api/content/navbar'
|
2
4
|
import type { NavbarDataRegistry } from '#api/vite/data/navbar'
|
3
5
|
import { polenVirtual } from '#api/vite/vi'
|
4
6
|
import type { Vite } from '#dep/vite/index'
|
5
7
|
import { reportDiagnostics } from '#lib/file-router/diagnostic-reporter'
|
6
8
|
import { FileRouter } from '#lib/file-router/index'
|
7
|
-
import {
|
8
|
-
import { debug } from '#singletons/debug'
|
9
|
+
import { debugPolen } from '#singletons/debug'
|
9
10
|
import { superjson } from '#singletons/superjson'
|
10
11
|
import mdx from '@mdx-js/rollup'
|
11
12
|
import rehypeShiki from '@shikijs/rehype'
|
12
|
-
import { Path, Str } from '@wollybeard/kit'
|
13
|
+
import { Arr, Cache, Path, Str } from '@wollybeard/kit'
|
14
|
+
import remarkFrontmatter from 'remark-frontmatter'
|
13
15
|
import remarkGfm from 'remark-gfm'
|
14
16
|
|
15
|
-
const
|
17
|
+
const debug = debugPolen.sub(`vite-plugin-pages`)
|
16
18
|
|
17
|
-
export const
|
18
|
-
export const
|
19
|
+
export const viProjectRoutes = polenVirtual([`project`, `routes.jsx`], { allowPluginProcessing: true })
|
20
|
+
export const viProjectPagesCatalog = polenVirtual([`project`, `data`, 'pages-catalog.jsonsuper'], {
|
21
|
+
allowPluginProcessing: true,
|
22
|
+
})
|
19
23
|
|
20
|
-
export interface
|
24
|
+
export interface Options {
|
21
25
|
config: Config.Config
|
22
26
|
navbarData?: NavbarDataRegistry
|
23
|
-
onPagesChange?: (pages: FileRouter.ScanResult) => void
|
24
|
-
onTreeChange?: (tree: FileRouter.RouteTreeNode) => void
|
25
27
|
}
|
26
28
|
|
27
|
-
export interface
|
28
|
-
sidebarIndex: SidebarIndex
|
29
|
-
|
30
|
-
}
|
31
|
-
|
32
|
-
export interface SidebarIndex {
|
33
|
-
[pathExpression: string]: FileRouter.Sidebar.Sidebar
|
29
|
+
export interface ProjectPagesCatalog {
|
30
|
+
sidebarIndex: Content.SidebarIndex
|
31
|
+
pages: Content.Page[]
|
34
32
|
}
|
35
33
|
|
36
34
|
/**
|
@@ -39,77 +37,53 @@ export interface SidebarIndex {
|
|
39
37
|
export const Pages = ({
|
40
38
|
config,
|
41
39
|
navbarData,
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
pagesCache = await FileRouter.scan({
|
57
|
-
dir: config.paths.project.absolute.pages,
|
58
|
-
glob: `**/*.{md,mdx}`,
|
59
|
-
})
|
60
|
-
_debug(`Found ${String(pagesCache.routes.length)} pages`)
|
61
|
-
} else {
|
62
|
-
_debug(`Using cached pages`)
|
40
|
+
}: Options): Vite.Plugin[] => {
|
41
|
+
const scanPages = Cache.memoize(debug.trace(async function scanPages() {
|
42
|
+
const result = await Content.scan({
|
43
|
+
dir: config.paths.project.absolute.pages,
|
44
|
+
glob: `**/*.{md,mdx}`,
|
45
|
+
})
|
46
|
+
return result
|
47
|
+
}))
|
48
|
+
|
49
|
+
const invalidateVirtualModules = (server: Vite.ViteDevServer) => {
|
50
|
+
const routesModule = server.moduleGraph.getModuleById(viProjectRoutes.id)
|
51
|
+
if (routesModule) {
|
52
|
+
server.moduleGraph.invalidateModule(routesModule)
|
53
|
+
debug(`Invalidated routes virtual module`)
|
63
54
|
}
|
64
|
-
return pagesCache
|
65
|
-
}
|
66
55
|
|
67
|
-
|
68
|
-
if (
|
69
|
-
|
70
|
-
|
71
|
-
dir: config.paths.project.absolute.pages,
|
72
|
-
glob: `**/*.{md,mdx}`,
|
73
|
-
})
|
74
|
-
treeCache = result.routeTree
|
75
|
-
_debug(`Built route tree`)
|
76
|
-
} else {
|
77
|
-
_debug(`Using cached tree`)
|
56
|
+
const catalogModule = server.moduleGraph.getModuleById(viProjectPagesCatalog.id)
|
57
|
+
if (catalogModule) {
|
58
|
+
server.moduleGraph.invalidateModule(catalogModule)
|
59
|
+
debug(`Invalidated pages catalog virtual module`)
|
78
60
|
}
|
79
|
-
return treeCache
|
80
|
-
}
|
81
|
-
|
82
|
-
const clearCache = () => {
|
83
|
-
_debug(`Clearing pages and tree cache`)
|
84
|
-
pagesCache = null
|
85
|
-
treeCache = null
|
86
61
|
}
|
87
62
|
|
88
|
-
const
|
89
|
-
return (file.endsWith(`.md`) || file.endsWith(`.mdx`))
|
90
|
-
&& file.includes(config.paths.project.absolute.pages)
|
91
|
-
}
|
92
|
-
|
93
|
-
const generatePagesModule = (pagesScanResult: FileRouter.ScanResult): string => {
|
63
|
+
const generateRoutesModule = (pages: Content.Page[]): string => {
|
94
64
|
const $ = {
|
95
|
-
|
65
|
+
routes: `routes`,
|
96
66
|
}
|
97
67
|
|
98
68
|
const s = Str.Builder()
|
99
|
-
s`export const ${$.
|
69
|
+
s`export const ${$.routes} = []`
|
100
70
|
|
101
71
|
// Generate imports and route objects
|
102
|
-
for (const route of
|
72
|
+
for (const { route, metadata } of pages) {
|
103
73
|
const filePathExp = Path.format(route.file.path.absolute)
|
104
74
|
const pathExp = FileRouter.routeToPathExpression(route)
|
105
|
-
const
|
75
|
+
const $$ = {
|
76
|
+
...$,
|
77
|
+
Component: Str.Case.camel(`page ` + Str.titlizeSlug(pathExp)),
|
78
|
+
}
|
106
79
|
|
107
80
|
s`
|
108
|
-
import ${
|
81
|
+
import ${$$.Component} from '${filePathExp}'
|
109
82
|
|
110
|
-
${
|
83
|
+
${$$.routes}.push({
|
111
84
|
path: '${pathExp}',
|
112
|
-
Component: ${
|
85
|
+
Component: ${$$.Component},
|
86
|
+
metadata: ${JSON.stringify(metadata)}
|
113
87
|
})
|
114
88
|
`
|
115
89
|
}
|
@@ -123,7 +97,11 @@ export const Pages = ({
|
|
123
97
|
enforce: `pre` as const,
|
124
98
|
...mdx({
|
125
99
|
jsxImportSource: `polen/react`,
|
126
|
-
remarkPlugins: [
|
100
|
+
remarkPlugins: [
|
101
|
+
// Parse frontmatter blocks so they're removed from content
|
102
|
+
remarkFrontmatter,
|
103
|
+
remarkGfm,
|
104
|
+
],
|
127
105
|
rehypePlugins: [
|
128
106
|
[
|
129
107
|
rehypeShiki,
|
@@ -150,66 +128,77 @@ export const Pages = ({
|
|
150
128
|
// Dev server configuration
|
151
129
|
configureServer(server) {
|
152
130
|
// Add pages directory to watcher
|
153
|
-
|
131
|
+
debug(`configureServer: watch pages directory`, config.paths.project.absolute.pages)
|
154
132
|
server.watcher.add(config.paths.project.absolute.pages)
|
155
|
-
},
|
156
133
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
if (!isPageFile(file)) return
|
134
|
+
// Handle file additions and deletions
|
135
|
+
const handleFileStructureChange = async (file: string, event: 'add' | 'unlink') => {
|
136
|
+
if (!Content.isPageFile(file, config.paths.project.absolute.pages)) return
|
161
137
|
|
162
|
-
|
138
|
+
debug(`Page file ${event === 'add' ? 'added' : 'deleted'}:`, file)
|
163
139
|
|
164
|
-
|
165
|
-
|
140
|
+
// Clear cache and rescan
|
141
|
+
scanPages.clear()
|
142
|
+
const newScanResult = await scanPages()
|
166
143
|
|
167
|
-
|
168
|
-
|
169
|
-
const newPages = await scanPages()
|
170
|
-
currentPagesData = newPages
|
171
|
-
|
172
|
-
// Check if page structure changed (added/removed pages)
|
173
|
-
const structureChanged = !oldPages
|
174
|
-
|| oldPages.routes.length !== newPages.routes.length
|
175
|
-
|| !oldPages.routes.every((oldRoute, i) =>
|
176
|
-
oldRoute.file.path.absolute === newPages.routes[i]?.file.path.absolute
|
177
|
-
)
|
178
|
-
|
179
|
-
if (structureChanged) {
|
180
|
-
_debug(`Page structure changed, triggering full reload`)
|
181
|
-
|
182
|
-
// Invalidate virtual module
|
183
|
-
const mod = server.moduleGraph.getModuleById(viProjectPages.id)
|
184
|
-
if (mod) {
|
185
|
-
server.moduleGraph.invalidateModule(mod)
|
186
|
-
_debug(`Invalidated pages virtual module`)
|
187
|
-
}
|
144
|
+
// Invalidate virtual modules
|
145
|
+
invalidateVirtualModules(server)
|
188
146
|
|
189
|
-
//
|
190
|
-
|
191
|
-
reportDiagnostics(newPages.diagnostics)
|
192
|
-
onPagesChange(newPages)
|
193
|
-
}
|
147
|
+
// Report any diagnostics
|
148
|
+
reportDiagnostics(newScanResult.diagnostics)
|
194
149
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
150
|
+
// Trigger full reload to ensure routes are updated
|
151
|
+
server.ws.send({ type: 'full-reload' })
|
152
|
+
}
|
153
|
+
|
154
|
+
server.watcher.on('add', (file) => handleFileStructureChange(file, 'add'))
|
155
|
+
server.watcher.on('unlink', (file) => handleFileStructureChange(file, 'unlink'))
|
156
|
+
},
|
200
157
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
158
|
+
// Hot update handling for existing files
|
159
|
+
async handleHotUpdate({ file, server, modules }) {
|
160
|
+
debug(`handleHotUpdate`, file)
|
161
|
+
if (!Content.isPageFile(file, config.paths.project.absolute.pages)) return
|
162
|
+
|
163
|
+
debug(`Page file changed:`, file)
|
164
|
+
|
165
|
+
// Get current pages before clearing cache
|
166
|
+
const oldPages = await scanPages()
|
167
|
+
|
168
|
+
// Clear cache and rescan
|
169
|
+
scanPages.clear()
|
170
|
+
const newScanResult = await scanPages()
|
171
|
+
|
172
|
+
// Check if the visible pages list changed. This can happen when:
|
173
|
+
// - A page's frontmatter `hidden` field changes (true <-> false)
|
174
|
+
// - A page's frontmatter affects its route (though we don't support this yet)
|
175
|
+
// If only the content changed (not frontmatter), we can use fast HMR.
|
176
|
+
const pageStructureChanged = !oldPages || !Arr.equalShallowly(
|
177
|
+
oldPages.list.map(p => Path.format(p.route.file.path.absolute)),
|
178
|
+
newScanResult.list.map(p => Path.format(p.route.file.path.absolute)),
|
179
|
+
)
|
180
|
+
|
181
|
+
if (!pageStructureChanged) {
|
182
|
+
debug(`Page content changed, allowing HMR`)
|
206
183
|
// Let default HMR handle the MDX file change
|
207
184
|
return modules
|
208
185
|
}
|
186
|
+
|
187
|
+
//
|
188
|
+
// ━━ Manual Invalidation
|
189
|
+
//
|
190
|
+
|
191
|
+
debug(`Page structure changed, triggering full reload`)
|
192
|
+
|
193
|
+
// Invalidate virtual modules and trigger reload
|
194
|
+
invalidateVirtualModules(server)
|
195
|
+
reportDiagnostics(newScanResult.diagnostics)
|
196
|
+
server.ws.send({ type: `full-reload` })
|
197
|
+
return []
|
209
198
|
},
|
210
199
|
resolveId(id) {
|
211
|
-
if (id ===
|
212
|
-
return
|
200
|
+
if (id === viProjectPagesCatalog.id) {
|
201
|
+
return viProjectPagesCatalog.resolved
|
213
202
|
}
|
214
203
|
},
|
215
204
|
load: {
|
@@ -217,26 +206,14 @@ export const Pages = ({
|
|
217
206
|
// id: viProjectPagesData.resolved,
|
218
207
|
// },
|
219
208
|
async handler(id) {
|
220
|
-
if (id !==
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
glob: `**/*.{md,mdx}`,
|
229
|
-
})
|
230
|
-
// Report any diagnostics from initial scan
|
231
|
-
reportDiagnostics(currentPagesData.diagnostics)
|
232
|
-
}
|
233
|
-
if (!currentTreeData) {
|
234
|
-
_debug(`loadingTreeDataInitially`)
|
235
|
-
currentTreeData = await getRouteTree(config)
|
236
|
-
}
|
237
|
-
const pagesScanResult = currentPagesData
|
238
|
-
const routeTree = currentTreeData
|
239
|
-
_debug(`usingPageRoutesFromPagesPlugin`, pagesScanResult.routes.length)
|
209
|
+
if (id !== viProjectPagesCatalog.resolved) return
|
210
|
+
debug(`viProjectPagesCatalog`)
|
211
|
+
|
212
|
+
const scanResult = await scanPages()
|
213
|
+
|
214
|
+
// Report any diagnostics
|
215
|
+
reportDiagnostics(scanResult.diagnostics)
|
216
|
+
debug(`Found ${String(scanResult.list.length)} visible pages`)
|
240
217
|
|
241
218
|
//
|
242
219
|
// ━━ Build Navbar
|
@@ -247,78 +224,36 @@ export const Pages = ({
|
|
247
224
|
const navbarPages = navbarData.get('pages')
|
248
225
|
navbarPages.length = 0 // Clear existing
|
249
226
|
|
250
|
-
|
251
|
-
|
252
|
-
if (child.value.type === 'directory') {
|
253
|
-
// Check if this directory has an index file
|
254
|
-
const hasIndex = child.children.some(c => c.value.type === 'file' && c.value.name === 'index')
|
255
|
-
|
256
|
-
if (hasIndex) {
|
257
|
-
const pathExp = FileRouter.pathToExpression([child.value.name])
|
258
|
-
const title = Str.titlizeSlug(child.value.name)
|
259
|
-
navbarPages.push({
|
260
|
-
// IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
|
261
|
-
// Without the leading slash, React Router treats paths as relative, which causes
|
262
|
-
// hydration mismatches between SSR (where base path is prepended) and client
|
263
|
-
// (where basename is configured). This ensures consistent behavior.
|
264
|
-
pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
|
265
|
-
title,
|
266
|
-
})
|
267
|
-
}
|
268
|
-
} else if (child.value.type === 'file' && child.value.name !== 'index') {
|
269
|
-
const pathExp = FileRouter.pathToExpression([child.value.name])
|
270
|
-
const title = Str.titlizeSlug(child.value.name)
|
271
|
-
navbarPages.push({
|
272
|
-
// IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
|
273
|
-
// Without the leading slash, React Router treats paths as relative, which causes
|
274
|
-
// hydration mismatches between SSR (where base path is prepended) and client
|
275
|
-
// (where basename is configured). This ensures consistent behavior.
|
276
|
-
pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
|
277
|
-
title,
|
278
|
-
})
|
279
|
-
}
|
280
|
-
}
|
227
|
+
const navbarItems = createNavbar(scanResult.list)
|
228
|
+
navbarPages.push(...navbarItems)
|
281
229
|
}
|
282
230
|
|
283
231
|
//
|
284
232
|
// ━━ Build Sidebar
|
285
233
|
//
|
286
234
|
|
287
|
-
const sidebarIndex
|
288
|
-
|
289
|
-
// Build sidebar for each top-level directory
|
290
|
-
for (const child of routeTree.children) {
|
291
|
-
if (child.value.type === 'directory') {
|
292
|
-
const pathExp = `/${child.value.name}`
|
293
|
-
// Create a subtree starting from this directory
|
294
|
-
const subtree = Tree.node(child.value, child.children)
|
295
|
-
// Pass the directory name as base path so paths are built correctly
|
296
|
-
const sidebar = FileRouter.Sidebar.buildFromTree(subtree, [child.value.name])
|
297
|
-
_debug(`Built sidebar for ${pathExp}:`, sidebar)
|
298
|
-
sidebarIndex[pathExp] = sidebar
|
299
|
-
}
|
300
|
-
}
|
235
|
+
const sidebarIndex = Content.buildSidebarIndex(scanResult)
|
301
236
|
|
302
237
|
//
|
303
238
|
// ━━ Put It All together
|
304
239
|
//
|
305
240
|
|
306
|
-
const
|
241
|
+
const projectPagesCatalog: ProjectPagesCatalog = {
|
307
242
|
sidebarIndex,
|
308
|
-
|
243
|
+
pages: scanResult.list,
|
309
244
|
}
|
310
245
|
|
311
246
|
// Return just the JSON string - let the JSON plugin handle the transformation
|
312
|
-
return superjson.stringify(
|
247
|
+
return superjson.stringify(projectPagesCatalog)
|
313
248
|
},
|
314
249
|
},
|
315
250
|
},
|
316
|
-
// Plugin
|
251
|
+
// Plugin 3: Virtual Module for React Router Routes
|
317
252
|
{
|
318
|
-
name: 'polen:
|
253
|
+
name: 'polen:routes',
|
319
254
|
resolveId(id) {
|
320
|
-
if (id ===
|
321
|
-
return
|
255
|
+
if (id === viProjectRoutes.id) {
|
256
|
+
return viProjectRoutes.resolved
|
322
257
|
}
|
323
258
|
},
|
324
259
|
load: {
|
@@ -326,19 +261,17 @@ export const Pages = ({
|
|
326
261
|
// id: viProjectPages.resolved,
|
327
262
|
// },
|
328
263
|
handler: async (id) => {
|
329
|
-
if (id !==
|
264
|
+
if (id !== viProjectRoutes.resolved) return
|
330
265
|
|
331
|
-
|
266
|
+
debug(`Loading viProjectRoutes virtual module`)
|
332
267
|
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
reportDiagnostics(currentPagesData.diagnostics)
|
337
|
-
}
|
268
|
+
const scanResult = await scanPages()
|
269
|
+
reportDiagnostics(scanResult.diagnostics)
|
270
|
+
const code = generateRoutesModule(scanResult.list)
|
338
271
|
|
339
272
|
// Generate the module code
|
340
273
|
return {
|
341
|
-
code
|
274
|
+
code,
|
342
275
|
moduleType: 'js',
|
343
276
|
}
|
344
277
|
},
|
@@ -346,12 +279,3 @@ export const Pages = ({
|
|
346
279
|
},
|
347
280
|
]
|
348
281
|
}
|
349
|
-
|
350
|
-
// Helper to get tree
|
351
|
-
export const getRouteTree = async (config: Config.Config): Promise<FileRouter.RouteTreeNode> => {
|
352
|
-
const result = await FileRouter.scanTree({
|
353
|
-
dir: config.paths.project.absolute.pages,
|
354
|
-
glob: `**/*.{md,mdx}`,
|
355
|
-
})
|
356
|
-
return result.routeTree
|
357
|
-
}
|
@@ -3,7 +3,7 @@ import { reportError } from '#api/server/report-error'
|
|
3
3
|
import type { Hono } from '#dep/hono/index'
|
4
4
|
import type { Vite } from '#dep/vite/index'
|
5
5
|
import { ResponseInternalServerError } from '#lib/kit-temp'
|
6
|
-
import {
|
6
|
+
import { debugPolen } from '#singletons/debug'
|
7
7
|
import * as HonoNodeServer from '@hono/node-server'
|
8
8
|
import { Err } from '@wollybeard/kit'
|
9
9
|
|
@@ -16,11 +16,11 @@ interface AppServerModule {
|
|
16
16
|
export const Serve = (
|
17
17
|
config: Config.Config,
|
18
18
|
): Vite.PluginOption => {
|
19
|
-
const
|
19
|
+
const debug = debugPolen.sub(`serve`)
|
20
20
|
let appPromise: Promise<App | Error>
|
21
21
|
|
22
22
|
const reloadApp = async ({ server }: { server: Vite.ViteDevServer }): Promise<App | Error> => {
|
23
|
-
|
23
|
+
debug('reloadApp')
|
24
24
|
return server.ssrLoadModule(config.paths.framework.template.server.app)
|
25
25
|
.then(module => module as AppServerModule)
|
26
26
|
.then(module => module.app)
|
@@ -55,12 +55,12 @@ export const Serve = (
|
|
55
55
|
}
|
56
56
|
},
|
57
57
|
handleHotUpdate({ server }) {
|
58
|
-
|
58
|
+
debug('handleHotUpdate')
|
59
59
|
// Reload app server immediately in the background
|
60
60
|
appPromise = reloadApp({ server })
|
61
61
|
},
|
62
62
|
async configureServer(server) {
|
63
|
-
|
63
|
+
debug('configureServer')
|
64
64
|
// Initial load
|
65
65
|
appPromise = reloadApp({ server })
|
66
66
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { Vite } from '#dep/vite/index'
|
2
2
|
import { type ImportEvent, isSpecifierFromPackage } from '#lib/kit-temp'
|
3
3
|
import { packagePaths } from '#package-paths'
|
4
|
-
import {
|
4
|
+
import { debugPolen } from '#singletons/debug'
|
5
5
|
import type * as Module from 'node:module'
|
6
6
|
import { fileURLToPath } from 'node:url'
|
7
7
|
|
@@ -18,7 +18,7 @@ export function initialize(data: SelfContainedModeHooksData) {
|
|
18
18
|
export const resolve: Module.ResolveHook = async (specifier, context, nextResolve) => {
|
19
19
|
if (!data_) throw new Error(`Self-contained mode not initialized`)
|
20
20
|
|
21
|
-
const
|
21
|
+
const debug = debugPolen.sub(`node-module-hooks`)
|
22
22
|
|
23
23
|
const from: ImportEvent = {
|
24
24
|
specifier,
|
@@ -32,7 +32,7 @@ export const resolve: Module.ResolveHook = async (specifier, context, nextResolv
|
|
32
32
|
importerPathExpOrFileUrlExp: from.context.parentURL,
|
33
33
|
})
|
34
34
|
) {
|
35
|
-
|
35
|
+
debug(`resolve check`, { specifier, context })
|
36
36
|
|
37
37
|
const to: ImportEvent = {
|
38
38
|
specifier: from.specifier,
|
@@ -43,7 +43,7 @@ export const resolve: Module.ResolveHook = async (specifier, context, nextResolv
|
|
43
43
|
},
|
44
44
|
}
|
45
45
|
|
46
|
-
|
46
|
+
debug(`resolve`, { from, to })
|
47
47
|
|
48
48
|
await nextResolve(to.specifier, to.context)
|
49
49
|
}
|
@@ -66,7 +66,7 @@ export const checkIsSelfImportFromProject = (input: {
|
|
66
66
|
}
|
67
67
|
|
68
68
|
export const VitePluginSelfContainedMode = ({ projectDirPathExp }: { projectDirPathExp: string }): Vite.Plugin => {
|
69
|
-
const d =
|
69
|
+
const d = debugPolen.sub(`vite-plugin:self-contained-import`)
|
70
70
|
|
71
71
|
return {
|
72
72
|
name: `polen:self-contained-import`,
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
import { Arr, Cli, Path, Str } from '@wollybeard/kit'
|
4
|
+
import $ from 'ansis'
|
5
|
+
import console from 'console'
|
6
|
+
|
7
|
+
const commandsDir = import.meta.dirname
|
8
|
+
const thisModuleName = Path.parse(import.meta.filename).name
|
9
|
+
const cliName = `polen static`
|
10
|
+
|
11
|
+
const h2 = (str: string) => {
|
12
|
+
return $.bold.black.bgWhiteBright(` ${str.toUpperCase()} `)
|
13
|
+
}
|
14
|
+
|
15
|
+
const code = (str: string) => {
|
16
|
+
if (!$.isSupported()) return `\`${str}\``
|
17
|
+
return $.magenta(str)
|
18
|
+
}
|
19
|
+
|
20
|
+
const s = Str.Builder()
|
21
|
+
const allCommands = await Cli.discoverCommandPointers(commandsDir)
|
22
|
+
const commands = allCommands.filter(_ => _.name !== thisModuleName)
|
23
|
+
|
24
|
+
s``
|
25
|
+
s`${$.bold.redBright`POLEN 🌺`} ${$.dim(`static commands`)}`
|
26
|
+
s`Manage static builds and deployments.`
|
27
|
+
s``
|
28
|
+
s``
|
29
|
+
s`${h2(`commands`)}`
|
30
|
+
s``
|
31
|
+
|
32
|
+
if (Arr.isEmpty(commands)) {
|
33
|
+
s`No commands available yet.`
|
34
|
+
} else {
|
35
|
+
commands.forEach(command => {
|
36
|
+
s`${$.dim`$ ${cliName}`} ${$.cyanBright(command.name)}`
|
37
|
+
})
|
38
|
+
}
|
39
|
+
s``
|
40
|
+
s`${$.dim`Get help for a command with ${code(`polen static <command> --help`)}`}`
|
41
|
+
s``
|
42
|
+
|
43
|
+
console.log(Str.indent(String(s)))
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
// @ts-nocheck
|
3
|
+
import { Api } from '#api/index'
|
4
|
+
import { Task } from '#lib/task'
|
5
|
+
import { Command } from '@molt/command'
|
6
|
+
import { Err, Path } from '@wollybeard/kit'
|
7
|
+
import { z } from 'zod'
|
8
|
+
|
9
|
+
const args = Command.create()
|
10
|
+
.parameter(
|
11
|
+
`source`,
|
12
|
+
z.string().describe('Path to the Polen build directory to rebase'),
|
13
|
+
)
|
14
|
+
.parameter(
|
15
|
+
`newBasePath`,
|
16
|
+
z.string().describe('New base path for the build (e.g., /new-path/)'),
|
17
|
+
)
|
18
|
+
.parameter(
|
19
|
+
`--target -t`,
|
20
|
+
z.string().optional().describe('Target directory for copy mode (if not provided, mutate in place)'),
|
21
|
+
)
|
22
|
+
.parse()
|
23
|
+
|
24
|
+
const plan: Api.Static.RebasePlan = args.target
|
25
|
+
? {
|
26
|
+
changeMode: 'copy',
|
27
|
+
sourcePath: args.source,
|
28
|
+
targetPath: args.target,
|
29
|
+
newBasePath: args.newBasePath,
|
30
|
+
}
|
31
|
+
: {
|
32
|
+
changeMode: 'mutate',
|
33
|
+
sourcePath: args.source,
|
34
|
+
newBasePath: args.newBasePath,
|
35
|
+
}
|
36
|
+
|
37
|
+
await Task.runAndExit(Api.Static.rebase, plan)
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from '#template/components/content/$$'
|