这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@anthonyshew
Copy link
Contributor

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:

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

  • Built the project successfully
  • Verified boundaries command now parses files with import attributes without errors
  • Added test fixture file with import attributes that gets checked by integration tests

🤖 Generated with Claude Code

Enables parsing of import attributes (the `with` keyword syntax) in the boundaries command by setting `import_attributes: true` in the SWC parser configuration. This was previously fixed for turbo-trace in PR #10078 but was missing from the boundaries module, causing parse errors when encountering syntax like `import x from 'y' with { type: 'json' }`.

Fixes #10961

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@anthonyshew anthonyshew requested a review from a team as a code owner November 5, 2025 06:01
@anthonyshew anthonyshew requested a review from tknickman November 5, 2025 06:01
@vercel
Copy link
Contributor

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
examples-basic-web Ready Ready Preview Comment Nov 5, 2025 6:33pm
examples-designsystem-docs Ready Ready Preview Comment Nov 5, 2025 6:33pm
examples-gatsby-web Ready Ready Preview Comment Nov 5, 2025 6:33pm
examples-kitchensink-blog Ready Ready Preview Comment Nov 5, 2025 6:33pm
examples-nonmonorepo Ready Ready Preview Comment Nov 5, 2025 6:33pm
examples-svelte-web Ready Ready Preview Comment Nov 5, 2025 6:33pm
examples-tailwind-web Ready Ready Preview Comment Nov 5, 2025 6:33pm
examples-vite-web Ready Ready Preview Comment Nov 5, 2025 6:33pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
turbo-site Skipped Skipped Nov 5, 2025 6:33pm

anthonyshew and others added 3 commits November 4, 2025 23:18
Updates the test file to match the actual output from the boundaries command:
- Adjusts patching file order pattern to handle all three files (import-attributes.js, index.ts, types.ts)
- Adds glob patterns to handle trailing whitespace differences
- Fixes blank line expectations in git diff output

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@anthonyshew
Copy link
Contributor Author

Merging past known CI flakes.

@anthonyshew anthonyshew merged commit f29fd1f into main Nov 5, 2025
52 of 56 checks passed
@anthonyshew anthonyshew deleted the fix-import-attributes branch November 5, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Boundaries cannot parse import attributes

2 participants