Skip to content

Commit f29fd1f

Browse files
anthonyshewclaude
andauthored
fix(boundaries): Enable import attributes parsing (#11053)
## Summary Fixes #10961 - Enables parsing of import attributes (the `with` keyword syntax) in the `turbo boundaries` command. ## Details The issue was that PR #10078 fixed import attributes parsing for `turbo-trace` but didn't apply the same fix to the boundaries module. This caused the boundaries command to fail with "Expected ';', got 'with'" when encountering modern import syntax like: ```js import pkg from './package.json' with { type: 'json' }; ``` ## Changes - Added `import_attributes: true` to the SWC ES syntax configuration in `crates/turborepo-lib/src/boundaries/mod.rs:437` - Added test fixture with import attributes to verify the fix works ## Test Plan - [x] Built the project successfully - [x] Verified boundaries command now parses files with import attributes without errors - [x] Added test fixture file with import attributes that gets checked by integration tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <[email protected]>
1 parent 4e852e1 commit f29fd1f

File tree

5 files changed

+15
-41
lines changed

5 files changed

+15
-41
lines changed

crates/turborepo-lib/src/boundaries/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ impl Run {
434434
} else {
435435
Syntax::Es(EsSyntax {
436436
jsx: true,
437+
import_attributes: true,
437438
..Default::default()
438439
})
439440
};

crates/turborepo/tests/snapshots/boundaries__boundaries_get_boundaries_lints_([email protected]).snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ expression: query_output
2626
"message": "import `../../packages/another/index.jsx` leaves the package",
2727
"import": "../../packages/another/index.jsx"
2828
},
29+
{
30+
"message": "import `../../packages/utils/data.json` leaves the package",
31+
"import": "../../packages/utils/data.json"
32+
},
2933
{
3034
"message": "import `@/../../packages/another/index.jsx` leaves the package",
3135
"import": "@/../../packages/another/index.jsx"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Test import attributes parsing
2+
import pkg from './package.json' with { type: 'json' };
3+
import data from '../../packages/utils/data.json' with { type: 'json' };
4+
5+
console.log(pkg.name);
6+
console.log(data);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "test-data",
3+
"value": 42
4+
}

turborepo-tests/integration/tests/command-boundaries.t

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)