Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ pnpm run docs:release-check

Deploy `docs/out` to `react-structured.dev`. For Vercel, use `docs` as the project
root; `vercel.json` checks public dependencies, installs the workspace, and builds
the library before the site. Production installs must not depend on a local yalc store. The
the library before the site. Keep the Framework Preset set to **Next.js** and the
Output Directory override **off** in Vercel's project settings. The Next.js adapter
reads build manifests from `.next` and handles the static export automatically;
setting its Output Directory to `out` makes it look for those manifests in the
wrong folder. `docs/out` remains the exported site for other static hosts.

Production installs must not depend on a local yalc store. The
manual Documentation checks workflow runs the same public-dependency guard and
uploads the static site after validation.

Expand Down
2 changes: 1 addition & 1 deletion docs/vercel.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"framework": "nextjs",
"installCommand": "cd .. && node scripts/check-docs-release.mjs && corepack enable && pnpm install --frozen-lockfile --ignore-scripts",
"buildCommand": "cd .. && pnpm run docs:build",
"outputDirectory": "out",
"cleanUrls": true,
"headers": [
{
Expand Down
17 changes: 17 additions & 0 deletions scripts/docs-deployment.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import test from 'node:test'

import nextConfig from '../docs/next.config.mjs'

const vercel = JSON.parse(
readFileSync(new URL('../docs/vercel.json', import.meta.url), 'utf8'),
)

test('Vercel looks for Next.js build manifests, not static-export assets', () => {
assert.equal(vercel.outputDirectory ?? '.next', nextConfig.distDir ?? '.next')
assert.equal(vercel.framework, 'nextjs')
assert.ok(!Object.hasOwn(vercel, 'outputDirectory'))
assert.equal(nextConfig.output, 'export')
assert.equal(vercel.buildCommand, 'cd .. && pnpm run docs:build')
})
1 change: 1 addition & 0 deletions scripts/docs-tooling.test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './oss-credits.test.mjs'
import './docs-dependencies.test.mjs'
import './docs-deployment.test.mjs'
import './mobile-layout.test.mjs'
import './search-recommendations.test.mjs'
import './llms.test.mjs'
Expand Down
Loading