-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(js): .swcrc path option should follow existing conventions #10127
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@AgentEnder, I noticed a couple of issues with #10118, which I've PRd a fix for here. I don't think this is the right solution because the behaviour is now unpredictable (i.e. it looks like you can provide a path relative to the workspace root, but it always resolves ot the package root) but wanted to put something out there to get the ball rolling. If having a default value in
I appreciate there are different types of misdirection from each of these solutions. |
@djgrant, I see where you are coming from on this, and it's probably a good thing to standardize them. We are looking at supporting the I'd recommend holding off on string replacement for that reason. Additionally, this has already been released as of this morning since 14.1.0 was pushed out. We can still change this, but it'll require a migration now in case anyone has already taken it up. If you feel comfortable writing a migration, here's how I'd imagine the implementation:
|
BREAKING CHANGE: swcrcPath –> swcrc
BREAKING CHANGE: swcrcPath –> swcrc
As the default needs to be defined in swc.impl.ts to resolve relative to the project root, the default is documented in the schema.json description.
As the default needs to be defined in swc.impl.ts to resolve relative to the project root, the default is documented in the schema.json description.
@AgentEnder thanks for the guidance on this. I've had a crack at it and tested locally. Let me know if there's anything I've missed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, do you care to update the migration version and we can get it merged?
packages/js/migrations.json
Outdated
}, | ||
"update-swcrc-path": { | ||
"cli": "nx", | ||
"version": "14.1.1-beta.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14.1.1 has been released already, can you bump this to 14.1.5-beta.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
While testing #10118 locally, I noticed a couple of potential issues that should perhaps be addressed before release:
swcrcPath
is not named consistently with other options e.g.tsConfig
,packageJson
swcrcPath
is resolved relative to the project roots, whereastsConfig
andpackageJson
are resolved relative to the workspace rootExpected Behavior
The implementation follows the same approach as themain
option – the option is resolved relative to the project path if the project path is not in the string.Update:
swcrc
path is alway resolved relative to the workspace root.The reason for following this implentation is that the default value defined in
schema.json
is static so cannot include the relative project path (unless we introduce some kind of string replacement e.g.$projectRoot/.lib.swcrc
). This is not an issue withtsConfig
andpackageJson
as they are required options.Related Issue(s)
#10058