1.0.34 • Published 10 months ago
@build-script/poormans-package-change v1.0.34
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! Pickup your phone (BEEEEEP)
Usage
poormans-package-change <command> [--args]
command: detect-package-change
Usage: poormans-package-change detect-package-change --registry ??? --dist-tag ??? --package ??? --bump --json --quiet
registry: default to use system .npmrc
dist-tag: default to "latest"
package: this folder contains package.json (default to ./)
bump: increase patch version in package.json if change detected
json: print json output even if stdout is tty
quiet: disable verbose debug output to stderr
Require git
available on PATH.
Output:
{ changedFiles: [......], changed: true }
if!process.stdout.isTTY
OR--json
is setchanged no.
orchanged yes.
if stdout isTTY AND--json
is not set- no output if
--bump
is set
The return code always 0 if no error. no matter changed or not.
What happens
- download newest
package.json
from npm, and cache it at${TMPDIR}/package-json-cache
- compare
version
field with local package.json- If they are not equal. Then I will do nothing and print "changed yes.".
- download published tarball from npm
- run
pnpm pack
locally, ornpm run prepack
+npm pack
if no pnpm. - compare files in created
.tgz
file and downloaded one. (by running some magicgit
commands)- if
--bump
is set, increase patch version inpackage.json
- if any file do not equal, print "changed yes.".
- if everything exact same, print "changed no."
- if
command: run-if-version-mismatch
Usage: poormans-package-change run-if-version-mismatch [--quiet] -- <command to run>
Eg: poormans-package-change run-if-version-mismatch -- pnpm publish --no-git-checks
Run a command, if local version
in package.json
is NOT same with npm registry.
The --
is required.
Example
# update package.json if something changed
poormans-package-change detect-package-change --bump --quiet
# run pnpm publish if version is not same with npm
# maybe modified by above command
# maybe by hand
poormans-package-change run-if-version-mismatch --quiet -- pnpm publish --no-git-checks
1.0.34
10 months ago
1.0.29
2 years ago
1.0.33
2 years ago
1.0.32
2 years ago
1.0.31
2 years ago
1.0.30
2 years ago
1.0.26
3 years ago
1.0.28
3 years ago
1.0.22
3 years ago
1.0.21
3 years ago
1.0.25
3 years ago
1.0.24
3 years ago
1.0.23
3 years ago
1.0.19
3 years ago
1.0.20
3 years ago
1.0.18
4 years ago
1.0.17
4 years ago
1.0.16
4 years ago
1.0.15
4 years ago
1.0.14
4 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago