Skip to content

sdk: generate with the vendored Cloudflare fork of Fern - #17

Draft
teamchong wants to merge 2 commits into
cloudflare:mainfrom
teamchong:feat/vendor-codegen-cli
Draft

teamchong wants to merge 2 commits into
cloudflare:mainfrom
teamchong:feat/vendor-codegen-cli

Conversation

@teamchong

Copy link
Copy Markdown
Collaborator

Generate SDKs with Cloudflare's fork of Fern, vendored as npm tarballs under vendor/codegen-cli, instead of downloading the Fern CLI from npm and the TypeScript generator from Docker Hub.

  • @cloudflare/codegen-cli 5.112.0: the Fern CLI, forked from fern-api 5.112.0.
  • @cloudflare/codegen-typescript-sdk 3.88.3: the TypeScript generator, forked from fernapi/fern-typescript-sdk 3.88.3, run natively via generators.yml local-command. TypeScript generation no longer needs Docker; other languages still do.
  • The image wrapper, sharded generation, and the multipart property-access post-fix in generate-sdk.ts are removed. The fork handles those directly.
  • The transformer bundles the vendored CLI and generator into dist.

Both tarballs are built from the fern branch of this repo. The CLI tarball is built from 341ac36, which is #16. Rebuild with scripts/build-vendor-cli.sh and compare against vendor/codegen-cli/SHA256SUMS; see vendor/codegen-cli/README.md.

Depends on #16.

Generate SDKs with Cloudflare's fork of Fern (https://github.com/fern-api/fern,
Apache-2.0), vendored as npm tarballs under vendor/codegen-cli instead of
downloading the Fern CLI from npm and the Fern TypeScript generator from
Docker Hub.

- @cloudflare/codegen-cli 5.112.0: the Fern CLI (`fern` command), forked from
  fern-api 5.112.0
- @cloudflare/codegen-typescript-sdk 3.88.3: Fern's TypeScript generator,
  forked from fernapi/fern-typescript-sdk 3.88.3 (was 3.80.1) and run
  natively via generators.yml local-command instead of the Docker image. The
  heap-tuned image wrapper and sharded generation are removed, and TypeScript
  generation no longer needs Docker; the other languages still do.
- the multipart property-access post-fix in generate-sdk.ts is removed; the
  fork reads multipart file fields through the request wrapper's property
  reference, so names that are not identifiers no longer need patching
  (5816c70 on the `fern` branch)
- the transformer bundles the vendored CLI and generator into dist and no
  longer needs Docker
- both tarballs are built from 6e08440 on the `fern` branch of
  cloudflare/forge, a snapshot of fern-api/fern 5.112.0 with Cloudflare's
  patches on top; see vendor/codegen-cli/README.md
Drops the no-conflicting-endpoint-paths fern check rule. /a/{x} and
/a/anything are distinct SDK methods, so the warning was noise.
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