Skip to content

Commit 4dba4fd

Browse files
committed
fix
1 parent 3084de7 commit 4dba4fd

File tree

6 files changed

+76
-13
lines changed

6 files changed

+76
-13
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
name: vercel-root-directory-cli
3+
description: 'Skill: vercel-root-directory-cli'
4+
---
5+
6+
@.claude/skills/vercel-root-directory-cli/vercel-root-directory-cli.mdc

.claude/rules/vercel-root-directory-cli.mdc renamed to .claude/skills/vercel-root-directory-cli/vercel-root-directory-cli.mdc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
---
2-
name: vercel-root-directory-cli
3-
description: |
4-
Fix for Vercel CLI deploy failures in monorepos when the project Root Directory is a subdirectory
5-
but vercel.json lives above it. Use when: (1) `vercel deploy` or `vercel deploy --prebuilt`
6-
fails with "The vercel.json file should be inside of the provided root directory", (2) dashboard
7-
builds succeed but the CLI fails, (3) the Vercel project Root Directory is `apps/...` with
8-
"Include files outside the root directory" enabled. Covers root-directory config mismatch in Vercel.
9-
---
10-
111
# Vercel Root Directory vs CLI Deploy
122

133
## Problem
@@ -54,4 +44,4 @@ Use this rule when all of these smell true:
5444
## References
5545

5646
- https://vercel.com/docs/monorepos
57-
- https://vercel.com/docs/deployments/configure-a-build#root-directory
47+
- https://vercel.com/docs/deployments/configure-a-build#root-directory
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: vercel-root-directory-cli
3+
description: 'Skill: vercel-root-directory-cli'
4+
---
5+
6+
# Vercel Root Directory vs CLI Deploy
7+
8+
## Problem
9+
10+
`vercel build` can pass while `vercel deploy` fails in a monorepo because the Vercel project is configured
11+
with a subdirectory Root Directory, but `vercel.json` sits at the repo root.
12+
13+
## Context / Trigger Conditions
14+
15+
Use this rule when all of these smell true:
16+
17+
- The Vercel project Root Directory is set to something like `apps/www`
18+
- `vercel.json` is at the repo root instead of inside that Root Directory
19+
- `vercel deploy` or `vercel deploy --prebuilt` fails with `The vercel.json file should be inside of the provided root directory`
20+
- The dashboard can still build because "Include files outside the root directory" is enabled
21+
22+
## Solution
23+
24+
1. Check the Vercel project Root Directory with `vercel project inspect`.
25+
2. Check where `vercel.json` actually lives.
26+
3. If Root Directory is a subdirectory, either:
27+
- move `vercel.json` into that Root Directory, or
28+
- change the Vercel project Root Directory back to repo root.
29+
4. Do not treat this as an app source failure unless `vercel build` reproduces it.
30+
31+
## Verification
32+
33+
- `vercel build` succeeds locally from the expected project root
34+
- `vercel project inspect` reports a Root Directory that matches where `vercel.json` lives
35+
- `vercel deploy` no longer fails with the root-directory error
36+
37+
## Example
38+
39+
- Repo root contains `vercel.json`
40+
- Vercel project Root Directory is `apps/www`
41+
- Dashboard builds may still work with files outside the root included
42+
- CLI deploy fails because it expects `vercel.json` inside `apps/www`
43+
44+
## Notes
45+
46+
- "Include files outside the root directory" helps the build step see workspace files. It does not make CLI config validation ignore the Root Directory boundary.
47+
- If the latest app error only appeared in remote logs, reproduce first with `vercel build` before changing source files.
48+
49+
## References
50+
51+
- https://vercel.com/docs/monorepos
52+
- https://vercel.com/docs/deployments/configure-a-build#root-directory

.github/actions/pnpm-install/action.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: 'Add a specific cache-prefix'
1414
required: false
1515
default: 'default'
16+
link-workspace-packages:
17+
description: 'Link local workspace packages during install'
18+
required: false
19+
default: 'false'
1620

1721
runs:
1822
using: 'composite'
@@ -30,6 +34,13 @@ runs:
3034
- name: 📥 Install dependencies
3135
shell: bash
3236
working-directory: ${{ inputs.cwd }}
33-
run: pnpm install --no-frozen-lockfile
37+
run: |
38+
args=(install --no-frozen-lockfile)
39+
40+
if [ "${{ inputs.link-workspace-packages }}" = "true" ]; then
41+
args+=(--config.link-workspace-packages=true)
42+
fi
43+
44+
pnpm "${args[@]}"
3445
env:
3546
HUSKY: '0'

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525

2626
- name: 📦 Monorepo install
2727
uses: ./.github/actions/pnpm-install
28+
with:
29+
link-workspace-packages: 'true'
2830

2931
# @link https://github.com/changesets/action
3032
- name: 🦋 Create Release Pull Request or Publish

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232

3333
## Compound Engineering Overrides
3434

35-
- **Git:** Never git add, commit, push, or create PR.
35+
- **Git:** Never git add, commit, push, or create PR unless the user explicitly asks.
36+
- **PR:** Before creating or updating a PR, run `bun check`. If it fails, stop and fix it or report the blocker. Do not open a PR with failing `bun check` unless the user explicitly says to.
3637
- **plan:** Include test-browser in acceptance criteria for browser features
3738
- **deepen-plan:** Context7 only when not covered by skills
3839
- **work:** UI tasks require test-browser BEFORE marking complete. Never guess.
@@ -118,6 +119,7 @@ pnpm --filter @platejs/core lint:fix
118119

119120
- [ ] Typecheck (IF updated .ts files): Bash `bun typecheck`
120121
- [ ] Lint: Bash `bun lint:fix`
122+
- [ ] PR gate (IF creating/updating a PR): Bash `bun check`
121123
- [ ] Learn (SKIP if trivial): CRITICAL: After completing this request, you MUST evaluate whether it produced extractable knowledge. EVALUATION PROTOCOL (NON-NEGOTIABLE): (1) COMPLETE the user's request first (2) EVALUATE - Did this require non-obvious investigation or debugging? Was the solution something that would help in future similar situations? Did I discover something not immediately obvious from documentation? (3) IF YES to any: Skill(learn) NOW to extract the knowledge (4) IF NO to all: Skip - no extraction needed This is NOT optional. Failing to evaluate = valuable knowledge lost.
122124

123125
### Post Compact Recovery

0 commit comments

Comments
 (0)