mrgit icon indicating copy to clipboard operation
mrgit copied to clipboard

mgit should use `package.json` if `mgit.json` was not found

Open pjasiun opened this issue 8 years ago • 12 comments

It would be helpful not to define the same data twice.

For instance: if my project use fixed hashes, these hashes should be stored in both package.json (to let developers who won't contribute to dependencies use simple npm install) and in mgit.json (for developers who will contribute to dependencies to have proper versions by default).

I understand that there are cases where two separate configurations need to be defined, but for some cases, one is better. My proposal is that if mgit.json is not defined then mgit use package.json.

pjasiun avatar Jan 22 '17 16:01 pjasiun

It makes sense as a feature. mgit.json could be optional, overriding options set in package.json.

Reinmar avatar Jan 23 '17 08:01 Reinmar

mgit cannot install dependencies from npm. It means, we cannot use a version of a package as a repository URL. In this case, repository URL has to be generated based on package name.

pomek avatar Jan 23 '17 10:01 pomek

I think that mgit should do nothing if there is a version instead of a repository path. It makes perfect sense: dependencies defined as an npm version I do not want to develop, only use. I want to work only with dependencies I get from git, and these should be handled by the mgit tool.

pjasiun avatar Jan 23 '17 10:01 pjasiun

So, if the package has a version instead of the repository URL, mgit should skip the package. Do I understand?

pomek avatar Jan 23 '17 10:01 pomek

Yep.

pjasiun avatar Jan 23 '17 10:01 pjasiun

I wanted to implement this while working on https://github.com/cksource/mgit2/issues/30 but, as you both noticed, it's more work to filter correct stuff from package.json.

Reinmar avatar Jan 23 '17 12:01 Reinmar

Is there a change that save-hashes will save them in the package.json if it is the config file?

pjasiun avatar Feb 01 '17 10:02 pjasiun

I would say yes.

pomek avatar Feb 01 '17 10:02 pomek

mgit could at least prompting No mgit.json found for now. But maybe it's only my problem that every time I'm trying to update ckeditor5-dev with mgit first :)

ma2ciek avatar Mar 16 '17 22:03 ma2ciek

You can make a PR for this. It makes sense to log such an error clearly :)

Reinmar avatar Mar 17 '17 09:03 Reinmar

Ok. I'll do it soon.

ma2ciek avatar Mar 17 '17 09:03 ma2ciek

Can't wait :)

pjasiun avatar Mar 21 '17 13:03 pjasiun