| title | Publishing |
|---|---|
| layout | doc.ejs |
Pulsar bundles a command line utility called ppm, to search for and install packages via the command line. This can be invoked either by using the pulsar command with the -p or --package option or ppm directly. The pulsar -p command can also be used to publish Pulsar packages to the public registry and update them.
See more in Using PPM.
There are a few things you should double check before publishing:
- Your package has a
README.mdfile at the root. - Your
package.jsonfile…- …has a “URL-safe”
namefield — without emoji or special characters. - …has a
descriptionfield. - …has a
repositoryfield containing the URL of your repository. - …has a
versionfield that is Semver V2 compliant and has a value of"0.0.0"before the first release. - has an
enginefield that contains an entry foratomsuch as:"engines": {"atom": ">=1.0.0 <2.0.0"}.
- …has a “URL-safe”
- Your package is in a Git repository that has been pushed to GitHub. Follow this guide if your package isn't already on GitHub.
Before you publish a package, it’s a good idea to check ahead of time if a package with the same name has already been published to the Pulsar Package Registry. You can do that by visiting https://packages.pulsar-edit.dev/packages/your-package-name to see if the package already exists. If it does, update your package’s name to something that is available before proceeding.
Now, run the following commands from your package folder to publish it:
$ pulsar -p login
$ pulsar -p publish minorpulsar -p login will let you create and set an API token in your keychain to permit interacting with GitHub API. This command is only needed for the first publication.
pulsar -p publish minor command does:
- Register the package name on Pulsar Package Registry if it is being published for the first time.
- Update the
versionfield in thepackage.jsonfile applying theminorversion increase (details below) and commits it. - Create a new Git tag for the version being published.
- Pushe the tag and current branch up to GitHub.
- Update Pulsar Package Registry with the new version being published.
Your package is now published and available on Pulsar Package Repository. Head on over to https://packages.pulsar-edit.dev/packages/your-package-name to see your package's page.
With pulsar -p publish, you can bump the version and publish by using
$ pulsar -p publish <type>where type can be major, minor and patch.
- major version when you make incompatible API changes
- e.g. version
1.0.0will become2.0.0
- e.g. version
- minor version when you add functionality in a backwards compatible manner
- e.g. version
1.0.0will become1.1.0
- e.g. version
- patch version when you make backwards compatible bug fixes
- e.g. version
1.0.0will become1.0.1
- e.g. version
Check out semantic versioning to learn more about best practices for versioning your package releases.
You can also run pulsar -p help publish to see all the available options and pulsar -p help to see all the other available commands.