-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Support multipackage monorepos #1534
Comments
It's a good point, yes the monorepo approach is becoming popular as a git optimization. But that doesn't mean it is a package management optimization. Personally I prefer to clone all my packages into a single "project" folder, and then link between the subfolders, which provides an equivalent development experience to a monorepo. With the monorepo approach, rather than installing From a technical perspective, installing from subfolders within a package is not possible anyway as packages need to have a well-defined package format and can't use arbitrary numbers of |
Just to provide a bit more context, yesterday I found out that this is a subject that has been brought to the table since 2012 at NPM's issues: npm/npm#2974 If I had seen that before I should have known there's no easy answer. |
Tools like bazel, lerna and yarn workspaces have helped to achieve better experience for monorepo based repositories. This seems like critical in adopting JSPM. Do you have change of thought on the subject @guybedford ? |
@fusionstrings yes there is a sort of a local monorepo pattern for jspm, just give me a few days to test that it is working smoothly before sharing further. |
I finally managed to put together my thoughts on this topic in #2491. There are still some linking features / bugs that need working out as are being tracked there. Would really value your feedback further on that too! |
A few big projects are embracing the monorepo approach (For example babel, Ember, React and soon Turf, or so it seems) without giving up their multipackage structure.
The thing is, instead of separating packages physically in the form of N repos (which tend to become a real mess) those project resort to a logical separation. They have a
packages
folder in which each subfolder is a package by itself with its ownpackage.json
, thus allowing for code reutilization at an atomic level.Tools like babel are using lerna to publish the contents of each subfolder as an NPM package, so people can build babel-like projects that need only a few individual packages. However, I believe that step to be overkill for a tool like jspm. We don't need to have NPM as a man in the middle if there's a folder convention.
Currently, when using jspm-cli to install a component from a github repo, we work under the assumption that there's a
package.json
in the root, like sowill look for https://github.com/facebook/react/blob/master/package.json
That behavior could remain untouched, but we could add support for a syntax like
Which will instead use https://github.com/facebook/react/blob/master/packages/react-dom/package.json to figure out the entry point and eventual dependencies.
The text was updated successfully, but these errors were encountered: