Open anilanar opened 7 years ago
Yeah, I agree that there can and should be a better way to watch for package changes and there are a lot of dependencies on commits. This was originally done for 2 reasons; based on my experiences and beliefs so far.
I'm very open to better ways to manage this. I've thought about combining git diff ${lastTag} -- ${pkg.path}
and some querying of NPM to do some parts of this better, but it still leaves out the automatic versioning. For example semantic-release also works in precisely the same way, and Northbrook's approach is actually heavily based on my experience with lerna-semantic-release
.
I agree. However I think conventions/methodologies should go into plugins (and it's fine if they are default plugins shipped with northbrook) as there are usually multiple ways of doing things right.
I think northbrook core should try its best to convey useful information that all plugins can benefit from. For example depGraph
is one of them. Changed packages since last release, all affected packages based on changed packages (through dependencies among them) all sound useful without enfocing any opinions, except git tags. I'll give this a further thinking though.
Although
commit
is a plugin,changedPackages
in northbrook core relies on a commit format implied by thecommit
plugin.I think Lerna's way of detecting changed packages is more generic: It executes
git diff ${lastTag} -- ${pkg.path}
. If there's a diff, then that package is changed.What do you think?
I propose moving old
changedPackages
into a plugin, and explicitly document/mark dependencies between plugins (i.e.release
heavily depends oncommit
).My use case is as follows:
package.json
version with npm version, and executenpm publish
if necessary.Later on, I can potentially merge 1-7 into a single plugin/script.