@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,79 @@
|
|
|
1
|
+
import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock";
|
|
2
|
+
import defaultMdxComponents from "fumadocs-ui/mdx";
|
|
3
|
+
import type { MDXComponents } from "mdx/types";
|
|
4
|
+
|
|
5
|
+
interface McpServerUrlProps {
|
|
6
|
+
path?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ClaudeMcpAddCommandProps extends McpServerUrlProps {
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface CodexMcpAddCommandProps extends McpServerUrlProps {
|
|
14
|
+
name?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function browserOrigin() {
|
|
18
|
+
return typeof window === "undefined" ? "" : window.location.origin;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function currentUrl(path = "/mcp") {
|
|
22
|
+
const origin = browserOrigin();
|
|
23
|
+
return origin ? new URL(path, origin).toString() : path;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function McpServerUrl(props: McpServerUrlProps) {
|
|
27
|
+
return <code suppressHydrationWarning>{currentUrl(props.path)}</code>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function McpServerUrlBlock(props: McpServerUrlProps) {
|
|
31
|
+
return (
|
|
32
|
+
<CodeBlock>
|
|
33
|
+
<Pre>
|
|
34
|
+
<code suppressHydrationWarning>{currentUrl(props.path)}</code>
|
|
35
|
+
</Pre>
|
|
36
|
+
</CodeBlock>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ClaudeMcpAddCommand(props: ClaudeMcpAddCommandProps) {
|
|
41
|
+
const command = `claude mcp add --transport http ${props.name ?? "this-app"} "${currentUrl(props.path)}"`;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<CodeBlock>
|
|
45
|
+
<Pre>
|
|
46
|
+
<code suppressHydrationWarning>{command}</code>
|
|
47
|
+
</Pre>
|
|
48
|
+
</CodeBlock>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function CodexMcpAddCommand(props: CodexMcpAddCommandProps) {
|
|
53
|
+
const command = `codex mcp add ${props.name ?? "this-app"} --url "${currentUrl(props.path)}"`;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<CodeBlock>
|
|
57
|
+
<Pre>
|
|
58
|
+
<code suppressHydrationWarning>{command}</code>
|
|
59
|
+
</Pre>
|
|
60
|
+
</CodeBlock>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function getMDXComponents(components?: MDXComponents) {
|
|
65
|
+
return {
|
|
66
|
+
...defaultMdxComponents,
|
|
67
|
+
McpServerUrl,
|
|
68
|
+
McpServerUrlBlock,
|
|
69
|
+
ClaudeMcpAddCommand,
|
|
70
|
+
CodexMcpAddCommand,
|
|
71
|
+
...components
|
|
72
|
+
} satisfies MDXComponents;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const useMDXComponents = getMDXComponents;
|
|
76
|
+
|
|
77
|
+
declare global {
|
|
78
|
+
type MDXProvidedComponents = ReturnType<typeof getMDXComponents>;
|
|
79
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
|
|
4
|
+
export type ButtonVariant = "default" | "secondary" | "outline" | "ghost" | "link" | "destructive";
|
|
5
|
+
export type ButtonSize = "default" | "sm" | "lg" | "icon";
|
|
6
|
+
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const variantClassNames: Record<ButtonVariant, string> = {
|
|
13
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
14
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
+
outline: "border border-border bg-background hover:bg-muted",
|
|
16
|
+
ghost: "hover:bg-muted",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
18
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const sizeClassNames: Record<ButtonSize, string> = {
|
|
22
|
+
default: "h-9 px-4 py-2",
|
|
23
|
+
sm: "h-8 px-3 text-sm",
|
|
24
|
+
lg: "h-10 px-6",
|
|
25
|
+
icon: "size-9",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
29
|
+
({ className, variant = "default", size = "default", type = "button", ...props }, ref) => (
|
|
30
|
+
<button
|
|
31
|
+
ref={ref}
|
|
32
|
+
type={type}
|
|
33
|
+
className={cn(
|
|
34
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
35
|
+
variantClassNames[variant],
|
|
36
|
+
sizeClassNames[size],
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
Button.displayName = "Button";
|
|
44
|
+
|
|
45
|
+
export { Button };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
|
|
4
|
+
export type CardBackground = "base" | "subdued" | "transparent";
|
|
5
|
+
export type CardPadding = "base" | "none";
|
|
6
|
+
|
|
7
|
+
type DivProps = React.ComponentPropsWithoutRef<"div">;
|
|
8
|
+
type DivRef = React.ElementRef<"div">;
|
|
9
|
+
|
|
10
|
+
type HeadingProps = React.ComponentPropsWithoutRef<"h3">;
|
|
11
|
+
type HeadingRef = React.ElementRef<"h3">;
|
|
12
|
+
|
|
13
|
+
type ParagraphProps = React.ComponentPropsWithoutRef<"p">;
|
|
14
|
+
type ParagraphRef = React.ElementRef<"p">;
|
|
15
|
+
|
|
16
|
+
export interface CardProps extends DivProps {
|
|
17
|
+
background?: CardBackground;
|
|
18
|
+
padding?: CardPadding;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const cardPaddingClassNames: Record<CardPadding, string> = {
|
|
22
|
+
base: "p-4",
|
|
23
|
+
none: "p-0",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const cardBackgroundClassNames: Record<CardBackground, string> = {
|
|
27
|
+
base: "bg-card",
|
|
28
|
+
subdued: "bg-muted",
|
|
29
|
+
transparent: "bg-transparent",
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
|
33
|
+
(
|
|
34
|
+
{ className, style, background = "base", padding = "base", ...props },
|
|
35
|
+
ref,
|
|
36
|
+
) => (
|
|
37
|
+
<div
|
|
38
|
+
ref={ref}
|
|
39
|
+
style={style}
|
|
40
|
+
className={cn(
|
|
41
|
+
"rounded-lg border border-border text-card-foreground shadow-sm",
|
|
42
|
+
cardBackgroundClassNames[background],
|
|
43
|
+
cardPaddingClassNames[padding],
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
Card.displayName = "Card";
|
|
51
|
+
|
|
52
|
+
const CardHeader = React.forwardRef<DivRef, DivProps>(
|
|
53
|
+
({ className, ...props }, ref) => (
|
|
54
|
+
<div ref={ref} className={cn("flex flex-col gap-1", className)} {...props} />
|
|
55
|
+
),
|
|
56
|
+
);
|
|
57
|
+
CardHeader.displayName = "CardHeader";
|
|
58
|
+
|
|
59
|
+
const CardTitle = React.forwardRef<HeadingRef, HeadingProps>(
|
|
60
|
+
({ className, ...props }, ref) => (
|
|
61
|
+
<h3 ref={ref} className={cn("text-base font-semibold", className)} {...props} />
|
|
62
|
+
),
|
|
63
|
+
);
|
|
64
|
+
CardTitle.displayName = "CardTitle";
|
|
65
|
+
|
|
66
|
+
const CardDescription = React.forwardRef<ParagraphRef, ParagraphProps>(
|
|
67
|
+
({ className, ...props }, ref) => (
|
|
68
|
+
<p ref={ref} className={cn("text-base text-muted-foreground", className)} {...props} />
|
|
69
|
+
),
|
|
70
|
+
);
|
|
71
|
+
CardDescription.displayName = "CardDescription";
|
|
72
|
+
|
|
73
|
+
const CardContent = React.forwardRef<DivRef, DivProps>(
|
|
74
|
+
({ className, ...props }, ref) => (
|
|
75
|
+
<div ref={ref} className={cn("pt-3", className)} {...props} />
|
|
76
|
+
),
|
|
77
|
+
);
|
|
78
|
+
CardContent.displayName = "CardContent";
|
|
79
|
+
|
|
80
|
+
const CardFooter = React.forwardRef<DivRef, DivProps>(
|
|
81
|
+
({ className, ...props }, ref) => (
|
|
82
|
+
<div ref={ref} className={cn("pt-4", className)} {...props} />
|
|
83
|
+
),
|
|
84
|
+
);
|
|
85
|
+
CardFooter.displayName = "CardFooter";
|
|
86
|
+
|
|
87
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
|
|
4
|
+
export interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
decorative?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(
|
|
10
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (
|
|
11
|
+
<div
|
|
12
|
+
ref={ref}
|
|
13
|
+
role={decorative ? "none" : "separator"}
|
|
14
|
+
aria-orientation={decorative ? undefined : orientation}
|
|
15
|
+
className={cn("shrink-0 bg-border", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
),
|
|
19
|
+
);
|
|
20
|
+
Separator.displayName = "Separator";
|
|
21
|
+
|
|
22
|
+
export { Separator };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { raybaseSchema, type RaybaseConfig } from "@raybase/core";
|
|
2
|
+
|
|
3
|
+
export const appConfig = {
|
|
4
|
+
appName: "__APP_NAME__",
|
|
5
|
+
// To remove the Core web admin panel, its APIs, and static assets from this
|
|
6
|
+
// deployment, set `admin: { enabled: false }`, then rebuild and redeploy.
|
|
7
|
+
// Operator MCP is separate; disable it with `mcp.operator.enabled: false`.
|
|
8
|
+
// admin: { enabled: false },
|
|
9
|
+
auth: {
|
|
10
|
+
signupMode: "invite-only",
|
|
11
|
+
publicRoutes: [],
|
|
12
|
+
// Enable only after dev/SPEC.md records
|
|
13
|
+
// `Cloudflare email capability: transactional-email`, and after running
|
|
14
|
+
// `raybase email enable --from noreply@example.com` plus completing
|
|
15
|
+
// Cloudflare Email Service DNS onboarding:
|
|
16
|
+
// email: {
|
|
17
|
+
// provider: "cloudflare",
|
|
18
|
+
// binding: "EMAIL",
|
|
19
|
+
// from: "noreply@example.com",
|
|
20
|
+
// appUrl: "https://app.example.com",
|
|
21
|
+
// passwordReset: { enabled: true },
|
|
22
|
+
// invites: { enabled: true },
|
|
23
|
+
// welcome: { enabled: true },
|
|
24
|
+
// emailVerification: { enabled: false },
|
|
25
|
+
// magicLink: { enabled: false }
|
|
26
|
+
// }
|
|
27
|
+
},
|
|
28
|
+
mcp: {
|
|
29
|
+
enabled: true,
|
|
30
|
+
oauth: {
|
|
31
|
+
dynamicClientRegistration: true,
|
|
32
|
+
allowedClientRedirectHosts: ["*"],
|
|
33
|
+
allowedClientMetadataHosts: ["*"]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
realtime: { enabled: false },
|
|
37
|
+
// To enable user-facing AI chat features, run `raybase ai enable`.
|
|
38
|
+
// Workers AI is the Core default. To route chat through Cloudflare AI Gateway,
|
|
39
|
+
// set ai.gateway.id and use a Gateway-routed model in ai.defaults.model.
|
|
40
|
+
// For BYOK, store only secret names here:
|
|
41
|
+
// gateway: { id: "my-gateway", authorizationSecretName: "OPENAI_API_KEY" }
|
|
42
|
+
// or use a Cloudflare AI Gateway Store Key:
|
|
43
|
+
// gateway: { id: "my-gateway", storeKeyName: "openai-prod" }
|
|
44
|
+
// ai: {
|
|
45
|
+
// enabled: true
|
|
46
|
+
// }
|
|
47
|
+
// External chat providers covered by AI Gateway should use the Core chat
|
|
48
|
+
// path. Capability Kits remain appropriate for non-chat modalities outside
|
|
49
|
+
// this contract, such as async image or video generation.
|
|
50
|
+
} satisfies RaybaseConfig;
|
|
51
|
+
|
|
52
|
+
// App-owned tables live in Raybase's SQLite Durable Object. Declare them
|
|
53
|
+
// with raybaseTable() and the policy vocabulary, then run `raybase migrate`.
|
|
54
|
+
// They become browsable at /admin and reachable through Raybase's data API
|
|
55
|
+
// and declared actions.
|
|
56
|
+
export const schema = raybaseSchema({});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineSeedVariants } from "@raybase/core/worker";
|
|
2
|
+
import type { RaybaseEnv, RaybaseSeedVariants } from "@raybase/core/worker";
|
|
3
|
+
import type { schema } from "./schema";
|
|
4
|
+
|
|
5
|
+
export async function seed() {
|
|
6
|
+
// This template starts without app-owned tables. Add demo rows here after
|
|
7
|
+
// declaring app tables in schema.ts.
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const seedVariants = defineSeedVariants({
|
|
11
|
+
"empty-app": async () => {
|
|
12
|
+
// Add app-owned demo rows here after declaring app tables in schema.ts.
|
|
13
|
+
}
|
|
14
|
+
} satisfies RaybaseSeedVariants<RaybaseEnv, typeof schema>);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { renderToReadableStream } from "react-dom/server";
|
|
2
|
+
import { ServerRouter } from "react-router";
|
|
3
|
+
import { type EntryContext } from "react-router";
|
|
4
|
+
import { isbot } from "isbot";
|
|
5
|
+
|
|
6
|
+
export default async function handleRequest(
|
|
7
|
+
request: Request,
|
|
8
|
+
responseStatusCode: number,
|
|
9
|
+
responseHeaders: Headers,
|
|
10
|
+
reactRouterContext: EntryContext,
|
|
11
|
+
) {
|
|
12
|
+
let shellRendered = false;
|
|
13
|
+
const userAgent = request.headers.get("user-agent");
|
|
14
|
+
|
|
15
|
+
const body = await renderToReadableStream(
|
|
16
|
+
<ServerRouter context={reactRouterContext} url={request.url} />,
|
|
17
|
+
{
|
|
18
|
+
onError(error: unknown) {
|
|
19
|
+
responseStatusCode = 500;
|
|
20
|
+
// Only log streaming errors once the shell has rendered — shell
|
|
21
|
+
// errors reject the promise above and are logged by React Router.
|
|
22
|
+
if (shellRendered) {
|
|
23
|
+
console.error(error);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
signal: request.signal,
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
shellRendered = true;
|
|
30
|
+
|
|
31
|
+
// Bots and SPA Mode renders wait for all content before responding.
|
|
32
|
+
if ((userAgent && isbot(userAgent)) || reactRouterContext.isSpaMode) {
|
|
33
|
+
await body.allReady;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
responseHeaders.set("Content-Type", "text/html");
|
|
37
|
+
return new Response(body, {
|
|
38
|
+
headers: responseHeaders,
|
|
39
|
+
status: responseStatusCode,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module "*.css";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DocsLayoutProps } from "fumadocs-ui/layouts/docs";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { ArrowLeft } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const appName = "__APP_NAME__";
|
|
6
|
+
const appHomeHref = "/";
|
|
7
|
+
|
|
8
|
+
export function baseOptions(): Omit<DocsLayoutProps, "children" | "tree"> {
|
|
9
|
+
return {
|
|
10
|
+
nav: {
|
|
11
|
+
title: DocsNavTitle,
|
|
12
|
+
url: appHomeHref
|
|
13
|
+
},
|
|
14
|
+
sidebar: {
|
|
15
|
+
footer: <DocsSidebarFooter />
|
|
16
|
+
},
|
|
17
|
+
themeSwitch: {
|
|
18
|
+
enabled: false
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function DocsNavTitle({ className, href = appHomeHref, ...props }: ComponentProps<"a">) {
|
|
24
|
+
return (
|
|
25
|
+
<div className={`${className ?? ""} inline-flex min-w-0 flex-col items-start gap-0.5 leading-none`} aria-label={`${appName} docs`}>
|
|
26
|
+
<a
|
|
27
|
+
{...props}
|
|
28
|
+
href={href}
|
|
29
|
+
title={`Back to ${appName}`}
|
|
30
|
+
className="max-w-44 truncate rounded-sm text-[0.9375rem] font-semibold leading-none text-fd-foreground underline-offset-4 transition-colors hover:text-fd-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring"
|
|
31
|
+
>
|
|
32
|
+
{appName}
|
|
33
|
+
</a>
|
|
34
|
+
<span className="text-[0.6875rem] font-medium leading-none text-fd-muted-foreground">Docs</span>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function DocsSidebarFooter() {
|
|
40
|
+
return (
|
|
41
|
+
<div className="mt-2 flex min-w-0 items-center border-t pt-3">
|
|
42
|
+
<a
|
|
43
|
+
href={appHomeHref}
|
|
44
|
+
title={`Back to ${appName}`}
|
|
45
|
+
className="inline-flex min-w-0 items-center gap-1.5 rounded-md px-1 py-1 text-xs font-medium text-fd-muted-foreground transition-colors hover:text-fd-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring"
|
|
46
|
+
>
|
|
47
|
+
<ArrowLeft className="size-3.5 shrink-0" aria-hidden="true" />
|
|
48
|
+
<span className="truncate">Back to app</span>
|
|
49
|
+
</a>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Raybase runs in the same worker as the React Router app: workers/app.ts
|
|
2
|
+
// routes Raybase's own paths here (the admin panel, its API, sign-in, setup
|
|
3
|
+
// and invite pages, MCP) and everything else to React Router.
|
|
4
|
+
import { createRaybaseApp, isRaybaseAdminPanelRequestDisabled } from "@raybase/core/worker";
|
|
5
|
+
import type { RaybaseEnv } from "@raybase/core/worker";
|
|
6
|
+
import { docsModule } from "@raybase/docs";
|
|
7
|
+
import { appMigrations } from "./db/migrations.gen";
|
|
8
|
+
import { appConfig, schema } from "./db/schema";
|
|
9
|
+
import { seed, seedVariants } from "./db/seed";
|
|
10
|
+
|
|
11
|
+
export { appConfig, schema };
|
|
12
|
+
|
|
13
|
+
const raybase = createRaybaseApp({
|
|
14
|
+
config: appConfig,
|
|
15
|
+
schema,
|
|
16
|
+
appMigrations,
|
|
17
|
+
seed,
|
|
18
|
+
seedVariants,
|
|
19
|
+
// No app search index yet: the starter has no tables of its own to index.
|
|
20
|
+
// Add one over the app's tables when it has some (see the raybase-search
|
|
21
|
+
// skill); the Guide module brings its own "guide" index for the docs corpus.
|
|
22
|
+
// raybase:modules:start
|
|
23
|
+
modules: [
|
|
24
|
+
docsModule<Env>()
|
|
25
|
+
],
|
|
26
|
+
// raybase:modules:end
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const raybaseHandler = raybase.handler;
|
|
30
|
+
export class RaybaseAIChatAgentObject extends raybase.RaybaseAIChatAgentObject {}
|
|
31
|
+
|
|
32
|
+
// Paths owned by the Raybase handler. React Router serves everything else,
|
|
33
|
+
// including /docs (its search lives at /docs/api/search, not /api/search).
|
|
34
|
+
const raybasePathPrefixes = ["/admin", "/api", "/login", "/signup", "/setup", "/invite", "/forgot-password", "/reset-password", "/verify-email", "/mcp", "/.well-known"];
|
|
35
|
+
|
|
36
|
+
export function isRaybaseRequest(url: URL): boolean {
|
|
37
|
+
return raybasePathPrefixes.some(
|
|
38
|
+
(prefix) => url.pathname === prefix || url.pathname.startsWith(`${prefix}/`)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function isDisabledRaybaseAdminRequest(request: Request): boolean {
|
|
43
|
+
return isRaybaseAdminPanelRequestDisabled(request, appConfig);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function handleRaybaseRequest(request: Request, env: Env, ctx: ExecutionContext): Response | Promise<Response> {
|
|
47
|
+
if (!raybaseHandler.fetch) throw new Error("Raybase handler is not fetch-compatible");
|
|
48
|
+
return raybaseHandler.fetch(request as never, env as never, ctx as never);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type CurrentUser = { id: string; name: string; email: string; isOperator: boolean };
|
|
52
|
+
|
|
53
|
+
// Asks Raybase who sent the request, from its own session cookie. Loaders use
|
|
54
|
+
// it to gate app pages: null means "send them to /login".
|
|
55
|
+
export async function currentUser(request: Request, env: Env, ctx: ExecutionContext): Promise<CurrentUser | null> {
|
|
56
|
+
const url = new URL("/api/account/me", request.url);
|
|
57
|
+
const headers = new Headers({ accept: "application/json" });
|
|
58
|
+
const cookie = request.headers.get("cookie");
|
|
59
|
+
if (cookie) headers.set("cookie", cookie);
|
|
60
|
+
const response = await handleRaybaseRequest(new Request(url, { headers }), env, ctx);
|
|
61
|
+
if (!response.ok) return null;
|
|
62
|
+
return (await response.json()) as CurrentUser;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type { RaybaseEnv };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
|
|
2
|
+
|
|
3
|
+
import "./app.css";
|
|
4
|
+
|
|
5
|
+
export default function App() {
|
|
6
|
+
return (
|
|
7
|
+
<html lang="en">
|
|
8
|
+
<head>
|
|
9
|
+
<meta charSet="utf-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
11
|
+
<Meta />
|
|
12
|
+
<Links />
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<Outlet />
|
|
16
|
+
{/* raybase:guide-widget:start */}
|
|
17
|
+
{/* raybase:guide-widget:end */}
|
|
18
|
+
<ScrollRestoration />
|
|
19
|
+
<Scripts />
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { LoaderFunctionArgs } from "react-router";
|
|
2
|
+
import { redirect, useLoaderData } from "react-router";
|
|
3
|
+
import { Button } from "../components/ui/button";
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../components/ui/card";
|
|
5
|
+
import { currentUser } from "../raybase.server";
|
|
6
|
+
|
|
7
|
+
// App pages are for signed-in members. Raybase owns sign-in (/login), owner
|
|
8
|
+
// setup (/setup) and invites (/invite); a loader only asks it who is here.
|
|
9
|
+
export async function loader({ request, context }: LoaderFunctionArgs) {
|
|
10
|
+
const user = await currentUser(request, context.cloudflare.env, context.cloudflare.ctx);
|
|
11
|
+
if (!user) throw redirect(`/login?next=${encodeURIComponent(new URL(request.url).pathname)}`);
|
|
12
|
+
return { user };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function Home() {
|
|
16
|
+
const { user } = useLoaderData<typeof loader>();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<main className="mx-auto grid min-h-screen w-full max-w-3xl content-start gap-6 px-4 py-12">
|
|
20
|
+
<header className="flex flex-wrap items-center justify-between gap-3">
|
|
21
|
+
<h1 className="text-2xl font-semibold">__APP_NAME__</h1>
|
|
22
|
+
<nav className="flex items-center gap-3 text-sm">
|
|
23
|
+
<a className="text-muted-foreground hover:text-foreground" href="/docs" data-raybase-docs-nav>
|
|
24
|
+
Docs
|
|
25
|
+
</a>
|
|
26
|
+
{user.isOperator ? (
|
|
27
|
+
<a className="text-muted-foreground hover:text-foreground" href="/admin">
|
|
28
|
+
Admin
|
|
29
|
+
</a>
|
|
30
|
+
) : null}
|
|
31
|
+
<form method="post" action="/api/auth/logout">
|
|
32
|
+
<Button type="submit" variant="outline" size="sm">
|
|
33
|
+
Sign out
|
|
34
|
+
</Button>
|
|
35
|
+
</form>
|
|
36
|
+
</nav>
|
|
37
|
+
</header>
|
|
38
|
+
<Card>
|
|
39
|
+
<CardHeader>
|
|
40
|
+
<CardTitle>Signed in as {user.name || user.email}</CardTitle>
|
|
41
|
+
<CardDescription>
|
|
42
|
+
Replace this page with the first screen of the approved spec in dev/SPEC.md.
|
|
43
|
+
</CardDescription>
|
|
44
|
+
</CardHeader>
|
|
45
|
+
<CardContent>
|
|
46
|
+
<p className="text-sm text-muted-foreground">
|
|
47
|
+
App routes live in app/routes. App tables are declared in app/db/schema.ts and managed by raybase migrate.
|
|
48
|
+
</p>
|
|
49
|
+
</CardContent>
|
|
50
|
+
</Card>
|
|
51
|
+
</main>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useLoaderData } from "react-router";
|
|
2
|
+
import { useFumadocsLoader } from "fumadocs-core/source/client";
|
|
3
|
+
import browserCollections from "collections/browser";
|
|
4
|
+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
5
|
+
import {
|
|
6
|
+
DocsBody,
|
|
7
|
+
DocsDescription,
|
|
8
|
+
DocsPage,
|
|
9
|
+
DocsTitle
|
|
10
|
+
} from "fumadocs-ui/layouts/docs/page";
|
|
11
|
+
import { getMDXComponents } from "../components/mdx";
|
|
12
|
+
import { baseOptions } from "../lib/layout.shared";
|
|
13
|
+
import { source } from "../lib/source";
|
|
14
|
+
|
|
15
|
+
export async function loader({ params }: { params: { "*": string | undefined } }) {
|
|
16
|
+
const slugs = params["*"]?.split("/").filter(Boolean) ?? [];
|
|
17
|
+
const page = source.getPage(slugs);
|
|
18
|
+
if (!page) throw new Response("Not found", { status: 404 });
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
path: page.path,
|
|
22
|
+
pageTree: await source.serializePageTree(source.getPageTree())
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const clientLoader = browserCollections.docs.createClientLoader({
|
|
27
|
+
component({ toc, frontmatter, default: MDX }) {
|
|
28
|
+
return (
|
|
29
|
+
<DocsPage toc={toc}>
|
|
30
|
+
<DocsTitle>{frontmatter.title}</DocsTitle>
|
|
31
|
+
<DocsDescription>{frontmatter.description}</DocsDescription>
|
|
32
|
+
<DocsBody>
|
|
33
|
+
<MDX components={getMDXComponents()} />
|
|
34
|
+
</DocsBody>
|
|
35
|
+
</DocsPage>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export default function DocsRoute() {
|
|
41
|
+
const data = useFumadocsLoader(useLoaderData<typeof loader>());
|
|
42
|
+
const content = clientLoader.useContent(data.path);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<DocsLayout {...baseOptions()} tree={data.pageTree}>
|
|
46
|
+
{content}
|
|
47
|
+
</DocsLayout>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFromSource } from "fumadocs-core/search/server";
|
|
2
|
+
import { source } from "../lib/source";
|
|
3
|
+
|
|
4
|
+
const search = createFromSource(source, {
|
|
5
|
+
language: "english"
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export async function loader({ request }: { request: Request }) {
|
|
9
|
+
return search.GET(request);
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Outlet } from "react-router";
|
|
2
|
+
import { RootProvider } from "fumadocs-ui/provider/react-router";
|
|
3
|
+
|
|
4
|
+
export default function DocsLayoutRoute() {
|
|
5
|
+
return (
|
|
6
|
+
<RootProvider
|
|
7
|
+
search={{ options: { api: "/docs/api/search" } }}
|
|
8
|
+
theme={{ enabled: false }}
|
|
9
|
+
>
|
|
10
|
+
<Outlet />
|
|
11
|
+
</RootProvider>
|
|
12
|
+
);
|
|
13
|
+
}
|