@raybase/create 0.0.2 → 0.3.4
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/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.md +38 -0
- package/assets/apple-touch-icons/0.png +0 -0
- package/assets/apple-touch-icons/1.png +0 -0
- package/assets/apple-touch-icons/2.png +0 -0
- package/assets/apple-touch-icons/3.png +0 -0
- package/assets/apple-touch-icons/4.png +0 -0
- package/assets/apple-touch-icons/5.png +0 -0
- package/assets/apple-touch-icons/6.png +0 -0
- package/assets/apple-touch-icons/7.png +0 -0
- package/assets/apple-touch-icons/8.png +0 -0
- package/assets/apple-touch-icons/9.png +0 -0
- package/assets/apple-touch-icons/A.png +0 -0
- package/assets/apple-touch-icons/B.png +0 -0
- package/assets/apple-touch-icons/C.png +0 -0
- package/assets/apple-touch-icons/D.png +0 -0
- package/assets/apple-touch-icons/E.png +0 -0
- package/assets/apple-touch-icons/F.png +0 -0
- package/assets/apple-touch-icons/G.png +0 -0
- package/assets/apple-touch-icons/H.png +0 -0
- package/assets/apple-touch-icons/I.png +0 -0
- package/assets/apple-touch-icons/J.png +0 -0
- package/assets/apple-touch-icons/K.png +0 -0
- package/assets/apple-touch-icons/L.png +0 -0
- package/assets/apple-touch-icons/M.png +0 -0
- package/assets/apple-touch-icons/N.png +0 -0
- package/assets/apple-touch-icons/O.png +0 -0
- package/assets/apple-touch-icons/P.png +0 -0
- package/assets/apple-touch-icons/Q.png +0 -0
- package/assets/apple-touch-icons/R.png +0 -0
- package/assets/apple-touch-icons/S.png +0 -0
- package/assets/apple-touch-icons/T.png +0 -0
- package/assets/apple-touch-icons/U.png +0 -0
- package/assets/apple-touch-icons/V.png +0 -0
- package/assets/apple-touch-icons/W.png +0 -0
- package/assets/apple-touch-icons/X.png +0 -0
- package/assets/apple-touch-icons/Y.png +0 -0
- package/assets/apple-touch-icons/Z.png +0 -0
- package/assets/apple-touch-icons/default.png +0 -0
- package/dist/.source-hash +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2353 -0
- package/dist/index.js.map +1 -0
- package/dist/raybase-package-ranges.d.ts +11 -0
- package/dist/raybase-package-ranges.d.ts.map +1 -0
- package/dist/raybase-package-ranges.js +11 -0
- package/dist/raybase-package-ranges.js.map +1 -0
- package/dist/source-fetch.d.ts +91 -0
- package/dist/source-fetch.d.ts.map +1 -0
- package/dist/source-fetch.js +325 -0
- package/dist/source-fetch.js.map +1 -0
- package/dist/source-hash.d.ts +2 -0
- package/dist/source-hash.d.ts.map +1 -0
- package/dist/source-hash.js +23 -0
- package/dist/source-hash.js.map +1 -0
- package/dist/starter-description.d.ts +44 -0
- package/dist/starter-description.d.ts.map +1 -0
- package/dist/starter-description.js +273 -0
- package/dist/starter-description.js.map +1 -0
- package/dist/starter-source.d.ts +43 -0
- package/dist/starter-source.d.ts.map +1 -0
- package/dist/starter-source.js +156 -0
- package/dist/starter-source.js.map +1 -0
- package/dist/store-app-apply.d.ts +27 -0
- package/dist/store-app-apply.d.ts.map +1 -0
- package/dist/store-app-apply.js +100 -0
- package/dist/store-app-apply.js.map +1 -0
- package/dist/store-app-manifest.d.ts +86 -0
- package/dist/store-app-manifest.d.ts.map +1 -0
- package/dist/store-app-manifest.js +110 -0
- package/dist/store-app-manifest.js.map +1 -0
- package/dist/store-app-registry.d.ts +30 -0
- package/dist/store-app-registry.d.ts.map +1 -0
- package/dist/store-app-registry.js +232 -0
- package/dist/store-app-registry.js.map +1 -0
- package/models/recommended.json +42 -0
- package/modules/api/templates/react-router/app/api/operations.ts +8 -0
- package/modules/api/templates/tanstack-start/src/api/operations.ts +15 -0
- package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
- package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
- package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
- package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
- package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
- package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
- package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
- package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
- package/modules/docs/templates/react-router/source.config.ts +5 -0
- package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
- package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
- package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
- package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
- package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
- package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
- package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
- package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
- package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
- package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
- package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
- package/package.json +34 -8
- package/skills/README.md +122 -0
- package/skills/raybase-actions/SKILL.md +223 -0
- package/skills/raybase-actions/references/action-patterns.md +190 -0
- package/skills/raybase-actions/references/adapting-actions.md +93 -0
- package/skills/raybase-actions/references/testing-actions.md +48 -0
- package/skills/raybase-agent-debugging/SKILL.md +230 -0
- package/skills/raybase-ai/SKILL.md +1310 -0
- package/skills/raybase-api/SKILL.md +45 -0
- package/skills/raybase-astro-emdash/SKILL.md +143 -0
- package/skills/raybase-astro-emdash-content-model/SKILL.md +217 -0
- package/skills/raybase-astro-emdash-content-model/references/LICENSE-emdash +9 -0
- package/skills/raybase-astro-emdash-content-model/references/emdash-collections.md +265 -0
- package/skills/raybase-astro-emdash-design/LICENSE-impeccable +60 -0
- package/skills/raybase-astro-emdash-design/SKILL.md +170 -0
- package/skills/raybase-astro-emdash-design/reference/color.md +91 -0
- package/skills/raybase-astro-emdash-design/reference/copy.md +73 -0
- package/skills/raybase-astro-emdash-design/reference/direction.md +115 -0
- package/skills/raybase-astro-emdash-design/reference/imagery.md +84 -0
- package/skills/raybase-astro-emdash-design/reference/layout.md +69 -0
- package/skills/raybase-astro-emdash-design/reference/motion.md +75 -0
- package/skills/raybase-astro-emdash-design/reference/polish.md +75 -0
- package/skills/raybase-astro-emdash-design/reference/typography.md +72 -0
- package/skills/raybase-astro-emdash-galley/SKILL.md +265 -0
- package/skills/raybase-astro-emdash-migration/SKILL.md +218 -0
- package/skills/raybase-astro-emdash-migration/references/inventory-and-conversion.md +242 -0
- package/skills/raybase-astro-emdash-security-review/SKILL.md +68 -0
- package/skills/raybase-astro-emdash-theme-selection/SKILL.md +216 -0
- package/skills/raybase-auth/SKILL.md +358 -0
- package/skills/raybase-background-jobs/SKILL.md +774 -0
- package/skills/raybase-building/SKILL.md +409 -0
- package/skills/raybase-building/references/interview-and-spec.md +87 -0
- package/skills/raybase-building/references/planning-docs.md +26 -0
- package/skills/raybase-building/references/schema-and-config.md +70 -0
- package/skills/raybase-changing-a-live-app/SKILL.md +119 -0
- package/skills/raybase-data-and-policies/SKILL.md +377 -0
- package/skills/raybase-deploy/SKILL.md +136 -0
- package/skills/raybase-docs-writing/SKILL.md +119 -0
- package/skills/raybase-guide/SKILL.md +235 -0
- package/skills/raybase-mcp/SKILL.md +309 -0
- package/skills/raybase-mcp/agents/openai.yaml +4 -0
- package/skills/raybase-notifications/SKILL.md +138 -0
- package/skills/raybase-pro-migration/SKILL.md +28 -0
- package/skills/raybase-react-router/SKILL.md +241 -0
- package/skills/raybase-react-router-design/LICENSE-impeccable +60 -0
- package/skills/raybase-react-router-design/SKILL.md +135 -0
- package/skills/raybase-react-router-design/reference/color.md +87 -0
- package/skills/raybase-react-router-design/reference/copy.md +83 -0
- package/skills/raybase-react-router-design/reference/delight.md +48 -0
- package/skills/raybase-react-router-design/reference/interaction.md +91 -0
- package/skills/raybase-react-router-design/reference/layout.md +82 -0
- package/skills/raybase-react-router-design/reference/motion.md +86 -0
- package/skills/raybase-react-router-design/reference/polish.md +79 -0
- package/skills/raybase-react-router-design/reference/typography.md +71 -0
- package/skills/raybase-react-router-security-review/LICENSE +22 -0
- package/skills/raybase-react-router-security-review/SKILL.md +190 -0
- package/skills/raybase-react-router-security-review/agents/openai.yaml +4 -0
- package/skills/raybase-react-router-security-review/references/api-security.md +519 -0
- package/skills/raybase-react-router-security-review/references/authentication.md +353 -0
- package/skills/raybase-react-router-security-review/references/authorization.md +372 -0
- package/skills/raybase-react-router-security-review/references/business-logic.md +443 -0
- package/skills/raybase-react-router-security-review/references/cryptography.md +329 -0
- package/skills/raybase-react-router-security-review/references/csrf.md +398 -0
- package/skills/raybase-react-router-security-review/references/data-protection.md +378 -0
- package/skills/raybase-react-router-security-review/references/deserialization.md +410 -0
- package/skills/raybase-react-router-security-review/references/error-handling.md +436 -0
- package/skills/raybase-react-router-security-review/references/file-security.md +457 -0
- package/skills/raybase-react-router-security-review/references/injection.md +259 -0
- package/skills/raybase-react-router-security-review/references/logging.md +433 -0
- package/skills/raybase-react-router-security-review/references/misconfiguration.md +435 -0
- package/skills/raybase-react-router-security-review/references/modern-threats.md +475 -0
- package/skills/raybase-react-router-security-review/references/raybase-react-router-security.md +235 -0
- package/skills/raybase-react-router-security-review/references/ssrf.md +413 -0
- package/skills/raybase-react-router-security-review/references/supply-chain.md +405 -0
- package/skills/raybase-react-router-security-review/references/xss.md +336 -0
- package/skills/raybase-realtime/SKILL.md +158 -0
- package/skills/raybase-realtime/agents/openai.yaml +4 -0
- package/skills/raybase-schema/SKILL.md +209 -0
- package/skills/raybase-search/SKILL.md +137 -0
- package/skills/raybase-search/agents/openai.yaml +4 -0
- package/skills/raybase-settings/SKILL.md +139 -0
- package/skills/raybase-settings/agents/openai.yaml +4 -0
- package/skills/raybase-tanstack-start/SKILL.md +166 -0
- package/skills/raybase-tanstack-start-design/LICENSE-impeccable +60 -0
- package/skills/raybase-tanstack-start-design/SKILL.md +140 -0
- package/skills/raybase-tanstack-start-design/reference/color.md +80 -0
- package/skills/raybase-tanstack-start-design/reference/copy.md +83 -0
- package/skills/raybase-tanstack-start-design/reference/delight.md +48 -0
- package/skills/raybase-tanstack-start-design/reference/interaction.md +91 -0
- package/skills/raybase-tanstack-start-design/reference/layout.md +82 -0
- package/skills/raybase-tanstack-start-design/reference/motion.md +86 -0
- package/skills/raybase-tanstack-start-design/reference/polish.md +79 -0
- package/skills/raybase-tanstack-start-design/reference/typography.md +71 -0
- package/skills/raybase-tanstack-start-security-review/LICENSE +22 -0
- package/skills/raybase-tanstack-start-security-review/SKILL.md +194 -0
- package/skills/raybase-tanstack-start-security-review/agents/openai.yaml +4 -0
- package/skills/raybase-tanstack-start-security-review/references/api-security.md +519 -0
- package/skills/raybase-tanstack-start-security-review/references/authentication.md +353 -0
- package/skills/raybase-tanstack-start-security-review/references/authorization.md +372 -0
- package/skills/raybase-tanstack-start-security-review/references/business-logic.md +443 -0
- package/skills/raybase-tanstack-start-security-review/references/cryptography.md +329 -0
- package/skills/raybase-tanstack-start-security-review/references/csrf.md +398 -0
- package/skills/raybase-tanstack-start-security-review/references/data-protection.md +378 -0
- package/skills/raybase-tanstack-start-security-review/references/deserialization.md +410 -0
- package/skills/raybase-tanstack-start-security-review/references/error-handling.md +436 -0
- package/skills/raybase-tanstack-start-security-review/references/file-security.md +457 -0
- package/skills/raybase-tanstack-start-security-review/references/injection.md +259 -0
- package/skills/raybase-tanstack-start-security-review/references/logging.md +433 -0
- package/skills/raybase-tanstack-start-security-review/references/misconfiguration.md +435 -0
- package/skills/raybase-tanstack-start-security-review/references/modern-threats.md +475 -0
- package/skills/raybase-tanstack-start-security-review/references/raybase-tanstack-security.md +208 -0
- package/skills/raybase-tanstack-start-security-review/references/ssrf.md +413 -0
- package/skills/raybase-tanstack-start-security-review/references/supply-chain.md +405 -0
- package/skills/raybase-tanstack-start-security-review/references/xss.md +336 -0
- package/skills-manifest.json +41 -0
- package/templates/astro-emdash/.dev.vars.example +7 -0
- package/templates/astro-emdash/AGENTS.md +122 -0
- package/templates/astro-emdash/DESIGN.md +90 -0
- package/templates/astro-emdash/components.json +21 -0
- package/templates/astro-emdash/content/docs/getting-started.mdx +20 -0
- package/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/templates/astro-emdash/content/docs/meta.json +4 -0
- package/templates/astro-emdash/content/docs/site-templates.mdx +62 -0
- package/templates/astro-emdash/dev/CODEBASE-MAP.md +46 -0
- package/templates/astro-emdash/dev/SPEC-OVERVIEW.md +15 -0
- package/templates/astro-emdash/dev/SPEC.md +84 -0
- package/templates/astro-emdash/dev/features/archive/.gitkeep +1 -0
- package/templates/astro-emdash/docs/theme-previews/base.svg +24 -0
- package/templates/astro-emdash/docs/theme-previews/steel.svg +24 -0
- package/templates/astro-emdash/docs/theme-previews/zen.svg +24 -0
- package/templates/astro-emdash/docs/themes.md +106 -0
- package/templates/astro-emdash/drizzle.config.ts +5 -0
- package/templates/astro-emdash/gitignore +11 -0
- package/templates/astro-emdash/migrations/app/meta/_journal.json +5 -0
- package/templates/astro-emdash/package.json +79 -0
- package/templates/astro-emdash/pnpm-workspace.yaml +71 -0
- package/templates/astro-emdash/public/_headers +4 -0
- package/templates/astro-emdash/site/astro.config.mjs +120 -0
- package/templates/astro-emdash/site/demo/README.md +72 -0
- package/templates/astro-emdash/site/demo/content/collection.json +43 -0
- package/templates/astro-emdash/site/demo/content/entries.json +120 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/manifest.json +51 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/sample-content.json +5 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/template.liquid +48 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/host.json +9 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/manifest.json +38 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/sample-content.json +34 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/template.liquid +84 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/manifest.json +64 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/page.json +7 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/sample-content.json +24 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/template.liquid +100 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/manifest.json +51 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/sample-content.json +5 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/template.liquid +70 -0
- package/templates/astro-emdash/site/gitignore +1 -0
- package/templates/astro-emdash/site/package.json +56 -0
- package/templates/astro-emdash/site/scripts/apply-site-templates.mjs +560 -0
- package/templates/astro-emdash/site/scripts/galley-demo.mjs +298 -0
- package/templates/astro-emdash/site/scripts/seed-galley-starter.mjs +360 -0
- package/templates/astro-emdash/site/scripts/site-origin.mjs +45 -0
- package/templates/astro-emdash/site/seed/seed.json +154 -0
- package/templates/astro-emdash/site/seed/templates/.gitkeep +1 -0
- package/templates/astro-emdash/site/src/components/RaybaseSignedInMenu.astro +163 -0
- package/templates/astro-emdash/site/src/components/blocks/RaybaseActionIsland.astro +41 -0
- package/templates/astro-emdash/site/src/content-door/raybase-routes.ts +738 -0
- package/templates/astro-emdash/site/src/content-door/resolve-page.ts +142 -0
- package/templates/astro-emdash/site/src/content-door/seed.ts +85 -0
- package/templates/astro-emdash/site/src/env.d.ts +12 -0
- package/templates/astro-emdash/site/src/layouts/SiteLayout.astro +68 -0
- package/templates/astro-emdash/site/src/lib/palettes.gen.ts +7 -0
- package/templates/astro-emdash/site/src/lib/site-motion.ts +169 -0
- package/templates/astro-emdash/site/src/lib/site-shell.ts +294 -0
- package/templates/astro-emdash/site/src/live.config.ts +8 -0
- package/templates/astro-emdash/site/src/middleware.ts +20 -0
- package/templates/astro-emdash/site/src/pages/[...slug].astro +113 -0
- package/templates/astro-emdash/site/src/pages/_raybase/handoff/consume.ts +6 -0
- package/templates/astro-emdash/site/src/pages/_raybase/islands/action.ts +8 -0
- package/templates/astro-emdash/site/src/pages/_raybase/sign-out/index.ts +6 -0
- package/templates/astro-emdash/site/src/styles/palette-fonts.gen.css +1 -0
- package/templates/astro-emdash/site/src/styles/palettes.gen.css +3 -0
- package/templates/astro-emdash/site/src/styles.css +607 -0
- package/templates/astro-emdash/site/tsconfig.json +12 -0
- package/templates/astro-emdash/site/wrangler.jsonc +34 -0
- package/templates/astro-emdash/source.config.ts +10 -0
- package/templates/astro-emdash/src/actions.ts +58 -0
- package/templates/astro-emdash/src/ai/agents.ts +20 -0
- package/templates/astro-emdash/src/ai/retrieval.ts +36 -0
- package/templates/astro-emdash/src/auth-door.ts +18 -0
- package/templates/astro-emdash/src/client.tsx +25 -0
- package/templates/astro-emdash/src/components/.gitkeep +1 -0
- package/templates/astro-emdash/src/components/account-menu.tsx +91 -0
- package/templates/astro-emdash/src/components/auth-shell.tsx +69 -0
- package/templates/astro-emdash/src/components/mode-toggle.tsx +32 -0
- package/templates/astro-emdash/src/components/search-command-palette.tsx +107 -0
- package/templates/astro-emdash/src/components/setup-token-page.tsx +196 -0
- package/templates/astro-emdash/src/components/ui/avatar.tsx +107 -0
- package/templates/astro-emdash/src/components/ui/badge.tsx +52 -0
- package/templates/astro-emdash/src/components/ui/button.tsx +69 -0
- package/templates/astro-emdash/src/components/ui/checkbox.tsx +29 -0
- package/templates/astro-emdash/src/components/ui/dialog.tsx +158 -0
- package/templates/astro-emdash/src/components/ui/dropdown-menu.tsx +303 -0
- package/templates/astro-emdash/src/components/ui/input.tsx +20 -0
- package/templates/astro-emdash/src/components/ui/label.tsx +20 -0
- package/templates/astro-emdash/src/components/ui/scroll-area.tsx +53 -0
- package/templates/astro-emdash/src/components/ui/select.tsx +215 -0
- package/templates/astro-emdash/src/components/ui/separator.tsx +23 -0
- package/templates/astro-emdash/src/components/ui/sheet.tsx +138 -0
- package/templates/astro-emdash/src/components/ui/sidebar.tsx +728 -0
- package/templates/astro-emdash/src/components/ui/skeleton.tsx +13 -0
- package/templates/astro-emdash/src/components/ui/textarea.tsx +18 -0
- package/templates/astro-emdash/src/components/ui/tooltip.tsx +66 -0
- package/templates/astro-emdash/src/db/migrations.gen.ts +6 -0
- package/templates/astro-emdash/src/db/schema.ts +6 -0
- package/templates/astro-emdash/src/db/seed.ts +16 -0
- package/templates/astro-emdash/src/db/storage.ts +32 -0
- package/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/templates/astro-emdash/src/docs/source.ts +7 -0
- package/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/templates/astro-emdash/src/hooks/use-mobile.ts +19 -0
- package/templates/astro-emdash/src/jobs.example.ts +48 -0
- package/templates/astro-emdash/src/lib/account.ts +12 -0
- package/templates/astro-emdash/src/lib/auth-client.ts +181 -0
- package/templates/astro-emdash/src/lib/utils.ts +6 -0
- package/templates/astro-emdash/src/mcp-app.ts +57 -0
- package/templates/astro-emdash/src/notifications.example.ts +37 -0
- package/templates/astro-emdash/src/raybase.auth.ts +70 -0
- package/templates/astro-emdash/src/raybase.config.ts +49 -0
- package/templates/astro-emdash/src/raybase.server.ts +56 -0
- package/templates/astro-emdash/src/realtime.example.ts +18 -0
- package/templates/astro-emdash/src/router.tsx +19 -0
- package/templates/astro-emdash/src/routes/__root.tsx +56 -0
- package/templates/astro-emdash/src/routes/_app/admin.tsx +13 -0
- package/templates/astro-emdash/src/routes/_app/forgot-password.tsx +97 -0
- package/templates/astro-emdash/src/routes/_app/index.tsx +169 -0
- package/templates/astro-emdash/src/routes/_app/invite.$token.tsx +11 -0
- package/templates/astro-emdash/src/routes/_app/login.tsx +193 -0
- package/templates/astro-emdash/src/routes/_app/profile.tsx +98 -0
- package/templates/astro-emdash/src/routes/_app/reset-password.$token.tsx +15 -0
- package/templates/astro-emdash/src/routes/_app/reset-password.tsx +115 -0
- package/templates/astro-emdash/src/routes/_app/setup.$token.tsx +11 -0
- package/templates/astro-emdash/src/routes/_app/signup.tsx +141 -0
- package/templates/astro-emdash/src/routes/_app/verify-email.$token.tsx +15 -0
- package/templates/astro-emdash/src/routes/_app/verify-email.tsx +154 -0
- package/templates/astro-emdash/src/routes/_app.tsx +33 -0
- package/templates/astro-emdash/src/routes/admin/$.ts +20 -0
- package/templates/astro-emdash/src/routes/api/$.ts +19 -0
- package/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/templates/astro-emdash/src/search.ts +6 -0
- package/templates/astro-emdash/src/settings.ts +12 -0
- package/templates/astro-emdash/src/styles-docs.css +3 -0
- package/templates/astro-emdash/src/styles.css +101 -0
- package/templates/astro-emdash/src/themes/base.css +76 -0
- package/templates/astro-emdash/src/themes/carbon.css +76 -0
- package/templates/astro-emdash/src/themes/fonts.css +25 -0
- package/templates/astro-emdash/src/themes/sage.css +76 -0
- package/templates/astro-emdash/src/themes/sand.css +76 -0
- package/templates/astro-emdash/src/themes/slate.css +81 -0
- package/templates/astro-emdash/src/themes/ultra.css +76 -0
- package/templates/astro-emdash/src/themes/zen.css +76 -0
- package/templates/astro-emdash/src/worker-entry.ts +31 -0
- package/templates/astro-emdash/tests/raybase-patterns.test.ts +29 -0
- package/templates/astro-emdash/tsconfig.json +36 -0
- package/templates/astro-emdash/vite.config.ts +130 -0
- package/templates/astro-emdash/vitest.config.ts +8 -0
- package/templates/astro-emdash/wrangler.jsonc +112 -0
- package/templates/react-router/.dev.vars.example +5 -0
- package/templates/react-router/.editorconfig +15 -0
- package/templates/react-router/AGENTS.md +54 -0
- package/templates/react-router/README.md +52 -0
- package/templates/react-router/app/app.css +44 -0
- package/templates/react-router/app/components/mdx.tsx +79 -0
- package/templates/react-router/app/components/ui/button.tsx +45 -0
- package/templates/react-router/app/components/ui/card.tsx +87 -0
- package/templates/react-router/app/components/ui/separator.tsx +22 -0
- package/templates/react-router/app/db/migrations.gen.ts +6 -0
- package/templates/react-router/app/db/schema.ts +56 -0
- package/templates/react-router/app/db/seed.ts +14 -0
- package/templates/react-router/app/entry.server.tsx +41 -0
- package/templates/react-router/app/globals.d.ts +1 -0
- package/templates/react-router/app/lib/layout.shared.tsx +52 -0
- package/templates/react-router/app/lib/source.ts +7 -0
- package/templates/react-router/app/lib/utils.ts +6 -0
- package/templates/react-router/app/raybase.server.ts +65 -0
- package/templates/react-router/app/root.tsx +23 -0
- package/templates/react-router/app/routes/_index.tsx +53 -0
- package/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/templates/react-router/app/routes/docs.tsx +13 -0
- package/templates/react-router/app/routes.ts +3 -0
- package/templates/react-router/components.json +22 -0
- package/templates/react-router/content/docs/getting-started.mdx +15 -0
- package/templates/react-router/content/docs/index.mdx +8 -0
- package/templates/react-router/content/docs/mcp.mdx +121 -0
- package/templates/react-router/content/docs/meta.json +4 -0
- package/templates/react-router/dev/CODEBASE-MAP.md +48 -0
- package/templates/react-router/dev/SPEC-OVERVIEW.md +35 -0
- package/templates/react-router/dev/SPEC.md +93 -0
- package/templates/react-router/dev/features/archive/.gitkeep +1 -0
- package/templates/react-router/drizzle.config.ts +5 -0
- package/templates/react-router/env.d.ts +53 -0
- package/templates/react-router/gitignore +23 -0
- package/templates/react-router/migrations/app/meta/_journal.json +1 -0
- package/templates/react-router/package.json +70 -0
- package/templates/react-router/public/_headers +4 -0
- package/templates/react-router/public/favicon.ico +0 -0
- package/templates/react-router/react-router.config.ts +9 -0
- package/templates/react-router/source.config.ts +5 -0
- package/templates/react-router/tests/raybase-patterns.test.ts +23 -0
- package/templates/react-router/tsconfig.json +27 -0
- package/templates/react-router/vite.config.ts +59 -0
- package/templates/react-router/vitest.config.ts +8 -0
- package/templates/react-router/workers/app.ts +40 -0
- package/templates/react-router/wrangler.jsonc +111 -0
- package/templates/tanstack-start/.dev.vars.example +5 -0
- package/templates/tanstack-start/AGENTS.md +95 -0
- package/templates/tanstack-start/DESIGN.md +65 -0
- package/templates/tanstack-start/components.json +21 -0
- package/templates/tanstack-start/content/docs/getting-started.mdx +65 -0
- package/templates/tanstack-start/content/docs/index.mdx +10 -0
- package/templates/tanstack-start/content/docs/mcp.mdx +122 -0
- package/templates/tanstack-start/content/docs/meta.json +4 -0
- package/templates/tanstack-start/dev/CODEBASE-MAP.md +84 -0
- package/templates/tanstack-start/dev/SPEC-OVERVIEW.md +46 -0
- package/templates/tanstack-start/dev/SPEC.md +213 -0
- package/templates/tanstack-start/dev/features/archive/.gitkeep +1 -0
- package/templates/tanstack-start/docs/theme-previews/base.svg +24 -0
- package/templates/tanstack-start/docs/theme-previews/steel.svg +24 -0
- package/templates/tanstack-start/docs/theme-previews/zen.svg +24 -0
- package/templates/tanstack-start/docs/themes.md +116 -0
- package/templates/tanstack-start/drizzle.config.ts +5 -0
- package/templates/tanstack-start/gitignore +11 -0
- package/templates/tanstack-start/migrations/app/0000_low_karen_page.sql +26 -0
- package/templates/tanstack-start/migrations/app/meta/0000_snapshot.json +196 -0
- package/templates/tanstack-start/migrations/app/meta/_journal.json +13 -0
- package/templates/tanstack-start/package.json +77 -0
- package/templates/tanstack-start/public/_headers +8 -0
- package/templates/tanstack-start/public/icons/app-icon-maskable.svg +1 -0
- package/templates/tanstack-start/public/icons/app-icon.svg +1 -0
- package/templates/tanstack-start/public/icons/apple-touch-icon.png +0 -0
- package/templates/tanstack-start/public/manifest.webmanifest +14 -0
- package/templates/tanstack-start/public/raybase-push-sw.js +32 -0
- package/templates/tanstack-start/source.config.ts +10 -0
- package/templates/tanstack-start/src/actions.ts +560 -0
- package/templates/tanstack-start/src/ai/agents.ts +78 -0
- package/templates/tanstack-start/src/ai/retrieval.ts +36 -0
- package/templates/tanstack-start/src/auth-door.ts +18 -0
- package/templates/tanstack-start/src/client.tsx +25 -0
- package/templates/tanstack-start/src/components/.gitkeep +1 -0
- package/templates/tanstack-start/src/components/account-menu.tsx +127 -0
- package/templates/tanstack-start/src/components/auth-shell.tsx +69 -0
- package/templates/tanstack-start/src/components/install-app.tsx +35 -0
- package/templates/tanstack-start/src/components/mode-toggle.tsx +32 -0
- package/templates/tanstack-start/src/components/search-command-palette.tsx +107 -0
- package/templates/tanstack-start/src/components/setup-token-page.tsx +197 -0
- package/templates/tanstack-start/src/components/ui/avatar.tsx +107 -0
- package/templates/tanstack-start/src/components/ui/badge.tsx +52 -0
- package/templates/tanstack-start/src/components/ui/button.tsx +69 -0
- package/templates/tanstack-start/src/components/ui/checkbox.tsx +29 -0
- package/templates/tanstack-start/src/components/ui/dialog.tsx +158 -0
- package/templates/tanstack-start/src/components/ui/dropdown-menu.tsx +303 -0
- package/templates/tanstack-start/src/components/ui/input.tsx +20 -0
- package/templates/tanstack-start/src/components/ui/label.tsx +20 -0
- package/templates/tanstack-start/src/components/ui/scroll-area.tsx +53 -0
- package/templates/tanstack-start/src/components/ui/select.tsx +215 -0
- package/templates/tanstack-start/src/components/ui/separator.tsx +23 -0
- package/templates/tanstack-start/src/components/ui/sheet.tsx +138 -0
- package/templates/tanstack-start/src/components/ui/sidebar.tsx +728 -0
- package/templates/tanstack-start/src/components/ui/skeleton.tsx +13 -0
- package/templates/tanstack-start/src/components/ui/textarea.tsx +18 -0
- package/templates/tanstack-start/src/components/ui/tooltip.tsx +66 -0
- package/templates/tanstack-start/src/db/migrations.gen.ts +6 -0
- package/templates/tanstack-start/src/db/schema.ts +90 -0
- package/templates/tanstack-start/src/db/seed.ts +106 -0
- package/templates/tanstack-start/src/db/storage.ts +32 -0
- package/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/templates/tanstack-start/src/docs/source.ts +7 -0
- package/templates/tanstack-start/src/hooks/use-mobile.ts +19 -0
- package/templates/tanstack-start/src/hooks/use-pwa-install.ts +77 -0
- package/templates/tanstack-start/src/jobs.example.ts +56 -0
- package/templates/tanstack-start/src/lib/account.ts +13 -0
- package/templates/tanstack-start/src/lib/auth-client.ts +187 -0
- package/templates/tanstack-start/src/lib/push-client.ts +98 -0
- package/templates/tanstack-start/src/lib/utils.ts +6 -0
- package/templates/tanstack-start/src/mcp-app.ts +74 -0
- package/templates/tanstack-start/src/notifications.example.ts +37 -0
- package/templates/tanstack-start/src/raybase.auth.ts +86 -0
- package/templates/tanstack-start/src/raybase.config.ts +86 -0
- package/templates/tanstack-start/src/raybase.server.ts +155 -0
- package/templates/tanstack-start/src/realtime.example.ts +46 -0
- package/templates/tanstack-start/src/router.tsx +19 -0
- package/templates/tanstack-start/src/routes/__root.tsx +73 -0
- package/templates/tanstack-start/src/routes/_app/admin.tsx +13 -0
- package/templates/tanstack-start/src/routes/_app/forgot-password.tsx +97 -0
- package/templates/tanstack-start/src/routes/_app/index.tsx +1316 -0
- package/templates/tanstack-start/src/routes/_app/invite.$token.tsx +11 -0
- package/templates/tanstack-start/src/routes/_app/login.tsx +193 -0
- package/templates/tanstack-start/src/routes/_app/profile.tsx +98 -0
- package/templates/tanstack-start/src/routes/_app/reset-password.$token.tsx +16 -0
- package/templates/tanstack-start/src/routes/_app/reset-password.tsx +115 -0
- package/templates/tanstack-start/src/routes/_app/setup.$token.tsx +11 -0
- package/templates/tanstack-start/src/routes/_app/signup.tsx +141 -0
- package/templates/tanstack-start/src/routes/_app/verify-email.$token.tsx +15 -0
- package/templates/tanstack-start/src/routes/_app/verify-email.tsx +154 -0
- package/templates/tanstack-start/src/routes/_app.tsx +33 -0
- package/templates/tanstack-start/src/routes/admin/$.ts +20 -0
- package/templates/tanstack-start/src/routes/api/$.ts +19 -0
- package/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/templates/tanstack-start/src/search.ts +26 -0
- package/templates/tanstack-start/src/settings.ts +12 -0
- package/templates/tanstack-start/src/styles-docs.css +3 -0
- package/templates/tanstack-start/src/styles.css +73 -0
- package/templates/tanstack-start/src/themes/base.css +76 -0
- package/templates/tanstack-start/src/themes/carbon.css +76 -0
- package/templates/tanstack-start/src/themes/fonts.css +18 -0
- package/templates/tanstack-start/src/themes/sage.css +76 -0
- package/templates/tanstack-start/src/themes/sand.css +76 -0
- package/templates/tanstack-start/src/themes/slate.css +76 -0
- package/templates/tanstack-start/src/themes/ultra.css +76 -0
- package/templates/tanstack-start/src/themes/zen.css +76 -0
- package/templates/tanstack-start/src/worker-entry.ts +30 -0
- package/templates/tanstack-start/tests/raybase-patterns.test.ts +247 -0
- package/templates/tanstack-start/tsconfig.json +33 -0
- package/templates/tanstack-start/vite.config.ts +132 -0
- package/templates/tanstack-start/vitest.config.ts +8 -0
- package/templates/tanstack-start/wrangler.jsonc +112 -0
- package/README.md +0 -3
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { LogOut, Shield, UserCircle } from "lucide-react";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { AccountMenu } from "../../components/account-menu";
|
|
5
|
+
import { loadAccountSummary, type AccountSummary } from "../../lib/account";
|
|
6
|
+
import { appConfig } from "../../raybase.config";
|
|
7
|
+
|
|
8
|
+
export const Route = createFileRoute("/_app/profile")({
|
|
9
|
+
server: {
|
|
10
|
+
handlers: {
|
|
11
|
+
GET: async ({ request, next }) => {
|
|
12
|
+
const { handleRaybaseRequest } = await import("../../raybase.server");
|
|
13
|
+
const url = new URL(request.url);
|
|
14
|
+
const accountResponse = await handleRaybaseRequest(new Request(new URL("/api/account/me", url).toString(), { headers: request.headers }));
|
|
15
|
+
if (accountResponse.status === 401) return Response.redirect(new URL("/login?next=/profile", url), 302);
|
|
16
|
+
return next();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
component: ProfilePage
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function ProfilePage() {
|
|
24
|
+
const [account, setAccount] = useState<AccountSummary | null>(null);
|
|
25
|
+
const [error, setError] = useState("");
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
let active = true;
|
|
29
|
+
void loadAccountSummary()
|
|
30
|
+
.then((summary) => {
|
|
31
|
+
if (active) setAccount(summary);
|
|
32
|
+
})
|
|
33
|
+
.catch((err) => {
|
|
34
|
+
if (active) setError(err instanceof Error ? err.message : "Unable to load account.");
|
|
35
|
+
});
|
|
36
|
+
return () => {
|
|
37
|
+
active = false;
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<main className="min-h-screen bg-background text-foreground">
|
|
43
|
+
<header className="border-b border-border bg-card/80">
|
|
44
|
+
<div className="mx-auto flex max-w-5xl items-center justify-between gap-4 px-4 py-4 md:px-8">
|
|
45
|
+
<a className="text-base font-extrabold text-foreground no-underline" href="/">
|
|
46
|
+
{appConfig.appName}
|
|
47
|
+
</a>
|
|
48
|
+
<AccountMenu />
|
|
49
|
+
</div>
|
|
50
|
+
</header>
|
|
51
|
+
|
|
52
|
+
<section className="mx-auto grid w-full max-w-5xl gap-6 px-4 py-8 md:px-8">
|
|
53
|
+
<div className="grid gap-2">
|
|
54
|
+
<h1 className="text-3xl font-bold leading-tight">Profile</h1>
|
|
55
|
+
<p className="text-muted-foreground">Your account for {appConfig.appName}.</p>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div className="grid max-w-2xl gap-5 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm">
|
|
59
|
+
{account ? (
|
|
60
|
+
<>
|
|
61
|
+
<div className="flex items-start gap-4">
|
|
62
|
+
<UserCircle className="mt-0.5 size-10 text-muted-foreground" aria-hidden="true" />
|
|
63
|
+
<div className="min-w-0">
|
|
64
|
+
<h2 className="truncate text-xl font-bold">{account.name}</h2>
|
|
65
|
+
<p className="truncate text-sm text-muted-foreground">{account.email}</p>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div className="flex flex-wrap gap-3">
|
|
70
|
+
{account.isOperator ? (
|
|
71
|
+
<a className="inline-flex min-h-10 items-center justify-center gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm font-semibold text-foreground hover:bg-muted" href="/admin">
|
|
72
|
+
<Shield className="size-4" aria-hidden="true" />
|
|
73
|
+
Admin
|
|
74
|
+
</a>
|
|
75
|
+
) : null}
|
|
76
|
+
<form action="/api/auth/logout" method="post">
|
|
77
|
+
<button className="inline-flex min-h-10 items-center justify-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90" type="submit">
|
|
78
|
+
<LogOut className="size-4" aria-hidden="true" />
|
|
79
|
+
Sign out
|
|
80
|
+
</button>
|
|
81
|
+
</form>
|
|
82
|
+
</div>
|
|
83
|
+
</>
|
|
84
|
+
) : error ? (
|
|
85
|
+
<div className="grid gap-3">
|
|
86
|
+
<p className="text-sm text-muted-foreground">Sign in to view your profile.</p>
|
|
87
|
+
<a className="inline-flex min-h-10 w-fit items-center justify-center rounded-md bg-primary px-3 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90" href="/login">
|
|
88
|
+
Sign in
|
|
89
|
+
</a>
|
|
90
|
+
</div>
|
|
91
|
+
) : (
|
|
92
|
+
<p className="text-sm text-muted-foreground">Loading profile...</p>
|
|
93
|
+
)}
|
|
94
|
+
</div>
|
|
95
|
+
</section>
|
|
96
|
+
</main>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createFileRoute, notFound } from "@tanstack/react-router";
|
|
2
|
+
import { ResetPasswordPage, passwordResetConfigured } from "./reset-password";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/_app/reset-password/$token")({
|
|
5
|
+
loader: async () => {
|
|
6
|
+
if (!passwordResetConfigured()) throw notFound();
|
|
7
|
+
return null;
|
|
8
|
+
},
|
|
9
|
+
component: ResetPasswordTokenRoute
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
function ResetPasswordTokenRoute() {
|
|
13
|
+
const { token } = Route.useParams();
|
|
14
|
+
return <ResetPasswordPage routeToken={token} />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { RaybaseConfig } from "@raybase/core";
|
|
2
|
+
import { createFileRoute, notFound } from "@tanstack/react-router";
|
|
3
|
+
import { KeyRound } from "lucide-react";
|
|
4
|
+
import { useEffect, useState, type FormEvent } from "react";
|
|
5
|
+
import {
|
|
6
|
+
AuthField,
|
|
7
|
+
AuthShell,
|
|
8
|
+
authButtonClass,
|
|
9
|
+
authInputClass
|
|
10
|
+
} from "../../components/auth-shell";
|
|
11
|
+
import { formObject, loadAuthCapabilities, postJson, type AuthCapabilities } from "../../lib/auth-client";
|
|
12
|
+
import { appConfig } from "../../raybase.config";
|
|
13
|
+
|
|
14
|
+
export const Route = createFileRoute("/_app/reset-password")({
|
|
15
|
+
loader: async () => {
|
|
16
|
+
if (!passwordResetConfigured()) throw notFound();
|
|
17
|
+
return null;
|
|
18
|
+
},
|
|
19
|
+
component: ResetPasswordRoute
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export function passwordResetConfigured(): boolean {
|
|
23
|
+
const config = appConfig as RaybaseConfig;
|
|
24
|
+
const email = config.auth?.email;
|
|
25
|
+
return email?.provider === "cloudflare" && Boolean(email.from) && email.passwordReset?.enabled !== false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function ResetPasswordRoute() {
|
|
29
|
+
return <ResetPasswordPage />;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function ResetPasswordPage({ routeToken = "" }: { routeToken?: string }) {
|
|
33
|
+
const [capabilities, setCapabilities] = useState<AuthCapabilities | null>(null);
|
|
34
|
+
const [token, setToken] = useState(routeToken);
|
|
35
|
+
const [error, setError] = useState("");
|
|
36
|
+
const [notice, setNotice] = useState("");
|
|
37
|
+
const [pending, setPending] = useState(false);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!routeToken && typeof window !== "undefined") {
|
|
41
|
+
setToken(new URL(window.location.href).searchParams.get("token") ?? "");
|
|
42
|
+
}
|
|
43
|
+
}, [routeToken]);
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
let active = true;
|
|
47
|
+
void loadAuthCapabilities()
|
|
48
|
+
.then((value) => {
|
|
49
|
+
if (active) setCapabilities(value);
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
if (active) setError(err instanceof Error ? err.message : "Unable to load reset status.");
|
|
53
|
+
});
|
|
54
|
+
return () => {
|
|
55
|
+
active = false;
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
const submit = (event: FormEvent<HTMLFormElement>) => {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
const form = formObject(event.currentTarget);
|
|
62
|
+
setPending(true);
|
|
63
|
+
setError("");
|
|
64
|
+
setNotice("");
|
|
65
|
+
void (async () => {
|
|
66
|
+
try {
|
|
67
|
+
await postJson("/api/auth/reset-password", {
|
|
68
|
+
token,
|
|
69
|
+
newPassword: form.newPassword
|
|
70
|
+
});
|
|
71
|
+
setNotice("Password updated. You can sign in now.");
|
|
72
|
+
} catch (err) {
|
|
73
|
+
setError(err instanceof Error ? err.message : "Unable to update password.");
|
|
74
|
+
} finally {
|
|
75
|
+
setPending(false);
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const unavailable = capabilities && !capabilities.passwordResetEnabled;
|
|
81
|
+
const missingToken = capabilities?.passwordResetEnabled && !token;
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<AuthShell
|
|
85
|
+
title="Set new password"
|
|
86
|
+
description={
|
|
87
|
+
unavailable
|
|
88
|
+
? "Password reset is not enabled for this workspace."
|
|
89
|
+
: missingToken
|
|
90
|
+
? "Open the reset link from your email."
|
|
91
|
+
: "Choose a new password fallback for your account."
|
|
92
|
+
}
|
|
93
|
+
footer={
|
|
94
|
+
<a className="font-semibold text-primary underline-offset-4 hover:underline" href="/login">
|
|
95
|
+
Back to sign in
|
|
96
|
+
</a>
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
{unavailable || missingToken ? null : (
|
|
100
|
+
<form className="grid gap-3" onSubmit={submit}>
|
|
101
|
+
<AuthField label="New password">
|
|
102
|
+
<input className={authInputClass} name="newPassword" type="password" autoComplete="new-password" minLength={10} required />
|
|
103
|
+
</AuthField>
|
|
104
|
+
<button className={authButtonClass} type="submit" disabled={pending || !capabilities}>
|
|
105
|
+
<KeyRound className="size-4" aria-hidden="true" />
|
|
106
|
+
Update password
|
|
107
|
+
</button>
|
|
108
|
+
{!capabilities && !error ? <p className="text-sm text-muted-foreground">Checking reset status...</p> : null}
|
|
109
|
+
{notice ? <p className="rounded-md border border-border bg-muted px-3 py-2 text-sm text-muted-foreground">{notice}</p> : null}
|
|
110
|
+
{error ? <p className="rounded-md border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive">{error}</p> : null}
|
|
111
|
+
</form>
|
|
112
|
+
)}
|
|
113
|
+
</AuthShell>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { SetupTokenPage } from "../../components/setup-token-page";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/_app/setup/$token")({
|
|
5
|
+
component: SetupRoute
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
function SetupRoute() {
|
|
9
|
+
const { token } = Route.useParams();
|
|
10
|
+
return <SetupTokenPage purpose="owner-setup" token={token} />;
|
|
11
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { RaybaseConfig } from "@raybase/core";
|
|
2
|
+
import { createFileRoute, notFound } from "@tanstack/react-router";
|
|
3
|
+
import { LogIn, UserPlus } from "lucide-react";
|
|
4
|
+
import { useEffect, useState, type FormEvent } from "react";
|
|
5
|
+
import {
|
|
6
|
+
AuthField,
|
|
7
|
+
AuthShell,
|
|
8
|
+
authButtonClass,
|
|
9
|
+
authInputClass
|
|
10
|
+
} from "../../components/auth-shell";
|
|
11
|
+
import {
|
|
12
|
+
currentNextPath,
|
|
13
|
+
formObject,
|
|
14
|
+
loadAuthCapabilities,
|
|
15
|
+
postJson,
|
|
16
|
+
registerPasskey,
|
|
17
|
+
safeRedirectTarget,
|
|
18
|
+
startProviderLogin,
|
|
19
|
+
type AuthCapabilities,
|
|
20
|
+
type AuthProvider
|
|
21
|
+
} from "../../lib/auth-client";
|
|
22
|
+
import { appConfig } from "../../raybase.config";
|
|
23
|
+
|
|
24
|
+
const mode = (appConfig as RaybaseConfig).auth?.signupMode;
|
|
25
|
+
const signupOpen = mode === "public" || mode === "provider-only";
|
|
26
|
+
const passwordSignup = mode === "public";
|
|
27
|
+
|
|
28
|
+
export const Route = createFileRoute("/_app/signup")({
|
|
29
|
+
loader: async () => {
|
|
30
|
+
if (!signupOpen) throw notFound();
|
|
31
|
+
return null;
|
|
32
|
+
},
|
|
33
|
+
component: SignupPage
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
function SignupPage() {
|
|
37
|
+
const [capabilities, setCapabilities] = useState<AuthCapabilities | null>(null);
|
|
38
|
+
const [error, setError] = useState("");
|
|
39
|
+
const [pending, setPending] = useState(false);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
let active = true;
|
|
43
|
+
void loadAuthCapabilities()
|
|
44
|
+
.then((value) => {
|
|
45
|
+
if (active) setCapabilities(value);
|
|
46
|
+
})
|
|
47
|
+
.catch((err) => {
|
|
48
|
+
if (active) setError(err instanceof Error ? err.message : "Unable to load signup status.");
|
|
49
|
+
});
|
|
50
|
+
return () => {
|
|
51
|
+
active = false;
|
|
52
|
+
};
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
const submit = (event: FormEvent<HTMLFormElement>) => {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
const payload = formObject(event.currentTarget);
|
|
58
|
+
setPending(true);
|
|
59
|
+
setError("");
|
|
60
|
+
void (async () => {
|
|
61
|
+
try {
|
|
62
|
+
const result = await postJson<{ redirect?: string; verificationRequired?: boolean }>("/api/auth/signup", payload);
|
|
63
|
+
if (!result.verificationRequired) {
|
|
64
|
+
try {
|
|
65
|
+
await registerPasskey();
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.warn("Passkey registration skipped", err);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
window.location.href = safeRedirectTarget(result.redirect, "/");
|
|
71
|
+
} catch (err) {
|
|
72
|
+
setError(err instanceof Error ? err.message : "Unable to create account.");
|
|
73
|
+
} finally {
|
|
74
|
+
setPending(false);
|
|
75
|
+
}
|
|
76
|
+
})();
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const providerLogin = (provider: AuthProvider) => {
|
|
80
|
+
setPending(true);
|
|
81
|
+
setError("");
|
|
82
|
+
void startProviderLogin(provider, currentNextPath("/")).catch((err) => {
|
|
83
|
+
setError(err instanceof Error ? err.message : "Unable to start provider sign-in.");
|
|
84
|
+
setPending(false);
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const unavailable = capabilities && !capabilities.publicSignupEnabled;
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<AuthShell
|
|
92
|
+
title={unavailable ? "Signup unavailable" : "Create account"}
|
|
93
|
+
description={unavailable ? "This workspace accepts new users by invite." : "Create an account for this workspace."}
|
|
94
|
+
footer={
|
|
95
|
+
<span>
|
|
96
|
+
Already have an account?{" "}
|
|
97
|
+
<a className="font-semibold text-primary underline-offset-4 hover:underline" href="/login">
|
|
98
|
+
Sign in
|
|
99
|
+
</a>
|
|
100
|
+
</span>
|
|
101
|
+
}
|
|
102
|
+
>
|
|
103
|
+
{unavailable ? (
|
|
104
|
+
<a className={authButtonClass} href="/login">
|
|
105
|
+
Back to sign in
|
|
106
|
+
</a>
|
|
107
|
+
) : (
|
|
108
|
+
<div className="grid gap-3">
|
|
109
|
+
{capabilities?.externalProviders.map((provider) => (
|
|
110
|
+
<button key={provider.id} className={authButtonClass} type="button" disabled={pending} onClick={() => providerLogin(provider)}>
|
|
111
|
+
<LogIn className="size-4" aria-hidden="true" />
|
|
112
|
+
Continue with {provider.label}
|
|
113
|
+
</button>
|
|
114
|
+
))}
|
|
115
|
+
{capabilities && capabilities.externalProviders.length === 0 && !passwordSignup ? (
|
|
116
|
+
<p className="text-sm text-muted-foreground">No sign-in provider is configured.</p>
|
|
117
|
+
) : null}
|
|
118
|
+
{passwordSignup ? (
|
|
119
|
+
<form className="grid gap-3" onSubmit={submit}>
|
|
120
|
+
<AuthField label="Name">
|
|
121
|
+
<input className={authInputClass} name="name" autoComplete="name" required />
|
|
122
|
+
</AuthField>
|
|
123
|
+
<AuthField label="Email">
|
|
124
|
+
<input className={authInputClass} name="email" type="email" autoComplete="username" required />
|
|
125
|
+
</AuthField>
|
|
126
|
+
<AuthField label="Password">
|
|
127
|
+
<input className={authInputClass} name="password" type="password" autoComplete="new-password" minLength={10} required />
|
|
128
|
+
</AuthField>
|
|
129
|
+
<button className={authButtonClass} type="submit" disabled={pending || !capabilities}>
|
|
130
|
+
<UserPlus className="size-4" aria-hidden="true" />
|
|
131
|
+
Create account
|
|
132
|
+
</button>
|
|
133
|
+
</form>
|
|
134
|
+
) : null}
|
|
135
|
+
{!capabilities && !error ? <p className="text-sm text-muted-foreground">Checking signup status...</p> : null}
|
|
136
|
+
{error ? <p className="rounded-md border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive">{error}</p> : null}
|
|
137
|
+
</div>
|
|
138
|
+
)}
|
|
139
|
+
</AuthShell>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createFileRoute, notFound } from "@tanstack/react-router";
|
|
2
|
+
import { VerifyEmailPage, emailVerificationConfigured } from "./verify-email";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/_app/verify-email/$token")({
|
|
5
|
+
loader: async () => {
|
|
6
|
+
if (!emailVerificationConfigured()) throw notFound();
|
|
7
|
+
return null;
|
|
8
|
+
},
|
|
9
|
+
component: VerifyEmailTokenRoute
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
function VerifyEmailTokenRoute() {
|
|
13
|
+
const { token } = Route.useParams();
|
|
14
|
+
return <VerifyEmailPage routeToken={token} />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { RaybaseConfig } from "@raybase/core";
|
|
2
|
+
import { createFileRoute, notFound } from "@tanstack/react-router";
|
|
3
|
+
import { BadgeCheck, MailCheck } from "lucide-react";
|
|
4
|
+
import { useEffect, useState, type FormEvent } from "react";
|
|
5
|
+
import {
|
|
6
|
+
AuthField,
|
|
7
|
+
AuthShell,
|
|
8
|
+
authButtonClass,
|
|
9
|
+
authInputClass
|
|
10
|
+
} from "../../components/auth-shell";
|
|
11
|
+
import { formObject, loadAuthCapabilities, postJson, type AuthCapabilities } from "../../lib/auth-client";
|
|
12
|
+
import { appConfig } from "../../raybase.config";
|
|
13
|
+
|
|
14
|
+
export const Route = createFileRoute("/_app/verify-email")({
|
|
15
|
+
loader: async () => {
|
|
16
|
+
if (!emailVerificationConfigured()) throw notFound();
|
|
17
|
+
return null;
|
|
18
|
+
},
|
|
19
|
+
component: VerifyEmailRoute
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export function emailVerificationConfigured(): boolean {
|
|
23
|
+
const config = appConfig as RaybaseConfig;
|
|
24
|
+
const email = config.auth?.email;
|
|
25
|
+
return email?.provider === "cloudflare" && Boolean(email.from) && email.emailVerification?.enabled === true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function VerifyEmailRoute() {
|
|
29
|
+
return <VerifyEmailPage />;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function VerifyEmailPage({ routeToken = "" }: { routeToken?: string }) {
|
|
33
|
+
const [capabilities, setCapabilities] = useState<AuthCapabilities | null>(null);
|
|
34
|
+
const [token, setToken] = useState(routeToken);
|
|
35
|
+
const [email, setEmail] = useState("");
|
|
36
|
+
const [error, setError] = useState("");
|
|
37
|
+
const [notice, setNotice] = useState("");
|
|
38
|
+
const [pending, setPending] = useState(false);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (typeof window !== "undefined") {
|
|
42
|
+
const url = new URL(window.location.href);
|
|
43
|
+
if (!routeToken) setToken(url.searchParams.get("token") ?? "");
|
|
44
|
+
setEmail(url.searchParams.get("email") ?? "");
|
|
45
|
+
}
|
|
46
|
+
}, [routeToken]);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
let active = true;
|
|
50
|
+
void loadAuthCapabilities()
|
|
51
|
+
.then((value) => {
|
|
52
|
+
if (active) setCapabilities(value);
|
|
53
|
+
})
|
|
54
|
+
.catch((err) => {
|
|
55
|
+
if (active) setError(err instanceof Error ? err.message : "Unable to load verification status.");
|
|
56
|
+
});
|
|
57
|
+
return () => {
|
|
58
|
+
active = false;
|
|
59
|
+
};
|
|
60
|
+
}, []);
|
|
61
|
+
|
|
62
|
+
const verifyToken = async (value: string) => {
|
|
63
|
+
const response = await fetch(`/api/auth/verify-email?token=${encodeURIComponent(value)}`);
|
|
64
|
+
const body = (await response.json().catch(() => ({}))) as { error?: string; message?: string };
|
|
65
|
+
if (!response.ok) throw new Error(body.error ?? body.message ?? "Unable to verify email.");
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (!token) return;
|
|
70
|
+
let active = true;
|
|
71
|
+
setPending(true);
|
|
72
|
+
setError("");
|
|
73
|
+
setNotice("");
|
|
74
|
+
void verifyToken(token)
|
|
75
|
+
.then(() => {
|
|
76
|
+
if (active) setNotice("Email verified. You can sign in now.");
|
|
77
|
+
})
|
|
78
|
+
.catch((err) => {
|
|
79
|
+
if (active) setError(err instanceof Error ? err.message : "Unable to verify email.");
|
|
80
|
+
})
|
|
81
|
+
.finally(() => {
|
|
82
|
+
if (active) setPending(false);
|
|
83
|
+
});
|
|
84
|
+
return () => {
|
|
85
|
+
active = false;
|
|
86
|
+
};
|
|
87
|
+
}, [token]);
|
|
88
|
+
|
|
89
|
+
const submit = (event: FormEvent<HTMLFormElement>) => {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
const form = formObject(event.currentTarget);
|
|
92
|
+
const submittedToken = token || form.token;
|
|
93
|
+
setPending(true);
|
|
94
|
+
setError("");
|
|
95
|
+
setNotice("");
|
|
96
|
+
void (async () => {
|
|
97
|
+
try {
|
|
98
|
+
if (submittedToken) {
|
|
99
|
+
await verifyToken(submittedToken);
|
|
100
|
+
setNotice("Email verified. You can sign in now.");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
await postJson("/api/auth/send-verification-email", {
|
|
104
|
+
email: form.email,
|
|
105
|
+
callbackURL: "/"
|
|
106
|
+
});
|
|
107
|
+
setNotice("If that account exists and needs verification, a new link has been sent.");
|
|
108
|
+
} catch (err) {
|
|
109
|
+
setError(err instanceof Error ? err.message : "Unable to verify email.");
|
|
110
|
+
} finally {
|
|
111
|
+
setPending(false);
|
|
112
|
+
}
|
|
113
|
+
})();
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const unavailable = capabilities && !capabilities.emailVerificationEnabled;
|
|
117
|
+
const missingToken = capabilities?.emailVerificationEnabled && !token;
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<AuthShell
|
|
121
|
+
title="Verify email"
|
|
122
|
+
description={
|
|
123
|
+
unavailable
|
|
124
|
+
? "Email verification is not enabled for this workspace."
|
|
125
|
+
: missingToken
|
|
126
|
+
? "Check your inbox for the verification link."
|
|
127
|
+
: "Finishing email verification."
|
|
128
|
+
}
|
|
129
|
+
footer={
|
|
130
|
+
<a className="font-semibold text-primary underline-offset-4 hover:underline" href="/login">
|
|
131
|
+
Back to sign in
|
|
132
|
+
</a>
|
|
133
|
+
}
|
|
134
|
+
>
|
|
135
|
+
{unavailable ? null : (
|
|
136
|
+
<form className="grid gap-3" onSubmit={submit}>
|
|
137
|
+
<input name="token" type="hidden" value={token} readOnly />
|
|
138
|
+
{!token ? (
|
|
139
|
+
<AuthField label="Email">
|
|
140
|
+
<input className={authInputClass} name="email" type="email" autoComplete="username" value={email} onChange={(event) => setEmail(event.target.value)} required />
|
|
141
|
+
</AuthField>
|
|
142
|
+
) : null}
|
|
143
|
+
<button className={authButtonClass} type="submit" disabled={pending || !capabilities}>
|
|
144
|
+
{token ? <BadgeCheck className="size-4" aria-hidden="true" /> : <MailCheck className="size-4" aria-hidden="true" />}
|
|
145
|
+
{token ? "Verify email" : "Resend verification email"}
|
|
146
|
+
</button>
|
|
147
|
+
{!capabilities && !error ? <p className="text-sm text-muted-foreground">Checking verification status...</p> : null}
|
|
148
|
+
{notice ? <p className="rounded-md border border-border bg-muted px-3 py-2 text-sm text-muted-foreground">{notice}</p> : null}
|
|
149
|
+
{error ? <p className="rounded-md border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm text-destructive">{error}</p> : null}
|
|
150
|
+
</form>
|
|
151
|
+
)}
|
|
152
|
+
</AuthShell>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { useEffect, useLayoutEffect } from "react";
|
|
3
|
+
import "../styles.css";
|
|
4
|
+
|
|
5
|
+
export const Route = createFileRoute("/_app")({
|
|
6
|
+
component: AppLayout
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
10
|
+
|
|
11
|
+
function AppLayout() {
|
|
12
|
+
// The root route is shared with docs. Keep app-owned theme behavior here so
|
|
13
|
+
// docs do not inherit the app stylesheet just by existing in the route tree.
|
|
14
|
+
useIsomorphicLayoutEffect(() => {
|
|
15
|
+
const stored = localStorage.getItem("theme");
|
|
16
|
+
const dark =
|
|
17
|
+
stored === "dark" ||
|
|
18
|
+
((!stored || stored === "system") && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
19
|
+
document.documentElement.classList.toggle("dark", dark);
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<script
|
|
25
|
+
dangerouslySetInnerHTML={{
|
|
26
|
+
__html:
|
|
27
|
+
"(function(){try{var t=localStorage.getItem('theme');var d=t==='dark'||((!t||t==='system')&&matchMedia('(prefers-color-scheme: dark)').matches);document.documentElement.classList.toggle('dark',d);}catch(e){}})();"
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
<Outlet />
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
const forward = async ({ request }: { request: Request }) => {
|
|
4
|
+
const { handleRaybaseRequest } = await import("../../raybase.server");
|
|
5
|
+
return handleRaybaseRequest(request);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Route = createFileRoute("/admin/$")({
|
|
9
|
+
server: {
|
|
10
|
+
handlers: {
|
|
11
|
+
GET: forward,
|
|
12
|
+
POST: forward,
|
|
13
|
+
PATCH: forward,
|
|
14
|
+
PUT: forward,
|
|
15
|
+
DELETE: forward,
|
|
16
|
+
OPTIONS: forward
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
component: () => null
|
|
20
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
const forward = async ({ request }: { request: Request }) => {
|
|
4
|
+
const { handleRaybaseRequest } = await import("../../raybase.server");
|
|
5
|
+
return handleRaybaseRequest(request);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Route = createFileRoute("/api/$")({
|
|
9
|
+
server: {
|
|
10
|
+
handlers: {
|
|
11
|
+
GET: forward,
|
|
12
|
+
POST: forward,
|
|
13
|
+
PATCH: forward,
|
|
14
|
+
PUT: forward,
|
|
15
|
+
DELETE: forward,
|
|
16
|
+
OPTIONS: forward
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/docs/$")({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: async ({ request }) => {
|
|
8
|
+
const { handleDocsRequest } = await import("../../docs/docs-handler");
|
|
9
|
+
return handleDocsRequest(request);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
component: DocumentNavigationFallback
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function DocumentNavigationFallback() {
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
window.location.assign(window.location.href);
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
export const Route = createFileRoute("/docs/api/markdown")({
|
|
4
|
+
server: {
|
|
5
|
+
handlers: {
|
|
6
|
+
GET: async ({ request }) => {
|
|
7
|
+
const { handleDocsRequest } = await import("../../../docs/docs-handler");
|
|
8
|
+
return handleDocsRequest(request);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
export const Route = createFileRoute("/docs/api/search")({
|
|
4
|
+
server: {
|
|
5
|
+
handlers: {
|
|
6
|
+
GET: async ({ request }) => {
|
|
7
|
+
const { handleDocsRequest } = await import("../../../docs/docs-handler");
|
|
8
|
+
return handleDocsRequest(request);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|