@raybase/create 0.0.1 → 0.3.3
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 +2351 -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,298 @@
|
|
|
1
|
+
// Loads and unloads the Galley demo starter set (site/demo). The demo is
|
|
2
|
+
// inspect-first teaching material: reading site/demo needs no dev server,
|
|
3
|
+
// loading uses the same install path as real registry Templates, and
|
|
4
|
+
// everything loaded is a draft that never reaches the public site. The
|
|
5
|
+
// menu-bound nav example in site/demo is inspect-first only because menus are
|
|
6
|
+
// live owner data. See site/demo/README.md for the file-by-file walkthrough.
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
+
import { resolveSiteOrigin } from "./site-origin.mjs";
|
|
12
|
+
|
|
13
|
+
const siteRoot = fileURLToPath(new URL("..", import.meta.url));
|
|
14
|
+
const appRoot = join(siteRoot, "..");
|
|
15
|
+
const demoRoot = join(siteRoot, "demo");
|
|
16
|
+
const markerPath = join(appRoot, ".raybase/galley-demo.json");
|
|
17
|
+
const lockPath = join(appRoot, ".raybase/templates.json");
|
|
18
|
+
const baseUrl = resolveSiteOrigin();
|
|
19
|
+
|
|
20
|
+
const demoTemplateIds = ["demo-article-card", "demo-article-page", "demo-articles-index"];
|
|
21
|
+
const demoPageSlugs = ["demo-articles"];
|
|
22
|
+
|
|
23
|
+
const collectionSeed = readDemoJson("content/collection.json");
|
|
24
|
+
const entriesSeed = readDemoJson("content/entries.json");
|
|
25
|
+
|
|
26
|
+
let cookie = "";
|
|
27
|
+
|
|
28
|
+
const command = process.argv[2];
|
|
29
|
+
try {
|
|
30
|
+
if (command === "load") await load();
|
|
31
|
+
else if (command === "unload") await unload();
|
|
32
|
+
else if (command === "status") status();
|
|
33
|
+
else {
|
|
34
|
+
console.error("Usage: node scripts/galley-demo.mjs <load|unload|status>");
|
|
35
|
+
process.exit(2);
|
|
36
|
+
}
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error(error instanceof Error ? error.message : error);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function load() {
|
|
43
|
+
await activateDevBypass();
|
|
44
|
+
await ensureDemoCollection();
|
|
45
|
+
const entrySlugs = await ensureDemoEntries();
|
|
46
|
+
|
|
47
|
+
for (const id of demoTemplateIds) {
|
|
48
|
+
const templateUrl = pathToFileURL(join(demoRoot, "templates", id)).href;
|
|
49
|
+
runStep(["pnpm", "exec", "raybase", "templates", "add", templateUrl, "--stage-only"], appRoot);
|
|
50
|
+
}
|
|
51
|
+
runStep(["node", "scripts/apply-site-templates.mjs"], siteRoot);
|
|
52
|
+
|
|
53
|
+
mkdirSync(join(appRoot, ".raybase"), { recursive: true });
|
|
54
|
+
writeFileSync(
|
|
55
|
+
markerPath,
|
|
56
|
+
`${JSON.stringify(
|
|
57
|
+
{
|
|
58
|
+
schemaVersion: 1,
|
|
59
|
+
loadedAt: new Date().toISOString(),
|
|
60
|
+
collection: collectionSeed.slug,
|
|
61
|
+
entrySlugs,
|
|
62
|
+
pages: demoPageSlugs,
|
|
63
|
+
templates: demoTemplateIds
|
|
64
|
+
},
|
|
65
|
+
null,
|
|
66
|
+
2
|
|
67
|
+
)}\n`
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
console.log("");
|
|
71
|
+
console.log("Galley demo loaded (drafts only; nothing is public).");
|
|
72
|
+
console.log(` Read the wiring: site/demo/README.md`);
|
|
73
|
+
console.log(` Browse the drafts: ${baseUrl}/_emdash/admin (Demo Articles collection, /demo-articles page)`);
|
|
74
|
+
console.log(` Templates installed: ${demoTemplateIds.join(", ")}`);
|
|
75
|
+
console.log(` Remove everything: pnpm --dir site run demo:unload`);
|
|
76
|
+
console.log("raybase doctor will warn until the demo is unloaded.");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function unload() {
|
|
80
|
+
await activateDevBypass();
|
|
81
|
+
const summary = [];
|
|
82
|
+
|
|
83
|
+
for (const slug of demoPageSlugs) {
|
|
84
|
+
const removed = await deletePage(slug);
|
|
85
|
+
if (removed) summary.push(`page /${slug}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const collectionRemoved = await deleteCollection(collectionSeed.slug);
|
|
89
|
+
if (collectionRemoved) summary.push(`collection ${collectionSeed.slug} (entries and design field included)`);
|
|
90
|
+
|
|
91
|
+
const templateResult = await deleteGalleyTemplates(demoTemplateIds);
|
|
92
|
+
if (templateResult.deleted.length) summary.push(`Galley templates ${templateResult.deleted.join(", ")}`);
|
|
93
|
+
|
|
94
|
+
for (const id of demoTemplateIds) {
|
|
95
|
+
const staged = join(siteRoot, "seed/templates", id);
|
|
96
|
+
if (existsSync(staged)) {
|
|
97
|
+
rmSync(staged, { recursive: true });
|
|
98
|
+
summary.push(`staged seed ${id}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
for (const slug of demoPageSlugs) {
|
|
102
|
+
const stagedPage = join(siteRoot, "seed/pages", `${slug}.json`);
|
|
103
|
+
if (existsSync(stagedPage)) {
|
|
104
|
+
unlinkSync(stagedPage);
|
|
105
|
+
summary.push(`staged page seed ${slug}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (cleanTemplateLock()) summary.push(".raybase/templates.json entries");
|
|
110
|
+
if (existsSync(markerPath)) {
|
|
111
|
+
unlinkSync(markerPath);
|
|
112
|
+
summary.push(".raybase/galley-demo.json marker");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
console.log("");
|
|
116
|
+
console.log(summary.length ? `Galley demo unloaded. Removed: ${summary.join("; ")}.` : "Galley demo unloaded (nothing was loaded).");
|
|
117
|
+
if (templateResult.leftAsDrafts.length) {
|
|
118
|
+
console.log(
|
|
119
|
+
`Left as never-published draft template records (this Galley version has no templates/delete route): ${templateResult.leftAsDrafts.join(", ")}. They render nowhere.`
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function status() {
|
|
125
|
+
const marker = existsSync(markerPath) ? JSON.parse(readFileSync(markerPath, "utf8")) : null;
|
|
126
|
+
const stagedIds = demoTemplateIds.filter((id) => existsSync(join(siteRoot, "seed/templates", id)));
|
|
127
|
+
console.log(marker ? `Galley demo loaded at ${marker.loadedAt}.` : "Galley demo is not loaded.");
|
|
128
|
+
if (stagedIds.length) console.log(`Staged demo seeds present: ${stagedIds.join(", ")}.`);
|
|
129
|
+
if (!marker && !stagedIds.length) console.log("Read site/demo/README.md, then load with: pnpm --dir site run demo:load");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function readDemoJson(relPath) {
|
|
133
|
+
return JSON.parse(readFileSync(join(demoRoot, relPath), "utf8"));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function runStep(argv, cwd) {
|
|
137
|
+
const result = spawnSync(argv[0], argv.slice(1), { cwd, stdio: "inherit", env: { ...process.env, EMDASH_URL: baseUrl } });
|
|
138
|
+
if (result.status !== 0) {
|
|
139
|
+
throw new Error(`Step failed (${argv.join(" ")}). Is the site dev server running at ${baseUrl}?`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function ensureDemoCollection() {
|
|
144
|
+
let collection = await getCollection(collectionSeed.slug);
|
|
145
|
+
if (!collection) {
|
|
146
|
+
const { fields, ...collectionBody } = collectionSeed;
|
|
147
|
+
await postJson("/_emdash/api/schema/collections", collectionBody, 201);
|
|
148
|
+
collection = await getCollection(collectionSeed.slug);
|
|
149
|
+
}
|
|
150
|
+
if (!collection) throw new Error(`Could not create or load the ${collectionSeed.slug} collection schema.`);
|
|
151
|
+
|
|
152
|
+
const existingFields = new Map((collection.fields ?? []).map((field) => [field.slug, field]));
|
|
153
|
+
for (const [sortOrder, field] of collectionSeed.fields.entries()) {
|
|
154
|
+
const existing = existingFields.get(field.slug);
|
|
155
|
+
if (!existing) {
|
|
156
|
+
await postJson(`/_emdash/api/schema/collections/${encodeURIComponent(collectionSeed.slug)}/fields`, { ...field, sortOrder }, 201);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (existing.type !== field.type) {
|
|
160
|
+
throw new Error(
|
|
161
|
+
`Collection ${collectionSeed.slug} field "${field.slug}" exists with type "${existing.type}", but the demo declares "${field.type}". Unload the demo (demo:unload) and reload it.`
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function ensureDemoEntries() {
|
|
168
|
+
const slugs = [];
|
|
169
|
+
for (const entry of entriesSeed.entries) {
|
|
170
|
+
slugs.push(entry.slug);
|
|
171
|
+
const existing = await request(`/_emdash/api/content/${encodeURIComponent(entriesSeed.collection)}/${encodeURIComponent(entry.slug)}`, {
|
|
172
|
+
method: "GET"
|
|
173
|
+
});
|
|
174
|
+
if (existing.status === 404) {
|
|
175
|
+
// Created without a publish call, the entry stays a draft: invisible on
|
|
176
|
+
// the public site and in builds, editable in the admin.
|
|
177
|
+
await postJson(`/_emdash/api/content/${encodeURIComponent(entriesSeed.collection)}`, { slug: entry.slug, data: entry.data }, 201);
|
|
178
|
+
console.log(`Created draft demo entry: ${entry.slug}`);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (!existing.ok) throw await apiError(existing, `Could not read demo entry ${entry.slug}`);
|
|
182
|
+
console.log(`Demo entry already present: ${entry.slug}`);
|
|
183
|
+
}
|
|
184
|
+
return slugs;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
async function getCollection(slug) {
|
|
188
|
+
const response = await request(`/_emdash/api/schema/collections/${encodeURIComponent(slug)}?includeFields=true`, { method: "GET" });
|
|
189
|
+
if (response.status === 404) return null;
|
|
190
|
+
if (!response.ok) throw await apiError(response, `Could not read collection ${slug} schema`);
|
|
191
|
+
const payload = unwrapApiPayload(await response.json());
|
|
192
|
+
return payload.item ?? payload;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
async function deletePage(slug) {
|
|
196
|
+
const existing = await request(`/_emdash/api/content/pages/${encodeURIComponent(slug)}`, { method: "GET" });
|
|
197
|
+
if (existing.status === 404) return false;
|
|
198
|
+
if (!existing.ok) throw await apiError(existing, `Could not read demo page ${slug}`);
|
|
199
|
+
const payload = unwrapApiPayload(await existing.json());
|
|
200
|
+
const id = payload.item?.id ?? payload.id;
|
|
201
|
+
const response = await request(`/_emdash/api/content/pages/${encodeURIComponent(id)}`, { method: "DELETE", headers: { "x-emdash-request": "1" } });
|
|
202
|
+
if (!response.ok) throw await apiError(response, `Could not delete demo page ${slug}`);
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async function deleteCollection(slug) {
|
|
207
|
+
const response = await request(`/_emdash/api/schema/collections/${encodeURIComponent(slug)}?force=true`, {
|
|
208
|
+
method: "DELETE",
|
|
209
|
+
headers: { "x-emdash-request": "1" }
|
|
210
|
+
});
|
|
211
|
+
if (response.status === 404) return false;
|
|
212
|
+
if (!response.ok) throw await apiError(response, `Could not delete collection ${slug}`);
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Current Galley releases may not expose a templates/delete plugin route. Feature-detect so
|
|
217
|
+
// unload starts deleting template records the moment a newer Galley ships
|
|
218
|
+
// one; until then the records stay as never-published drafts.
|
|
219
|
+
async function deleteGalleyTemplates(ids) {
|
|
220
|
+
const deleted = [];
|
|
221
|
+
const leftAsDrafts = [];
|
|
222
|
+
for (const id of ids) {
|
|
223
|
+
const response = await request(`/_emdash/api/plugins/galley/templates/delete`, {
|
|
224
|
+
method: "POST",
|
|
225
|
+
headers: { "content-type": "application/json", "x-emdash-request": "1" },
|
|
226
|
+
body: JSON.stringify({ id })
|
|
227
|
+
});
|
|
228
|
+
if (response.ok) deleted.push(id);
|
|
229
|
+
else leftAsDrafts.push(id);
|
|
230
|
+
}
|
|
231
|
+
return { deleted, leftAsDrafts };
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function cleanTemplateLock() {
|
|
235
|
+
if (!existsSync(lockPath)) return false;
|
|
236
|
+
const lock = JSON.parse(readFileSync(lockPath, "utf8"));
|
|
237
|
+
let changed = false;
|
|
238
|
+
for (const id of demoTemplateIds) {
|
|
239
|
+
if (lock.templates && id in lock.templates) {
|
|
240
|
+
delete lock.templates[id];
|
|
241
|
+
changed = true;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
for (const slug of demoPageSlugs) {
|
|
245
|
+
if (lock.pages && slug in lock.pages) {
|
|
246
|
+
delete lock.pages[slug];
|
|
247
|
+
changed = true;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (changed) {
|
|
251
|
+
lock.updatedAt = new Date().toISOString();
|
|
252
|
+
writeFileSync(lockPath, `${JSON.stringify(lock, null, 2)}\n`);
|
|
253
|
+
}
|
|
254
|
+
return changed;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async function activateDevBypass() {
|
|
258
|
+
const response = await fetch(`${baseUrl}/_emdash/api/setup/dev-bypass?redirect=/`, { redirect: "manual" }).catch(() => null);
|
|
259
|
+
cookie = response ? readCookie(response) : "";
|
|
260
|
+
if (!cookie) {
|
|
261
|
+
throw new Error(`Could not reach EmDash at ${baseUrl}. Start the site dev server first (raybase dev, or pnpm --dir site run dev).`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
async function postJson(path, body, expectedStatus = 200) {
|
|
266
|
+
const response = await request(path, {
|
|
267
|
+
method: "POST",
|
|
268
|
+
headers: { "content-type": "application/json", "x-emdash-request": "1" },
|
|
269
|
+
body: JSON.stringify(body)
|
|
270
|
+
});
|
|
271
|
+
if (response.status !== expectedStatus) throw await apiError(response, `POST ${path} failed`);
|
|
272
|
+
return unwrapApiPayload(await response.json());
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
async function request(path, init) {
|
|
276
|
+
return fetch(`${baseUrl}${path}`, {
|
|
277
|
+
...init,
|
|
278
|
+
headers: { ...(init.headers ?? {}), ...(cookie ? { cookie } : {}) }
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
async function apiError(response, prefix) {
|
|
283
|
+
const text = await response.text();
|
|
284
|
+
return new Error(`${prefix}: ${response.status} ${response.statusText}\n${text}`);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function readCookie(response) {
|
|
288
|
+
const setCookies = response.headers.getSetCookie?.() ?? [];
|
|
289
|
+
const parts = setCookies.length ? setCookies : response.headers.get("set-cookie")?.split(",") ?? [];
|
|
290
|
+
return parts
|
|
291
|
+
.map((part) => part.trim().split(";")[0])
|
|
292
|
+
.filter(Boolean)
|
|
293
|
+
.join("; ");
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function unwrapApiPayload(payload) {
|
|
297
|
+
return payload && typeof payload === "object" && "data" in payload ? payload.data : payload;
|
|
298
|
+
}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { resolveSiteOrigin } from "./site-origin.mjs";
|
|
2
|
+
|
|
3
|
+
const baseUrl = resolveSiteOrigin();
|
|
4
|
+
|
|
5
|
+
const pagesCollection = {
|
|
6
|
+
slug: "pages",
|
|
7
|
+
label: "Pages",
|
|
8
|
+
labelSingular: "Page",
|
|
9
|
+
supports: ["drafts", "revisions", "search"],
|
|
10
|
+
hasSeo: true,
|
|
11
|
+
urlPattern: "/{slug}",
|
|
12
|
+
fields: [
|
|
13
|
+
{
|
|
14
|
+
slug: "title",
|
|
15
|
+
label: "Title",
|
|
16
|
+
type: "string",
|
|
17
|
+
required: true,
|
|
18
|
+
searchable: true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
slug: "description",
|
|
22
|
+
label: "Description",
|
|
23
|
+
type: "text",
|
|
24
|
+
searchable: true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
slug: "content",
|
|
28
|
+
label: "Content",
|
|
29
|
+
type: "portableText",
|
|
30
|
+
searchable: true
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const template = {
|
|
36
|
+
id: "raybase-starter-landing",
|
|
37
|
+
version: 1,
|
|
38
|
+
label: "Raybase Starter Landing",
|
|
39
|
+
status: "published",
|
|
40
|
+
createdAt: new Date().toISOString(),
|
|
41
|
+
updatedAt: new Date().toISOString(),
|
|
42
|
+
fields: {
|
|
43
|
+
eyebrow: { label: "Eyebrow", kind: "string", default: "Astro + EmDash + Raybase" },
|
|
44
|
+
headline: { label: "Headline", kind: "text", default: "__APP_NAME__" },
|
|
45
|
+
body: {
|
|
46
|
+
label: "Body",
|
|
47
|
+
kind: "text",
|
|
48
|
+
default:
|
|
49
|
+
"Publish content from EmDash while Raybase controls operator access, handoff minting, audit, docs, and public Server Island actions."
|
|
50
|
+
},
|
|
51
|
+
primaryLabel: { label: "Primary label", kind: "string", default: "Open admin" },
|
|
52
|
+
primaryUrl: { label: "Primary URL", kind: "url", default: "/_emdash/admin" },
|
|
53
|
+
secondaryLabel: { label: "Secondary label", kind: "string", default: "Read docs" },
|
|
54
|
+
secondaryUrl: { label: "Secondary URL", kind: "url", default: "http://127.0.0.1:3000/docs" },
|
|
55
|
+
features: {
|
|
56
|
+
label: "Features",
|
|
57
|
+
kind: "list",
|
|
58
|
+
fields: {
|
|
59
|
+
title: { label: "Title", kind: "string" },
|
|
60
|
+
body: { label: "Body", kind: "text" }
|
|
61
|
+
},
|
|
62
|
+
default: [
|
|
63
|
+
{
|
|
64
|
+
title: "EmDash owns content",
|
|
65
|
+
body: "Pages, drafts, media, revisions, and Galley template instances live in the Astro site's D1 and R2 bindings."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: "Raybase owns access",
|
|
69
|
+
body: "The spine mints short-lived ES256 handoff tokens and records handoff audit events."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: "Public islands stay narrow",
|
|
73
|
+
body: "The site proxies only allow-listed Raybase actions instead of exposing arbitrary URLs."
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
liquidSource: String.raw`
|
|
79
|
+
<section class="page-section galley-landing">
|
|
80
|
+
<style>
|
|
81
|
+
.galley-landing {
|
|
82
|
+
display: grid;
|
|
83
|
+
gap: clamp(2rem, 5vw, 4rem);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.galley-landing__hero {
|
|
87
|
+
display: grid;
|
|
88
|
+
gap: 1.35rem;
|
|
89
|
+
max-width: 760px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.galley-landing__eyebrow {
|
|
93
|
+
color: var(--color-muted);
|
|
94
|
+
font-size: 0.82rem;
|
|
95
|
+
font-weight: 800;
|
|
96
|
+
letter-spacing: 0;
|
|
97
|
+
text-transform: uppercase;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.galley-landing h1 {
|
|
101
|
+
font-size: clamp(2.75rem, 7vw, 5.6rem);
|
|
102
|
+
letter-spacing: 0;
|
|
103
|
+
line-height: 0.95;
|
|
104
|
+
margin: 0;
|
|
105
|
+
max-width: 12ch;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.galley-landing__body {
|
|
109
|
+
color: var(--color-muted);
|
|
110
|
+
font-size: clamp(1.08rem, 2vw, 1.3rem);
|
|
111
|
+
line-height: 1.65;
|
|
112
|
+
margin: 0;
|
|
113
|
+
max-width: 62ch;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.galley-landing__features {
|
|
117
|
+
display: grid;
|
|
118
|
+
gap: 1rem;
|
|
119
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.galley-landing__feature {
|
|
123
|
+
background: var(--color-surface);
|
|
124
|
+
border: 1px solid var(--color-border);
|
|
125
|
+
border-radius: var(--radius);
|
|
126
|
+
padding: 1.25rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.galley-landing__feature h2 {
|
|
130
|
+
font-size: 1rem;
|
|
131
|
+
margin: 0 0 0.5rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.galley-landing__feature p {
|
|
135
|
+
color: var(--color-muted);
|
|
136
|
+
line-height: 1.55;
|
|
137
|
+
margin: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@media (max-width: 760px) {
|
|
141
|
+
.galley-landing__features {
|
|
142
|
+
grid-template-columns: 1fr;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
146
|
+
<div class="galley-landing__hero">
|
|
147
|
+
<p class="galley-landing__eyebrow" data-dynamic-text="eyebrow">{{ eyebrow | escape }}</p>
|
|
148
|
+
<h1 data-dynamic-text="headline">{{ headline | escape }}</h1>
|
|
149
|
+
<p class="galley-landing__body" data-dynamic-text="body">{{ body | escape }}</p>
|
|
150
|
+
<div class="button-row">
|
|
151
|
+
<a class="button" href="{{ primaryUrl | escape }}" data-dynamic-href="primaryUrl" data-dynamic-text="primaryLabel">{{ primaryLabel | escape }}</a>
|
|
152
|
+
<a class="button secondary" href="{{ secondaryUrl | escape }}" data-dynamic-href="secondaryUrl" data-dynamic-text="secondaryLabel">{{ secondaryLabel | escape }}</a>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
<div class="galley-landing__features" data-dynamic-list="features">
|
|
156
|
+
{% for feature in features %}
|
|
157
|
+
<article class="galley-landing__feature" data-dynamic-list-item="features.{{ forloop.index0 }}">
|
|
158
|
+
<h2 data-dynamic-text="features.{{ forloop.index0 }}.title">{{ feature.title | escape }}</h2>
|
|
159
|
+
<p data-dynamic-text="features.{{ forloop.index0 }}.body">{{ feature.body | escape }}</p>
|
|
160
|
+
</article>
|
|
161
|
+
{% endfor %}
|
|
162
|
+
</div>
|
|
163
|
+
</section>
|
|
164
|
+
`
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const pageBody = {
|
|
168
|
+
slug: "home",
|
|
169
|
+
data: {
|
|
170
|
+
title: "__APP_NAME__",
|
|
171
|
+
description: "A public Astro content site governed by a Raybase spine.",
|
|
172
|
+
content: [
|
|
173
|
+
{
|
|
174
|
+
_type: "galley.block",
|
|
175
|
+
_key: "home-galley-landing",
|
|
176
|
+
templateId: template.id,
|
|
177
|
+
templateVersion: 1,
|
|
178
|
+
data: {
|
|
179
|
+
eyebrow: "Astro + EmDash + Raybase",
|
|
180
|
+
headline: "__APP_NAME__",
|
|
181
|
+
body:
|
|
182
|
+
"Publish content from EmDash while Raybase controls operator access, handoff minting, audit, docs, and public Server Island actions.",
|
|
183
|
+
primaryLabel: "Open admin",
|
|
184
|
+
primaryUrl: "/_emdash/admin",
|
|
185
|
+
secondaryLabel: "Read docs",
|
|
186
|
+
secondaryUrl: "http://127.0.0.1:3000/docs",
|
|
187
|
+
features: template.fields.features.default
|
|
188
|
+
},
|
|
189
|
+
richText: {}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
_type: "raybase.actionIsland",
|
|
193
|
+
_key: "home-server-island",
|
|
194
|
+
title: "Server Island status",
|
|
195
|
+
body: "This island calls the public content.site_snapshot action through the local site proxy.",
|
|
196
|
+
action: "content.site_snapshot"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
let cookie = "";
|
|
203
|
+
|
|
204
|
+
try {
|
|
205
|
+
await activateDevBypass();
|
|
206
|
+
await ensurePagesCollectionSchema();
|
|
207
|
+
const saved = await postJson("/_emdash/api/plugins/galley/templates/save", { template });
|
|
208
|
+
const page = await upsertHomePage();
|
|
209
|
+
await postJson(`/_emdash/api/content/pages/${encodeURIComponent(page.id)}/publish`, {});
|
|
210
|
+
|
|
211
|
+
console.log(`Installed Galley template: ${saved.template.label} (${saved.template.id})`);
|
|
212
|
+
console.log(`Installed homepage content: ${baseUrl}/`);
|
|
213
|
+
} catch (error) {
|
|
214
|
+
console.error(error instanceof Error ? error.message : error);
|
|
215
|
+
process.exit(1);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async function activateDevBypass() {
|
|
219
|
+
const response = await fetch(`${baseUrl}/_emdash/api/setup/dev-bypass?redirect=/`, {
|
|
220
|
+
redirect: "manual"
|
|
221
|
+
});
|
|
222
|
+
cookie = readCookie(response);
|
|
223
|
+
if (!cookie) {
|
|
224
|
+
throw new Error("Could not activate EmDash dev bypass. Is the Astro site dev server running?");
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async function ensurePagesCollectionSchema() {
|
|
229
|
+
let collection = await getPagesCollection();
|
|
230
|
+
if (!collection) {
|
|
231
|
+
await postJson(
|
|
232
|
+
"/_emdash/api/schema/collections",
|
|
233
|
+
{
|
|
234
|
+
slug: pagesCollection.slug,
|
|
235
|
+
label: pagesCollection.label,
|
|
236
|
+
labelSingular: pagesCollection.labelSingular,
|
|
237
|
+
supports: pagesCollection.supports,
|
|
238
|
+
hasSeo: pagesCollection.hasSeo,
|
|
239
|
+
urlPattern: pagesCollection.urlPattern
|
|
240
|
+
},
|
|
241
|
+
201
|
|
242
|
+
);
|
|
243
|
+
collection = await getPagesCollection();
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (!collection) throw new Error("Could not create or load the pages collection schema.");
|
|
247
|
+
|
|
248
|
+
await putJson(`/_emdash/api/schema/collections/${encodeURIComponent(pagesCollection.slug)}`, {
|
|
249
|
+
label: pagesCollection.label,
|
|
250
|
+
labelSingular: pagesCollection.labelSingular,
|
|
251
|
+
supports: pagesCollection.supports,
|
|
252
|
+
hasSeo: pagesCollection.hasSeo,
|
|
253
|
+
urlPattern: pagesCollection.urlPattern
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
const existingFields = new Map((collection.fields ?? []).map((field) => [field.slug, field]));
|
|
257
|
+
for (const [sortOrder, field] of pagesCollection.fields.entries()) {
|
|
258
|
+
const existing = existingFields.get(field.slug);
|
|
259
|
+
if (!existing) {
|
|
260
|
+
await postJson(
|
|
261
|
+
`/_emdash/api/schema/collections/${encodeURIComponent(pagesCollection.slug)}/fields`,
|
|
262
|
+
{ ...field, sortOrder },
|
|
263
|
+
201
|
|
264
|
+
);
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (existing.type !== field.type) {
|
|
269
|
+
throw new Error(
|
|
270
|
+
`Pages field "${field.slug}" exists with type "${existing.type}", but Galley setup requires "${field.type}". Reset the EmDash content database or migrate the field intentionally.`
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const { slug: _slug, type: _type, ...updates } = field;
|
|
275
|
+
await putJson(
|
|
276
|
+
`/_emdash/api/schema/collections/${encodeURIComponent(pagesCollection.slug)}/fields/${encodeURIComponent(field.slug)}`,
|
|
277
|
+
{ ...updates, sortOrder }
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
async function getPagesCollection() {
|
|
283
|
+
const response = await request(
|
|
284
|
+
`/_emdash/api/schema/collections/${encodeURIComponent(pagesCollection.slug)}?includeFields=true`,
|
|
285
|
+
{ method: "GET" }
|
|
286
|
+
);
|
|
287
|
+
if (response.status === 404) return null;
|
|
288
|
+
if (!response.ok) throw await apiError(response, "Could not read pages collection schema");
|
|
289
|
+
const payload = unwrapApiPayload(await response.json());
|
|
290
|
+
return payload.item ?? payload;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async function upsertHomePage() {
|
|
294
|
+
const existing = await request("/_emdash/api/content/pages/home", { method: "GET" });
|
|
295
|
+
if (existing.status === 404) {
|
|
296
|
+
const created = await postJson("/_emdash/api/content/pages", pageBody, 201);
|
|
297
|
+
return created.item;
|
|
298
|
+
}
|
|
299
|
+
if (!existing.ok) throw await apiError(existing, "Could not read existing home page");
|
|
300
|
+
|
|
301
|
+
const rawPayload = await existing.json();
|
|
302
|
+
const payload = unwrapApiPayload(rawPayload);
|
|
303
|
+
const item = payload.item;
|
|
304
|
+
const updated = await putJson(`/_emdash/api/content/pages/${encodeURIComponent(item.id)}`, {
|
|
305
|
+
...pageBody,
|
|
306
|
+
_rev: payload._rev ?? rawPayload._rev ?? rawPayload.data?._rev
|
|
307
|
+
});
|
|
308
|
+
return updated.item;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
async function postJson(path, body, expectedStatus = 200) {
|
|
312
|
+
const response = await request(path, {
|
|
313
|
+
method: "POST",
|
|
314
|
+
headers: { "content-type": "application/json", "x-emdash-request": "1" },
|
|
315
|
+
body: JSON.stringify(body)
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
if (response.status !== expectedStatus) throw await apiError(response, `POST ${path} failed`);
|
|
319
|
+
return unwrapApiPayload(await response.json());
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
async function putJson(path, body, expectedStatus = 200) {
|
|
323
|
+
const response = await request(path, {
|
|
324
|
+
method: "PUT",
|
|
325
|
+
headers: { "content-type": "application/json", "x-emdash-request": "1" },
|
|
326
|
+
body: JSON.stringify(body)
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
if (response.status !== expectedStatus) throw await apiError(response, `PUT ${path} failed`);
|
|
330
|
+
return unwrapApiPayload(await response.json());
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
async function request(path, init) {
|
|
334
|
+
return fetch(`${baseUrl}${path}`, {
|
|
335
|
+
...init,
|
|
336
|
+
headers: {
|
|
337
|
+
...(init.headers ?? {}),
|
|
338
|
+
...(cookie ? { cookie } : {})
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
async function apiError(response, prefix) {
|
|
344
|
+
const text = await response.text();
|
|
345
|
+
return new Error(`${prefix}: ${response.status} ${response.statusText}\n${text}`);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function readCookie(response) {
|
|
349
|
+
const setCookie = response.headers.get("set-cookie");
|
|
350
|
+
if (!setCookie) return "";
|
|
351
|
+
return setCookie
|
|
352
|
+
.split(",")
|
|
353
|
+
.map((part) => part.trim().split(";")[0])
|
|
354
|
+
.filter(Boolean)
|
|
355
|
+
.join("; ");
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function unwrapApiPayload(payload) {
|
|
359
|
+
return payload && typeof payload === "object" && "data" in payload ? payload.data : payload;
|
|
360
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the running Astro/EmDash site origin. `raybase dev` may move the
|
|
7
|
+
* site off 4321 when the port is taken; it persists the resolved origin to
|
|
8
|
+
* the app root's `.dev.vars`, which is the source of truth for tooling that
|
|
9
|
+
* runs as a separate process (templates:apply, seed:galley, demo:*).
|
|
10
|
+
*/
|
|
11
|
+
export function resolveSiteOrigin() {
|
|
12
|
+
const fromEnv = process.env.EMDASH_URL ?? process.env.RAYBASE_SITE_ORIGIN;
|
|
13
|
+
if (fromEnv) return fromEnv.replace(/\/$/, "");
|
|
14
|
+
return readAppDevVar("RAYBASE_SITE_ORIGIN") ?? "http://127.0.0.1:4321";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the Raybase spine origin — the handoff issuer this site
|
|
19
|
+
* verifies against. `raybase dev` may move the spine off 3000 (`--port` or
|
|
20
|
+
* the busy-port auto-bump) and persists the resolved origin to the app
|
|
21
|
+
* root's `.dev.vars`, so a site process it did not launch (standalone
|
|
22
|
+
* `pnpm dev`, tooling) still verifies against the port the spine really
|
|
23
|
+
* uses instead of a stale 3000 default.
|
|
24
|
+
*/
|
|
25
|
+
export function resolveSpineOrigin() {
|
|
26
|
+
const fromEnv = process.env.RAYBASE_SPINE_URL ?? process.env.PUBLIC_RAYBASE_SPINE_URL;
|
|
27
|
+
if (fromEnv) return fromEnv.replace(/\/$/, "");
|
|
28
|
+
return readAppDevVar("RAYBASE_SPINE_ORIGIN") ?? "http://127.0.0.1:3000";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function readAppDevVar(key) {
|
|
32
|
+
const appRoot = fileURLToPath(new URL("../..", import.meta.url));
|
|
33
|
+
const devVarsFile = join(appRoot, ".dev.vars");
|
|
34
|
+
if (!existsSync(devVarsFile)) return null;
|
|
35
|
+
for (const line of readFileSync(devVarsFile, "utf8").split(/\r?\n/)) {
|
|
36
|
+
const trimmed = line.trim();
|
|
37
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
38
|
+
const index = trimmed.indexOf("=");
|
|
39
|
+
if (index === -1) continue;
|
|
40
|
+
if (trimmed.slice(0, index).trim() !== key) continue;
|
|
41
|
+
const value = trimmed.slice(index + 1).trim();
|
|
42
|
+
if (value) return value.replace(/\/$/, "");
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|