-
Notifications
You must be signed in to change notification settings - Fork 3k
npm should init/update submodules when installing from git url #1876
Comments
Yea, that would be cool. +1. |
Still cool. +1 |
@isaacs would you merge a PR that implemented this? |
Sure. |
👍 +1
|
Maybe we can just add |
@alexeyraspopov might as well submit a PR, this issue has been hanging around for awhile |
see #3343 but maybe i can do a PR after some other npm-cache related PR/issues are resolved (#4667, #4824, #4965). maybe we can checkout the revision + update submodules + tar the whole directory OR just copy the files without taring (not sure about that at all). just now i tried to install |
Due to npm/npm#1876 can't link Protagonist nicely via package.json. This workaround seems to work.
Since 00ecb61 for #6400, we no longer use One thing is caching. The current handling of git remotes re-uses local mirrors of remote repos to store relevant data. Should we leverage this mechanism for submodules as well? If so, we can't let a single git invocation do all the work, but need to do a lot more work in npm. We'd have to iterate over submodules and to recurse into them ourselves. We'd have to look at how The other thing is configurability. Usually a submodule is considered a dependency which we need, so updating and initializing is the right thing to do. But what if a project uses submodules for the web site with all its huge videos? Or the repository of huge test cases? Or some company-internal style checking tool which is not available to other users? In short, there may be reasons for packages to better not initialize their submodules automatically. And the choice is likely per package, not per user. Should we introduce a |
|
@othiym23 Did I get you right?
Theoretically it would be conceivable that some people depend on submodules not being initialized. E.g. they might have some machinery to do so automatically, and that machinery might break if the repo is already initialized by npm. Unlikely, but possible. Seeing the many references to this bug here tells me that people need this feature. So if the next major release is imminent, or you'd be willing to bump the major version for this, that's fine. Otherwise I'd say that practically the lack of submodule support is a bug, not something to rely on, so submodule initialization fixes that bug and doesn't need a major version bump.
Well, if people have npm module A, and submodules B and C which are unfit for npm installs, then we could tell them to instead create a master module D which uses A, B, C as submodules, so that A itself refers to B and C via relative paths outside its module, not via submodules. Is this the kind of git-based solution you had in mind? |
I would say the requirement is that this feature shouldnt cause a significant performance hit. It's not important how that requirement gets satisfied. Git dependencies are already significantly slower to install than plain dependencies, especially once we land your patch to build git deps before caching them (which is a much-needed change, thank you).
Yes.
If breaking existing use cases is a concern, there's no alternative but to bump major. Semver is pretty unambiguous here. Right now I don't have an opinion on whether it's a significant concern, because we lack evidence one way or the other. There are a few other small but breaking changes queued up for |
it would be nice if installing from a git url expanded the git submodules before running the install scripts.
The text was updated successfully, but these errors were encountered: