JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q49156F
  • License MIT

check npm dist before publish

Package Exports

  • publish-police
  • publish-police/package.json

Readme

publish-police

Check npm package dist before publish (yep, I always forgot to build before publish)

npm GitHub

install

pnpm i publish-police -D

features

{
  "files": ["<pattern>"],
  "exports": {
    // ...exports
  },
}
  1. Check files fields in package.json is exit on disk.
  2. Check file listed in exports fields in package.json is exit on disk.

options

strict - default true, e.g. publish-police --strict=false

throw error if files not present or empty in package.json.

usage

set it in prepublishOnly script

{
  "prepublishOnly": "publish-police",
}

or exec manually before publish...

{
  "ci:publish": "pnpm run build && publish-police && pnpm changeset publish",
}