Add missing test/setup-scm-loader.ts preload for .scm imports - #1286
Open
lab1207 wants to merge 1 commit into
Open
Add missing test/setup-scm-loader.ts preload for .scm imports#1286lab1207 wants to merge 1 commit into
lab1207 wants to merge 1 commit into
Conversation
cli/bunfig.toml lists test/setup-scm-loader.ts among its preloads, but the file was never exported to the public mirror. Any test reaching the SDK barrel (which re-exports code-map, which imports .scm tree-sitter query files) threw "Unknown file type" at import time, which bun surfaces as an unhandled error between tests — a fresh clone showed a wall of dead test files with no obvious cause. The plugin registers a bun loader that imports .scm files as a default-exported string, matching what the bundled build does. Verified against the CLI suite: 1,576 pass, with only the pre-existing Windows-path failures in export-conversation.test.ts remaining (unrelated). 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
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.
Problem
cli/bunfig.tomllists three test preloads:But
test/setup-scm-loader.tsdoes not exist in the public mirror. Any test thatreaches
@codebuff/sdk(which re-exports code-map, which imports.scmtree-sitter query files) dies at import time with "Unknown file type" — which bun
reports as "Unhandled error between tests", so a fresh clone shows a wall of
failing test files with no obvious cause. (The same file is referenced in
docs/testing.md, there under a corrupted path
../test/n.ts.)Fix
One new file: a bun
plugin()that loads.scmimports as a default-exportedstring — the same thing the bundled build does. Registered via the preload that
bunfig.toml already declares, so no config change is needed.
Verification
cd cli && bun test src/commands src/utils/__tests__ src/state:export-conversation.test.ts (expects
/project/..., gets\project\...) —present on main without this change, happy to file a separate issue for those
Tested on Windows 11 / bun 1.3.14.