universal-npm-tools
v1.0.1
Published
Shared npm packing and publishing tools for Universal JavaScript packages.
Maintainers
Readme
universal-npm-tools
Shared npm packing and publishing tools for Universal JavaScript packages.
Installation
npm install --save-dev universal-npm-toolsCommands
universal-npm pack creates an npm tarball in the source package directory.
universal-npm pack --dry-run validates and lists the package without creating a tarball.
universal-npm publish --dry-run runs the publication checks without publishing.
universal-npm publish publishes the package.
This package validates a release with npm run release:dry-run and publishes itself with npm run release.
Before packing or publishing, the command:
- Runs the configured check script. The default is
testwhen that script exists. - Copies the project to a temporary directory.
- Uses
Package.mdas the stagedReadMe.md. - Generates TypeScript declarations from the configured entry points.
- Removes npm lifecycle scripts from the staged package.
- Runs npm from the staged package.
- Removes the temporary directory.
The source project is not modified.
Configuration
Configuration is read from universalNpm in the source package.json.
{
"universalNpm": {
"checkScript": "test",
"entryPoints": [
"index.js"
],
"checkJs": true,
"types": [
"node"
]
}
}Set checkScript to false to disable the check command. entryPoints defaults to main, then index.js. checkJs enables JavaScript type checking during declaration generation and defaults to false. types contains any installed @types packages required while generating declarations and defaults to an empty list.
Authentication
The command preserves a project .npmrc. npm also uses its normal environment configuration, user-level .npmrc, and current npm login.
