Repository navigation
Conversation
TomChv
force-pushed
the
feat/module-gen-cutover
branch
from
August 19, 2026 14:53
60ab175 to
5bb27c6
Compare
TomChv
force-pushed
the
feat/module-gen-cutover
branch
from
August 21, 2026 12:11
5bb27c6 to
2d94993
Compare
TomChv
force-pushed
the
feat/module-gen-cutover
branch
from
August 25, 2026 16:06
2d94993 to
170c5d5
Compare
TomChv
marked this pull request as ready for review
August 25, 2026 16:15
eunomie
approved these changes
Aug 26, 2026
TomChv
force-pushed
the
feat/module-gen-cutover
branch
from
August 28, 2026 11:24
170c5d5 to
68a16a1
Compare
TomChv
force-pushed
the
feat/module-gen-cutover
branch
from
August 28, 2026 12:26
68a16a1 to
5129f66
Compare
Route Mod.generate to this SDK's generator for dagger-module.toml modules, and keep delegating to the engine for dagger.json ones. A workspace module builds from its committed files, so what generate writes *is* what the runtime executes; a legacy module regenerates at call time anyway, and generating it here would only leave a second, differently-versioned copy on disk. Both routes run through generateStaged so `mod generate` and generate-all cannot pick different generators. Both keep the generateLocalDependencies staging: a dependent's schema is only loadable once its local deps' generated files exist, and dep generation may cross SDKs. That staging is scaffolding, not output, and each route has to take it back out a different way. The SDK route builds its changeset out of the unstaged workspace, so the deps never enter it. The engine route hands back a whole workspace instead, so this takes the module's own directory out of that result and lays it over the unstaged base — diffing the whole thing against the base would write the dependencies' generated files into the user's tree alongside the module they asked for, and diffing against the staged workspace instead cancels the module's own output whenever the engine has already generated it for a dependent. generate-legacy-deps covers the case; generate-deps already covered the SDK side. Staging the generated tree over the module's existing one, rather than in place of it, is what keeps the module's source and config out of the changeset — withNewDirectory swaps the whole directory, and staging only what we generate reports everything else as deleted. Applying to disk hides that; staging into a workspace does not, and the engine generates a dependency by doing exactly that. The cost of layering is that a file we stop generating is left behind, so regeneration prunes the `*.gen.ts` it owns first. Without it a dependency dropped from a module's config keeps its <dep>.gen.ts, exporting an API against a module that is no longer served, and a default tsc rejects the directory. Pruned in both the baseline and the workspace, for the same reason client generation does both. The typescript pin gets a check that can fail. Asserting it on a fixture that arrives pinned only proves generation left it alone, so the dependency fixture drops to a bare package.json — the shape a module has before its first generate — and the check asserts the pin appears. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
force-pushed
the
feat/module-gen-cutover
branch
from
August 28, 2026 13:17
5129f66 to
97514ea
Compare
Member
Author
|
Superseded by #39, which squashes this whole stack into a single PR off The stack had PRs overwriting each other — this one included — which made the intermediate states hard to reason about, and thirteen PRs each fanning out a full check suite made CI unreadable. Branch is left pushed, so nothing here is lost. |
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.
Mod.generate now generates dagger-module.toml modules here instead of routing
through the engine's built-in TypeScript runtime. dagger.json modules keep
delegating: that runtime regenerates everything at call time regardless, so
generating them here would only leave a second, differently-versioned copy of
the same files on disk.
Dependency-closure staging is kept for both paths — a dependent's schema can
only be loaded once its local deps' generated files exist, which is true no
matter who does the generating.
No .gitignore or .gitattributes is written. The engine appends to both around
codegen, but for a workspace module the ignore list reduces to
node_modules/.pnpm-store, which is the user's business rather than codegen's.
The new check asserts the tree contract rather than one marker file, because
that contract is enforced somewhere else entirely: the runtime does no codegen
for these modules, so a missing piece surfaces as a module that won't load at
dagger calltime, long after generate ran.Signed-off-by: Tom Chauveau [email protected]
Stack created with GitHub Stacks CLI • Give Feedback 💬