1.0.3 • Published 4 years ago
@idlebox/poormans-package-change v1.0.3
poormans-package-change
- Do you manage more than 10 package at same time?
- Did you forgot/lazy to tag previous version with git?
- Did you remember which package changed since last publish?
- Should you increase version and publish it again?
Run this now! It's FREE! :D
detect-package-change --bump
Usage
Usage: detect-package-change --registry ??? --dist-tag ??? --package ??? --bump
registry: default to use system .npmrc
dist-tag: default to "latest"
package: default to ./ (this folder contains package.json)
bump: increase patch version in package.json if change detected
Require git
available on PATH.
Use detect-package-change 2>/dev/null
to mute debug output.
Output:
changed no.
orchanged yes.
if stdout isTTY{ changedFiles: [......], changed: true }
otherwise- no output if
--bump
is set
The return code always 0 when success. no matter changed or not.
What happens
- download newest
package.json
from npm - compare
version
field with local package.json- If they are not equal, it means you already want to publish new version, then I will do nothing.
- download published tarball from npm
- run
npm pack
/yarn pack
locally - compare files in the two by running
git
- if anything not equal, you should publish a new version.
- (if
--bump
is set) increase patch version inpackage.json
other tools
TODO: # package-changed
Likedetect-package-change
, but return 0 if something changed, 1 nothing changed, error otherwise.
Eg.if package-changed ; then yarn version --major yarn publish fi
run-if-version-mismatch --quiet -- command to run
Run a command, if local version
in package.json
is NOT same with npm registry.
The --
is required.
Eg.
run-if-version-mismatch --quiet -- yarn publish