diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 4c9b2e1dc..f6b6671e1 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -480,7 +480,7 @@ If vercel.json or .vercel detected: 1. Check for `vercel` CLI: `which vercel 2>/dev/null` 2. If installed: `vercel ls --prod 2>/dev/null | head -3` -3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch +3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch — only when the Vercel project is connected to this Git repository. For a CLI-only project, ask how production deploys run and record that command as the deploy trigger 4. Set health check: the production URL from vercel project settings Ask for the production URL if not available from the CLI, then confirm it before writing. @@ -510,6 +510,8 @@ If deploy workflows detected but no platform config: If nothing detected: +A project deployed only with the Vercel CLI has no `vercel.json` or `.vercel/`; `vercel link` creates `.vercel/`, so a re-run detects it. + Use AskUserQuestion to gather the information: 1. **How are deploys triggered?** diff --git a/setup-deploy/SKILL.md.tmpl b/setup-deploy/SKILL.md.tmpl index d1aa78707..2a718d518 100644 --- a/setup-deploy/SKILL.md.tmpl +++ b/setup-deploy/SKILL.md.tmpl @@ -121,7 +121,7 @@ If vercel.json or .vercel detected: 1. Check for `vercel` CLI: `which vercel 2>/dev/null` 2. If installed: `vercel ls --prod 2>/dev/null | head -3` -3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch +3. Vercel deploys automatically on push — preview on PR, production on merge to the default branch — only when the Vercel project is connected to this Git repository. For a CLI-only project, ask how production deploys run and record that command as the deploy trigger 4. Set health check: the production URL from vercel project settings Ask for the production URL if not available from the CLI, then confirm it before writing. @@ -151,6 +151,8 @@ If deploy workflows detected but no platform config: If nothing detected: +A project deployed only with the Vercel CLI has no `vercel.json` or `.vercel/`; `vercel link` creates `.vercel/`, so a re-run detects it. + Use AskUserQuestion to gather the information: 1. **How are deploys triggered?** diff --git a/test/setup-deploy-vercel-trigger.test.ts b/test/setup-deploy-vercel-trigger.test.ts new file mode 100644 index 000000000..17bb74037 --- /dev/null +++ b/test/setup-deploy-vercel-trigger.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, test } from 'bun:test'; +import * as fs from 'fs'; +import * as path from 'path'; + +const SKILL = fs.readFileSync(path.resolve(import.meta.dir, '..', 'setup-deploy', 'SKILL.md'), 'utf-8'); + +function section(heading: string, next: string): string { + const start = SKILL.indexOf(heading); + expect(start).toBeGreaterThanOrEqual(0); + return SKILL.slice(start, SKILL.indexOf(next, start + heading.length)); +} + +describe('setup-deploy does not assume Vercel deploys on push', () => { + test('auto-deploy is conditional on a Git-connected Vercel project', () => { + const vercel = section('#### Vercel', '#### Netlify'); + expect(vercel).toContain('only when the Vercel project is connected to this Git repository'); + expect(vercel).toContain('For a CLI-only project, ask how production deploys run and record that command as the deploy trigger'); + }); + + test('the nothing-detected path explains how a CLI-only Vercel project becomes detectable', () => { + const manual = section('#### Custom / Manual', '1. **How are deploys triggered?**'); + expect(manual).toContain('deployed only with the Vercel CLI has no `vercel.json` or `.vercel/`'); + expect(manual).toContain('`vercel link` creates `.vercel/`'); + expect(SKILL).not.toMatch(/GoLive/i); + }); +});