Skip to content

Fix the Netlify build from the repo and rename document to docs - #815

Merged
acasazza merged 3 commits into
v5.0.0from
chore/netlify-docs-rename
Aug 21, 2026
Merged

Fix the Netlify build from the repo and rename document to docs#815
acasazza merged 3 commits into
v5.0.0from
chore/netlify-docs-rename

Conversation

@acasazza

Copy link
Copy Markdown
Member

Brings the Netlify deploy back from the dead and gives the v5 storybook its real name.

Why Netlify was failing

The deploy has errored on every build since June, and deleting packages/docs in 213b4d3 made it unrecoverable — whatever the dashboard build command pointed at no longer exists. Nobody on the team has Netlify credentials, so the fix has to come from the repo. That works, because netlify.toml takes precedence over the dashboard.

Two causes are addressed at once.

pnpm version. Security overrides live in pnpm-workspace.yaml, which only pnpm 10+ reads; older versions reject the lockfile with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. Netlify has no PNPM_VERSION variable — per its docs the only lever is the root packageManager field via Corepack, and that field was missing entirely, so Netlify was running whatever pnpm its build image happens to ship. It is now pinned to pnpm@11.22.0, and the inline version: 10 is dropped from the three workflows so there is one source of truth (having both has already produced "Multiple versions of pnpm specified" on this repo).

Build target. command and publish now point at the renamed docs package. base is pinned to / on purpose: a stale base directory left in the dashboard would abort the build before this file is ever read, and that is a scenario nobody can rule out without dashboard access.

The whole build config lives in the repo now rather than in the dashboard — the dashboard settings are invisible to code review, which is exactly how this rotted unnoticed for months.

packages/documentpackages/docs

The old packages/docs was the v4 documentation, deleted in 213b4d3. The v5 storybook had been living under the placeholder name document only to avoid colliding with it; with the collision gone it takes the name that describes what it is. Kept as its own commit so the rename is reviewable on its own.

Renamed: the directory, the package name, the root docs:dev / docs:build scripts, the gh-pages artifact path, and the storybook MCP server filter in .mcp.json.

Toolchain now on latest

  • pnpm 11.22.0 — verified to keep lockfileVersion: '9.0', so no format break; regenerating changes only the importer block
  • Node 24.x in all three workflows (was 20.x in gh-pages, 22.x in the other two) and in netlify.toml (was 20) — this is the version the suite is developed and tested on locally

Verification

  • pnpm install --frozen-lockfile passes under pnpm 11, lockfile unchanged by the packageManager addition
  • pnpm build green on all three packages, check-compiler guard included
  • pnpm test — core-components 110 passed, react-hooks-components 99 passed, react-components 998 passed / 24 skipped
  • pnpm audit --prod --audit-level high — no known vulnerabilities
  • pnpm docs:build outputs to packages/docs/storybook-static, matching publish exactly

The one thing that cannot be verified from here is Netlify itself. The deploy preview on this PR is the first real signal. If it stays red for a reason that lives only in the dashboard — a stale base directory, the wrong production branch, the site linked to the wrong repo — it will need someone with Netlify access.

🤖 Generated with Claude Code

Alessandro Casazza added 2 commits August 21, 2026 11:39
The old packages/docs was the v4 documentation and was deleted in 213b4d3; this is the v5 storybook, which had been living under the placeholder name 'document' only to avoid colliding with it. Now that the collision is gone, it takes the name that describes what it is.

Renamed the directory, the package name, the root docs:dev / docs:build scripts, the gh-pages artifact path and the storybook MCP server filter in .mcp.json.
…hain

The Netlify deploy has failed on every build since June, and deleting packages/docs in 213b4d3 made it unrecoverable: whatever the dashboard build command referenced is gone. Nobody on the team has Netlify credentials, so the fix has to come from the repo — which netlify.toml can do, since it takes precedence over the dashboard.

Two likely causes are addressed at once:

- pnpm. Overrides live in pnpm-workspace.yaml, which only pnpm 10+ reads; older versions reject the lockfile with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. Netlify has no PNPM_VERSION variable — the only lever is the root packageManager field via Corepack, which was missing entirely, so Netlify was running whatever pnpm its build image ships. Pinned to 11.22.0, and the inline 'version: 10' is dropped from the three workflows so there is a single source of truth (having both has already produced 'Multiple versions of pnpm specified' on this repo).
- build target. command and publish now point at the renamed docs package. base is pinned to '/' to neutralise any stale base directory still set in the dashboard, which would abort the build before this file is read.

Node is aligned to 24.x everywhere — it was 20.x in gh-pages and 22.x in the other two — matching the version the suite is developed and tested on locally.
@acasazza acasazza self-assigned this Aug 21, 2026
Reverts the trigger removal from e84de92, restoring the original block verbatim, comments included. GitHub Pages is configured with build_type 'workflow' and is already serving commercelayer.github.io/commercelayer-react-components, so the deploy job has a valid target.

Note the trigger watches 'main' only, as it originally did: it will stay dormant until v5 lands there.

No VITE_BASE_URL is set. packages/docs/.storybook/main.ts reads one, but with it unset Vite emits relative asset paths (./assets, ./sb-manager), which resolve correctly both under the Pages repository subpath and at the Netlify domain root. Verified by inspecting index.html and iframe.html from both builds.
@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/commercelayer/commercelayer-react-components/@commercelayer/core-components@815
npm i https://pkg.pr.new/commercelayer/commercelayer-react-components/@commercelayer/react-components@815
npm i https://pkg.pr.new/commercelayer/commercelayer-react-components/@commercelayer/react-hooks-components@815

commit: c9533fd

@acasazza
acasazza merged commit 5476624 into v5.0.0 Aug 21, 2026
2 checks passed
@acasazza
acasazza deleted the chore/netlify-docs-rename branch August 21, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant