Package Pre-Publish Audit
Audit and verify package distribution tarballs, manifests, and build outputs before publishing to package registries (npm, PyPI, Crates.io, or Maven). Ensures zero unintended files, credentials, local path leaks, or broken entrypoint links exist in release artifacts.
Critical Pre-Publish Checklist
- Secret & Credential Scrubbing:
- Verify
.npmignore,.gitignore, orpackage.jsonfilesfield. - Assert
.env, private keys, local auth tokens, and test fixtures are excluded.
- Verify
- Entrypoint & Typing Integrity:
- Assert
main,module,bin, andtypesinpackage.json(orpyproject.toml/Cargo.toml) point to valid, existing files in build output.
- Assert
- Tarball Content Inspection (Dry-Run):
- Run dry-run packaging and inspect the file list line by line.
- License & README Verification:
- Ensure
LICENSEfile is bundled and matches the declared SPDX license identifier. - Confirm
README.mdis present and rendered cleanly without broken links.
- Ensure
Execution Commands by Ecosystem
# npm / JavaScript
npm pack --dry-run --json > .evidence/npm-pack-preview.json
# Python / PyPI
python -m build --sdist --wheel && twine check dist/*
# Rust / Crates.io
cargo package --list