Skip to content

Consume canonical TypeScript API exports - #1430

Draft
Adam Ratzman (adamint) wants to merge 2 commits into
mainfrom
adamint/canonical-ts-api-export
Draft

Consume canonical TypeScript API exports#1430
Adam Ratzman (adamint) wants to merge 2 commits into
mainfrom
adamint/canonical-ts-api-export

Conversation

@adamint

Copy link
Copy Markdown
Member

Draft. Consumer half of microsoft/aspire#19032 — tracking #17608.

Today AtsJsonGenerator reconstructs TypeScript signatures on the site side: options-overload synthesis, C# inheritance borrowing, container-base inference, missing-declaration stubs. It's a second implementation of the TypeScript projection that lives in the wrong repo, and it drifts from what the generator actually emits. That's the bug behind #17608.

The plan is for the CLI to hand us the API surface for an exact Name@Version and for this repo to do nothing but validate, sort, dedupe, and write.

What's in the draft so far

The schema v1 contract and the fixtures, so the switchover has something to land against:

  • src/schemas/typescript-api-export.ts — parser/validator, typed loader, concatenateDeclarations
  • tests/fixtures/typescript-api-export/*.json — unedited aspire sdk export output for Aspire.Hosting and Aspire.Hosting.Redis
  • 16 unit tests, including one that concatenates every declaration fragment and shells out to tsc --noEmit --strict with skipLibCheck off

The fixtures are deliberately raw CLI output, not hand-tidied — if the producer drifts, these tests are what catches it. That already paid off once: the augmentation ownership test here caught addRedis shipping as interface:DistributedApplicationBuilder owned by Aspire.Hosting.Redis, which collides with core's item ID. Fixed on the producer side.

Still to come on this branch

  • Rewire update-ts-api.ts onto aspire sdk export and delete AtsJsonGenerator
  • Reduce generate-twoslash-types.ts to validation + dedupe + write
  • Drop the TypeScript half of normalize-generated-api-data.ts

Keeping it a draft until microsoft/aspire#19032 is in and there's a CLI on a feed CI can restore — the refresh workflow can't run against a sdk export that isn't published yet.

Testing

328/328 unit tests, eslint clean.

Adam Ratzman (adamint) and others added 2 commits August 5, 2026 18:14
Validates schema version 1 documents produced by `aspire sdk export`
before the site reads them: unknown schema versions, the wrong language,
missing package identity, duplicate stable IDs, declaration IDs that
disagree on content, and blank signatures are all rejected at the input
rather than surfacing as empty code blocks on a published page.

The fixtures are unedited CLI output for one core and one integration
package. Their combined declaration fragments type-check with noEmit and
skipLibCheck disabled, which is what lets the site stop authoring shims.

No signature conversion here; consumers still read the existing data.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 819baaf4-91c3-44ce-8004-3dbc9110f810
Regenerated with the producer fixes: augmentation item IDs now carry the contributing package so
two integrations extending DistributedApplicationBuilder cannot collide, and CreateBuilderOptions
gained the client-only throwOnPendingRejections property the module has always shipped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 819baaf4-91c3-44ce-8004-3dbc9110f810
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1430. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1430 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

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