refactor(api): regenerate the OpenAPI client on openapi-ts 0.99 - #27
Merged
Conversation
The generator was bumped to 0.99 with #26 but its output was left at 0.64, so this is the regeneration that bump deferred. openapi-ts no longer consumes a separate client package: it emits its own fetch runtime into src/api/client and src/api/core. Nothing imports @hey-api/client-fetch any more, so it is dropped from dependencies and from the rollup externals. The published package now has one runtime dependency, @algorandfoundation/algokit-utils, plus the algosdk peer. Operation names now track the spec's operationIds verbatim - nfd_getLookup rather than nfdGetLookup. Only src/api-client.ts imports them and nothing generated is re-exported from src/index.ts, so the renames are internal. The public type surface is unchanged. src/types.ts pulls four types out of the generated output - NfdRecord, NfdSearchV2Response, VerifyConfirmResponseBody and VerifyRequestResponseBody - and all four are identical once doc comments are stripped. 0.99 emits the shared schema's description in place of the property's, which changes hover text and nothing else. Three supporting fixes, each of which blocked the regeneration: - openapi3.yaml moved out of src/api to sit beside openapi-ts.config.ts. 0.99 cleans its output directory before every run, so the spec was deleted by the generator that reads it, and generate:openapi failed on the second run with "Input file not found". It is gitignored, matching the fact that it is fetched from the private nfd-backend repo and was never committed. - The eslint and prettier ignores matched src/api/*.gen.ts, which no longer covers client/ and core/. The eslint post-processor failed the generate step on explicit-function-return-type in the emitted runtime, and the package-level prettier ignore silenced openapi-ts's own formatting pass, so the first successful run landed unformatted. eslint now skips src/api entirely and the generator formats its own output. - output.format and output.lint are deprecated in favour of postProcess. eslint is deliberately not in the list. Verified against the live API rather than the mocks, since the HTTP client underneath changed: search, resolve, and reverse lookup all return real data, including the repeated-address query serialisation and the 404 path that reverseLookup swallows per chunk. pnpm run ci passes: 246 tests, SDK build, all ten example builds.
pbennett
added a commit
that referenced
this pull request
Aug 28, 2026
#27 merged as `refactor(api):` and published nothing. The Angular preset ships releaseRules for feat, fix, perf and breaking changes only, so commit-analyzer returned "no release" and the regenerated OpenAPI client has been sitting on main while npm still serves the old one in 2.0.0. The gap was already visible in the config: release-notes-generator lists a "Code Refactoring" section, which under stock rules can only ever appear riding along with someone else's feat or fix, never on its own. Adds refactor and revert as patch through releaseRules on the commit-analyzer. They are additive — the preset's own rules still apply as the fallback — and verified against the commits since v2.0.0, which now analyze as patch rather than none. Merging this therefore also publishes 2.0.1. Corrects both docs, which stated the refactor rule as though it were stock, and now name it as a local override.
Contributor
|
🎉 This PR is included in version 2.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#26 bumped the generator to 0.99 but left its output at 0.64. This is the regeneration that deferred.
The structural change
openapi-ts no longer consumes a separate client package. It emits its own fetch runtime into
src/api/client/andsrc/api/core/(~2,000 lines). Nothing imports@hey-api/client-fetchany more, so it is dropped fromdependenciesand from the rollup externals.The published package now has one runtime dependency —
@algorandfoundation/algokit-utils— plus thealgosdkpeer.The public type surface is unchanged
src/types.tspulls four types out of the generated output:NfdRecord,NfdSearchV2Response,VerifyConfirmResponseBody,VerifyRequestResponseBody. All four are identical once doc comments are stripped. 0.99 emits the shared schema's description in place of the property's own, which changes hover text and nothing else.Operation names now track the spec's
operationIds verbatim —nfd_getLookuprather thannfdGetLookup. Onlysrc/api-client.tsimports them, and nothing generated is re-exported fromsrc/index.ts, so those 12 renames are internal.Three supporting fixes, each of which blocked the regeneration
openapi3.yamlmoved out ofsrc/api/to sit besideopenapi-ts.config.ts. 0.99 cleans its output directory before every run, so the spec was being deleted by the generator that reads it —generate:openapifailed on the second run withInput file not found. It is now gitignored, which matches the reality that it is fetched from the privatenfd-backendrepo (needsGITHUB_TOKEN) and was never committed.The eslint and prettier ignores matched
src/api/*.gen.ts, which no longer coversclient/andcore/. Two separate failures came out of that: the eslint post-processor failed the generate step onexplicit-function-return-typein the emitted runtime, and the package-level prettier ignore silenced openapi-ts's own formatting pass, so the first successful run landed unformatted with semicolons. eslint now skipssrc/apientirely and the generator formats its own output.output.format/output.lintare deprecated in favour ofpostProcess. eslint is deliberately not in that list.Verified against the live API, not the mocks
The HTTP client underneath changed, and the test suite mocks at a level that would not notice. Ran against MainNet:
The multi-address call confirms the repeated-
addressquery serialisation survives the new serializer — one known address resolved while an unknown one was simply absent from the response.pnpm run cipasses: lint, format:check, typecheck, 246 tests, SDK build, all ten example builds.Release
refactor:→ patch, so this publishes 2.0.1. The HTTP client implementation underNfdApiClientis swapped, which is why it is not achore:.