Skip to content

Remove duplicated docs build check executions - #1908

Merged
marcleblanc2 merged 2 commits into
mainfrom
build/run-checks-once
Sep 11, 2026
Merged

Remove duplicated docs build check executions#1908
marcleblanc2 merged 2 commits into
mainfrom
build/run-checks-once

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This is task 6a of the Vercel audit tracked in #1905.

Problem

  • next build evaluated the asynchronous Next.js config twice before printing the Next.js banner

  • Logs recorded phase-production-build twice in process 31244, and both evaluations ran all four checks each

Changes

  • Run the four checks in order from the build package script, before next build. Vercel invokes this script once, while Next.js may evaluate its config more than once.

  • Chain commands with &&, so any failed check exits non-zero and prevents the deploy build from continuing

  • Keep the existing generate-mermaid-logos script name for compatibility and point it at the real dev/generate-mermaid-icons.mjs file

  • Update the build-command guidance to distinguish npm run build from direct next build

Test plan

mise exec -- pnpm install --frozen-lockfile
mise exec -- pnpm build
mise exec -- pnpm dev --port 3106
curl http://localhost:3106/
mise exec -- npx tsc --noEmit

Note: #1907 also edits next.config.js; whichever merges second needs a trivial rebase.

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 11, 2026 8:37am UTC

Request Review

@marcleblanc2
marcleblanc2 marked this pull request as ready for review September 11, 2026 07:47
@marcleblanc2
marcleblanc2 requested a review from a team September 11, 2026 07:47
@marcleblanc2 marcleblanc2 changed the title Run docs build checks once Remove duplicated docs build check executions Sep 11, 2026
Comment thread package.json Outdated
"scripts": {
"dev": "next dev",
"build": "next build",
"build": "node dev/check-links.mjs && node dev/check-filenames.mjs && node dev/check-images.mjs && node dev/generate-mermaid-icons.mjs && next build",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there must be an aggregate way to have all of these defined in one checks.mjs file?

node dev/checks.mjs - default everything
node dev/checks.mjs links
node dev/checks.mjs filenames

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking. I've had Amp write one script which calls the other 3.

marcleblanc2 and others added 2 commits September 11, 2026 02:33
Review feedback on #1908: one dispatcher instead of four commands in
the build script. `node dev/checks.mjs` runs every check, a name
picks one (`links`, `filenames`, `images`), and flags pass through
to a single check. The three check-* npm scripts collapse into
`npm run check`.

Amp-Thread-ID: https://ampcode.com/threads/T-01a08f98-1ebd-76aa-8801-45886f61a68c
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 merged commit 5ff2322 into main Sep 11, 2026
4 checks passed
@marcleblanc2
marcleblanc2 deleted the build/run-checks-once branch September 11, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants