// Generated by scripts/generate-manifest.mjs. Do not edit by hand. import type { AddOnCompiled } from '../../../../../types.js' type TemplateRecord = Record type TemplateAddOn = TemplateRecord & { integrations?: Array routes?: Array } type TemplateRenderContext = { [key: string]: any packageManager: any projectName: any typescript: any tailwind: any blank: any js: any jsx: any fileRouter: any codeRouter: any routerOnly: any includeExamples: any addOnEnabled: Record addOnOption: Record addOns: Array integrations: Array routes: Array getPackageManagerAddScript: (...args: Array) => string getPackageManagerRunScript: (...args: Array) => string getPackageManagerExecuteScript: (...args: Array) => string relativePath: (...args: Array) => string integrationImportContent: (...args: Array) => string integrationImportCode: (...args: Array) => string | undefined renderTemplate: (content: string) => string ignoreFile: () => never } type TemplateRenderer = (context: TemplateRenderContext) => string | undefined function __escapeXML(value: unknown) { if (value === undefined || value === null) { return '' } return String(value).replace(/[&<>'"]/g, (character) => { switch (character) { case '&': return '&' case '<': return '<' case '>': return '>' case '"': return '"' case "'": return ''' default: return character } }) } export function getManifestTemplateKey(template: string) { let hash = 0x811c9dc5 for (let i = 0; i < template.length; i++) { hash ^= template.charCodeAt(i) hash = Math.imul(hash, 0x01000193) >>> 0 } return `${hash.toString(16).padStart(8, '0')}:${template.length}` } const templateRenderers: Record = { } export function hasManifestTemplate(template: string) { return getManifestTemplateKey(template) in templateRenderers } export function renderManifestTemplate( template: string, context: TemplateRenderContext, ) { const key = getManifestTemplateKey(template) const renderer = templateRenderers[key] if (!renderer) { throw new Error(`Template ${key} was not precompiled into the manifest`) } return renderer(context) ?? '' } export const addOn = { "name": "Strapi", "description": "Headless CMS with admin UI (self-hosted, content models in TypeScript).", "link": "https://strapi.io/", "phase": "add-on", "type": "add-on", "category": "cms", "color": "#4945FF", "modes": [ "file-router" ], "routes": [ { "url": "/demo/strapi", "name": "Strapi", "path": "src/routes/demo.strapi.tsx", "jsName": "StrapiDemo" } ], "id": "strapi", "version": "0.0.0", "packageAdditions": { "dependencies": { "@strapi/client": "^1.6.1" } }, "readme": "## Setting up Strapi\n\nThe current setup shows an example of how to use Strapi with an articles collection which is part of the example structure & data.\n\n- Create a local running copy of the strapi admin\n\n```bash\npnpm dlx create-strapi@latest my-strapi-project\ncd my-strapi-project\npnpm dev\n```\n\n- Login and publish the example articles to see them on the strapi demo page.\n- Set the `VITE_STRAPI_URL` environment variable in your `.env.local`. (For local it should be http://localhost:1337/api)\n", "readmeIsEjs": false, "files": { "_dot_env.local.append": "# Strapi configuration\nVITE_STRAPI_URL=\"http://localhost:1337/api\"", "src/lib/strapiClient.ts": "import { strapi } from \"@strapi/client\";\n\nexport const strapiClient = strapi({\n baseURL: import.meta.env.VITE_STRAPI_URL,\n});\n\nexport const articles = strapiClient.collection(\"articles\");\n", "src/routes/demo/strapi.tsx": "import { articles } from '../../lib/strapiClient'\nimport { createFileRoute, Link } from '@tanstack/solid-router'\nimport { Show, For } from 'solid-js'\n\nexport const Route = createFileRoute('/demo/strapi')({\n component: RouteComponent,\n loader: async () => {\n const { data: strapiArticles } = await articles.find()\n return strapiArticles\n },\n})\n\nfunction RouteComponent() {\n const strapiArticles = Route.useLoaderData()\n\n return (\n
\n
\n

CMS

\n

Strapi Articles

\n\n 0}\n fallback={

No articles found.

}\n >\n
\n \n {(article) => (\n \n
\n

\n {article.title || 'Untitled'}\n

\n\n {article.description && (\n

\n {article.description}\n

\n )}\n\n {article.content && (\n

\n {article.content}\n

\n )}\n\n {article.createdAt && (\n

\n {new Date(article.createdAt).toLocaleDateString()}\n

\n )}\n
\n \n )}\n
\n
\n \n
\n
\n )\n}\n", "src/routes/demo/strapi_.$articleId.tsx": "import { articles } from '../../lib/strapiClient'\nimport { createFileRoute, Link } from '@tanstack/solid-router'\n\nexport const Route = createFileRoute('/demo/strapi_/$articleId')({\n component: RouteComponent,\n loader: async ({ params }) => {\n const { data: article } = await articles.findOne(params.articleId)\n return article\n },\n})\n\nfunction RouteComponent() {\n const article = Route.useLoaderData()\n\n return (\n
\n
\n \n \n \n \n Back to Articles\n \n\n
\n

{article()?.title || 'Untitled'}

\n\n {article()?.createdAt && (\n

\n Published on{' '}\n {new Date(\n article()?.createdAt || article()?.attributes?.createdAt,\n ).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n })}\n

\n )}\n\n {article()?.description && (\n
\n

Description

\n

\n {article()?.description || article()?.attributes?.description}\n

\n
\n )}\n\n {article()?.content && (\n
\n

Content

\n
\n {article()?.content}\n
\n
\n )}\n
\n
\n
\n )\n}\n" }, "deletedFiles": [], "smallLogo": "\n\n\n\n\n\n\n\n" } satisfies AddOnCompiled