fix(bazel): make //:pkg consumable as an external Bzlmod module#106
Merged
Conversation
Two defects surfaced when scheduling-bridge consumed this module via bazel_dep + npm_link_package (the first non-leaf consumer): - scripts/svelte-package-bazel-wrapper.mjs resolved the -o output against the action cwd (BAZEL_BINDIR root). In an external-module build the declared output tree lives under bazel-out/.../bin/external/<repo>/, so svelte-package wrote outside the declared output and Bazel silently packaged an empty dist/. The output is now anchored next to the resolved input tree artifact, which is correct in both repo contexts. - //:scheduling_kit declared no npm deps, so consumers linking //:pkg got no package store entries for the kit's runtime dependencies and failed at import time (ERR_MODULE_NOT_FOUND on zod). drizzle-orm and zod are now declared; effect is deliberately left to the consumer's copy so effect identity stays shared across the package boundary. Validated: //:pkg, //:typecheck, //:test green in this workspace, and scheduling-bridge //:pkg //:typecheck //:test green consuming this tree via --override_module. Refs: scheduling-bridge#82
Jesssullivan
added a commit
that referenced
this pull request
Jun 11, 2026
- package.json, MODULE.bazel, BUILD.bazel aligned at 0.9.1 - regenerate docs/generated surfaces Patch release carrying the external-Bzlmod-module packaging fix (#106) so scheduling-bridge can consume //:pkg from the module graph (refs Jesssullivan/scheduling-bridge#82).
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.
Summary
scheduling-bridge is adopting pure-Bazel consumption of the kit (
bazel_dep+npm_link_packageof@tummycrypt_scheduling_kit//:pkg, refs Jesssullivan/scheduling-bridge#82). As the first non-leaf module consumed through the tinyland-inc/bazel-registry module graph, two latent defects surfaced:Empty
dist/in external-module builds.scripts/svelte-package-bazel-wrapper.mjsresolved-o distagainst the action cwd (BAZEL_BINDIRroot). When this module is built as an external module, declared outputs live underbazel-out/.../bin/external/tummycrypt_scheduling_kit+/, so svelte-package wrote outside the declared tree and Bazel silently packaged an emptydist/(declared tree artifacts are tolerated empty). The wrapper now anchors the output next to the resolved input tree artifact, which is correct in both the own-workspace and external-module contexts.No npm store entries for runtime deps.
//:scheduling_kitdeclared no npm deps, so consumers linking//:pkghad no package-store siblings for the kit's runtime dependencies and failed at import time (ERR_MODULE_NOT_FOUND: zod).drizzle-ormandzodare now declared on the packagedjs_library.effectis deliberately NOT linked: consumers declare their own copy and effect values cross the package boundary (re-exportedErrors), so a second linked copy forks runtime identity (instanceof) and breaks consumer declaration emit (TS2742).Validation
bazel build //:pkg //:typecheckandbazel test //:testgreen (local, disk cache, no RBE);bazel-bin/pkg/distpopulated as before.//:pkg,//:typecheck,//:test(158 vitest tests) green consuming this tree via--override_module=tummycrypt_scheduling_kit=<this checkout>.Release plan: 0.9.1 patch release follows, then registration in tinyland-inc/bazel-registry, then the bridge bumps its
bazel_depto 0.9.1.Refs Jesssullivan/scheduling-bridge#82