Repository navigation
Conversation
TomChv
force-pushed
the
feat/module-config-writers
branch
from
August 21, 2026 12:11
1de881b to
ce593e0
Compare
TomChv
force-pushed
the
feat/module-config-writers
branch
from
August 25, 2026 16:06
ce593e0 to
335e5b4
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-config-writers
branch
2 times, most recently
from
August 28, 2026 12:26
6fe7012 to
653642f
Compare
Module codegen needs the same package.json/tsconfig/deno.json writers init
already has — they were the module writers all along, just missing the one
thing codegen adds: the typescript pin.
It is not cosmetic. The runtime mounts its own prebuilt compiler, and skips
dependency installation entirely for an otherwise dependency-free module, only
when the pin matches the engine's default; without it every `dagger call` pays
for a package-manager install. Deno has no node_modules to fall back on, so it
gets the same pin through its import map.
A module that picked its own version keeps it, and that means looking in both
dependency sections: devDependencies is where a compiler normally goes, and
writing dependencies.typescript beside one leaves the module declaring two
versions of the same package — which npm resolves to the runtime one, quietly
overriding the compiler the user chose.
Format everything we write while we are here. sjson edits in place, which reads
as "preserve the user's formatting" but only holds for the parts it does not
touch: keys it adds are appended compactly, and a file created from scratch —
every fresh module — comes out entirely inlined. Indenting reformats an
existing file's whitespace, which is a real cost, but these are committed config
files people read and edit; emitting them minified is worse. The width stays at
pretty's own default rather than zero, so a short array like the
@dagger.io/dagger path alias keeps to one line, exactly as the engine's writer
leaves it.
Two init assertions had encoded the old output shape ("type":"module" with no
space) and now read the way the file does.
Ignore the helper binaries a bare `go build` drops in a helper directory. Every
.dang caller builds them inside a Linux container, so a local one is never read
— only committed by accident.
Signed-off-by: Tom Chauveau <[email protected]>
TomChv
force-pushed
the
feat/module-config-writers
branch
from
August 28, 2026 13:17
653642f to
a247b51
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. |
TomChv
added a commit
that referenced
this pull request
Oct 9, 2026
…erate A module written by a v0.21 engine carries a .gitignore naming sdk/ and __dagger.entrypoint.ts, because its runtime regenerated both on every call. A 1.0 module commits them, the trusted runtime does no codegen, and source loading honours .gitignore before the runtime sees the tree, so the two lines hide the very files the module requires: `committed generated file "sdk/client.gen.ts" is missing`, with the file on disk. dagger/dagger#13720 taught `dagger setup` to remove exactly those lines, but it learns them by running the legacy SDK's codegen, which an SDK-module provider like this one does not implement, so for a module this SDK converts the engine removes nothing — and this SDK's own dagger.json conversion never touched the file either (SDK Main-Engine Test Run, 2026-10-07 — issue #25, case G14). generateScope now takes the `/sdk` (or `/sdk/`) and `/__dagger.entrypoint.ts` lines out of the module's .gitignore with the same semantics as #13720: only those exact root-anchored lines, every other line kept byte for byte, a removed line taking only its own terminator, the file written only when a line went, never created, and left in place when emptied. It runs on every generation under either loading path, because a manifest written by an earlier SDK version or by `dagger setup` has already lost the dagger.json that marks a migration, and before the first module load of the run, because a workspace-backed module source applies the .gitignore too and would hide the staged sdk/ from the self client's load. Three e2e checks cover it on the legacy-deps fixture pair: the lines go and the rest survives verbatim, a second generation leaves the file untouched (asserted on the changeset layer), and a module with no .gitignore or one naming no generated file is not written. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
added a commit
that referenced
this pull request
Oct 9, 2026
…erate A module written by a v0.21 engine carries a .gitignore naming sdk/ and __dagger.entrypoint.ts, because its runtime regenerated both on every call. A 1.0 module commits them, the trusted runtime does no codegen, and source loading honours .gitignore before the runtime sees the tree, so the two lines hide the very files the module requires: `committed generated file "sdk/client.gen.ts" is missing`, with the file on disk. dagger/dagger#13720 taught `dagger setup` to remove exactly those lines, but it learns them by running the legacy SDK's codegen, which an SDK-module provider like this one does not implement, so for a module this SDK converts the engine removes nothing — and this SDK's own dagger.json conversion never touched the file either (SDK Main-Engine Test Run, 2026-10-07 — issue #25, case G14). generateScope now takes the `/sdk` (or `/sdk/`) and `/__dagger.entrypoint.ts` lines out of the module's .gitignore with the same semantics as #13720: only those exact root-anchored lines, every other line kept byte for byte, a removed line taking only its own terminator, the file written only when a line went, never created, and left in place when emptied. It runs on every generation under either loading path, because a manifest written by an earlier SDK version or by `dagger setup` has already lost the dagger.json that marks a migration, and before the first module load of the run, because a workspace-backed module source applies the .gitignore too and would hide the staged sdk/ from the self client's load. Three e2e checks cover it on the legacy-deps fixture pair: the lines go and the rest survives verbatim, a second generation leaves the file untouched (asserted on the changeset layer), and a module with no .gitignore or one naming no generated file is not written. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
added a commit
that referenced
this pull request
Oct 9, 2026
…erate (#76) A module written by a v0.21 engine carries a .gitignore naming sdk/ and __dagger.entrypoint.ts, because its runtime regenerated both on every call. A 1.0 module commits them, the trusted runtime does no codegen, and source loading honours .gitignore before the runtime sees the tree, so the two lines hide the very files the module requires: `committed generated file "sdk/client.gen.ts" is missing`, with the file on disk. dagger/dagger#13720 taught `dagger setup` to remove exactly those lines, but it learns them by running the legacy SDK's codegen, which an SDK-module provider like this one does not implement, so for a module this SDK converts the engine removes nothing — and this SDK's own dagger.json conversion never touched the file either (SDK Main-Engine Test Run, 2026-10-07 — issue #25, case G14). generateScope now takes the `/sdk` (or `/sdk/`) and `/__dagger.entrypoint.ts` lines out of the module's .gitignore with the same semantics as #13720: only those exact root-anchored lines, every other line kept byte for byte, a removed line taking only its own terminator, the file written only when a line went, never created, and left in place when emptied. It runs on every generation under either loading path, because a manifest written by an earlier SDK version or by `dagger setup` has already lost the dagger.json that marks a migration, and before the first module load of the run, because a workspace-backed module source applies the .gitignore too and would hide the staged sdk/ from the self client's load. Three e2e checks cover it on the legacy-deps fixture pair: the lines go and the rest survives verbatim, a second generation leaves the file untouched (asserted on the changeset layer), and a module with no .gitignore or one naming no generated file is not written. Signed-off-by: Tom Chauveau <[email protected]>
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.
Module codegen needs the same package.json/tsconfig/deno.json writers init
already has — they were the module writers all along, just missing the one
thing codegen adds: the typescript pin.
It is not cosmetic. The runtime mounts its own prebuilt compiler, and skips
dependency installation entirely for an otherwise dependency-free module, only
when the pin matches the engine's default; without it every
dagger callpaysfor a package-manager install. Deno has no node_modules to fall back on, so it
gets the same pin through its import map.
Both use setIfNotExists, so a module that picked its own version keeps it and
accepts the install rather than being silently retargeted. Existing
expectations updated for the new output, with explicit cases for the
preservation path.
Signed-off-by: Tom Chauveau [email protected]
Stack created with GitHub Stacks CLI • Give Feedback 💬