Repository navigation
Conversation
TomChv
force-pushed
the
feat/ts-core-package
branch
from
November 16, 2026 11:57
48f63c1 to
7e4cc79
Compare
TomChv
force-pushed
the
feat/ts-core-package
branch
4 times, most recently
from
November 24, 2026 13:20
e148f85 to
cc1a93c
Compare
TomChv
force-pushed
the
feat/ts-core-package
branch
3 times, most recently
from
November 25, 2026 13:16
f7e6f24 to
1fdb0fd
Compare
TomChv
commented
Nov 25, 2026
| sdk/typescript/src/api: core's bindings import `./core.js` and sit beside the | ||
| entry points that file re-exports, which is typescript-sdk's shape. | ||
| """ | ||
| let tsSdkCodegen: Container! { |
Member
Author
There was a problem hiding this comment.
Can't we simply create a module call codegen in the typescript-sdk repo so we get that binary there. Instead of rebuilding it here.
TomChv
force-pushed
the
feat/ts-core-package
branch
from
November 26, 2026 14:13
3c3690f to
f431154
Compare
The generated Dagger API bindings, `dag` and the typed `connect`, split out of `@dagger.io/dagger` so a scope can depend on the engine's API without the decorators, the provisioning code and the OpenTelemetry SDK that the aggregate pulls with it. Its version is the **engine** release, not the TypeScript SDK's, which is why it is published from this repo: the bindings describe one engine's schema. Every `.ts` file is produced by dagger/typescript-sdk's packager against a running engine and copied here unmodified — `client.gen.ts` alone is 23k lines — so the package is vendored rather than authored, and README.md says so. `@dagger.io/session` is a published dependency pinned by range: core needs a session, and #132 made it a range so a session release does not need a core release to go with it. The lockfile pins the build's own inputs, which the publish uses through `npm ci`; `files` publishes `dist/` alone, so neither the lockfile nor the sources ship. Lint ignores the directory in the same commit it arrives: the vendored sources are not formatted to this repo's rules and `yarn lint` reports 3275 errors otherwise. Signed-off-by: Tom Chauveau <[email protected]>
…o/dagger
The aggregate is generated per scope by dagger/typescript-sdk now, so nothing
here needs to publish it; core, whose version is the engine release, is the half
this repo releases. The TypeScript release row calls `releaseCore`, links to
core's npm page, and polls core's packument to decide a release landed —
`npmVersionURL` named the aggregate, which is the version the release waits on.
The end-to-end publish check moves with it: it asserted the published name, the
tarball path and `dist/src/index.{js,d.ts}` from the aggregate's layout, where
core's manifest points at `./dist/index.js`.
`release`, `releaseDryRun` and `versionFromTag` go with the publisher they
served. `release` did carry one thing worth keeping — it was the only place
running `npm run build` over sdk/typescript and asserting a dist/ came out,
which the test checks do not do — so that lives on as `buildTypescript`.
Publishing a prerelease leaves `latest` alone, which is right for a package with
stable releases behind it and wrong for this one: core has only ever been a
prerelease, so `latest` would sit on an old beta whose bindings target a
different API view than the session its own `latest` resolves to — the mismatch
this package exists to avoid, on the default install path.
So the release reconciles `latest` too, in two steps that fail independently.
npm will not take the same version twice, so a publish that lands and a tag
move that does not cannot be repaired by retrying the publish; `promoteCoreLatest`
is separate and idempotent, `published` means the version is on npm *and*
`latest` is settled, and the release skips a publish it has already done. The
decision is `shouldMoveNpmLatest`, in Go against semver: a prerelease never
displaces a stable `latest`, because comparison alone puts 1.0.1-beta.1 and
2.0.0-beta.1 *above* 1.0.0 — only a prerelease of the same version sorts below.
Signed-off-by: Tom Chauveau <[email protected]>
Nothing kept the 23.6k vendored lines in step with anything. The directory is excluded from lint and no generator produced it, so a copy left behind an engine bump would publish under a new version with every check green. The series that added it showed the failure twice: a commit claiming the sources had not changed, read off a regeneration against the wrong engine, then 746 lines of correction, then 14 more. `coreBindings` renders client.gen.ts from `daggerEngine.introspectionJson` — the same introspection `clientLibrary` renders sdk/typescript/src/api from, and no engine session is opened for either — using typescript-sdk's codegen built from its pinned source. The framework pairs it with `core-bindings/stale`, red until the result is committed. The engine is what the bindings describe, so the engine is what they are rendered from. Copying them from a typescript-sdk release instead was the first attempt at this and is wrong: an engine can move with nothing in that repo moving, and the copy would stay stale exactly then. Measured on this tree — rendering against main's engine yields six lines v1.1.0 does not have, a `disk` option on temporary directories, which a pinned copy would have missed. The pin is only the renderer and the three entry points no renderer produces: connect.ts, core.ts and index.ts are hand-written upstream. package.json, package-lock.json, tsconfig.json and README.md are this repo's — the version in particular is a placeholder the release overwrites from the tag, which is what lets a client fix ship inside one engine release (1.0.0-beta.25.2 did). Signed-off-by: Tom Chauveau <[email protected]>
Both of the stale checks CI reported, which is the machinery doing its job rather than anything going wrong. `typescript-client/core-bindings/stale`: rebasing moved this branch 138 commits forward, and main's engine grew API the committed bindings did not have — 75 lines, around artifact dimensions. That the check noticed is the whole point of rendering them from the engine rather than copying them from an SDK release. `go-sdk/generate/stale`: `coreBindings` is new public surface on typescript-client-dev, so the release module's generated client carries it now. The entrypoint's source maps move with main.go's line numbers. Signed-off-by: Tom Chauveau <[email protected]>
v1.3.0 is the first release carrying #120, which has the bindings generators style identifiers through the engine's `Naming.formatIdentifiers` rather than guessing from schema names. v1.1.0's codegen guessed, and guessed wrong for API newer than its own pairing: `ArtifactUriOpts` and `ImageMediaTypes.Oci` where this engine says `ArtifactURIOpts` and `OCI`. It also carries the codegen module (#149), so the renderer arrives as a dependency instead of a `go build` recipe kept here — the thing the two sides agreeing was never checked against. Signed-off-by: Tom Chauveau <[email protected]>
54 lines, all casing: `ArtifactURIOpts`, `ImageMediaTypes.OCI`, `ModuleSourceClientSchemaIntrospectionJSONOpts`. These are the engine's own spellings, asked for through `Naming.formatIdentifiers` — v1.1.0's codegen predated that query and guessed `Uri`, `Oci`, `Json` from the schema names. The lock pins the renderer at v1.3.0 / aa3bf26, and the Go client picks up the module's surface as a dependency rather than a build kept in this repo. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
force-pushed
the
feat/ts-core-package
branch
from
November 26, 2026 16:47
6244141 to
798c347
Compare
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.
Splits the generated Dagger API bindings out of
@dagger.io/daggerinto@dagger.io/core, and makes this repo release that package instead of the aggregate.A scope can now depend on the engine's API without the decorators, the provisioning code and the OpenTelemetry SDK the aggregate pulls with it. Paired with dagger/typescript-sdk#141, which generates the aggregate per scope and pins core by a bounded range.
The package
sdk/typescript/packages/coreis vendored, not authored. Every.tsfile is produced by dagger/typescript-sdk'spackageragainst a running engine and copied here unmodified;client.gen.tsalone is 23k lines.README.mdsays so, and lint ignores the directory in the commit that adds it — the vendored sources are not formatted to this repo's rules andyarn lintreports 3275 errors otherwise.Its version is the engine release, not the TypeScript SDK's, which is why it lives here: the bindings describe one engine's schema.
1.0.0-beta.28pairs with typescript-sdk's beta.28.@dagger.io/sessionis a dependency pinned by range (^1.0.0-beta.3) rather than exactly, so a session release does not need a core release to go with it (dagger/typescript-sdk#132). The floor is beta.3 deliberately: session beta.2 setsENGINE_VERSION = v1.0.0-beta.25, so admitting it would pair beta.28 bindings with a request for the API view those bindings were renamed out of.package-lock.jsonpins the build's own inputs and the publish installs throughnpm ci, so the emitteddist/is reproducible and a mismatched lockfile fails rather than quietly resolving something else.filespublishesdist/alone, so neither the lockfile nor the sources ship.What this moves
This repo stops publishing
@dagger.io/dagger. Nothing replaces it here — the aggregate is generated per scope by typescript-sdk now.release,releaseDryRunandversionFromTagare removed with the publisher they served, the release row callsreleaseCore, and the links, the packument the release polls, and the end-to-end publish check all move to core. That check had asserted the aggregate's name, tarball path anddist/src/index.{js,d.ts}, where core's manifest points at./dist/index.js.releasedid carry one thing worth keeping: it was the only place that rannpm run buildoversdk/typescriptand asserted adist/came out — the test checks runyarn test:node/bun test:bunagainst the sources and lint only lints them. That lives on as a newbuildTypescriptcheck.The core release container runs Node 24 (
nodeVersionLts) where the aggregate's ran 22, hence the new pin indagger.lock.The
latestdist-tagPublishing a prerelease leaves
latestalone. That is right for a package with stable releases behind it and wrong for this one: core has only ever been a prerelease, solatestwould sit on an old beta whose bindings target a different API view than the session its ownlatestresolves to — the mismatch this package exists to avoid, on the default install path.So the release reconciles
latest, in two steps that fail independently. npm will not take the same version twice, so a publish that lands and a tag move that does not cannot be repaired by retrying the publish —treatAlreadyPublishedAsDonewould see the version and report the component done. Therefore:promoteCoreLatestis a separate, idempotent step;publishedmeans the version is on npm andlatestis settled, so a half-finished release is retried rather than reported done;The decision is
shouldMoveNpmLatest, in Go againstgolang.org/x/mod/semver, with a unit test. Two rules, and the second is not implied by the first: a prerelease never displaces a stablelatest, because comparison alone puts1.0.1-beta.1and2.0.0-beta.1above1.0.0— only a prerelease of the same version sorts below it.Verified
release-core-dry-runandbuild-typescriptpass on a beta.28 engine. The dry run passing withnpm ciis also what proves the lockfile agrees with the manifest.shouldMoveNpmLatest: 11 cases, including the three above and1.0.0-beta.9not takinglatestfrom1.0.0-beta.25.2, which a string compare gets backwards.client.gen.tswith typescript-sdk at the beta.28 pairing produces an identical file.main: node, bun and deno each run in all three shapes (vendored bundle, facade, no facade), resolving core1.0.0-beta.28and the layers1.0.0-beta.3with one deduped copy of session;tsc --noEmitanddeno checkboth pass.Keeping the vendored sources honest
coreBindingscopies core's.tsfiles from a pinned dagger/typescript-sdk release, so the framework gives acore-bindings/stalecheck for free: CI is red until the committed copy matches the pin. Bumping the pin is how core follows an engine pairing.It copies rather than renders, deliberately. A module's own bindings come from the same SDK release's committed bundle, and core is what a scope resolves instead of that bundle — so rendering them here, against whatever engine happens to run the generator, is how the two would drift apart. Making the pin the pairing is what ties them together.
Verified green on the committed copy and red with one line appended to
connect.ts.versionis0.0.0, as its siblingsdk/typescript/package.jsonand its upstream both carry:releaseCoresets it from the release tag. That is also what lets a client fix ship inside one engine release —1.0.0-beta.25.2could not be expressed by a version derived from the engine.Signed-off-by: Tom Chauveau [email protected]