-
Notifications
You must be signed in to change notification settings - Fork 239
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
[RRFC] Workspaces: support to version specifiers other than semver ranges #301
Comments
It seems like anything that Why would the specifier "type" make a difference if the dependency is in the workspace? |
I'm sorry I haven't been available to attend but has this issue seen any movement? @isaacs @ruyadorno |
@jsg2021 yeah most definitely there were lots of discussions during the meetings. Long story short, this spawned a larger conversation about revamping the workspaces install algorithm and we're looking to propose these changes as its own RFC. |
@ruyadorno thank you for the update. Again, I'm sorry for the delay in responding. This last month has been crazy. It seams that the larger conversion seems to have hijacked my initial issue: supporting git versioned dependencies within the workspace. From the rfc meeting I was able to attend, it sounded like @isaacs had an idea for this, like a low hanging fruit. I really hope we can move forward with this without the larger discussion blocking it. For reference, I'm currently working with a workspace of 50+ projects, with each depending on several of the other projects within the workspace. As it is now, when installing this workspace I effectively clone each project 10 times over instead of just linking. I have worked around by adding a post-install script that deletes these extra clones. It's just a minor annoyance for me, since I have a pretty fast internet connection. However, I have a colleague whose only internet option is a cellular tether. This is particularly painful for him. |
@ruyadorno @isaacs Could I get a link to look into, so I may make a local patch? |
@ruyadorno @isaacs I now have several colleagues on slow internet connections where our workspace install takes over an hour. Skipping the git versioned deps (which are in the workspace) should speed this up tremendously. |
It would also be great if there was the possibility to specify "variables" or some kind of placeholder. $ cat package.json
{
"workspaces": ["a", "b"],
"dependencies": {
"xyz": "^1.2.5"
},
"devDependencies": {
"abc": "^2.0.0"
}
}
$ cat a/package.json
{
"dependencies": {
"xyz": "workspace",
"bar": "workspace/b",
},
"devDependencies": {
"abc": "workspace"
}
}
$ cat b/package.json
{
"dependencies": {
"bar": "^1.0.0",
},
"devDependencies": {
"abc": "workspace"
}
} |
Currently, workspaces only support semver-range version specifiers in order to link a pkg:
Semver ranges when used as version specifiers are primarily used to fetch packages from the configured registry, e.g:
The workspaces implementation take advantage of the rather flexible nature of semver-range-matching in order to favor local workspaces symlinking instead of downloading packages from the registry:
Other version specifiers
From
npm-package-arg
we can see that the npm installer supports many other different types of version specifiers:git
- A git repotag
- A tagged version, like "foo@latest"version
- A specific version number, like "[email protected]"range
- A version range, like "[email protected]"file
- A local .tar.gz, .tar or .tgz file.directory
- A local directory.remote
- An http url (presumably to a tgz)Supporting different version specifiers
Here are some of the initial questions I'd love to get some feedback over here and also during one of our RFC calls:
References
Original issue by @jsg2021: npm/cli#1942
The text was updated successfully, but these errors were encountered: