-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(devkit): support pnpm catalogs #30036
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit 608a369.
☁️ Nx Cloud last updated this comment at |
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 util is used to get version numbers which are later used with semver helper methods, see:
nx/packages/angular/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.ts
Lines 16 to 21 in 2d19500
const version = checkAndCleanWithSemver('tailwindcss', tailwindVersion); | |
if (lt(version, '2.0.0')) { | |
throw new Error( | |
`The Tailwind CSS version "${tailwindVersion}" is not supported. Please upgrade to v2.0.0 or higher.` | |
); | |
} |
As such, we can't really just return the version with the catalog:
protocol still there as that would result in downstream code failing as its expecting a semver.
I think to truly fix the issue you are seeing we'd need to be able to resolve the version, but I also don't love putting custom code in here for parsing pnpm-workspace.yaml and such.
@AgentEnder, what are you suggesting? Would using a parser to retrieve the pnpm version number be alright if it is not colocated in this file? |
Current Behavior
nx generate plugin
throws the following error if a package like typescript is using the PNPM catalog feature in the package.json:This is due too the semver validation that fails with the catalog.
Expected Behavior
If I am using a pnpm catalog, the package dependency should not be checked for a valid semver.
Related Issue(s)
Fixes #30035