1.0.33 • Published 9 months ago

@build-script/poormans-package-change v1.0.33

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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 set
  • changed no. or changed 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

  1. download newest package.json from npm, and cache it at ${TMPDIR}/package-json-cache
  2. compare version field with local package.json
    • If they are not equal. Then I will do nothing and print "changed yes.".
  3. download published tarball from npm
  4. run pnpm pack locally, or npm run prepack+npm pack if no pnpm.
  5. compare files in created .tgz file and downloaded one. (by running some magic git commands)
    1. if --bump is set, increase patch version in package.json
    2. if any file do not equal, print "changed yes.".
    3. if everything exact same, print "changed no."

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.29

10 months ago

1.0.33

9 months ago

1.0.32

9 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.26

1 year ago

1.0.28

1 year ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.19

2 years ago

1.0.20

2 years ago

1.0.18

2 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago