[pull] main from fern-api:main#746
Merged
Merged
Conversation
* feat(cli): add examples field to GraphQL spec config for user-provided operation examples Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: narrow definition.schema.examples type before passing to RelativeFilePath.of() Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: address Claude review - v2 path bug, error handling, operationType discriminator - Add examples resolution in ApiDefinitionConverter.convertGraphQlSpec for v2 fern.yml path - Add try/catch + structural validation to loadGraphQlExamples in both OSSWorkspace and DocsDefinitionResolver - Add optional operationType/namespace discriminator to GraphQlOperationExamplesInput - Use composite key lookup in GraphQLConverter (scoped first, bare-name fallback) - Use static import for GraphQlOperationExamplesInput type in OSSWorkspace Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: biome import ordering in OSSWorkspace.ts Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: address Claude review round 2 - case normalization, inner validation, preview watcher Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: biome formatting for multi-line if conditions Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: fix operationType discriminator and add missing namespace in OSSWorkspace Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: add absoluteFilepathToExamples to GraphQL spec test fixtures Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: add examples field to GraphQLSpecSchema Fern definition and regenerate schema Co-Authored-By: rishabh <rishabh@buildwithfern.com> * fix: update fern-yml.schema.json with examples field for GraphQL spec Co-Authored-By: rishabh <rishabh@buildwithfern.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: rishabh <rishabh@buildwithfern.com>
…16030) * chore(internal): scaffold expandFernignorePatterns helper Pure function that expands .fernignore glob patterns against a list of candidate paths using the same minimatch semantics as @fern-api/replay. Not wired up yet — that lands with the generator-cli fix. Tracer test covers the customer-reported bug: `src/foo/**` must match nested files, not be treated as a literal path named `**`. * chore(internal): regression guard for literal-path .fernignore entries Customers who list a bare filename (e.g. `LICENSE`) must continue to have that file preserved. Confirms the new glob path doesn't change literal matching semantics. * chore(internal): preserve bare directory entries in .fernignore Patterns with no glob characters fall through a literal+prefix path so `src/foo` keeps matching every file under `src/foo/`. The old wipe relied on `lstat` plus `git restore <dir>` for this case; the rewrite preserves the behaviour without depending on disk lstat. * chore(internal): skip comments, blank lines, and surrounding whitespace Mirrors the parsing the old literal-matching path already did so an existing .fernignore with `# comment` lines or stray indentation keeps working under the new glob expander. * chore(internal): regression guard for dotfile glob matches Locks in `dot: true` so a pattern like `src/**` continues to cover files whose names start with `.` (e.g. `.hidden.py`). Matches the flag replay's FileOwnership uses, so the two surfaces agree on which files .fernignore protects. * chore(internal): add ClonedRepository.listTrackedFiles Thin wrapper around `git ls-tree -r HEAD --name-only`. The fernignore glob expander needs the list of HEAD-tracked paths to expand patterns against — anything not in HEAD wouldn't be restorable via `git restore` anyway, so HEAD is the right truth source. * test(internal): customer-shaped integration for .fernignore preservation Composes ClonedRepository's existing wipe/restore primitives with the new glob expander and asserts that files matching `src/keep/**` survive byte-identically while files outside the pattern get replaced by fresh generator output. Mirrors the publish sequence GitHub.push uses. * fix(generator-cli): expand .fernignore glob patterns before the wipe Replaces literal `fileExists` matching in `GitHub.getFernignoreFiles` with `expandFernignorePatterns` over the HEAD-tracked file list. Patterns like `src/foo/**` now actually preserve their matching files through the generator wipe; previously they silently produced no matches and the customer's files were deleted, restored only if they happened to have a creation patch in replay's lockfile. The contract per ADR 0002 in @fern-api/replay is that .fernignore- matched files are protected by `.fernignore` itself at the wipe layer. This change makes the implementation match that contract. * fix(generator-cli): respect trailing-slash directory patterns Gitignore convention is to write `src/foo/` to mean "the directory", and customers copy-paste from .gitignore. The old prefix branch built `pattern + "/"` and ended up with `src/foo//` which never matched anything — silent data loss identical to the bug this branch already closes. Switches to a single matching strategy: strip an optional trailing slash, then always run minimatch (handles globs and extglob alike), then fall through to literal-or-prefix for bare paths. Drops the GLOB_CHARS regex so future minimatch features don't reopen the same class of bug. * chore(internal): regression guard for extglob .fernignore patterns The old GLOB_CHARS classifier missed `+(...)`, `@(...)`, `(...|...)` extglob forms and silently dropped them into the literal branch — same data-loss shape as the original bug. The trailing-slash fix removed the classifier; this test pins down that extglob keeps working under the new always-minimatch shape. * chore(internal): make bare-dir test order-independent The assertion's deterministic order was an accident of `filter` over `tracked` — a refactor that swaps iteration shape would have failed the test without changing user-visible behavior. Sort both sides. * chore(generator-cli): cut 0.9.34 and consume @fern-api/replay 0.16.2 Ships the .fernignore glob-matching fix on this branch alongside the matching replay release that picks up the lockfile hands-off cleanse. The customer story (fern-demo/smallest-ai-python-sdk#64) needs both halves to be whole.
…16032) Without it, minimatch interprets a leading `!` in a pattern as logical negation. `!src/bar` then returns "every file that isn't literally `src/bar`" — essentially the entire tracked list — and `restoreFiles` quietly restores all of it from HEAD, discarding the new generator output. The regen PR opens but contains no API changes. The existing comment claiming negation was disabled was aspirational; this enforces it. Also trims the 0.9.34 changelog entry that just shipped and cuts 0.9.35.
…thon/TS/CLI changelogs) (#16031) * chore(deps): bump @fern-api/generator-cli catalog pin to 0.9.34 Co-Authored-By: tanmay.singh <tstanmay13@gmail.com> * chore(deps): bump @fern-api/generator-cli catalog pin to 0.9.35 Co-Authored-By: tanmay.singh <tstanmay13@gmail.com> * chore: add changelog entries for Python, TypeScript, and CLI generator-cli 0.9.35 bump Co-Authored-By: tanmay.singh <tstanmay13@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )