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
24 changes: 12 additions & 12 deletions .github/workflows/redirects-in-sync.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: redirects-in-sync

# Guarantees vercel.json matches redirects.config.js (the single source of
# truth). Vercel reads vercel.json at the start of a deployment, so a commit
# that edits redirects.config.js without regenerating vercel.json would ship
# stale production redirects. This job regenerates the file and fails if it
# differs from what's committed.
# Guarantees render.yaml matches redirects.config.js (the single source of
# truth). Render reads render.yaml at the start of a deployment, so a commit
# that edits redirects.config.js without regenerating render.yaml would ship
# stale production redirects. This job regenerates the generated block and fails
# if it differs from what's committed.

on:
pull_request:
Expand All @@ -22,14 +22,14 @@ jobs:

# No `npm install` needed: the sync script uses only Node built-ins and
# imports the local redirects.config.js.
- name: Regenerate vercel.json from redirects.config.js
run: node scripts/sync-vercel-redirects.mjs
- name: Regenerate render.yaml from redirects.config.js
run: node scripts/sync-render-redirects.mjs

- name: Fail if vercel.json is out of date
- name: Fail if render.yaml is out of date
run: |
if [ -n "$(git status --porcelain vercel.json)" ]; then
echo "::error::vercel.json is out of sync with redirects.config.js. Run 'npm run sync-redirects' and commit the result."
git --no-pager diff vercel.json
if [ -n "$(git status --porcelain render.yaml)" ]; then
echo "::error::render.yaml is out of sync with redirects.config.js. Run 'npm run sync-redirects' and commit the result."
git --no-pager diff render.yaml
exit 1
fi
echo "vercel.json is in sync with redirects.config.js."
echo "render.yaml is in sync with redirects.config.js."
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "module",
"scripts": {
"dev": "vocs dev",
"sync-redirects": "node scripts/sync-vercel-redirects.mjs",
"prebuild": "node scripts/sync-vercel-redirects.mjs",
"sync-redirects": "node scripts/sync-render-redirects.mjs",
"prebuild": "node scripts/sync-render-redirects.mjs",
"build": "vocs build",
"preview": "vocs preview",
"format": "prettier --write ."
Expand Down
9 changes: 7 additions & 2 deletions redirects.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
*
* Single source of truth for redirects. Consumed in two places:
* - the dev-server redirect middleware in vocs.config.tsx (local `vocs dev`)
* - `npm run sync-redirects`, which mirrors these into vercel.json so Vercel
* - `npm run sync-redirects`, which splices these into render.yaml so Render
* serves them in production (Vocs has no build-time redirect support).
*
* After editing, run `npm run sync-redirects` and commit the updated vercel.json.
* After editing, run `npm run sync-redirects` and commit the updated render.yaml.
*
* Follows the OffchainLabs/arbitrum-docs redirects.config.js pattern. Kept as a
* `.js` module (types in redirects.config.d.ts) so it resolves natively in both
Expand Down Expand Up @@ -128,6 +128,11 @@ export const redirects = [
{ from: "/smart-routing-address", to: "/onramp/smart-routing-address" },
{ from: "/global-address", to: "/onramp/smart-routing-address" },

// Magic Account (legacy) → Chain Abstraction. Was a manual Render redirect to
// /sdk/advanced/chain-abstraction, itself now legacy; collapse the hop straight
// to the live page. (/magic-account/* subpaths are handled in render.yaml.)
{ from: "/magic-account", to: "/smart-accounts/chain-abstraction/overview" },

// Embedded Wallet docs live at /wallets/* (alpha — unlisted in sidebars).

// React WaaS hooks → Advanced › React Hooks (legacy)
Expand Down
Loading
Loading