9848803f4f
The /docs deploy from #3860 still returned HTTP 500 with `EvalError: Code generation from strings disallowed for this context` (captured via `wrangler tail`). `next-mdx-remote/rsc` compiles MDX to JSX *at runtime* using `new Function()` style code generation. Cloudflare Workers' security sandbox bans all dynamic code generation from strings, even from inside trusted code, so any worker invocation that touched the docs page threw immediately. Switch to a build-time markdown -> HTML pipeline: - Drop `next-mdx-remote` and `gray-matter`. Add `marked` (pure-JS, no eval). - `web/scripts/generate-docs-content.mjs` now runs each markdown source through `marked.parse()` (gfm enabled) at build time and writes the resulting HTML strings into `web/lib/docs-content.generated.ts`. - `web/app/[locale]/docs/page.tsx` renders each section as `<article className="docs-content" dangerouslySetInnerHTML={{ __html: section.html }} />`. No MDX runtime, no JSX compilation at request time, just static HTML injection. - `web/app/globals.css` adds a `@layer components` block targeting `.docs-content h1..h4, p, a, ul, ol, li, blockquote, code, pre, table, thead, th, td, hr, strong`. Same shadcn-themed look that the dropped `mdx-components.tsx` provided, applied via CSS instead of React component overrides. - `web/components/docs/mdx-components.tsx` removed. We lose MDX features (JSX inside markdown), but the docs are pure markdown anyway. `docs/` remains the SoT; the marketing site renders identical content with no eval and no fs at runtime.
61 lines
2.2 KiB
JSON
61 lines
2.2 KiB
JSON
{
|
|
"name": "oh-my-openagent-web",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"prepare": "node ./scripts/generate-docs-content.mjs",
|
|
"prebuild": "node ./scripts/prepare-build.mjs",
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"lint": "eslint \"app/**/*.{ts,tsx}\" \"components/**/*.{ts,tsx}\" \"lib/**/*.{ts,tsx}\" \"e2e/**/*.{ts,tsx}\"",
|
|
"lint:fix": "eslint --fix \"app/**/*.{ts,tsx}\" \"components/**/*.{ts,tsx}\" \"lib/**/*.{ts,tsx}\" \"e2e/**/*.{ts,tsx}\"",
|
|
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
|
|
"type-check": "tsc --noEmit",
|
|
"test:e2e": "playwright test",
|
|
"test:e2e:ui": "playwright test --ui",
|
|
"test:e2e:headed": "playwright test --headed",
|
|
"preview": "node ./scripts/prepare-build.mjs && opennextjs-cloudflare build && opennextjs-cloudflare preview",
|
|
"deploy": "node ./scripts/prepare-build.mjs && opennextjs-cloudflare build && opennextjs-cloudflare deploy",
|
|
"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
|
|
},
|
|
"dependencies": {
|
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
"@radix-ui/react-separator": "^1.1.8",
|
|
"@radix-ui/react-slot": "^1.2.4",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"geist": "^1.7.0",
|
|
"lucide-react": "0.577.0",
|
|
"marked": "^18.0.3",
|
|
"motion": "^12.38.0",
|
|
"next": "15.5.18",
|
|
"next-intl": "^4.11.0",
|
|
"react": "^19.2.6",
|
|
"react-dom": "^19.2.6",
|
|
"tailwind-merge": "^3.5.0",
|
|
"tailwindcss-animate": "^1.0.7"
|
|
},
|
|
"devDependencies": {
|
|
"@opennextjs/cloudflare": "^1.19.8",
|
|
"@playwright/test": "1.59.1",
|
|
"@tailwindcss/postcss": "4.2.4",
|
|
"@types/node": "^25.6.2",
|
|
"@types/react": "^19.2.14",
|
|
"@types/react-dom": "^19.2.3",
|
|
"eslint": "^10.3.0",
|
|
"eslint-config-next": "15.5.18",
|
|
"eslint-config-prettier": "10.1.8",
|
|
"eslint-plugin-prettier": "5.5.5",
|
|
"globals": "^17.6.0",
|
|
"postcss": "^8.5.14",
|
|
"prettier": "3.8.3",
|
|
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
"tailwindcss": "4.2.4",
|
|
"typescript-eslint": "^8.59.2",
|
|
"typescript": "6.0.3",
|
|
"wrangler": "^4.90.0"
|
|
}
|
|
}
|