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

Conversation

@NicholasLYang
Copy link
Contributor

Description

Support import attributes. Also bumps our prettier version so prettier can format import attributes.

Testing Instructions

Adds a test for them.

@NicholasLYang NicholasLYang requested a review from a team as a code owner March 3, 2025 21:45
@vercel
Copy link
Contributor

vercel bot commented Mar 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 8:41pm

@NicholasLYang NicholasLYang merged commit 8016cdc into main Mar 5, 2025
39 checks passed
@NicholasLYang NicholasLYang deleted the fix/support-import-attributes branch March 5, 2025 21:08
anthonyshew added a commit that referenced this pull request Nov 5, 2025
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 added a commit that referenced this pull request Nov 5, 2025
## 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 <noreply@anthropic.com>
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.

3 participants