Skip to content

ci: configure Netlify so deploy previews actually build - #209

Merged
Eliav2 merged 1 commit into
mainfrom
ci/netlify-previews
Aug 8, 2026
Merged

ci: configure Netlify so deploy previews actually build#209
Eliav2 merged 1 commit into
mainfrom
ci/netlify-previews

Conversation

@Eliav2

@Eliav2 Eliav2 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Netlify is connected for preview URLs but has never produced a successful deploy. react-xarrows.netlify.app currently returns 404, and the checks on #208 are all Deploy failed.

Why it fails

There is no netlify.toml, so Netlify falls back to auto-detection, and auto-detection cannot work on this repo:

  • the site lives in examples/, not the repo root
  • but it cannot be built from examples/ either, because it resolves the library from ../src through a Vite alias, so a base directory of examples/ would not see it
  • and the root build script builds the library into lib/, which is not a website

Fix

Pins the build command, publish directory and Node version.

command = "pnpm --filter react-xarrows-examples run build"
publish = "examples/dist"
NODE_VERSION = "22"

GITHUB_PAGES is deliberately left unset. examples/vite.config.ts reads it to choose between the /react-xarrows/ base GitHub Pages needs and the root base Netlify serves from, so setting it here would break every asset URL. Verified locally that with it unset the emitted index.html references /assets/..., which is what Netlify wants.

This PR tests itself

Netlify reads netlify.toml from the pull request branch, so the deploy preview check on this PR is the verification. If it goes green, previews work.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added Netlify deploy preview configuration.
    • Configured previews to build and publish the examples site.
    • Updated the deployment environment to use Node.js 22.

Netlify is connected to this repo for pull request preview URLs but has never
produced a successful deploy; react-xarrows.netlify.app returns 404.

There was no netlify.toml, so it fell back to auto-detection, which cannot
work here. The site lives in examples/, but it resolves the library from ../src
through a Vite alias, so it has to be built from the repo root rather than with
a base directory of examples/. Meanwhile the root build script builds the
library into lib/, which is not a website.

Pins the build command, the publish directory and Node 22.

GITHUB_PAGES is deliberately left unset: examples/vite.config.ts reads it to
choose between the /react-xarrows/ base GitHub Pages needs and the root base
Netlify serves from.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codesandbox

codesandbox Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for react-xarrows ready!

Name Link
🔨 Latest commit 6e0ceff
🔍 Latest deploy log https://app.netlify.com/projects/react-xarrows/deploys/6a7778bd3ac16c0008bda9dd
😎 Deploy Preview https://deploy-preview-209--react-xarrows.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bbce3f74-5bef-4775-904b-ed94101a4a7c

📥 Commits

Reviewing files that changed from the base of the PR and between 94e2496 and 6e0ceff.

📒 Files selected for processing (1)
  • netlify.toml

📝 Walkthrough

Walkthrough

The pull request adds Netlify configuration for deploy previews. Netlify builds the examples package from the repository root, publishes examples/dist, uses Node.js 22, and leaves GITHUB_PAGES unset.

Changes

Netlify deployment

Layer / File(s) Summary
Configure Netlify builds
netlify.toml
Defines the examples build command, publish directory, Node.js 22 environment, and root asset-path behavior for Netlify.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: configuring Netlify to build deploy previews.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/netlify-previews

Comment @coderabbitai help to get the list of available commands.

@Eliav2
Eliav2 merged commit 15afe2b into main Aug 8, 2026
6 checks passed
@Eliav2
Eliav2 deleted the ci/netlify-previews branch August 8, 2026 18:53
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.

1 participant