-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat(versionGroups): mark specific dependencies for removal #65
Comments
Hey @Aghassi, this should be possible now with the |
@JamieMason awesome thanks! Anyway I can help with this? |
Sure, thanks a lot. Putting each dependency into a semver/version group happens here, but you won't need to change this The logic for finding out if a given version group is valid or not happens here syncpack/src/bin-list/list-version-groups.ts Lines 24 to 32 in dea1675
The removal could probably happen around here: syncpack/src/bin-fix-mismatches/fix-mismatches.ts Lines 27 to 29 in dea1675
The harder question is deciding where this should be handled - throwing it in with version mismatches would be convenient The rules surface in a few different places too, like in list, list-mismatches, and fix-mismatches. Hope this is helpful and makes sense, thanks again David. EDIT: maybe adding "isAllowed: false" as a new prop returned from |
I've got a working version in this branch, could you give a try please @Aghassi and let me know if it works in your repo. |
Released in 7.2.1 |
Yep yep, let me upgrade to v7 and come back to this and fill you in |
@JamieMason just keeping you updated, I just landed the 7.x upgrade internally. I am at a conference this week, but will be trying the new features next week |
So I have two hurdles and maybe I'm doing it wrong so feel free to correct me When I enable EDIT: ignore versionGroups, see next comment versionGroups: [
{
isBanned: true,
dependencies: ['react'],
packages: ['**'],
},
], I'm curious if I'm misunderstanding the usage or if there is a good way to debug. My exact command for testing is EDIT My config looks like this module.exports = {
dev: true,
// Regex to filter what dependencies we care about.
filter,
indent: ' ',
peer: true,
prod: true,
resolutions: true,
overrides: true,
workspace: true,
semverRange: '',
sortAz: [
'contributors',
'dependencies',
'devDependencies',
'keywords',
'peerDependencies',
'scripts',
],
sortFirst: ['name', 'description', 'version', 'author'],
source: paths,
versionGroups: [
{
isBanned: true,
dependencies: ['react'],
packages: ['**'],
},
],
} |
Oh ignore me if a dependency is ignored and also in the is banned the ignored wins out. The silent success threw me off. |
The messaging could be cleaner but bans do work :)
I would just change the error to be something more useful. I think it would be nice to say |
Description
There are some cases were you may not want certain dependencies introduced into the codebase (for example, say your company uses Typescript, you wouldn't want people trying to introduce Flow). Having a way to have a disallow list would be nice.
Suggested Solution
Have a list in the config of disallowed dependencies to prevent them being added anywhere in the repo.
Help Needed
Mostly want to know if this fits the goal of this project before looking to add this feature, or if it's not the job of this project
The text was updated successfully, but these errors were encountered: