Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"name": "polyfill",
"source": "github.com/dagger/polyfill@main",
"pin": "e90bbfc4843258a877a3a95b8db1571e7981e65f"
"pin": "16627066d1852106320bdc0cfa0e5f901efe5970"
}
],
"source": "."
Expand Down
5 changes: 4 additions & 1 deletion mod.dang
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ type Mod {
if (skipGenerate(ws)) {
polyfill.workspace(ws).fork.changes
} else {
polyfill.workspace(ws).moduleSource("/" + rootPath).generate.changes
# Stage the local dependency closure so this module's codegen sees
# up-to-date dependency bindings before generating it.
let stagedWs = ws.withChanges(polyfill.workspace(ws).moduleSource("/" + rootPath).core.generateLocalDependencies(ws))
polyfill.workspace(stagedWs).moduleSource("/" + rootPath).generate.changes
}
}
}
7 changes: 6 additions & 1 deletion typescript-sdk.dang
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,12 @@ type TypescriptSdk {
modules(ws)
.filter { mod => mod.skipGenerate(ws) == false }
.reduce(pws.fork) { fork, mod =>
fork.merge(pws.moduleSource("/" + mod.rootPath).generate)
# Stage this module's local dependency closure first (leaf-first, possibly
# across SDKs) so its codegen sees up-to-date dependency bindings. The dep
# codegen is ephemeral: it appears in both the fork's before and after, so
# it cancels in the merge, leaving only each module's own changes.
let stagedWs = ws.withChanges(pws.moduleSource("/" + mod.rootPath).core.generateLocalDependencies(ws))
fork.merge(polyfill.workspace(stagedWs).moduleSource("/" + mod.rootPath).generate)
}
.changes
}
Expand Down