@raybase/create 0.0.2 → 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,325 @@
|
|
|
1
|
+
// Fetching a source tree from outside Raybase: a GitHub repository pinned to a
|
|
2
|
+
// commit, or a set of direct files listed in a file-manifest.json. Raybase Kits
|
|
3
|
+
// (packages/cli/src/kit-registry.ts) and starters (./starter-source.ts) both
|
|
4
|
+
// resolve through these, so the pinning, integrity and path-safety rules are
|
|
5
|
+
// one implementation. The CLI imports this package, so it lives here rather
|
|
6
|
+
// than in @raybase/cli.
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
import { lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, rmSync, writeFileSync } from "node:fs";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import { dirname, join, resolve, sep } from "node:path";
|
|
12
|
+
export const MAX_SOURCE_BYTES = 25 * 1024 * 1024;
|
|
13
|
+
/**
|
|
14
|
+
* Parses `github:<owner>/<repo>[/<path>][#<ref>]`. `subject` names the spec in
|
|
15
|
+
* errors ("GitHub kit specs"); `requirePath` demands the path segment (a kit
|
|
16
|
+
* lives inside a registry repo, a starter may be the whole repo). The ref is
|
|
17
|
+
* a branch, tag or commit and is always resolved to a commit sha on fetch.
|
|
18
|
+
*/
|
|
19
|
+
export function parseGithubSource(raw, options) {
|
|
20
|
+
const withoutPrefix = raw.slice("github:".length);
|
|
21
|
+
const [coordinate, ref] = splitSourceRef(withoutPrefix);
|
|
22
|
+
const segments = coordinate.split("/").filter(Boolean);
|
|
23
|
+
if (segments.length < (options.requirePath ? 3 : 2)) {
|
|
24
|
+
throw new Error(`${options.subject} must be github:<owner>/<repo>${options.requirePath ? "/<path>" : "[/<path>]"}[#ref].`);
|
|
25
|
+
}
|
|
26
|
+
const [owner, repo, ...pathSegments] = segments;
|
|
27
|
+
if (!owner || !repo || (options.requirePath && !pathSegments.length)) {
|
|
28
|
+
throw new Error(`${options.subject} must include owner, repo${options.requirePath ? ", and path" : ""}.`);
|
|
29
|
+
}
|
|
30
|
+
if ([owner, repo, ...pathSegments].some((segment) => segment === ".." || segment === ".")) {
|
|
31
|
+
throw new Error(`${options.subject} must not contain traversal segments.`);
|
|
32
|
+
}
|
|
33
|
+
return { owner, repo, path: pathSegments.join("/"), ref };
|
|
34
|
+
}
|
|
35
|
+
export function splitSourceRef(value) {
|
|
36
|
+
const index = value.lastIndexOf("#");
|
|
37
|
+
if (index === -1)
|
|
38
|
+
return [value, undefined];
|
|
39
|
+
const ref = value.slice(index + 1).trim();
|
|
40
|
+
if (!ref)
|
|
41
|
+
throw new Error("GitHub ref after # must not be empty.");
|
|
42
|
+
return [value.slice(0, index), ref];
|
|
43
|
+
}
|
|
44
|
+
export function assertSafeSourcePath(value, label = "path") {
|
|
45
|
+
if (!value || value.startsWith("/") || value.startsWith("\\") || value.split(/[\\/]+/).includes("..")) {
|
|
46
|
+
throw new Error(`${label} must be a safe relative path.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function sha256Hex(value) {
|
|
50
|
+
return createHash("sha256").update(value).digest("hex");
|
|
51
|
+
}
|
|
52
|
+
export function sha256SourceIntegrity(value) {
|
|
53
|
+
return `sha256-${createHash("sha256").update(value).digest("base64")}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Validates a direct-files manifest: schemaVersion 1 and a non-empty list of
|
|
57
|
+
* safe relative paths, each with a byte size and a hex sha256. `subject` names
|
|
58
|
+
* the manifest in errors ("Kit file manifest for resend-email"); `entry`
|
|
59
|
+
* prefixes per-file errors; `upgrade` is the tool to upgrade when the
|
|
60
|
+
* manifest is newer than this one.
|
|
61
|
+
*/
|
|
62
|
+
export function validateDirectFileManifest(value, labels) {
|
|
63
|
+
const manifest = value;
|
|
64
|
+
if (!manifest || typeof manifest !== "object")
|
|
65
|
+
throw new Error(`${labels.subject} must be an object.`);
|
|
66
|
+
if (Number(manifest.schemaVersion) > 1)
|
|
67
|
+
throw new Error(`${labels.subject} is newer than ${labels.upgrade}.`);
|
|
68
|
+
if (manifest.schemaVersion !== 1)
|
|
69
|
+
throw new Error(`${labels.subject} schemaVersion must be 1.`);
|
|
70
|
+
if (!Array.isArray(manifest.files) || !manifest.files.length)
|
|
71
|
+
throw new Error(`${labels.subject} lists no files.`);
|
|
72
|
+
for (const file of manifest.files) {
|
|
73
|
+
assertSafeSourcePath(file.path, `${labels.entry} file manifest path`);
|
|
74
|
+
if (!Number.isInteger(file.size) || file.size < 0)
|
|
75
|
+
throw new Error(`${labels.entry} file manifest entry ${file.path} has an invalid size.`);
|
|
76
|
+
if (typeof file.sha256 !== "string" || !/^[0-9a-f]{64}$/.test(file.sha256))
|
|
77
|
+
throw new Error(`${labels.entry} file manifest entry ${file.path} has an invalid sha256.`);
|
|
78
|
+
}
|
|
79
|
+
return manifest;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Direct files only (no archives): each file listed in file-manifest.json is
|
|
83
|
+
* read through `readFile` (relative to the files/ directory beside the
|
|
84
|
+
* manifest) and verified against its pinned size and sha256 before it is
|
|
85
|
+
* written. Returns the materialized root; the caller removes its parent.
|
|
86
|
+
*/
|
|
87
|
+
export async function materializeDirectFiles(input) {
|
|
88
|
+
const totalBytes = input.fileManifest.files.reduce((sum, file) => sum + file.size, 0);
|
|
89
|
+
if (totalBytes > MAX_SOURCE_BYTES)
|
|
90
|
+
throw new Error(`${input.label} files exceed ${MAX_SOURCE_BYTES} bytes.`);
|
|
91
|
+
const root = mkdtempSync(join(tmpdir(), input.tempPrefix));
|
|
92
|
+
const out = join(root, "root");
|
|
93
|
+
mkdirSync(out, { recursive: true });
|
|
94
|
+
try {
|
|
95
|
+
writeFileSync(join(out, "file-manifest.json"), input.fileManifestBytes);
|
|
96
|
+
for (const file of input.fileManifest.files) {
|
|
97
|
+
const bytes = await input.readFile(file.path);
|
|
98
|
+
if (bytes.byteLength !== file.size)
|
|
99
|
+
throw new Error(`${input.label} file size mismatch: ${file.path}.`);
|
|
100
|
+
if (sha256Hex(bytes) !== file.sha256)
|
|
101
|
+
throw new Error(`${input.label} file hash mismatch: ${file.path}.`);
|
|
102
|
+
const target = join(out, file.path);
|
|
103
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
104
|
+
writeFileSync(target, bytes);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
rmSync(root, { recursive: true, force: true });
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
export function siblingHref(href, suffix) {
|
|
114
|
+
const slash = href.lastIndexOf("/");
|
|
115
|
+
return slash === -1 ? suffix : `${href.slice(0, slash + 1)}${suffix}`;
|
|
116
|
+
}
|
|
117
|
+
export async function fetchSourceBuffer(url, label = "resource") {
|
|
118
|
+
const response = await fetch(url, { headers: { "user-agent": "raybase-cli" } });
|
|
119
|
+
if (!response.ok)
|
|
120
|
+
throw new Error(`Could not fetch ${label} ${url}: ${response.status} ${response.statusText}`);
|
|
121
|
+
const length = Number(response.headers.get("content-length") ?? "0");
|
|
122
|
+
if (length > MAX_SOURCE_BYTES)
|
|
123
|
+
throw new Error(`${label} ${url} is too large (${length} bytes).`);
|
|
124
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
125
|
+
if (bytes.byteLength > MAX_SOURCE_BYTES)
|
|
126
|
+
throw new Error(`${label} ${url} is too large (${bytes.byteLength} bytes).`);
|
|
127
|
+
return bytes;
|
|
128
|
+
}
|
|
129
|
+
// GitHub's REST API. GITHUB_API_URL is the variable GitHub itself sets for
|
|
130
|
+
// Enterprise Server and Actions runners; tests point it at a local stub.
|
|
131
|
+
function githubApiBase() {
|
|
132
|
+
return (process.env.GITHUB_API_URL?.trim() || "https://api.github.com").replace(/\/+$/, "");
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Downloads a repository's tarball at one commit. A `ref` (branch, tag or
|
|
136
|
+
* sha) is resolved to its commit sha first, and with no ref the default
|
|
137
|
+
* branch's head is used, so the caller always learns the exact commit.
|
|
138
|
+
*/
|
|
139
|
+
export async function downloadGithubRepo(owner, repo, ref, options = {}) {
|
|
140
|
+
const headers = githubHeaders();
|
|
141
|
+
const resolvedRef = ref ? await githubCommitSha(owner, repo, ref, headers) : await githubDefaultBranchSha(owner, repo, headers);
|
|
142
|
+
const response = await fetch(`${githubApiBase()}/repos/${owner}/${repo}/tarball/${resolvedRef}`, { headers, redirect: "follow" });
|
|
143
|
+
if (!response.ok) {
|
|
144
|
+
throw new Error(`Could not download GitHub archive for ${owner}/${repo}: ${response.status} ${response.statusText}${githubRateLimitHint(response)}`);
|
|
145
|
+
}
|
|
146
|
+
const length = Number(response.headers.get("content-length") ?? "0");
|
|
147
|
+
if (length > MAX_SOURCE_BYTES)
|
|
148
|
+
throw new Error(`GitHub archive is too large (${length} bytes).`);
|
|
149
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
150
|
+
if (bytes.byteLength > MAX_SOURCE_BYTES)
|
|
151
|
+
throw new Error(`GitHub archive is too large (${bytes.byteLength} bytes).`);
|
|
152
|
+
const extractedRoot = extractArchive(bytes, `raybase-github-${owner}-${repo}-`, { symlinks: options.symlinks });
|
|
153
|
+
const entries = readdirSync(extractedRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory());
|
|
154
|
+
const root = entries.length === 1 ? join(extractedRoot, entries[0].name) : extractedRoot;
|
|
155
|
+
return {
|
|
156
|
+
root,
|
|
157
|
+
resolvedRef,
|
|
158
|
+
cleanup: () => rmSync(dirname(extractedRoot), { recursive: true, force: true })
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
async function githubDefaultBranchSha(owner, repo, headers) {
|
|
162
|
+
const metadata = await githubJson(`${githubApiBase()}/repos/${owner}/${repo}`, headers);
|
|
163
|
+
if (!metadata.default_branch)
|
|
164
|
+
throw new Error(`GitHub repo ${owner}/${repo} did not report a default branch.`);
|
|
165
|
+
return githubCommitSha(owner, repo, metadata.default_branch, headers);
|
|
166
|
+
}
|
|
167
|
+
async function githubCommitSha(owner, repo, ref, headers) {
|
|
168
|
+
const commit = await githubJson(`${githubApiBase()}/repos/${owner}/${repo}/commits/${encodeURIComponent(ref)}`, headers);
|
|
169
|
+
if (!commit.sha)
|
|
170
|
+
throw new Error(`GitHub ref ${owner}/${repo}#${ref} did not resolve to a commit sha.`);
|
|
171
|
+
return commit.sha;
|
|
172
|
+
}
|
|
173
|
+
async function githubJson(url, headers) {
|
|
174
|
+
const response = await fetch(url, { headers });
|
|
175
|
+
if (!response.ok)
|
|
176
|
+
throw new Error(`GitHub API request failed: ${response.status} ${response.statusText}${githubRateLimitHint(response)}`);
|
|
177
|
+
return (await response.json());
|
|
178
|
+
}
|
|
179
|
+
function githubHeaders() {
|
|
180
|
+
return {
|
|
181
|
+
accept: "application/vnd.github+json",
|
|
182
|
+
"user-agent": "raybase-cli",
|
|
183
|
+
...(process.env.GITHUB_TOKEN ? { authorization: `Bearer ${process.env.GITHUB_TOKEN}` } : {})
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function githubRateLimitHint(response) {
|
|
187
|
+
const remaining = response.headers.get("x-ratelimit-remaining");
|
|
188
|
+
const reset = response.headers.get("x-ratelimit-reset");
|
|
189
|
+
if (remaining === "0" && reset) {
|
|
190
|
+
return `; GitHub rate limit resets at ${new Date(Number(reset) * 1000).toISOString()}. Set GITHUB_TOKEN for higher limits.`;
|
|
191
|
+
}
|
|
192
|
+
return "";
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Extracts a .tgz after checking every entry is a safe relative path, and
|
|
196
|
+
* every hard link names a safe path. Symlinks follow `options.symlinks`
|
|
197
|
+
* (default "reject"): with "contained", a symlink whose target is absolute or
|
|
198
|
+
* resolves outside the archive refuses the whole archive before anything is
|
|
199
|
+
* extracted, and the extracted tree is checked again afterwards.
|
|
200
|
+
*/
|
|
201
|
+
export function extractArchive(bytes, prefix, options = {}) {
|
|
202
|
+
const policy = options.symlinks ?? "reject";
|
|
203
|
+
const root = mkdtempSync(join(tmpdir(), prefix));
|
|
204
|
+
const archive = join(root, "archive.tgz");
|
|
205
|
+
const out = join(root, "root");
|
|
206
|
+
mkdirSync(out, { recursive: true });
|
|
207
|
+
writeFileSync(archive, bytes);
|
|
208
|
+
const fail = (message) => {
|
|
209
|
+
rmSync(root, { recursive: true, force: true });
|
|
210
|
+
throw new Error(message);
|
|
211
|
+
};
|
|
212
|
+
const listing = spawnSync("tar", ["-tzf", archive], { encoding: "utf8" });
|
|
213
|
+
const verbose = spawnSync("tar", ["-tvzf", archive], { encoding: "utf8" });
|
|
214
|
+
if (listing.status !== 0 || verbose.status !== 0)
|
|
215
|
+
fail(`Could not inspect archive: ${listing.stderr || verbose.stderr || listing.stdout}`);
|
|
216
|
+
const names = listing.stdout.split("\n").filter((line) => line.trim());
|
|
217
|
+
const details = verbose.stdout.split("\n").filter((line) => line.trim());
|
|
218
|
+
if (names.length !== details.length)
|
|
219
|
+
fail("Could not inspect archive: its listings disagree.");
|
|
220
|
+
try {
|
|
221
|
+
names.forEach((rawName, index) => {
|
|
222
|
+
const name = rawName.trim();
|
|
223
|
+
assertSafeSourcePath(name.replace(/\/$/, ""), `archive entry ${name}`);
|
|
224
|
+
const detail = details[index];
|
|
225
|
+
// bsdtar and GNU tar both print "<name> link to <target>" for hard links
|
|
226
|
+
// and a leading "l" with "<name> -> <target>" for symlinks.
|
|
227
|
+
const hardLink = detail.lastIndexOf(`${name} link to `);
|
|
228
|
+
if (hardLink !== -1) {
|
|
229
|
+
assertSafeSourcePath(detail.slice(hardLink + name.length + " link to ".length), `archive hard link ${name}`);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (!detail.startsWith("l"))
|
|
233
|
+
return;
|
|
234
|
+
if (policy === "reject")
|
|
235
|
+
throw new Error(`Source contains a symlink: ${name}`);
|
|
236
|
+
const arrow = detail.lastIndexOf(`${name} -> `);
|
|
237
|
+
const target = arrow === -1 ? "" : detail.slice(arrow + name.length + " -> ".length);
|
|
238
|
+
if (!target || !symlinkTargetStaysInside(name, target))
|
|
239
|
+
throw new Error(`Source contains a symlink that leaves it: ${name} -> ${target}`);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
fail(error instanceof Error ? error.message : String(error));
|
|
244
|
+
}
|
|
245
|
+
const tar = spawnSync("tar", ["-xzf", archive, "-C", out], { encoding: "utf8" });
|
|
246
|
+
if (tar.status !== 0)
|
|
247
|
+
fail(`Could not extract archive: ${tar.stderr || tar.stdout}`);
|
|
248
|
+
try {
|
|
249
|
+
if (policy === "reject")
|
|
250
|
+
rejectSymlinks(out);
|
|
251
|
+
else
|
|
252
|
+
assertSymlinksContained(out);
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
fail(error instanceof Error ? error.message : String(error));
|
|
256
|
+
}
|
|
257
|
+
return out;
|
|
258
|
+
}
|
|
259
|
+
function symlinkTargetStaysInside(name, target) {
|
|
260
|
+
if (target.startsWith("/") || target.startsWith("\\") || /^[A-Za-z]:/.test(target))
|
|
261
|
+
return false;
|
|
262
|
+
const parts = name.replace(/\/$/, "").split("/").slice(0, -1);
|
|
263
|
+
for (const part of target.split(/[\\/]+/)) {
|
|
264
|
+
if (!part || part === ".")
|
|
265
|
+
continue;
|
|
266
|
+
if (part === "..") {
|
|
267
|
+
if (!parts.length)
|
|
268
|
+
return false;
|
|
269
|
+
parts.pop();
|
|
270
|
+
}
|
|
271
|
+
else
|
|
272
|
+
parts.push(part);
|
|
273
|
+
}
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
// After extraction: every symlink must resolve (or, dangling, point) inside `directory`.
|
|
277
|
+
function assertSymlinksContained(directory, top = directory) {
|
|
278
|
+
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
279
|
+
const full = join(directory, entry.name);
|
|
280
|
+
const stat = lstatSync(full);
|
|
281
|
+
if (stat.isSymbolicLink()) {
|
|
282
|
+
const target = resolve(dirname(full), readlinkSync(full));
|
|
283
|
+
if (target !== top && !target.startsWith(`${top}${sep}`))
|
|
284
|
+
throw new Error(`Source contains a symlink that leaves it: ${full}`);
|
|
285
|
+
}
|
|
286
|
+
else if (stat.isDirectory()) {
|
|
287
|
+
assertSymlinksContained(full, top);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
export function rejectSymlinks(directory, skip = new Set()) {
|
|
292
|
+
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
293
|
+
if (skip.has(entry.name))
|
|
294
|
+
continue;
|
|
295
|
+
const full = join(directory, entry.name);
|
|
296
|
+
const stat = lstatSync(full);
|
|
297
|
+
if (stat.isSymbolicLink())
|
|
298
|
+
throw new Error(`Source contains a symlink: ${full}`);
|
|
299
|
+
if (entry.isDirectory())
|
|
300
|
+
rejectSymlinks(full, skip);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/** sha256 over sorted relative paths and contents; names in `skip` (at any depth) are left out. */
|
|
304
|
+
export function directoryIntegrity(directory, skip = new Set()) {
|
|
305
|
+
const hash = createHash("sha256");
|
|
306
|
+
for (const file of walkFiles(directory, skip)) {
|
|
307
|
+
hash.update(file.slice(directory.length + 1));
|
|
308
|
+
hash.update(readFileSync(file));
|
|
309
|
+
}
|
|
310
|
+
return `sha256-${hash.digest("base64")}`;
|
|
311
|
+
}
|
|
312
|
+
function walkFiles(directory, skip) {
|
|
313
|
+
const files = [];
|
|
314
|
+
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
315
|
+
if (skip.has(entry.name))
|
|
316
|
+
continue;
|
|
317
|
+
const full = join(directory, entry.name);
|
|
318
|
+
if (entry.isDirectory())
|
|
319
|
+
files.push(...walkFiles(full, skip));
|
|
320
|
+
else if (entry.isFile())
|
|
321
|
+
files.push(full);
|
|
322
|
+
}
|
|
323
|
+
return files.sort();
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=source-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-fetch.js","sourceRoot":"","sources":["../src/source-fetch.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5H,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WA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,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-hash.d.ts","sourceRoot":"","sources":["../src/source-hash.ts"],"names":[],"mappings":"AASA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAarD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
|
+
import { join, sep } from "node:path";
|
|
4
|
+
// Content signature of the create-raybase source tree. The build stamps it
|
|
5
|
+
// into dist/.source-hash (scripts/stamp-source-hash.mjs) and the local-mode
|
|
6
|
+
// staleness guard recomputes it against the repo's src at run time, so the
|
|
7
|
+
// comparison tracks content — not mtimes, which git operations from
|
|
8
|
+
// concurrent checkouts refresh without changing anything.
|
|
9
|
+
export function hashSourceTree(srcDir) {
|
|
10
|
+
const hash = createHash("sha256");
|
|
11
|
+
const files = readdirSync(srcDir, { recursive: true })
|
|
12
|
+
.filter((entry) => statSync(join(srcDir, entry)).isFile())
|
|
13
|
+
.map((entry) => entry.split(sep).join("/"))
|
|
14
|
+
.sort();
|
|
15
|
+
for (const file of files) {
|
|
16
|
+
hash.update(file);
|
|
17
|
+
hash.update("\0");
|
|
18
|
+
hash.update(readFileSync(join(srcDir, file.split("/").join(sep))));
|
|
19
|
+
hash.update("\0");
|
|
20
|
+
}
|
|
21
|
+
return hash.digest("hex");
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=source-hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-hash.js","sourceRoot":"","sources":["../src/source-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEtC,2EAA2E;AAC3E,4EAA4E;AAC5E,2EAA2E;AAC3E,oEAAoE;AACpE,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,KAAK,GAAI,WAAW,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAc;SACjE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACzD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC1C,IAAI,EAAE,CAAC;IACV,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const STARTER_DESCRIPTION_FILE = "raybase.starter.json";
|
|
2
|
+
export declare const STARTER_FRAMEWORKS: readonly ["tanstack-start", "react-router", "astro-emdash"];
|
|
3
|
+
export type StarterFramework = (typeof STARTER_FRAMEWORKS)[number];
|
|
4
|
+
export type StarterDescription = {
|
|
5
|
+
/** Display name of the starter. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The Raybase framework the starter is built on. */
|
|
8
|
+
framework: StarterFramework;
|
|
9
|
+
/** Semver range of Raybase versions the starter supports, e.g. ">=0.3.0 <0.4.0". */
|
|
10
|
+
raybase: string;
|
|
11
|
+
/** Keys written to the created project's .dev.vars, with their default values. */
|
|
12
|
+
devVars?: Record<string, string>;
|
|
13
|
+
/** Starter-relative Markdown file merged into the project's AGENTS.md. */
|
|
14
|
+
agentInstructions?: string;
|
|
15
|
+
/** Starter-relative template written to dev/SPEC.md (`__APP_NAME__` is replaced). */
|
|
16
|
+
spec?: string;
|
|
17
|
+
/** Steps appended to create-raybase's next steps. */
|
|
18
|
+
nextSteps?: string[];
|
|
19
|
+
/** Starter-relative skill folders (each with a SKILL.md), installed beside Raybase's skills. */
|
|
20
|
+
skills?: string[];
|
|
21
|
+
/** Project-relative files `raybase doctor` requires, in addition to the framework's. */
|
|
22
|
+
requiredFiles?: string[];
|
|
23
|
+
/** "table.column" values the starter seals with RAYBASE_DATA_SECRETS_KEY outside the app schema. */
|
|
24
|
+
sealedColumns?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Project-relative files of a first-party module (docs, guide, api) that the
|
|
27
|
+
* starter supplies itself, such as its own `src/components/guide-widget.tsx`.
|
|
28
|
+
* Creating keeps the starter's file instead of laying the module's over it,
|
|
29
|
+
* and records it as the app's own, so a later module update leaves it alone.
|
|
30
|
+
*/
|
|
31
|
+
moduleFiles?: string[];
|
|
32
|
+
};
|
|
33
|
+
export declare class StarterDescriptionError extends Error {
|
|
34
|
+
readonly problems: string[];
|
|
35
|
+
constructor(source: string, problems: string[]);
|
|
36
|
+
}
|
|
37
|
+
/** Strict validation: unknown keys, wrong types and unsafe paths are all reported together. */
|
|
38
|
+
export declare function validateStarterDescription(value: unknown, source?: string): StarterDescription;
|
|
39
|
+
/** Reads `<dir>/raybase.starter.json`; null when the file is absent, throws when it is unreadable or invalid. */
|
|
40
|
+
export declare function readStarterDescription(dir: string): StarterDescription | null;
|
|
41
|
+
/** Null when `version` is inside the starter's `raybase` range, otherwise a sentence saying it is not. */
|
|
42
|
+
export declare function starterRangeProblem(description: Pick<StarterDescription, "name" | "raybase">, version: string): string | null;
|
|
43
|
+
export declare function satisfiesSemverRange(version: string, range: string): boolean;
|
|
44
|
+
//# sourceMappingURL=starter-description.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starter-description.d.ts","sourceRoot":"","sources":["../src/starter-description.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D,eAAO,MAAM,kBAAkB,6DAA8D,CAAC;AAC9F,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,SAAS,EAAE,gBAAgB,CAAC;IAC5B,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,oGAAoG;IACpG,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA0BF,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,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