Skip to content

refactor(api): regenerate the OpenAPI client on openapi-ts 0.99 - #27

Merged
pbennett merged 1 commit into
mainfrom
chore/regenerate-api-client
Aug 28, 2026
Merged

refactor(api): regenerate the OpenAPI client on openapi-ts 0.99#27
pbennett merged 1 commit into
mainfrom
chore/regenerate-api-client

Conversation

@pbennett

Copy link
Copy Markdown
Contributor

#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/ and src/api/core/ (~2,000 lines). 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.

The public type surface is unchanged

src/types.ts pulls 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_getLookup rather than nfdGetLookup. Only src/api-client.ts imports them, and nothing generated is re-exported from src/index.ts, so those 12 renames are internal.

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 being deleted by the generator that reads it — generate:openapi failed on the second run with Input file not found. It is now gitignored, which matches the reality that it is fetched from the private nfd-backend repo (needs GITHUB_TOKEN) and was never committed.

The eslint and prettier ignores matched src/api/*.gen.ts, which no longer covers client/ and core/. Two separate failures came out of that: 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 with semicolons. eslint now skips src/api entirely and the generator formats its own output.

output.format / output.lint are deprecated in favour of postProcess. 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:

search   → total 17, patrickalgo.algo, bullishpatrick.algo
resolve  → nfdomains.algo, owner NRLA7VZ2…, appID 763844423
lookup   → KHPMV7… -> amor.algo   (single and multi-address)
lookup   → {}                     (404 path, swallowed per chunk)

The multi-address call confirms the repeated-address query serialisation survives the new serializer — one known address resolved while an unknown one was simply absent from the response.

pnpm run ci passes: 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 under NfdApiClient is swapped, which is why it is not a chore:.

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
pbennett merged commit 4c5af92 into main Aug 28, 2026
1 check passed
@pbennett
pbennett deleted the chore/regenerate-api-client branch August 28, 2026 04:43
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.
@txnlab-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant