Commit 2c02881
authored
feat: make CLI deployment default, gate API behind experimental-api flag (#363)
* docs(track): add cli-default-experimental-api-20260430
Plan to make CLI deployment the default and gate API behind an
opt-in experimental-api input. Refs #362.
* chore(track): start cli-default-experimental-api-20260430 implementation
* feat(config): add experimental-api input with mutual-exclusion validation
- Add experimental-api boolean input to action.yml (default: false)
- Add experimentalApi field to ActionConfig type
- Parse the new input in getActionConfig(); throw on mutual exclusion
with vercel-args
- Cover defaults, parsing, and mutual-exclusion error in config tests
Phase 1 (T001-T004) of cli-default-experimental-api-20260430. Refs #362.
* feat(vercel): default routing to CLI; gate API behind experimentalApi flag
createVercelClient() now routes to VercelCliClient by default and to
VercelApiClient only when config.experimentalApi is true, emitting a
core.warning that the API path is experimental and may break across
@vercel/client updates.
Routing tests rewritten as the four-case matrix from spec AC-1; the
mutual-exclusion case is enforced upstream in getActionConfig().
Phase 2 (T005-T007) of cli-default-experimental-api-20260430. Refs #362.
* docs: document CLI default with experimental-api opt-in
- action.yml: real description for vercel-args; reword scope deprecation
message so it no longer ties scope to vercel-args presence
- README.md: replace 'Migration to API-based Deployment' section with a
new 'Deployment Mode' section covering CLI default, experimental-api
opt-in, the experimental warning, mutual-exclusion rule, CLI ↔ API
input mapping, API-only inputs, and a migration note for users who
relied on the previous v42 API default
- README.md: rename 'API Deployment Inputs (New)' to 'Experimental API
Deployment Inputs' and gate them on experimental-api: true
- README.md: drop 'Deprecated' label on vercel-args / scope; add an
experimental-api row to the inputs table
Phase 3 + Phase 4 (T008-T010) of cli-default-experimental-api-20260430.
Refs #362.
* test(integration): add factory routing tests + rebuild dist
- Add experimentalApi to integration createConfig helper (compile fix)
- Add factory routing tests: default config -> VercelCliClient (no warning);
experimental-api: true -> VercelApiClient (with warning containing
'experimental' and '@vercel/client')
- Rebuild dist/index.js with the new routing and config validation
Phase 5 (T011-T012) of cli-default-experimental-api-20260430. All 244
unit tests + 19 integration tests pass. Refs #362.
* docs(track): sync product.md with cli-default-experimental-api
* fix(action): remove deprecationMessage from scope input
Spec FR-6 requires removing the deprecationMessage from scope; the
description retains the vercel-org-id preference guidance, so the input
is still discoverable but no longer marked deprecated. CLI is now the
standard mode and scope is only relevant there.
Refs #362.
* refactor(types): encode deployment mode as discriminated union
Replace ActionConfig.vercelArgs (string) and ActionConfig.experimentalApi
(boolean) with a single discriminated union field:
type DeploymentMode =
| { kind: 'cli', vercelArgs: string }
| { kind: 'experimental-api' }
interface ActionConfig {
deployment: DeploymentMode
// ...
}
Rationale (from review:review-type-analyzer, confidence 82): the previous
two-field shape made the (experimental-api: true, vercel-args: '--prod')
pair typecheck even though it is illegal at runtime. The discriminated
union makes that combination unrepresentable — the absence of vercelArgs
on the 'experimental-api' variant is enforced by the type system.
The runtime mutual-exclusion check still lives in config.ts, but it is
now a pure input-parsing concern: it transforms raw action.yml inputs
into one of the two valid type states, throwing if both inputs claim
to be set.
createVercelClient() switches on deployment.kind with an exhaustive
match. VercelCliClient narrows config.deployment.kind === 'cli' before
reading vercelArgs.
Test fixtures across config/vercel/integration tests updated to the new
shape; assertions on config.vercelArgs become assertions on
config.deployment shape.
All 243 unit + 19 integration tests pass; typecheck + lint clean; dist
rebuilt.
Refs #362.
* chore(track): finalize cli-default-experimental-api-20260430
- Move active/ -> completed/
- Update metadata.json: status -> review, pr -> #363
- Sync tracks.jsonl section + status
- Add product spec SPEC-001 (deployment) merged from track spec
- Update product-specs index
* fix: apply AI code review suggestions
- config: trim vercel-args before mutual-exclusion check; whitespace-only
values no longer trigger spurious errors and the trimmed value is what
gets stored in the cli variant (copilot review thread)
- config: resolveDeploymentEnvironment now takes the parsed DeploymentMode
and the typed target; in experimental-api mode the GitHub deployment
environment is inferred from target=production rather than from
vercel-args (which is forbidden in that mode). Fixes a mislabel where
API-mode production deploys appeared as preview in GitHub deployments.
(copilot + cubic review threads)
- vercel: add an exhaustive default branch with assertNever in
createVercelClient() so unexpected deployment.kind values fail loud
at runtime instead of silently returning undefined (copilot review)
- README: close the scope row in the inputs table with a trailing |
(cubic review)
- plan.md: correct the historical 244 -> 243 unit test count
(cubic review). 248 today after the new tests added in this commit.
- tests: cover trimmed vercel-args, target-aware experimental-api
environment resolution, and the new resolveDeploymentEnvironment
signature in index.test.ts
Refs #362.1 parent 4076535 commit 2c02881
26 files changed
Lines changed: 772 additions & 123 deletions
File tree
- .please/docs
- knowledge
- product-specs
- deployment
- tracks/completed/cli-default-experimental-api-20260430
- dist
- src
- __integration__
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments