-
-
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(groups): target instances by specifier type #163
Comments
Something roughly like this could potentially be possible using some new internals coming soon. For a totally made up example the new functionality might look something like this on a versionGroup: {
"versionGroups": [
{
# for any dependency (react, lodash etc)
"dependencies": ["**"],
# in devDependencies and peerDependencies only
"dependencyTypes": ["dev", "peer"],
# in every package in the monorepo
"packages": ["**"],
+ # using version specifier "*" only
+ "specifierTypes": ["latest"],
# ignore them
"isIgnored": true
}
]
} The internal types which could be exposed as possible values are:
In your case though, especially because this will take a while, might you be better to set and check some environment variables to help decide when to run certain tasks or not? Thanks a lot for the detailed issue. Finally, if you or anyone reading this finds syncpack useful, please tell people about it – it's completely free and has been a ton of work, please help us spread the word – thanks! |
I like the
I did look into this, but did not find a way. The tool does not do this. And otherwise, there is no way to distinguish one My simplified example using CLI is almost literally all that the tool does under the hood. Imagine if my CLI example was wrapped into a single shell script, that you have no influence of. The only changes I could make are to our environment, e.g. edit
Thank you for all your hard work, Jamie. I am certainly talking about the tool :) |
One way I could achieve this, perhaps, is to read every Something along the lines of: check-versions && syncpack || true |
- check-versions && syncpack || true
+ check-versions && syncpack list || true EDIT: I see what you mean now, |
Right, my example was oversimplified, we run it with exact command and config file flag and all that 😁 |
Released in 12.2.0. 👋 If anyone reading this finds syncpack useful, please tell people about it. |
Description
Our use case is a bit of an edge case, and is not a problem with syncpack. But I am wondering if a solution could be introduced as a feature to deal with this.
A tool we use for repo management has a workflow that goes like this:
npm install foo
)package.json
file with the new dependency using*
as a placeholder.{pnpm,npm,yarn} install
, to install the*
version, which is a SemVer way of saying "latest".require.resolve('my-package')
to get the package location and then readspackage.json
to get the version.package.json
again, and sets the actual version.This can be also reproduced and visualized without a particular tool, with just
npm
and CLI:The problem occurs because of the way we use
syncpack
. It runs aspostinstall
script. And there's no way to discriminate the first install from the second install. So it runs twice.And when it runs the first time, the version is still
*
. Syncpack will set this version across the whole workspace (monorepo). Correctly so, of course, as it is ultimately the highest version, as far as SemVer is concerned.But in our case, it is only transient, but it affects all other packages.
The temporary fix for us was to set
preferVersion
tolowestSemver
, but this introduces other problems, that I won't get into, as they are not really important here.Suggested Solution
I'd like to be able to ignore certain SemVers, notably
*
.Help Needed
N/A
The text was updated successfully, but these errors were encountered: