feat(packager): regenerate the TypeScript library bindings - #19
Draft
TomChv wants to merge 1 commit into
Draft
Conversation
The library ships its own generated bindings (src/api/client.gen.ts), and vendoring the library here means owning their regeneration. Add the packager module that does it, mirroring dagger/dagger's own clientLibrary generator. The schema is the session's, not a module's: a plain session serves no modules, so introspecting it yields the core API alone — unscrubbed, which is what a library binds and what neither ModuleSource.introspectionSchemaJSON (scrubs Host, currentWorkspace, ...) nor clientSchemaIntrospectionJSON (installs the module it is called on) gives. `codegen introspect` is the one subcommand that talks to the engine. It does so over plain HTTP against the nested session rather than through the Go SDK, so the generation subcommands keep their only inputs as files and pull in no dependency; it also only ever runs in this repo's own generate step, never in a user's. The bindings land where the library source expects them, so vendoring the rest of the library later drops in around them. On their own they do not compile — the runtime they import (../common/context.js) arrives with that source. Signed-off-by: Tom Chauveau <tom@dagger.io>
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.
The library ships its own generated bindings (src/api/client.gen.ts), and
vendoring the library here means owning their regeneration. Add the packager
module that does it, mirroring dagger/dagger's own clientLibrary generator.
The schema is the session's, not a module's: a plain session serves no modules,
so introspecting it yields the core API alone — unscrubbed, which is what a
library binds and what neither ModuleSource.introspectionSchemaJSON (scrubs
Host, currentWorkspace, ...) nor clientSchemaIntrospectionJSON (installs the
module it is called on) gives.
codegen introspectis the one subcommand that talks to the engine. It does soover plain HTTP against the nested session rather than through the Go SDK, so
the generation subcommands keep their only inputs as files and pull in no
dependency; it also only ever runs in this repo's own generate step, never in a
user's.
The bindings land where the library source expects them, so vendoring the rest
of the library later drops in around them. On their own they do not compile —
the runtime they import (../common/context.js) arrives with that source.
Signed-off-by: Tom Chauveau tom@dagger.io
Stack created with GitHub Stacks CLI • Give Feedback 💬