Skip to content

[pull] main from fern-api:main#770

Merged
pull[bot] merged 3 commits into
code:mainfrom
fern-api:main
Jun 5, 2026
Merged

[pull] main from fern-api:main#770
pull[bot] merged 3 commits into
code:mainfrom
fern-api:main

Conversation

@pull

@pull pull Bot commented Jun 5, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

lifanzou and others added 3 commits June 4, 2026 20:54
* feat(swift): improve Swift SDK build performance

Three changes that reduce Swift SDK E2E build time without altering
customer-facing library output:

1. Fix SPM auto-compiling dynamic snippet files as 650+ separate
   executables by renaming Snippets/ to .snippets/ (hidden from SPM
   5.9+ auto-discovery). Saves ~71s of linking overhead.

2. Add `maxExamplesPerEndpoint` config option to limit wire test
   examples per endpoint, reducing test compilation time for large
   specs.

3. Combine build and test into single `swift test -c release`
   invocation in seed scripts to avoid redundant recompilation.

Benchmarked against Square OpenAPI spec: 680s → 139s E2E (-79%).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove maxExamplesPerEndpoint — it only games the benchmark, not real customers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert metadata.json changes from local seed run

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Move snippets to Tests/Snippets/ and wrap as library code

Instead of renaming Snippets/ to .snippets/ (which hides files from SPM
but also prevents compilation), move snippets into Tests/Snippets/ so
they compile as part of the test target. Each snippet is wrapped in an
enum to eliminate top-level executable code, preventing SPM from treating
them as standalone executables while still validating compilation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix biome formatting: inline writeFile call

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address review feedback

- Align Docker and local scripts: both use `swift build -c release
  --build-tests` + `swift test -c release` (no echo no-op, no
  debug/release divergence)
- Add validation to wrapSnippetAsLibrary: warn and fall back to raw
  snippet if the expected function pattern isn't found

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert to single-invocation build+test for maximum E2E gains

The split approach (swift build + swift test) added a second SPM
invocation costing ~3m35s of release-mode build graph validation.
Reverting to `swift test -c release` in the build phase with echo in
the test phase. Seed always runs build→test sequentially so the test
phase is never invoked independently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Extract wrapSnippetAsLibrary as exported function and add unit tests

Makes the snippet-wrapping logic directly testable by extracting it from the
class. Adds tests covering: typical wrapping, missing func declaration fallback,
missing invocation fallback, trailing whitespace tolerance, enum naming, and
trailing empty line stripping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Move changelog from swift generator to CLI (review feedback)

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>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: lifanzou <265923155+lifanzou@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Jun 5, 2026
@pull pull Bot added the ⤵️ pull label Jun 5, 2026
@pull pull Bot merged commit 92f5e6a into code:main Jun 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants