polen 0.9.1-next.2 → 0.10.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -364
- package/build/api/api.d.ts +1 -0
- package/build/api/api.d.ts.map +1 -1
- package/build/api/api.js +1 -0
- package/build/api/api.js.map +1 -1
- package/build/api/config/configurator.d.ts +9 -1
- package/build/api/config/configurator.d.ts.map +1 -1
- package/build/api/config/configurator.js +18 -6
- package/build/api/config/configurator.js.map +1 -1
- package/build/api/config/load.js +5 -5
- package/build/api/config/load.js.map +1 -1
- package/build/api/config-resolver/resolve.js +2 -2
- package/build/api/config-resolver/resolve.js.map +1 -1
- package/build/api/content/$$.d.ts +7 -0
- package/build/api/content/$$.d.ts.map +1 -0
- package/build/api/content/$$.js +7 -0
- package/build/api/content/$$.js.map +1 -0
- package/build/api/content/$.d.ts +2 -0
- package/build/api/content/$.d.ts.map +1 -0
- package/build/api/content/$.js +2 -0
- package/build/api/content/$.js.map +1 -0
- package/build/api/content/metadata.d.ts +10 -0
- package/build/api/content/metadata.d.ts.map +1 -0
- package/build/api/content/metadata.js +9 -0
- package/build/api/content/metadata.js.map +1 -0
- package/build/api/content/navbar.d.ts +10 -0
- package/build/api/content/navbar.d.ts.map +1 -0
- package/build/api/content/navbar.js +45 -0
- package/build/api/content/navbar.js.map +1 -0
- package/build/api/content/page.d.ts +11 -0
- package/build/api/content/page.d.ts.map +1 -0
- package/build/api/content/page.js +2 -0
- package/build/api/content/page.js.map +1 -0
- package/build/api/content/scan.d.ts +19 -0
- package/build/api/content/scan.d.ts.map +1 -0
- package/build/api/content/scan.js +90 -0
- package/build/api/content/scan.js.map +1 -0
- package/build/api/content/sidebar.d.ts +104 -0
- package/build/api/content/sidebar.d.ts.map +1 -0
- package/build/api/content/sidebar.js +166 -0
- package/build/api/content/sidebar.js.map +1 -0
- package/build/api/content/utils.d.ts +5 -0
- package/build/api/content/utils.d.ts.map +1 -0
- package/build/api/content/utils.js +8 -0
- package/build/api/content/utils.js.map +1 -0
- package/build/api/schema/data-sources/schema-directory/schema-directory.js +1 -1
- package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
- package/build/api/static/index.d.ts +2 -0
- package/build/api/static/index.d.ts.map +1 -0
- package/build/api/static/index.js +2 -0
- package/build/api/static/index.js.map +1 -0
- package/build/api/static/manifest.d.ts +18 -0
- package/build/api/static/manifest.d.ts.map +1 -0
- package/build/api/static/manifest.js +13 -0
- package/build/api/static/manifest.js.map +1 -0
- package/build/api/static/rebase.d.ts +14 -0
- package/build/api/static/rebase.d.ts.map +1 -0
- package/build/api/static/rebase.js +110 -0
- package/build/api/static/rebase.js.map +1 -0
- package/build/api/static/static.d.ts +3 -0
- package/build/api/static/static.d.ts.map +1 -0
- package/build/api/static/static.js +3 -0
- package/build/api/static/static.js.map +1 -0
- package/build/api/vite/plugins/branding/index.d.ts +4 -0
- package/build/api/vite/plugins/branding/index.d.ts.map +1 -0
- package/build/api/vite/plugins/branding/index.js +80 -0
- package/build/api/vite/plugins/branding/index.js.map +1 -0
- package/build/api/vite/plugins/build.d.ts.map +1 -1
- package/build/api/vite/plugins/build.js +22 -1
- package/build/api/vite/plugins/build.js.map +1 -1
- package/build/api/vite/plugins/core.d.ts +2 -2
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +4 -5
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/main.d.ts.map +1 -1
- package/build/api/vite/plugins/main.js +2 -1
- package/build/api/vite/plugins/main.js.map +1 -1
- package/build/api/vite/plugins/pages.d.ts +8 -14
- package/build/api/vite/plugins/pages.d.ts.map +1 -1
- package/build/api/vite/plugins/pages.js +110 -183
- package/build/api/vite/plugins/pages.js.map +1 -1
- package/build/api/vite/plugins/serve.js +5 -5
- package/build/api/vite/plugins/serve.js.map +1 -1
- package/build/cli/_/self-contained-mode.js +5 -5
- package/build/cli/_/self-contained-mode.js.map +1 -1
- package/build/cli/commands/static/$default.d.ts +3 -0
- package/build/cli/commands/static/$default.d.ts.map +1 -0
- package/build/cli/commands/static/$default.js +38 -0
- package/build/cli/commands/static/$default.js.map +1 -0
- package/build/cli/commands/static/rebase.d.ts +2 -0
- package/build/cli/commands/static/rebase.d.ts.map +1 -0
- package/build/cli/commands/static/rebase.js +26 -0
- package/build/cli/commands/static/rebase.js.map +1 -0
- package/build/cli/commands/static.d.ts +3 -0
- package/build/cli/commands/static.d.ts.map +1 -0
- package/build/cli/commands/static.js +5 -0
- package/build/cli/commands/static.js.map +1 -0
- package/build/exports/components.d.ts +2 -0
- package/build/exports/components.d.ts.map +1 -0
- package/build/exports/components.js +2 -0
- package/build/exports/components.js.map +1 -0
- package/build/lib/demos/builder.d.ts +83 -0
- package/build/lib/demos/builder.d.ts.map +1 -0
- package/build/lib/demos/builder.js +237 -0
- package/build/lib/demos/builder.js.map +1 -0
- package/build/lib/demos/config-schema.d.ts +243 -0
- package/build/lib/demos/config-schema.d.ts.map +1 -0
- package/build/lib/demos/config-schema.js +52 -0
- package/build/lib/demos/config-schema.js.map +1 -0
- package/build/lib/demos/config.d.ts +40 -0
- package/build/lib/demos/config.d.ts.map +1 -0
- package/build/lib/demos/config.js +180 -0
- package/build/lib/demos/config.js.map +1 -0
- package/build/lib/demos/index.d.ts +9 -0
- package/build/lib/demos/index.d.ts.map +1 -0
- package/build/lib/demos/index.js +8 -0
- package/build/lib/demos/index.js.map +1 -0
- package/build/lib/demos/ui/components.d.ts +33 -0
- package/build/lib/demos/ui/components.d.ts.map +1 -0
- package/build/lib/demos/ui/components.js +699 -0
- package/build/lib/demos/ui/components.js.map +1 -0
- package/build/lib/demos/ui/data-collector.d.ts +88 -0
- package/build/lib/demos/ui/data-collector.d.ts.map +1 -0
- package/build/lib/demos/ui/data-collector.js +174 -0
- package/build/lib/demos/ui/data-collector.js.map +1 -0
- package/build/lib/demos/ui/landing-page-cli.d.ts +3 -0
- package/build/lib/demos/ui/landing-page-cli.d.ts.map +1 -0
- package/build/lib/demos/ui/landing-page-cli.js +21 -0
- package/build/lib/demos/ui/landing-page-cli.js.map +1 -0
- package/build/lib/demos/ui/landing-page.d.ts +32 -0
- package/build/lib/demos/ui/landing-page.d.ts.map +1 -0
- package/build/lib/demos/ui/landing-page.js +83 -0
- package/build/lib/demos/ui/landing-page.js.map +1 -0
- package/build/lib/demos/ui/page-renderer.d.ts +26 -0
- package/build/lib/demos/ui/page-renderer.d.ts.map +1 -0
- package/build/lib/demos/ui/page-renderer.js +104 -0
- package/build/lib/demos/ui/page-renderer.js.map +1 -0
- package/build/lib/demos/utils.d.ts +14 -0
- package/build/lib/demos/utils.d.ts.map +1 -0
- package/build/lib/demos/utils.js +37 -0
- package/build/lib/demos/utils.js.map +1 -0
- package/build/lib/deployment/$$.d.ts +3 -0
- package/build/lib/deployment/$$.d.ts.map +1 -0
- package/build/lib/deployment/$$.js +3 -0
- package/build/lib/deployment/$$.js.map +1 -0
- package/build/lib/deployment/$.d.ts +2 -0
- package/build/lib/deployment/$.d.ts.map +1 -0
- package/build/lib/deployment/$.js +2 -0
- package/build/lib/deployment/$.js.map +1 -0
- package/build/lib/deployment/metadata.d.ts +32 -0
- package/build/lib/deployment/metadata.d.ts.map +1 -0
- package/build/lib/deployment/metadata.js +37 -0
- package/build/lib/deployment/metadata.js.map +1 -0
- package/build/lib/deployment/path-manager.d.ts +41 -0
- package/build/lib/deployment/path-manager.d.ts.map +1 -0
- package/build/lib/deployment/path-manager.js +157 -0
- package/build/lib/deployment/path-manager.js.map +1 -0
- package/build/lib/file-router/file-router.d.ts +0 -2
- package/build/lib/file-router/file-router.d.ts.map +1 -1
- package/build/lib/file-router/file-router.js +0 -2
- package/build/lib/file-router/file-router.js.map +1 -1
- package/build/lib/file-router/route.d.ts +2 -0
- package/build/lib/file-router/route.d.ts.map +1 -1
- package/build/lib/file-router/route.js.map +1 -1
- package/build/lib/file-router/scan.d.ts.map +1 -1
- package/build/lib/file-router/scan.js +22 -13
- package/build/lib/file-router/scan.js.map +1 -1
- package/build/lib/github-actions/git-controller.d.ts +50 -0
- package/build/lib/github-actions/git-controller.d.ts.map +1 -0
- package/build/lib/github-actions/git-controller.js +90 -0
- package/build/lib/github-actions/git-controller.js.map +1 -0
- package/build/lib/github-actions/github-actions.d.ts +7 -0
- package/build/lib/github-actions/github-actions.d.ts.map +1 -0
- package/build/lib/github-actions/github-actions.js +7 -0
- package/build/lib/github-actions/github-actions.js.map +1 -0
- package/build/lib/github-actions/index.d.ts +2 -0
- package/build/lib/github-actions/index.d.ts.map +1 -0
- package/build/lib/github-actions/index.js +2 -0
- package/build/lib/github-actions/index.js.map +1 -0
- package/build/lib/github-actions/lib/get-pr-deployments.d.ts +12 -0
- package/build/lib/github-actions/lib/get-pr-deployments.d.ts.map +1 -0
- package/build/lib/github-actions/lib/get-pr-deployments.js +51 -0
- package/build/lib/github-actions/lib/get-pr-deployments.js.map +1 -0
- package/build/lib/github-actions/pr-controller.d.ts +39 -0
- package/build/lib/github-actions/pr-controller.d.ts.map +1 -0
- package/build/lib/github-actions/pr-controller.js +122 -0
- package/build/lib/github-actions/pr-controller.js.map +1 -0
- package/build/lib/github-actions/run-step-cli.d.ts +9 -0
- package/build/lib/github-actions/run-step-cli.d.ts.map +1 -0
- package/build/lib/github-actions/run-step-cli.js +71 -0
- package/build/lib/github-actions/run-step-cli.js.map +1 -0
- package/build/lib/github-actions/runner.d.ts +17 -0
- package/build/lib/github-actions/runner.d.ts.map +1 -0
- package/build/lib/github-actions/runner.js +195 -0
- package/build/lib/github-actions/runner.js.map +1 -0
- package/build/lib/github-actions/schemas/context.d.ts +933 -0
- package/build/lib/github-actions/schemas/context.d.ts.map +1 -0
- package/build/lib/github-actions/schemas/context.js +407 -0
- package/build/lib/github-actions/schemas/context.js.map +1 -0
- package/build/lib/github-actions/schemas/index.d.ts +5 -0
- package/build/lib/github-actions/schemas/index.d.ts.map +1 -0
- package/build/lib/github-actions/schemas/index.js +5 -0
- package/build/lib/github-actions/schemas/index.js.map +1 -0
- package/build/lib/github-actions/search-module.d.ts +38 -0
- package/build/lib/github-actions/search-module.d.ts.map +1 -0
- package/build/lib/github-actions/search-module.js +40 -0
- package/build/lib/github-actions/search-module.js.map +1 -0
- package/build/lib/github-actions/step.d.ts +163 -0
- package/build/lib/github-actions/step.d.ts.map +1 -0
- package/build/lib/github-actions/step.js +121 -0
- package/build/lib/github-actions/step.js.map +1 -0
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +5 -3
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/kit-temp.d.ts +54 -0
- package/build/lib/kit-temp.d.ts.map +1 -1
- package/build/lib/kit-temp.js +82 -14
- package/build/lib/kit-temp.js.map +1 -1
- package/build/lib/kit-temp.test-d.d.ts +2 -0
- package/build/lib/kit-temp.test-d.d.ts.map +1 -0
- package/build/lib/kit-temp.test-d.js +75 -0
- package/build/lib/kit-temp.test-d.js.map +1 -0
- package/build/lib/mask/$$.d.ts +3 -0
- package/build/lib/mask/$$.d.ts.map +1 -0
- package/build/lib/mask/$$.js +3 -0
- package/build/lib/mask/$$.js.map +1 -0
- package/build/lib/mask/$.d.ts +2 -0
- package/build/lib/mask/$.d.ts.map +1 -0
- package/build/lib/mask/$.js +2 -0
- package/build/lib/mask/$.js.map +1 -0
- package/build/lib/mask/apply.d.ts +86 -0
- package/build/lib/mask/apply.d.ts.map +1 -0
- package/build/lib/mask/apply.js +86 -0
- package/build/lib/mask/apply.js.map +1 -0
- package/build/lib/mask/mask.d.ts +124 -0
- package/build/lib/mask/mask.d.ts.map +1 -0
- package/build/lib/mask/mask.js +137 -0
- package/build/lib/mask/mask.js.map +1 -0
- package/build/lib/mask/mask.test-d.d.ts +2 -0
- package/build/lib/mask/mask.test-d.d.ts.map +1 -0
- package/build/lib/mask/mask.test-d.js +102 -0
- package/build/lib/mask/mask.test-d.js.map +1 -0
- package/build/lib/mutation-type.d.ts +18 -0
- package/build/lib/mutation-type.d.ts.map +1 -0
- package/build/lib/mutation-type.js +16 -0
- package/build/lib/mutation-type.js.map +1 -0
- package/build/lib/task/$$.d.ts +3 -0
- package/build/lib/task/$$.d.ts.map +1 -0
- package/build/lib/task/$$.js +3 -0
- package/build/lib/task/$$.js.map +1 -0
- package/build/lib/task/$.d.ts +2 -0
- package/build/lib/task/$.d.ts.map +1 -0
- package/build/lib/task/$.js +2 -0
- package/build/lib/task/$.js.map +1 -0
- package/build/lib/task/report.d.ts +28 -0
- package/build/lib/task/report.d.ts.map +1 -0
- package/build/lib/task/report.js +33 -0
- package/build/lib/task/report.js.map +1 -0
- package/build/lib/task/task.d.ts +44 -0
- package/build/lib/task/task.d.ts.map +1 -0
- package/build/lib/task/task.js +63 -0
- package/build/lib/task/task.js.map +1 -0
- package/build/lib/version-history/index.d.ts +3 -0
- package/build/lib/version-history/index.d.ts.map +1 -0
- package/build/lib/version-history/index.js +2 -0
- package/build/lib/version-history/index.js.map +1 -0
- package/build/lib/version-history/types.d.ts +64 -0
- package/build/lib/version-history/types.d.ts.map +1 -0
- package/build/lib/version-history/types.js +5 -0
- package/build/lib/version-history/types.js.map +1 -0
- package/build/lib/version-history/version-history.d.ts +85 -0
- package/build/lib/version-history/version-history.d.ts.map +1 -0
- package/build/lib/version-history/version-history.js +248 -0
- package/build/lib/version-history/version-history.js.map +1 -0
- package/build/project-data.d.ts +0 -1
- package/build/project-data.d.ts.map +1 -1
- package/build/sandbox.d.ts +2 -0
- package/build/sandbox.d.ts.map +1 -0
- package/build/sandbox.js +18 -0
- package/build/sandbox.js.map +1 -0
- package/build/singletons/debug.d.ts +1 -1
- package/build/singletons/debug.d.ts.map +1 -1
- package/build/singletons/debug.js +1 -1
- package/build/singletons/debug.js.map +1 -1
- package/build/template/components/CodeBlockEnhancer.d.ts +2 -0
- package/build/template/components/CodeBlockEnhancer.d.ts.map +1 -0
- package/build/template/components/CodeBlockEnhancer.jsx +175 -0
- package/build/template/components/CodeBlockEnhancer.jsx.map +1 -0
- package/build/template/components/HamburgerMenu.d.ts +9 -0
- package/build/template/components/HamburgerMenu.d.ts.map +1 -0
- package/build/template/components/HamburgerMenu.jsx +53 -0
- package/build/template/components/HamburgerMenu.jsx.map +1 -0
- package/build/template/components/Link.jsx +1 -1
- package/build/template/components/Logo.d.ts +9 -0
- package/build/template/components/Logo.d.ts.map +1 -0
- package/build/template/components/Logo.jsx +29 -0
- package/build/template/components/Logo.jsx.map +1 -0
- package/build/template/components/NotFound.d.ts +2 -0
- package/build/template/components/NotFound.d.ts.map +1 -0
- package/build/template/components/NotFound.jsx +26 -0
- package/build/template/components/NotFound.jsx.map +1 -0
- package/build/template/components/ThemeToggle.d.ts +3 -0
- package/build/template/components/ThemeToggle.d.ts.map +1 -0
- package/build/template/components/ThemeToggle.jsx +10 -0
- package/build/template/components/ThemeToggle.jsx.map +1 -0
- package/build/template/components/content/$$.d.ts +2 -0
- package/build/template/components/content/$$.d.ts.map +1 -0
- package/build/template/components/content/$$.js +2 -0
- package/build/template/components/content/$$.js.map +1 -0
- package/build/template/components/sidebar/Sidebar.d.ts +2 -2
- package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.d.ts +3 -3
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.jsx +3 -3
- package/build/template/components/sidebar/SidebarItem.jsx.map +1 -1
- package/build/template/contexts/ThemeContext.d.ts +12 -0
- package/build/template/contexts/ThemeContext.d.ts.map +1 -0
- package/build/template/contexts/ThemeContext.jsx +41 -0
- package/build/template/contexts/ThemeContext.jsx.map +1 -0
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/reference.jsx +4 -8
- package/build/template/routes/reference.jsx.map +1 -1
- package/build/template/routes/root.d.ts.map +1 -1
- package/build/template/routes/root.jsx +192 -55
- package/build/template/routes/root.jsx.map +1 -1
- package/build/template/server/app.d.ts.map +1 -1
- package/build/template/server/app.js +2 -21
- package/build/template/server/app.js.map +1 -1
- package/package.json +27 -13
- package/src/api/api.ts +1 -0
- package/src/api/config/configurator.ts +28 -6
- package/src/api/config/load.ts +5 -5
- package/src/api/config-resolver/resolve.ts +2 -2
- package/src/api/content/$$.ts +6 -0
- package/src/api/content/$.test.ts +72 -0
- package/src/api/content/$.ts +1 -0
- package/src/api/content/metadata.ts +11 -0
- package/src/api/content/navbar.test.ts +55 -0
- package/src/api/content/navbar.ts +61 -0
- package/src/api/content/page.ts +12 -0
- package/src/api/content/scan.ts +117 -0
- package/src/api/content/sidebar.test.ts +297 -0
- package/src/api/content/sidebar.ts +283 -0
- package/src/api/content/utils.ts +7 -0
- package/src/api/schema/data-sources/schema-directory/schema-directory.ts +1 -1
- package/src/api/singletons/markdown/markdown.test.ts +1 -1
- package/src/api/static/index.ts +1 -0
- package/src/api/static/manifest.test.ts +106 -0
- package/src/api/static/manifest.ts +16 -0
- package/src/api/static/rebase.test.ts +229 -0
- package/src/api/static/rebase.ts +140 -0
- package/src/api/static/static.ts +2 -0
- package/src/api/utils/asset-url/asset-url.test.ts +4 -4
- package/src/api/vite/plugins/branding/index.ts +108 -0
- package/src/api/vite/plugins/build.ts +25 -1
- package/src/api/vite/plugins/core.ts +6 -7
- package/src/api/vite/plugins/main.ts +2 -0
- package/src/api/vite/plugins/pages.ts +131 -207
- package/src/api/vite/plugins/serve.ts +5 -5
- package/src/cli/_/self-contained-mode.ts +5 -5
- package/src/cli/commands/static/$default.ts +43 -0
- package/src/cli/commands/static/rebase.ts +37 -0
- package/src/cli/commands/static.ts +6 -0
- package/src/exports/components.ts +1 -0
- package/src/lib/demos/builder.ts +298 -0
- package/src/lib/demos/config-schema.ts +56 -0
- package/src/lib/demos/config.test.ts +193 -0
- package/src/lib/demos/config.ts +205 -0
- package/src/lib/demos/index.ts +9 -0
- package/src/lib/demos/ui/components.ts +739 -0
- package/src/lib/demos/ui/data-collector.ts +246 -0
- package/src/lib/demos/ui/landing-page-cli.ts +23 -0
- package/src/lib/demos/ui/landing-page.ts +126 -0
- package/src/lib/demos/ui/page-renderer.ts +124 -0
- package/src/lib/demos/utils.ts +43 -0
- package/src/lib/deployment/$$.ts +2 -0
- package/src/lib/deployment/$.test.ts +53 -0
- package/src/lib/deployment/$.ts +1 -0
- package/src/lib/deployment/metadata.ts +40 -0
- package/src/lib/deployment/path-manager.ts +186 -0
- package/src/lib/file-router/file-router.ts +0 -2
- package/src/lib/file-router/linter.test.ts +2 -0
- package/src/lib/file-router/route.ts +2 -0
- package/src/lib/file-router/scan.ts +26 -14
- package/src/lib/github-actions/git-controller.ts +151 -0
- package/src/lib/github-actions/github-actions.ts +6 -0
- package/src/lib/github-actions/index.ts +1 -0
- package/src/lib/github-actions/lib/get-pr-deployments.ts +76 -0
- package/src/lib/github-actions/pr-controller.test.ts +172 -0
- package/src/lib/github-actions/pr-controller.ts +183 -0
- package/src/lib/github-actions/run-step-cli.ts +84 -0
- package/src/lib/github-actions/runner.test.ts +192 -0
- package/src/lib/github-actions/runner.ts +226 -0
- package/src/lib/github-actions/schemas/context.ts +424 -0
- package/src/lib/github-actions/schemas/index.ts +5 -0
- package/src/lib/github-actions/search-module.test.ts +110 -0
- package/src/lib/github-actions/search-module.ts +76 -0
- package/src/lib/github-actions/step.test.ts +149 -0
- package/src/lib/github-actions/step.ts +232 -0
- package/src/lib/helpers.ts +4 -3
- package/src/lib/kit-temp.test-d.ts +115 -0
- package/src/lib/kit-temp.test.ts +127 -0
- package/src/lib/kit-temp.ts +128 -14
- package/src/lib/mask/$$.ts +2 -0
- package/src/lib/mask/$.test.ts +248 -0
- package/src/lib/mask/$.ts +1 -0
- package/src/lib/mask/apply.ts +134 -0
- package/src/lib/mask/mask.test-d.ts +144 -0
- package/src/lib/mask/mask.ts +244 -0
- package/src/lib/mutation-type.ts +20 -0
- package/src/lib/shiki/shiki.test.ts +1 -1
- package/src/lib/task/$$.ts +2 -0
- package/src/lib/task/$.test.ts +209 -0
- package/src/lib/task/$.ts +1 -0
- package/src/lib/task/report.ts +72 -0
- package/src/lib/task/task.ts +112 -0
- package/src/lib/version-history/index.test.ts +196 -0
- package/src/lib/version-history/index.ts +4 -0
- package/src/lib/version-history/types.ts +68 -0
- package/src/lib/version-history/version-history.ts +293 -0
- package/src/project-data.ts +0 -1
- package/src/sandbox.ts +20 -0
- package/src/singletons/debug.ts +1 -1
- package/src/template/components/CodeBlockEnhancer.tsx +192 -0
- package/src/template/components/HamburgerMenu.tsx +96 -0
- package/src/template/components/Link.tsx +1 -1
- package/src/template/components/Logo.tsx +46 -0
- package/src/template/components/NotFound.tsx +28 -0
- package/src/template/components/ThemeToggle.tsx +21 -0
- package/src/template/components/content/$$.ts +1 -0
- package/src/template/components/sidebar/Sidebar.tsx +2 -2
- package/src/template/components/sidebar/SidebarItem.tsx +12 -12
- package/src/template/contexts/ThemeContext.tsx +60 -0
- package/src/template/routes/reference.tsx +4 -8
- package/src/template/routes/root.tsx +216 -76
- package/src/template/server/app.ts +2 -27
- package/build/lib/file-router/scan-tree.d.ts +0 -20
- package/build/lib/file-router/scan-tree.d.ts.map +0 -1
- package/build/lib/file-router/scan-tree.js +0 -158
- package/build/lib/file-router/scan-tree.js.map +0 -1
- package/build/lib/file-router/sidebar/index.d.ts +0 -3
- package/build/lib/file-router/sidebar/index.d.ts.map +0 -1
- package/build/lib/file-router/sidebar/index.js +0 -4
- package/build/lib/file-router/sidebar/index.js.map +0 -1
- package/build/lib/file-router/sidebar/sidebar-tree.d.ts +0 -9
- package/build/lib/file-router/sidebar/sidebar-tree.d.ts.map +0 -1
- package/build/lib/file-router/sidebar/sidebar-tree.js +0 -85
- package/build/lib/file-router/sidebar/sidebar-tree.js.map +0 -1
- package/build/lib/file-router/sidebar/types.d.ts +0 -17
- package/build/lib/file-router/sidebar/types.d.ts.map +0 -1
- package/build/lib/file-router/sidebar/types.js +0 -2
- package/build/lib/file-router/sidebar/types.js.map +0 -1
- package/build/lib/tree/index.d.ts +0 -3
- package/build/lib/tree/index.d.ts.map +0 -1
- package/build/lib/tree/index.js +0 -2
- package/build/lib/tree/index.js.map +0 -1
- package/build/lib/tree/tree.d.ts +0 -62
- package/build/lib/tree/tree.d.ts.map +0 -1
- package/build/lib/tree/tree.js +0 -134
- package/build/lib/tree/tree.js.map +0 -1
- package/src/lib/file-router/scan-tree.test.ts +0 -189
- package/src/lib/file-router/scan-tree.ts +0 -205
- package/src/lib/file-router/sidebar/index.ts +0 -3
- package/src/lib/file-router/sidebar/sidebar-tree.test.ts +0 -123
- package/src/lib/file-router/sidebar/sidebar-tree.ts +0 -110
- package/src/lib/file-router/sidebar/types.ts +0 -19
- package/src/lib/tree/index.ts +0 -2
- package/src/lib/tree/tree.test.ts +0 -117
- package/src/lib/tree/tree.ts +0 -183
@@ -0,0 +1,163 @@
|
|
1
|
+
/**
|
2
|
+
* Type-safe workflow step framework for GitHub Actions
|
3
|
+
*/
|
4
|
+
import type { GitHub } from '@actions/github/lib/utils.ts';
|
5
|
+
import { z } from 'zod/v4';
|
6
|
+
import type { GitController } from './git-controller.ts';
|
7
|
+
import type { PullRequestController } from './pr-controller.ts';
|
8
|
+
import type { Context, ContextSchema as RealContextSchema } from './schemas/context.ts';
|
9
|
+
/**
|
10
|
+
* Arguments passed to the step's run function.
|
11
|
+
*
|
12
|
+
* @template $Inputs - The validated input values based on your inputs schema
|
13
|
+
* @template $Context - The GitHub Actions context (validated if context schema provided)
|
14
|
+
*/
|
15
|
+
export interface Args<$Inputs extends Inputs = Inputs, $Context = Context> {
|
16
|
+
/** GitHub Actions core utilities for logging, setting outputs, etc. */
|
17
|
+
core: typeof import('@actions/core');
|
18
|
+
/** GitHub Actions context containing event payload, repo info, etc. */
|
19
|
+
context: $Context;
|
20
|
+
/** Validated input values passed to the step */
|
21
|
+
inputs: $Inputs;
|
22
|
+
/** Authenticated Octokit instance for GitHub API operations */
|
23
|
+
github: InstanceType<typeof GitHub>;
|
24
|
+
/** zx's $ function for executing shell commands */
|
25
|
+
$: typeof import('zx').$;
|
26
|
+
/** Node.js fs/promises module for file operations */
|
27
|
+
fs: typeof import('node:fs/promises');
|
28
|
+
/** PR controller for pull request operations (comment, review, etc.) */
|
29
|
+
pr: PullRequestController;
|
30
|
+
/** Git controller for git operations (commit, push, etc.) without subprocess details */
|
31
|
+
git: GitController;
|
32
|
+
}
|
33
|
+
export type Outputs = object;
|
34
|
+
export type Inputs = object;
|
35
|
+
type InputsSchema = z.ZodObject;
|
36
|
+
type OutputsSchema = z.ZodObject;
|
37
|
+
type ContextSchema = z.Schema;
|
38
|
+
export interface Step<$InputsSchema extends InputsSchema = InputsSchema, $OutputsSchema extends OutputsSchema = OutputsSchema, $ContextSchema extends ContextSchema = ContextSchema> {
|
39
|
+
definition: Definition<$InputsSchema, $OutputsSchema, $ContextSchema>;
|
40
|
+
run: Runner<z.output<$InputsSchema>, z.output<$OutputsSchema>, z.output<$ContextSchema>>;
|
41
|
+
}
|
42
|
+
export type Runner<$Inputs extends Inputs = Inputs, $Outputs extends Outputs = Outputs, $Context = Context> = (context: Args<$Inputs, $Context>) => Promise<$Outputs>;
|
43
|
+
export interface Definition<$InputsSchema extends InputsSchema, $OutputsSchema extends OutputsSchema, $ContextSchema extends ContextSchema> {
|
44
|
+
description?: string;
|
45
|
+
name?: string;
|
46
|
+
inputsSchema?: $InputsSchema;
|
47
|
+
outputsSchema?: $OutputsSchema;
|
48
|
+
contextSchema?: $ContextSchema;
|
49
|
+
}
|
50
|
+
export interface CreateInput<$InputsSchema extends InputsSchema, $OutputsSchema extends OutputsSchema, $ContextSchema extends z.Schema> {
|
51
|
+
description?: string;
|
52
|
+
name?: string;
|
53
|
+
inputs?: $InputsSchema;
|
54
|
+
outputs?: $OutputsSchema;
|
55
|
+
context?: $ContextSchema;
|
56
|
+
run: (args: Args<z.output<$InputsSchema>, z.output<$ContextSchema>>) => Promise<{} extends z.Infer<$OutputsSchema> ? void : z.Infer<$OutputsSchema>>;
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* Create a type-safe GitHub Actions workflow step with runtime validation.
|
60
|
+
*
|
61
|
+
* This is the main entry point for defining custom workflow steps that can be executed
|
62
|
+
* by the GitHub Actions runner. It provides:
|
63
|
+
* - Type-safe inputs/outputs with Zod schema validation
|
64
|
+
* - Automatic GitHub Actions output handling (both individual outputs and bundled JSON)
|
65
|
+
* - Context validation to ensure steps run in the correct workflow events
|
66
|
+
* - Integration with GitHub API via Octokit
|
67
|
+
* - Built-in error handling and logging
|
68
|
+
*
|
69
|
+
* @example Basic step with inputs and outputs
|
70
|
+
* ```typescript
|
71
|
+
* import { z } from 'zod'
|
72
|
+
* import { GitHubActions } from '#lib/github-actions'
|
73
|
+
*
|
74
|
+
* export default GitHubActions.createStep({
|
75
|
+
* name: 'my-step',
|
76
|
+
* description: 'Processes some data and returns results',
|
77
|
+
* inputs: z.object({
|
78
|
+
* message: z.string(),
|
79
|
+
* count: z.number().optional().default(1),
|
80
|
+
* }),
|
81
|
+
* outputs: z.object({
|
82
|
+
* result: z.string(),
|
83
|
+
* processed: z.boolean(),
|
84
|
+
* }),
|
85
|
+
* async run({ inputs, core }) {
|
86
|
+
* core.info(`Processing: ${inputs.message}`)
|
87
|
+
*
|
88
|
+
* return {
|
89
|
+
* result: inputs.message.toUpperCase(),
|
90
|
+
* processed: true,
|
91
|
+
* }
|
92
|
+
* }
|
93
|
+
* })
|
94
|
+
* ```
|
95
|
+
*
|
96
|
+
* @example Step with specific context requirements
|
97
|
+
* ```typescript
|
98
|
+
* export default GitHubActions.createStep({
|
99
|
+
* name: 'pr-only-step',
|
100
|
+
* description: 'This step only runs on pull requests',
|
101
|
+
* context: GitHubActions.PullRequestContext,
|
102
|
+
* outputs: z.object({
|
103
|
+
* pr_number: z.number(),
|
104
|
+
* }),
|
105
|
+
* async run({ context, core }) {
|
106
|
+
* const prNumber = context.payload.pull_request.number
|
107
|
+
* core.info(`Running on PR #${prNumber}`)
|
108
|
+
*
|
109
|
+
* return { pr_number: prNumber }
|
110
|
+
* }
|
111
|
+
* })
|
112
|
+
* ```
|
113
|
+
*
|
114
|
+
* @example Using the GitHub API
|
115
|
+
* ```typescript
|
116
|
+
* export default GitHubActions.createStep({
|
117
|
+
* name: 'create-issue',
|
118
|
+
* description: 'Creates a GitHub issue',
|
119
|
+
* inputs: z.object({
|
120
|
+
* title: z.string(),
|
121
|
+
* body: z.string(),
|
122
|
+
* }),
|
123
|
+
* outputs: z.object({
|
124
|
+
* issue_number: z.number(),
|
125
|
+
* issue_url: z.string(),
|
126
|
+
* }),
|
127
|
+
* async run({ inputs, github, context }) {
|
128
|
+
* const issue = await github.rest.issues.create({
|
129
|
+
* owner: context.repo.owner,
|
130
|
+
* repo: context.repo.repo,
|
131
|
+
* title: inputs.title,
|
132
|
+
* body: inputs.body,
|
133
|
+
* })
|
134
|
+
*
|
135
|
+
* return {
|
136
|
+
* issue_number: issue.data.number,
|
137
|
+
* issue_url: issue.data.html_url,
|
138
|
+
* }
|
139
|
+
* }
|
140
|
+
* })
|
141
|
+
* ```
|
142
|
+
*
|
143
|
+
* @param input - Step configuration object
|
144
|
+
* @param input.name - Unique identifier for the step (used in logging and debugging)
|
145
|
+
* @param input.description - Human-readable description of what the step does
|
146
|
+
* @param input.inputs - Optional Zod schema for validating step inputs
|
147
|
+
* @param input.outputs - Optional Zod schema for validating step outputs
|
148
|
+
* @param input.context - Optional Zod schema for validating GitHub Actions context (event type)
|
149
|
+
* @param input.run - Async function that implements the step logic
|
150
|
+
*
|
151
|
+
* @returns A Step object that can be executed by the GitHub Actions runner
|
152
|
+
*
|
153
|
+
* @remarks
|
154
|
+
* - All outputs are automatically set as GitHub Actions outputs
|
155
|
+
* - Boolean outputs are properly handled (use fromJSON in workflows)
|
156
|
+
* - A special 'json' output contains all outputs bundled together
|
157
|
+
* - The runner provides extensive logging and error handling
|
158
|
+
* - Steps can access PR controller for pull request operations
|
159
|
+
* - The `$` from zx is available for shell commands
|
160
|
+
*/
|
161
|
+
export declare function createStep<$InputsSchema extends InputsSchema, $OutputsSchema extends OutputsSchema, $ContextSchema extends ContextSchema = RealContextSchema>(input: CreateInput<$InputsSchema, $OutputsSchema, $ContextSchema>): Step<$InputsSchema, $OutputsSchema, $ContextSchema>;
|
162
|
+
export {};
|
163
|
+
//# sourceMappingURL=step.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/lib/github-actions/step.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAEvF;;;;;GAKG;AACH,MAAM,WAAW,IAAI,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAAE,QAAQ,GAAG,OAAO;IACvE,uEAAuE;IACvE,IAAI,EAAE,cAAc,eAAe,CAAC,CAAA;IAEpC,uEAAuE;IACvE,OAAO,EAAE,QAAQ,CAAA;IAEjB,gDAAgD;IAChD,MAAM,EAAE,OAAO,CAAA;IAEf,+DAA+D;IAC/D,MAAM,EAAE,YAAY,CAAC,OAAO,MAAM,CAAC,CAAA;IAEnC,mDAAmD;IACnD,CAAC,EAAE,cAAc,IAAI,EAAE,CAAC,CAAA;IAExB,qDAAqD;IACrD,EAAE,EAAE,cAAc,kBAAkB,CAAC,CAAA;IAErC,wEAAwE;IACxE,EAAE,EAAE,qBAAqB,CAAA;IAEzB,wFAAwF;IACxF,GAAG,EAAE,aAAa,CAAA;CACnB;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,MAAM,MAAM,MAAM,GAAG,MAAM,CAAA;AAE3B,KAAK,YAAY,GAAG,CAAC,CAAC,SAAS,CAAA;AAE/B,KAAK,aAAa,GA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cAAc,CAAA;IACxB,GAAG,EAAE,CACH,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,KAE1D,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;CAClF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AACH,wBAAgB,UAAU,CACxB,aAAa,SAAS,YAAY,EAClC,cAAc,SAAS,aAAa,EACpC,cAAc,SAAS,aAAa,GAAG,iBAAiB,EAExD,KAAK,EAAE,WAAW,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,GAChE,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,CAYrD"}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
/**
|
2
|
+
* Type-safe workflow step framework for GitHub Actions
|
3
|
+
*/
|
4
|
+
import { z } from 'zod/v4';
|
5
|
+
/**
|
6
|
+
* Create a type-safe GitHub Actions workflow step with runtime validation.
|
7
|
+
*
|
8
|
+
* This is the main entry point for defining custom workflow steps that can be executed
|
9
|
+
* by the GitHub Actions runner. It provides:
|
10
|
+
* - Type-safe inputs/outputs with Zod schema validation
|
11
|
+
* - Automatic GitHub Actions output handling (both individual outputs and bundled JSON)
|
12
|
+
* - Context validation to ensure steps run in the correct workflow events
|
13
|
+
* - Integration with GitHub API via Octokit
|
14
|
+
* - Built-in error handling and logging
|
15
|
+
*
|
16
|
+
* @example Basic step with inputs and outputs
|
17
|
+
* ```typescript
|
18
|
+
* import { z } from 'zod'
|
19
|
+
* import { GitHubActions } from '#lib/github-actions'
|
20
|
+
*
|
21
|
+
* export default GitHubActions.createStep({
|
22
|
+
* name: 'my-step',
|
23
|
+
* description: 'Processes some data and returns results',
|
24
|
+
* inputs: z.object({
|
25
|
+
* message: z.string(),
|
26
|
+
* count: z.number().optional().default(1),
|
27
|
+
* }),
|
28
|
+
* outputs: z.object({
|
29
|
+
* result: z.string(),
|
30
|
+
* processed: z.boolean(),
|
31
|
+
* }),
|
32
|
+
* async run({ inputs, core }) {
|
33
|
+
* core.info(`Processing: ${inputs.message}`)
|
34
|
+
*
|
35
|
+
* return {
|
36
|
+
* result: inputs.message.toUpperCase(),
|
37
|
+
* processed: true,
|
38
|
+
* }
|
39
|
+
* }
|
40
|
+
* })
|
41
|
+
* ```
|
42
|
+
*
|
43
|
+
* @example Step with specific context requirements
|
44
|
+
* ```typescript
|
45
|
+
* export default GitHubActions.createStep({
|
46
|
+
* name: 'pr-only-step',
|
47
|
+
* description: 'This step only runs on pull requests',
|
48
|
+
* context: GitHubActions.PullRequestContext,
|
49
|
+
* outputs: z.object({
|
50
|
+
* pr_number: z.number(),
|
51
|
+
* }),
|
52
|
+
* async run({ context, core }) {
|
53
|
+
* const prNumber = context.payload.pull_request.number
|
54
|
+
* core.info(`Running on PR #${prNumber}`)
|
55
|
+
*
|
56
|
+
* return { pr_number: prNumber }
|
57
|
+
* }
|
58
|
+
* })
|
59
|
+
* ```
|
60
|
+
*
|
61
|
+
* @example Using the GitHub API
|
62
|
+
* ```typescript
|
63
|
+
* export default GitHubActions.createStep({
|
64
|
+
* name: 'create-issue',
|
65
|
+
* description: 'Creates a GitHub issue',
|
66
|
+
* inputs: z.object({
|
67
|
+
* title: z.string(),
|
68
|
+
* body: z.string(),
|
69
|
+
* }),
|
70
|
+
* outputs: z.object({
|
71
|
+
* issue_number: z.number(),
|
72
|
+
* issue_url: z.string(),
|
73
|
+
* }),
|
74
|
+
* async run({ inputs, github, context }) {
|
75
|
+
* const issue = await github.rest.issues.create({
|
76
|
+
* owner: context.repo.owner,
|
77
|
+
* repo: context.repo.repo,
|
78
|
+
* title: inputs.title,
|
79
|
+
* body: inputs.body,
|
80
|
+
* })
|
81
|
+
*
|
82
|
+
* return {
|
83
|
+
* issue_number: issue.data.number,
|
84
|
+
* issue_url: issue.data.html_url,
|
85
|
+
* }
|
86
|
+
* }
|
87
|
+
* })
|
88
|
+
* ```
|
89
|
+
*
|
90
|
+
* @param input - Step configuration object
|
91
|
+
* @param input.name - Unique identifier for the step (used in logging and debugging)
|
92
|
+
* @param input.description - Human-readable description of what the step does
|
93
|
+
* @param input.inputs - Optional Zod schema for validating step inputs
|
94
|
+
* @param input.outputs - Optional Zod schema for validating step outputs
|
95
|
+
* @param input.context - Optional Zod schema for validating GitHub Actions context (event type)
|
96
|
+
* @param input.run - Async function that implements the step logic
|
97
|
+
*
|
98
|
+
* @returns A Step object that can be executed by the GitHub Actions runner
|
99
|
+
*
|
100
|
+
* @remarks
|
101
|
+
* - All outputs are automatically set as GitHub Actions outputs
|
102
|
+
* - Boolean outputs are properly handled (use fromJSON in workflows)
|
103
|
+
* - A special 'json' output contains all outputs bundled together
|
104
|
+
* - The runner provides extensive logging and error handling
|
105
|
+
* - Steps can access PR controller for pull request operations
|
106
|
+
* - The `$` from zx is available for shell commands
|
107
|
+
*/
|
108
|
+
export function createStep(input) {
|
109
|
+
const { run, inputs, outputs, context, ...rest } = input;
|
110
|
+
const definition = {
|
111
|
+
...rest,
|
112
|
+
inputsSchema: inputs,
|
113
|
+
outputsSchema: outputs,
|
114
|
+
contextSchema: context,
|
115
|
+
};
|
116
|
+
return {
|
117
|
+
definition,
|
118
|
+
run,
|
119
|
+
};
|
120
|
+
}
|
121
|
+
//# sourceMappingURL=step.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../../src/lib/github-actions/step.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAwG1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AACH,MAAM,UAAU,UAAU,CAKxB,KAAiE;IAEjE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IACxD,MAAM,UAAU,GAA8D;QAC5E,GAAG,IAAI;QACP,YAAY,EAAE,MAAM;QACpB,aAAa,EAAE,OAAO;QACtB,aAAa,EAAE,OAAO;KACvB,CAAA;IACD,OAAO;QACL,UAAU;QACV,GAAG;KACG,CAAA;AACV,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,iCAAiC,CACrD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,iCAAiC,CACrD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAWlB"}
|
package/build/lib/helpers.js
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
import { Manifest } from '@wollybeard/kit';
|
1
|
+
import { Err, Manifest } from '@wollybeard/kit';
|
2
2
|
/**
|
3
3
|
* Check if a project has a package installed by examining its package.json
|
4
4
|
*/
|
5
5
|
export async function checkIsProjectHasPackageInstalled(projectRoot, packageName) {
|
6
6
|
const packageJson = await Manifest.resource.read(projectRoot);
|
7
|
-
if (
|
8
|
-
|
7
|
+
if (Err.is(packageJson)) {
|
8
|
+
if (packageJson._tag === 'ResourceErrorNotFound')
|
9
|
+
return false;
|
10
|
+
throw packageJson;
|
9
11
|
}
|
10
12
|
// Check if React is in dependencies or devDependencies
|
11
13
|
return !!(packageJson.dependencies?.[packageName]
|
package/build/lib/helpers.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,WAAmB,EACnB,WAAmB;IAEnB,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAE7D,IAAI,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;QACxB,IAAI,WAAW,CAAC,IAAI,KAAK,uBAAuB;YAAE,OAAO,KAAK,CAAA;QAC9D,MAAM,WAAW,CAAA;IACnB,CAAC;IAED,uDAAuD;IACvD,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC;WAC5C,WAAW,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;AAClD,CAAC"}
|
package/build/lib/kit-temp.d.ts
CHANGED
@@ -10,6 +10,46 @@ export interface ImportEvent {
|
|
10
10
|
specifier: string;
|
11
11
|
context: ResolveHookContext;
|
12
12
|
}
|
13
|
+
export type ObjPolicyFilter<$Object extends object, $Key extends Keyof<$Object>, Mode extends 'allow' | 'deny'> = Mode extends 'allow' ? Pick<$Object, Extract<$Key, keyof $Object>> : Omit<$Object, Extract<$Key, keyof $Object>>;
|
14
|
+
/**
|
15
|
+
* Like keyof but returns PropertyKey for object
|
16
|
+
*/
|
17
|
+
type Keyof<$Object extends object> = object extends $Object ? PropertyKey : (keyof $Object);
|
18
|
+
/**
|
19
|
+
* Filter object properties based on a policy mode and set of keys
|
20
|
+
*
|
21
|
+
* @param mode - 'allow' to keep only specified keys, 'deny' to remove specified keys
|
22
|
+
* @param obj - The object to filter
|
23
|
+
* @param keys - The keys to process
|
24
|
+
* @returns A filtered object with proper type inference
|
25
|
+
*
|
26
|
+
* @example
|
27
|
+
* ```ts
|
28
|
+
* const obj = { a: 1, b: 2, c: 3 }
|
29
|
+
*
|
30
|
+
* // Allow mode: keep only 'a' and 'c'
|
31
|
+
* objPolicyFilter('allow', obj, ['a', 'c']) // { a: 1, c: 3 }
|
32
|
+
*
|
33
|
+
* // Deny mode: remove 'a' and 'c'
|
34
|
+
* objPolicyFilter('deny', obj, ['a', 'c']) // { b: 2 }
|
35
|
+
* ```
|
36
|
+
*/
|
37
|
+
export declare const objPolicyFilter: <obj extends object, keyUnion extends Keyof<obj>, mode extends "allow" | "deny">(mode: mode, obj: obj, keys: readonly keyUnion[]) => ObjPolicyFilter<obj, keyUnion, mode>;
|
38
|
+
/**
|
39
|
+
* Filter an object using a predicate function
|
40
|
+
*
|
41
|
+
* @param obj - The object to filter
|
42
|
+
* @param predicate - Function that returns true to keep a key/value pair
|
43
|
+
* @returns A new object with only the key/value pairs where predicate returned true
|
44
|
+
*
|
45
|
+
* @example
|
46
|
+
* ```ts
|
47
|
+
* const obj = { a: 1, b: 2, c: 3 }
|
48
|
+
* objFilter(obj, (k, v) => v > 1) // { b: 2, c: 3 }
|
49
|
+
* objFilter(obj, k => k !== 'b') // { a: 1, c: 3 }
|
50
|
+
* ```
|
51
|
+
*/
|
52
|
+
export declare const objFilter: <T extends object>(obj: T, predicate: (key: keyof T, value: T[keyof T], obj: T) => boolean) => Partial<T>;
|
13
53
|
export declare const ObjPick: <T extends object, K extends keyof T>(obj: T, keys: readonly K[]) => Pick<T, K>;
|
14
54
|
export declare const ObjOmit: <T extends object, K extends keyof T>(obj: T, keys: readonly K[]) => Omit<T, K>;
|
15
55
|
export declare const ObjPartition: <T extends object, K extends keyof T>(obj: T, keys: readonly K[]) => {
|
@@ -18,4 +58,18 @@ export declare const ObjPartition: <T extends object, K extends keyof T>(obj: T,
|
|
18
58
|
};
|
19
59
|
export declare const ensureEnd: (string: string, ending: string) => string;
|
20
60
|
export declare const ResponseInternalServerError: () => Response;
|
61
|
+
/**
|
62
|
+
* Execute an operation on multiple items, continuing even if some fail
|
63
|
+
*/
|
64
|
+
export declare function tryCatchMany<item, result>(items: item[], operation: (item: item) => Promise<result>): Promise<[result[], (Error & {
|
65
|
+
context: {
|
66
|
+
item: item;
|
67
|
+
};
|
68
|
+
})[]]>;
|
69
|
+
/**
|
70
|
+
* Type-level helper to check if two types are exactly the same (invariant).
|
71
|
+
*/
|
72
|
+
export type IsExact<T, U> = T extends U ? U extends T ? true : false : false;
|
73
|
+
export type ExtendsExact<$Input, $Constraint> = $Input extends $Constraint ? $Constraint extends $Input ? $Input : never : never;
|
74
|
+
export {};
|
21
75
|
//# sourceMappingURL=kit-temp.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"kit-temp.d.ts","sourceRoot":"","sources":["../../src/lib/kit-temp.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"kit-temp.d.ts","sourceRoot":"","sources":["../../src/lib/kit-temp.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGrD,eAAO,MAAM,WAAW,GAAI,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,YAM7C,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAI,SAAS,MAAM,GAAG,SAAS,KAAG,MAG3E,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,GAAG,SAAS,EAAE,aAAa,MAAM,KAAG,MAIzF,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,MAAM,KAAG,IAG3D,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,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,SAAS,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAA;AAG5E,MAAM,MAAM,YAAY,CAAC,MAAM,EAAE,WAAW,IAC1C,MAAM,SAAS,WAAW,GACtB,WAAW,SAAS,MAAM,GACxB,MAAM,GACN,KAAK,GACT,KAAK,CAAA"}
|
package/build/lib/kit-temp.js
CHANGED
@@ -11,7 +11,8 @@
|
|
11
11
|
//
|
12
12
|
//
|
13
13
|
//
|
14
|
-
import { Fs, Http, Path, Undefined } from '@wollybeard/kit';
|
14
|
+
import { Arr, Err, Fs, Http, Path, Undefined } from '@wollybeard/kit';
|
15
|
+
import { never } from '@wollybeard/kit/language';
|
15
16
|
export const arrayEquals = (a, b) => {
|
16
17
|
if (a.length !== b.length)
|
17
18
|
return false;
|
@@ -52,22 +53,74 @@ export const pickFirstPathExisting = async (paths) => {
|
|
52
53
|
export const isSpecifierFromPackage = (specifier, packageName) => {
|
53
54
|
return specifier === packageName || specifier.startsWith(packageName + `/`);
|
54
55
|
};
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
/**
|
57
|
+
* Filter object properties based on a policy mode and set of keys
|
58
|
+
*
|
59
|
+
* @param mode - 'allow' to keep only specified keys, 'deny' to remove specified keys
|
60
|
+
* @param obj - The object to filter
|
61
|
+
* @param keys - The keys to process
|
62
|
+
* @returns A filtered object with proper type inference
|
63
|
+
*
|
64
|
+
* @example
|
65
|
+
* ```ts
|
66
|
+
* const obj = { a: 1, b: 2, c: 3 }
|
67
|
+
*
|
68
|
+
* // Allow mode: keep only 'a' and 'c'
|
69
|
+
* objPolicyFilter('allow', obj, ['a', 'c']) // { a: 1, c: 3 }
|
70
|
+
*
|
71
|
+
* // Deny mode: remove 'a' and 'c'
|
72
|
+
* objPolicyFilter('deny', obj, ['a', 'c']) // { b: 2 }
|
73
|
+
* ```
|
74
|
+
*/
|
75
|
+
export const objPolicyFilter = (mode, obj, keys) => {
|
76
|
+
const result = mode === 'deny' ? { ...obj } : {};
|
77
|
+
if (mode === 'allow') {
|
78
|
+
// For allow mode, only add specified keys
|
79
|
+
for (const key of keys) {
|
80
|
+
if (key in obj) {
|
81
|
+
// @ts-expect-error
|
82
|
+
result[key] = obj[key];
|
83
|
+
}
|
59
84
|
}
|
60
|
-
|
61
|
-
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
// For deny mode, remove specified keys
|
88
|
+
for (const key of keys) {
|
89
|
+
delete result[key];
|
90
|
+
}
|
91
|
+
}
|
92
|
+
return result;
|
62
93
|
};
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
94
|
+
/**
|
95
|
+
* Filter an object using a predicate function
|
96
|
+
*
|
97
|
+
* @param obj - The object to filter
|
98
|
+
* @param predicate - Function that returns true to keep a key/value pair
|
99
|
+
* @returns A new object with only the key/value pairs where predicate returned true
|
100
|
+
*
|
101
|
+
* @example
|
102
|
+
* ```ts
|
103
|
+
* const obj = { a: 1, b: 2, c: 3 }
|
104
|
+
* objFilter(obj, (k, v) => v > 1) // { b: 2, c: 3 }
|
105
|
+
* objFilter(obj, k => k !== 'b') // { a: 1, c: 3 }
|
106
|
+
* ```
|
107
|
+
*/
|
108
|
+
export const objFilter = (obj, predicate) => {
|
109
|
+
const result = {};
|
110
|
+
// Use Object.keys to get all enumerable own properties
|
111
|
+
// This matches the behavior of for...in but only for own properties
|
112
|
+
for (const key of Object.keys(obj)) {
|
113
|
+
if (predicate(key, obj[key], obj)) {
|
114
|
+
result[key] = obj[key];
|
68
115
|
}
|
69
|
-
|
70
|
-
|
116
|
+
}
|
117
|
+
return result;
|
118
|
+
};
|
119
|
+
export const ObjPick = (obj, keys) => {
|
120
|
+
return objPolicyFilter('allow', obj, keys);
|
121
|
+
};
|
122
|
+
export const ObjOmit = (obj, keys) => {
|
123
|
+
return objPolicyFilter('deny', obj, keys);
|
71
124
|
};
|
72
125
|
export const ObjPartition = (obj, keys) => {
|
73
126
|
return keys.reduce((acc, key) => {
|
@@ -91,4 +144,19 @@ export const ResponseInternalServerError = () => new Response(null, {
|
|
91
144
|
status: Http.Status.InternalServerError.code,
|
92
145
|
statusText: Http.Status.InternalServerError.description,
|
93
146
|
});
|
147
|
+
/**
|
148
|
+
* Execute an operation on multiple items, continuing even if some fail
|
149
|
+
*/
|
150
|
+
export async function tryCatchMany(items, operation) {
|
151
|
+
const partitionedResults = await Promise.all(items.map(async (item) => {
|
152
|
+
const result = await Err.tryCatch(() => operation(item));
|
153
|
+
if (Err.is(result)) {
|
154
|
+
const error = result;
|
155
|
+
error.context = { item };
|
156
|
+
return error;
|
157
|
+
}
|
158
|
+
return result;
|
159
|
+
})).then(Arr.partitionErrors);
|
160
|
+
return partitionedResults;
|
161
|
+
}
|
94
162
|
//# sourceMappingURL=kit-temp.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"kit-temp.js","sourceRoot":"","sources":["../../src/lib/kit-temp.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,EAAE;AACF,EAAE;AACF,EAAE;AACF,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,mFAAmF;AACnF,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,EAAE;AACF,EAAE;AAEF,OAAO,EAAE,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"kit-temp.js","sourceRoot":"","sources":["../../src/lib/kit-temp.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,EAAE;AACF,EAAE;AACF,EAAE;AACF,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,mFAAmF;AACnF,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,EAAE;AACF,EAAE;AAEF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAW,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAIhD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAE,CAAQ,EAAE,E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CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAC7B,OAAO,kBAAyB,CAAA;AAClC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"kit-temp.test-d.d.ts","sourceRoot":"","sources":["../../src/lib/kit-temp.test-d.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import { Ts } from '@wollybeard/kit';
|
2
|
+
import { objFilter, ObjOmit, ObjPick, objPolicyFilter } from './kit-temp.js';
|
3
|
+
// Test 1: objPolicyFilter with allow mode
|
4
|
+
{
|
5
|
+
const result = objPolicyFilter('allow', testObj, ['a', 'c']);
|
6
|
+
Ts.assertEqual()(result);
|
7
|
+
}
|
8
|
+
// Test 2: objPolicyFilter with deny mode
|
9
|
+
{
|
10
|
+
const result = objPolicyFilter('deny', testObj, ['a', 'c']);
|
11
|
+
Ts.assertEqual()(result);
|
12
|
+
}
|
13
|
+
// Test 3: objFilter returns Partial<T>
|
14
|
+
{
|
15
|
+
const result = objFilter(testObj, (key, value) => value !== 'hello');
|
16
|
+
Ts.assertEqual()(result);
|
17
|
+
// All properties are optional
|
18
|
+
Ts.assertSub()(undefined);
|
19
|
+
Ts.assertSub()(undefined);
|
20
|
+
Ts.assertSub()(undefined);
|
21
|
+
Ts.assertSub()(undefined);
|
22
|
+
}
|
23
|
+
// Test 4: ObjPick type inference
|
24
|
+
{
|
25
|
+
const result = ObjPick(testObj, ['a', 'c']);
|
26
|
+
Ts.assertEqual()(result);
|
27
|
+
}
|
28
|
+
// Test 5: ObjOmit type inference
|
29
|
+
{
|
30
|
+
const result = ObjOmit(testObj, ['a', 'c']);
|
31
|
+
Ts.assertEqual()(result);
|
32
|
+
}
|
33
|
+
// Test 6: ObjPolicyFilter type-level function
|
34
|
+
{
|
35
|
+
}
|
36
|
+
// Test 7: Edge cases
|
37
|
+
{
|
38
|
+
// Empty object
|
39
|
+
const empty = {};
|
40
|
+
const allowEmpty = objPolicyFilter('allow', empty, []);
|
41
|
+
const denyEmpty = objPolicyFilter('deny', empty, []);
|
42
|
+
const filterEmpty = objFilter(empty, () => true);
|
43
|
+
Ts.assertEqual()(allowEmpty);
|
44
|
+
Ts.assertEqual()(denyEmpty);
|
45
|
+
Ts.assertEqual()(filterEmpty);
|
46
|
+
// Single property object
|
47
|
+
const single = { a: 1 };
|
48
|
+
const allowSingle = objPolicyFilter('allow', single, ['a']);
|
49
|
+
const denySingle = objPolicyFilter('deny', single, ['a']);
|
50
|
+
const filterSingle = objFilter(single, () => true);
|
51
|
+
Ts.assertEqual()(allowSingle);
|
52
|
+
Ts.assertEqual()(denySingle);
|
53
|
+
Ts.assertEqual()(filterSingle);
|
54
|
+
}
|
55
|
+
// Test 8: Complex nested object
|
56
|
+
{
|
57
|
+
const complexObj = {};
|
58
|
+
const picked = objPolicyFilter('allow', complexObj, ['nested', 'optional']);
|
59
|
+
Ts.assertEqual()(picked);
|
60
|
+
const omitted = objPolicyFilter('deny', complexObj, ['nested', 'optional']);
|
61
|
+
Ts.assertEqual()(omitted);
|
62
|
+
const filtered = objFilter(complexObj, (key) => key !== 'array');
|
63
|
+
Ts.assertEqual()(filtered);
|
64
|
+
}
|
65
|
+
// Test 9: Keys parameter type inference
|
66
|
+
{
|
67
|
+
// With const assertion
|
68
|
+
const keys1 = ['a', 'c'];
|
69
|
+
const result1 = objPolicyFilter('allow', testObj, keys1);
|
70
|
+
Ts.assertEqual()(result1);
|
71
|
+
// Without const assertion (wider type)
|
72
|
+
const keys2 = ['a', 'c'];
|
73
|
+
const result2 = objPolicyFilter('allow', testObj, keys2);
|
74
|
+
}
|
75
|
+
//# sourceMappingURL=kit-temp.test-d.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"kit-temp.test-d.js","sourceRoot":"","sources":["../../src/lib/kit-temp.test-d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE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,CAAC,CAAA;IACpF,EAAE,CAAC,WAAW,EAA4D,CAAC,MAAM,CAAC,CAAA;IAElF,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAC,CAAA;IACpF,EAAE,CAAC,WAAW,EAA4C,CAAC,OAAO,CAAC,CAAA;IAEnE,MAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,CAAA;IAChE,EAAE,CAAC,WAAW,EAAuB,CAAC,QAAQ,CAAC,CAAA;AACjD,CAAC;AAED,wCAAwC;AACxC,CAAC;IACC,uBAAuB;IACvB,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,CAAU,CAAA;IACjC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;IACxD,EAAE,CAAC,WAAW,EAA6B,CAAC,OAAO,CAAC,CAAA;IAEpD,uCAAuC;IACvC,MAAM,KAAK,GAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC3C,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;AAG1D,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/lib/mask/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.js","sourceRoot":"","sources":["../../../src/lib/mask/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|