fix(build): resolve @stacksjs/actions subpath when compiling the CLI - #2247
Merged
Conversation
`"@stacksjs/*": ["./*/src"]` binds the wildcard to the whole remainder, so
`@stacksjs/actions/blog` looked for `./actions/blog/src`, missed, and fell back
to `actions/dist/blog.js` — which nothing builds before the compile job:
error: Could not resolve: "@stacksjs/actions/blog"
at core/buddy/src/production-server.ts:370:53
error: script "compile:linux-x64" exited with code 1
This is the same entry I added in #2223 and then removed, because it appeared
to turn `core/config` and `core/env` tests red. It did not. That was the
load-order race in the config overrides fallback, fixed in #2246 — the entry
perturbed module resolution enough to expose it, which is also how a package.json
dependency in #2244 managed to "break" the same two packages.
With #2246 landed, `core/config` + `core/env` pass locally with this applied
(322 tests), and the CLI bundles 1933 modules and links.
Closes #2242
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.
Closes #2242. Takes
compilegreen — the last of main's three red CI jobs after #2223 (typecheck) and this.The fix
One
pathsentry:@stacksjs/*binds the wildcard to the whole remainder, so@stacksjs/actions/bloglooked for./actions/blog/src, missed, and fell back toactions/dist/blog.js. Nothing builds workspace packages before the compile job, so:Why this was reverted once, and why it is safe now
This is the same entry I added in #2223 and then removed, because it appeared to turn
core/configandcore/envtests red. It did not.That was the load-order race in the config overrides fallback, fixed in #2246:
defaultsForOverrides()omittedapp.url, soexpect(typeof app.url).toBe('string')passed or failed on whether the async config load won. This entry perturbed module resolution enough to expose it — which is exactly how apackage.jsondependency in #2244 also managed to "break" the same two packages. Two changes with nothing in common except that they moved resolution around; that was the signature I misread as "the tsconfig entry is at fault".With #2246 on main:
core/config+core/envwith this applied: 322 pass, 0 failNote on scope
Only
@stacksjs/actions/*. Thebrowser/composables/desktop-buildentries stay incore/tsconfig.jsonwhere they fix typecheck; this file is extended by mostcore/*package tsconfigs, so it governsbun testresolution too and deserves the narrower footprint. That asymmetry is commented in both files.