pubware
Agnostic & extensible package publisher
Table of Contents
Overview
Pubware is an agnostic and extensible package publisher. Pubware supports any npm
, yarn
, pnpm
project, or other publishing processes (Python packages, Ruby gems, etc.) with a Node runtime. Additionally, functionality can be extended with community-made plugins. Pubware can be customized to any publishing requirements.
🔥 Features
- 💡 Intuitive DX
- 🏗️ Built with type-safety
- 🚀 Performant and minimal
- 🤯 Headless support (run in CI)
- 🏃 Dry runs for testing
- 🔌 Extensible functionality
- 🔄 Lifecycle hooks
Requirements
Installation
Install pubware
as a dev dependency:
npm install -D pubware
Add the publish
script to package.json
:
"scripts": {
"publish": "pubware"
}
Usage
Run the command:
npm run publish
Or with npx
:
npx pubware
Args
--dry-run
Pass the --dry-run
arg to run and report on what changes would have happened:
npm run publish --dry-run
--headless
Pass the --headless
arg to run without an interface (CI support):
npm run publish --headless
Configuration
Configuration is supported with a pubware.json
file or within package.json
. You can pass values to plugins based on plugin-specific parameters.
{
"pubware": {
"plugins": {
"internal": {
"@pubware/npm": {},
"@pubware/git": {}
},
"external": {
"github": {},
"slack": {},
"custom-plugin": {
"key": "value"
}
}
}
}
}
Plugins
Plugins extend the functionality of pubware and can be configured per project. Plugins are defined in the configuration as either internal
or external
. The internal
plugins come pre-bundled with pubware, such as the @pubware/npm
and @pubware/git
plugins. The external
plugins represent the additional project-based plugins. All plugins are executed in the order they are defined.
Internal
The internal
plugins, @pubware/npm
and @pubware/git
, have a unique disabled
attribute, as well as their original configuration:
{
"internal": {
"@pubware/npm": {
"disabled": false
},
"@pubware/git": {
"disabled": false
}
}
}
Learn more about the @pubware/npm and @pubware/git plugins.
External
The external
plugins can be used for any additional functionality:
{
"external": {
"gitlab": {},
"discord": {},
"doordash": {}
}
}
[!IMPORTANT]
A plugin must match the dependency import name when referencing from node_modules
Local plugins are also supported:
{
"external": {
"./plugin.js": {}
}
}
Creating Plugins
Plugins support various utility methods and lifecycle hooks that make it easy to integrate with pubware.
Learn more about creating plugins.
Development
Install the modules:
pnpm install
Create a build:
pnpm build
Link the build to your global node_modules
:
pnpm link .
Run the build:
pnpm pubware
License
MIT