Commit b9a86a1
feat(cli): route fern sdk preview through remote generation, add --local and --push-diff (#14856)
* feat: route fern sdk preview through Fiddle for remote generation by default
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* feat(cli): route fern sdk preview through Fiddle for remote generation by default
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* feat(cli): add --push-diff flag and use publishV2 by default for remote preview
- Default fern sdk preview (no flags): publishV2(npmOverride) → registry-only publish, safe to merge independently
- With --push-diff: githubV2(push) + preview=true → Fiddle publishes AND pushes diff branch to SDK repo
- Added explicit isPreview param to remote generation chain (createAndStartJob, runRemoteGenerationForGenerator, runRemoteGenerationForAPIWorkspace) so preview flag can be set independently of absolutePathToPreview
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* chore: trigger CI re-run with correct PR title
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* fix(cli): set isPreview=false for remote preview to avoid dry-run publish
In Fiddle, preview=true causes dryRun=true in the generator config,
which makes the generator run 'npm publish --dry-run' instead of
actually publishing. For sdk preview via publishV2(npmOverride),
we want the generator to actually publish to the registry.
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* chore(cli): remove internal Fiddle implementation details from comments
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* fix(cli): address PR review — _other returns undefined, isPreview conditional on pushDiff, clarify JSDoc
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* fix(cli): decouple isPreview from Fiddle preview field, remove --push-diff
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* fix(cli): replace fiddlePreview with publishV2 output mode check
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* fix(cli): simplify preview field — just send isPreview, let Fiddle handle dryRun
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* feat(cli): decouple fiddlePreview from isPreview, add --push-diff support
- Add `fiddlePreview` param to decouple what's sent to Fiddle as `preview`
from CLI-internal `isPreview` behavior. For sdk preview, isPreview=true
(lenient env vars, skip version check) while fiddlePreview=false (so
Fiddle doesn't set dryRun=true). This preserves fern generate --preview
behavior exactly as-is.
- Add `pushPreviewBranch` param threaded through the remote generation
chain. Will be sent to Fiddle once fiddle-sdk is bumped.
- Add `--push-diff` CLI flag for pushing preview branches to SDK repos.
- Add `getGithubOwnerRepo` helper and pushDiff support to
`overrideGroupOutputForRemotePreview` — uses githubV2(push) with npm
publishInfo when --push-diff is set and generator has github config.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(cli): consolidate overrideGroupOutputForPreview into single function
Merge the local-Docker-only overrideGroupOutputForPreview and remote-only
overrideGroupOutputForRemotePreview into a single exported function with an
optional pushDiff param. Extract createNpmOverrideOutputMode helper to
deduplicate the publishV2(npmOverride) construction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(cli): gate --push-diff, add validation, clarify dryRun comment
- Error out on --push-diff until fiddle-sdk is bumped with
pushPreviewBranch support — without it, Fiddle would treat the
githubV2(push) job as a normal push to the default branch.
- Error on --push-diff combined with --output (incompatible flags).
- Warn when --push-diff falls back to registry-only publish because
the generator has no github output configuration.
- Clarify the dryRun comment in createAndStartJob.ts explaining
that fiddlePreview is the sole mechanism preventing dryRun for
sdk preview jobs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs(cli): improve --output and --push-diff option descriptions
Document the behavior differences between modes: omitting --output
uses remote generation, providing it uses local Docker. Add examples
for --output combinations. Clarify --push-diff branch naming, GitHub
App requirement, and incompatibility with --output.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(cli): add --local flag to fern sdk preview, make --output use remote generation
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* docs(cli): update --push-diff help text to reference --local instead of --output
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
* fix(cli): override output mode to downloadFiles for remote disk-only preview
When --output is provided without a registry URL and without --local,
remote generation was using the generator's original output mode (e.g.
npm publish to registry.npmjs.org) which fails. Override to
downloadFiles so the generator produces files without publishing,
and the CLI downloads them from S3 to the specified path.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(cli): add unit tests for sdk preview output mode overrides
Cover getGithubOwnerRepo, overrideGroupOutputForDownload, and
overrideGroupOutputForPreview including pushDiff routing logic.
Add clarifying comment on publishV2 being registry-only.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(cli): remove unnecessary isPreview param from createAndStartJob
isPreview was threaded to createAndStartJob only to participate in the
fallback chain for the Fiddle preview flag, but no caller needed it —
fern sdk preview already passes fiddlePreview explicitly, and fern
generate --preview relies on absolutePathToPreview != null. Simplify
the fallback to: fiddlePreview ?? absolutePathToPreview != null.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(cli): remove test config files accidentally committed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(cli): remove extra destructured params from createJob inner function
automationMode and autoMerge are in the type signature but not
destructured on main (they're commented out in the createJobV3 call).
The merge conflict resolution incorrectly added them to the
destructuring.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: barry.zou <barry.zou@buildwithfern.com>
Co-authored-by: Barry <barry@Barrys-MacBook-Pro.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent ba5b837 commit b9a86a1
7 files changed
Lines changed: 604 additions & 73 deletions
File tree
- packages/cli
- cli/src
- commands/sdk-preview
- __test__
- generation/remote-generation/remote-workspace-runner/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2447 | 2447 | | |
2448 | 2448 | | |
2449 | 2449 | | |
2450 | | - | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
2451 | 2471 | | |
2452 | 2472 | | |
2453 | 2473 | | |
| |||
2461 | 2481 | | |
2462 | 2482 | | |
2463 | 2483 | | |
2464 | | - | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
2465 | 2487 | | |
2466 | 2488 | | |
2467 | 2489 | | |
| |||
Lines changed: 294 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
2 | 11 | | |
3 | | - | |
| 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 | + | |
4 | 50 | | |
5 | 51 | | |
6 | 52 | | |
| |||
33 | 79 | | |
34 | 80 | | |
35 | 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 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
0 commit comments