Skip to content

improvement: remove extends from unions#3

Merged
dsinghvi merged 1 commit into
mainfrom
dsinghvi-patch-1
Apr 3, 2022
Merged

improvement: remove extends from unions#3
dsinghvi merged 1 commit into
mainfrom
dsinghvi-patch-1

Conversation

@dsinghvi

@dsinghvi dsinghvi commented Apr 3, 2022

Copy link
Copy Markdown
Member

No description provided.

@dsinghvi dsinghvi merged commit 8169cdd into main Apr 3, 2022
@dannysheridan dannysheridan deleted the dsinghvi-patch-1 branch December 9, 2023 21:01
dsinghvi pushed a commit that referenced this pull request Jan 21, 2024
* Add unions to IR

* Remove _Unknown visitor

* Remove unknown

* Add http types
dsinghvi added a commit that referenced this pull request Jan 22, 2024
* save progress on openapi type generator

* convert to union

* fern types converter

* fix deps
dsinghvi added a commit that referenced this pull request Jan 24, 2024
* precommit checks

* install husky

* fingers crossed

* fingers crossed

* fix circleci

* ignore depcheck
dsinghvi added a commit that referenced this pull request Feb 3, 2024
* migrate package to filename

* fix circleci config
devin-ai-integration Bot added a commit that referenced this pull request Apr 18, 2026
- Extract list generate logic into listGenerateCommands.ts (matches
  list preview pattern, fixes inconsistency #2)
- Use Pick<AbstractAPIWorkspace> instead of manual WorkspaceGeneratorsInfo
  interface (#3)
- Add --json flag to list preview command (#5)
- Deduplicate to one entry per (groupName, apiName) pair (Concern #2)
- Add 16 unit tests for listGenerateCommands
- Update listPreviewGroups tests for deduplication behavior (21 tests)

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
lifanzou added a commit that referenced this pull request Apr 21, 2026
* feat(cli): add fern automations list preview subcommand

Adds a new hidden subcommand that discovers previewable generator groups
and outputs a JSON array of objects with groupName, apiName, and generator.

A generator is previewable when:
- It is a supported TypeScript/npm generator
- automation.preview is not false in generators.yml

Designed for consumption by the fern-preview GitHub Action to replace
client-side YAML parsing of generators.yml with a single CLI call.

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>

* test(cli): add unit tests for listPreviewGroups

Extracts core filtering logic from the inline command handler into a
standalone listPreviewGroups() function for testability. Adds 20 tests
covering:
- Basic detection of all 3 TypeScript generator variants
- Exclusion of non-TypeScript generators (Python, Java, Go)
- automation.preview flag filtering
- Mixed-language groups
- Multi-API workspace support with apiName
- Group name filtering
- Edge cases (empty workspaces, null config, empty groups)

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>

* refactor(cli): address PR review feedback

- Extract list generate logic into listGenerateCommands.ts (matches
  list preview pattern, fixes inconsistency #2)
- Use Pick<AbstractAPIWorkspace> instead of manual WorkspaceGeneratorsInfo
  interface (#3)
- Add --json flag to list preview command (#5)
- Deduplicate to one entry per (groupName, apiName) pair (Concern #2)
- Add 16 unit tests for listGenerateCommands
- Update listPreviewGroups tests for deduplication behavior (21 tests)

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>

* docs(cli): update JSDoc to reference --json flag in GHA example

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>

* feat(cli): replace fern automations list preview with fern automations preview

Consolidate discovery and execution into a single command:
- sdkPreview() now returns SdkPreviewResult instead of writing stdout
- New addAutomationsPreviewCommand discovers groups via listPreviewGroups()
  and calls sdkPreview() for each, aggregating results as JSON
- Remove addAutomationsListPreviewCommand (listing-only, no longer needed)
- Output formatting moved to CLI command handler (writeSdkPreviewOutput)

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>

* fix(cli): fix biome import ordering in cli.ts

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>

* fix(cli): address review feedback for automations preview

- Add optional code field to SdkPreviewError and propagate CliError.Code
  values (AuthError, ConfigError) through all error return paths
- Move AutomationsPreviewGroupResult interface to module level
- Use bracket notation argv["push-diff"] for consistency with other commands

Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: barry.zou <barry.zou@buildwithfern.com>
devin-ai-integration Bot added a commit that referenced this pull request May 18, 2026
…ns, parallel locale publishing

Issue #1: Extract buildTranslatedDocsDefinition into shared module
  - Both V2 (publishDocs.ts) and ledger (publishDocsLedger.ts) now import
    from buildTranslatedDocsDefinition.ts instead of duplicating ~140 lines
    of MDX processing logic (snippet resolution, image rewrites, nav overlays)

Issue #2: Wire resolver into ledger preview path
  - publishDocsViaLedgerPreview now accepts optional resolver parameter
  - When translations are available, preview publishes them via
    finishTranslation after the base deployment completes

Issue #3: Parallel locale publishing
  - Replace sequential for...of with Promise.all in
    publishTranslationsViaLedger, matching V2's parallel approach

Issue #4: Document dual-mode double-publish
  - Add comment explaining that dual mode intentionally publishes
    translations via both V2 and ledger for migration parity

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>
emjoseph added a commit that referenced this pull request May 19, 2026
* feat(cli): add docs-ledger multi-locale translation publishing

Port the V2 translation loop into the ledger pipeline:
- buildLedgerInput now accepts an optional locale parameter (default "en")
- After base deployment finishes, publishDocsViaLedger loops through
  resolver.getTranslationPages() and publishes each locale via
  register + finishTranslation
- Translation MDX processing (snippet resolution, image rewrites,
  @/ imports, comment stripping, nav overlays) is shared with V2
- V2 registerTranslation loop is skipped when deployMode=="ledger"
  (translations handled by the ledger path instead)

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>

* fix: organize imports for biome check

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>

* fix: narrow docsRegistrationId type instead of non-null assertion

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>

* fix(cli): extract shared translation pipeline, add preview translations, parallel locale publishing

Issue #1: Extract buildTranslatedDocsDefinition into shared module
  - Both V2 (publishDocs.ts) and ledger (publishDocsLedger.ts) now import
    from buildTranslatedDocsDefinition.ts instead of duplicating ~140 lines
    of MDX processing logic (snippet resolution, image rewrites, nav overlays)

Issue #2: Wire resolver into ledger preview path
  - publishDocsViaLedgerPreview now accepts optional resolver parameter
  - When translations are available, preview publishes them via
    finishTranslation after the base deployment completes

Issue #3: Parallel locale publishing
  - Replace sequential for...of with Promise.all in
    publishTranslationsViaLedger, matching V2's parallel approach

Issue #4: Document dual-mode double-publish
  - Add comment explaining that dual mode intentionally publishes
    translations via both V2 and ledger for migration parity

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>

* fix(cli): reuse client in preview translations, add failure summary log

1. Reuse existing 'client' in preview translation path instead of
   creating a redundant client2 instance
2. Aggregate per-locale failures into a summary log at the end of
   translation publishing (both preview and non-preview paths):
   e.g. '2/5 locale(s) failed: es, ja'

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>

* refactor: build all locales upfront with fail-fast, single register→upload→finish flow

Restructure translation publishing so all locale DocsDefinitions are
built before any network calls. If any locale fails to build, the
entire publish aborts immediately.

Production path (publishDocsLedger.ts):
- Phase 1: Build base + all translation inputs in parallel (fail-fast)
- Phase 2: Merge all blobs, single register → upload → finish for base
- Phase 3: Attach translations (blobs already uploaded)

Preview path (publishDocsLedgerPreview.ts):
- Phase 1: Build base input + all translated DocsDefinitions upfront
- Phase 2: previewRegister → build translation ledger inputs (need
  server-assigned domain) → merge blobs → upload → finish
- Phase 3: Attach translations

Removes per-locale try/catch error handling — errors now propagate
to abort the entire publish rather than warn-and-continue.

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>

* feat(cli): pass translations inline to finish call, remove Phase 3

Replace per-locale finishTranslation loop with a single finish call
that includes a translations[] array. Both production and preview
paths now follow a two-phase pipeline:
  Phase 1: Build all locales upfront (fail-fast)
  Phase 2: Single register → upload → finish (base + translations)

The server persists locale-specific segments for each translation
entry after the base deployment is created — no separate round-trips.

Co-Authored-By: Eugene Joseph <joseph.eugene@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant