Replies: 34 comments 22 replies
-
There are some issues with Yarn's approach, which npm 7 adopted as well. First of all, they use the noun "workspace" to call a package inside the monorepo. Which is not what most people expect, according to the polls I did on Twitter. A workspace usually means a set of projects in IDE world. The second issue is that it is much harder to find the root of the workspace, when that info is declared in package.json. It is not enough to find the first I cannot object if most of the users want this change but then we'll have to do a lot of renamings in the repository. |
Beta Was this translation helpful? Give feedback.
-
@zkochan Thanks for speedy answer.
|
Beta Was this translation helpful? Give feedback.
-
I am not convinced yet that Yarn's approach can be considered a standard. Lerna is still very popular and uses a separate file. pnpm uses a separate file and Rush uses a |
Beta Was this translation helpful? Give feedback.
-
Reusing the same package.json key could give the expectation that pnpm needs to behave identically to other monorepo managers. There was a similar backtracking of |
Beta Was this translation helpful? Give feedback.
-
Let's hear what others think cc @pnpm/collaborators |
Beta Was this translation helpful? Give feedback.
-
Does pnpm still require YAML for lockfiles? |
Beta Was this translation helpful? Give feedback.
-
yes pnpm-lock.yaml also, Yarn uses yaml for its lockfile as well. |
Beta Was this translation helpful? Give feedback.
-
I personally prefer |
Beta Was this translation helpful? Give feedback.
-
@zkochan It may not and should not be in first place. The proposal is for the sake of interoperability/coherence between tools only.
@zkochan Primary maintainers may discontinue the project in favor of other tools like
@statianzo Good point. I've updated description, checkout. Such expectations are completely unwarranted. No further compliance with existing tools is required by this proposal. |
Beta Was this translation helpful? Give feedback.
-
My 0.50 cents. Long story short, I prefer to have a separate file, either is only for workspaces or anything else. I'd rather prefer to see a One reason is, the
There are other examples, as Having a separate file you have more options to scale, avoid collisions, and is way easier to read and recognize the origin. I understand is more convenient to have everything in the Having this, you can workout nice stuff like better IDE strategy for autocomplete or stuff like that (vcode extensions), I think this is hardly possible using the |
Beta Was this translation helpful? Give feedback.
-
@juanpicado Thanks for sharing. My proposal doesn't concern |
Beta Was this translation helpful? Give feedback.
-
The issue for supporting |
Beta Was this translation helpful? Give feedback.
-
Personally, I think it would be best to keep everything inside a separate file. The |
Beta Was this translation helpful? Give feedback.
-
@ematipico |
Beta Was this translation helpful? Give feedback.
-
@zkochan Rather than worrying about this, I guess you can have a sort of CLI option supporting both 😅 While I personally like |
Beta Was this translation helpful? Give feedback.
-
IMHO no package manager ever has to care about looking like npm or using the same files as npm. I don't think any package manager has even to use The only rightful concerns are the ability to release packages to the npm registry (and that includes generating a valid npm-compatible |
Beta Was this translation helpful? Give feedback.
-
There is no reason to change anything and why I would strongly opt against adapting the
=> Adopting now More reasons:
|
Beta Was this translation helpful? Give feedback.
-
I agree with @desmap on this one. Having a distinction for pnpm is an advantage imho. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
@pie6k Thanks for your opinion. Seems like nobody gets the point of backward compatibility. Unique way of configuration isn't always good if it comes at cost of learning new things. @zkochan That's right. This is proposal, not a bug report. |
Beta Was this translation helpful? Give feedback.
-
I don't see a need for interoperability between package managers. I don't use pnpm only because it's faster than yarn, I use it because it's safer and the DX is better. I couldn't care less about it not being interoperable with package managers I have no intention of using. I would argue that, on the contrary, interoperability is harmful. Because people may just run npm or yarn because they can, with horrible results. Anything that would finally not require relying on hacks like |
Beta Was this translation helpful? Give feedback.
-
For me and my team, there is great utility is using pnpm as a direct replacement for npm. Following npm's design decisions directly reduces the friction of using pnpm. If I can tell my team that they can just run the following and carry on, that's a good day alias npm="pnpm" Extending features and behaving as a superset is fine, of course, but learning tooling is what gets JavaScript the most criticism |
Beta Was this translation helpful? Give feedback.
-
Will we support |
Beta Was this translation helpful? Give feedback.
-
Related PR: #5554 |
Beta Was this translation helpful? Give feedback.
-
I am in favor of
What about
|
Beta Was this translation helpful? Give feedback.
-
Having two separate files (root So coming from I would say having a separate file adds a lot of friction but little value for the end-users. In general I would agree that polluting |
Beta Was this translation helpful? Give feedback.
-
I am fairly new to using pnpm as a package manager but absolutely love it. However I came across a recent issue when I setup a next.js app in my monorepo. The monorepo was setup as follows:
where packages:
- 'packages/apps/*'
- 'packages/libs/*' Now, when I navigate into the When I run I had to add this section to my root "workspaces": [
"packages/apps/*",
"packages/libs/*"
], Assuming I have not made some fundamental mistake here then this seems like unnecessary duplication to me. So I too would vote to adopt the use of |
Beta Was this translation helpful? Give feedback.
-
I also think it seems daft to have to pollute the root of my repo with yet another config file—in this case with a lengthy name—only to contain a couple of lines… packages:
- packages/* |
Beta Was this translation helpful? Give feedback.
-
Moving away from pnpm for this sole reason. There are some enterprise tools that you to just use yarn and npm when you upload a package on their systems. We would have liked to keep pnpm for local development - which would have been fine, had it supported the package.json workspace option. In that case locally we'd use pnpm, but that's not an option it seems. |
Beta Was this translation helpful? Give feedback.
-
Since catalogs configs added to |
Beta Was this translation helpful? Give feedback.
-
I propose to deprecate
pnpm-workspace.yaml
in favor ofpackage.json#workspaces
field.Rationale
Other tools tend to use root
package.json
as starting point of configuration for monorepo project. At least two useworkspaces
field for glob patterns (as of November 4, 2020). Here is a small comparison between tools:pnpm-workspace.yaml
packages: ...
package.json
workspaces: [...]
package.json
workspaces: [...]
lerna.json
packages : [...]
rush.json
projects : [ {packageName: ... }... ]
Pros
pnpm-workspace.yaml
#2614 Custom location forpnpm-workspace.yaml
#1197(assuming no other
pnpm
features are YAML-bound)Cons
workspaces:
definitions (highly unlikely)workspaces
by third-party tools may cause false-positivie "bug" reports due to false expectations from consumerspnpm-workspace.yaml
topackage.json#workspaces
Steps to deprecate
pnpm-workspace.yaml
package.json#workspaces
field instead ofpnpm-workspace.yaml
in first placeBeta Was this translation helpful? Give feedback.
All reactions