Publishing
Pulsar bundles a command line utility called ppm into every installation of Pulsar, to search for and install packages via the command line. This is invoked by using the pulsar command with the -p or --package option. Optionally, you are still able to call PPM directly via ppm in the command line. The pulsar -p command can also be used to publish Pulsar packages to the public registry and update them.
See more in Using PPM.
Prepare your package
There are a few things you should double check before publishing:
- Your
package.jsonfile hasname,description, andrepositoryfields. - Your
package.jsonnameis URL-safe — meaning it contains no emoji or other special characters that are invalid in a URL. - Your
package.jsonfile has aversionfield with a value of"0.0.0". - Your
package.jsonversionfield is SemVer v2 compliant. - Your
package.jsonfile has anenginesfield that contains an entry foratomsuch as:"engines": {"atom": ">=1.0.0 <2.0.0"}. - Your package has a
README.mdfile at the root. - Your
repositoryURL in thepackage.jsonfile is the same as the URL of your repository. - Your package is in a Git repository that has been pushed to GitHub. Follow this guide if your package isn’t already on GitHub.
Publish your package
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 let’s review what the pulsar -p publish command does:
- Registers the package name on Pulsar Package Registry if it is being published for the first time.
- Updates the
versionfield in thepackage.jsonfile and commits it. - Creates a new Git tag for the version being published.
- Pushes the tag and current branch up to GitHub.
- Updates Pulsar Package Registry with the new version being published.
Now run the following commands to publish your package:
$ cd path-to-your-package
$ pulsar -p publish minor
If this is the first package you are publishing, the pulsar -p publish command may prompt you for your GitHub username and password. If you have two-factor authentication enabled, use a personal access token in lieu of a password. This is required to publish and you only need to enter this information the first time you publish. The credentials are stored securely in your keychain once you login.
Your package is now published and available on Pulsar Package Registry. 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 <version-type>
where version-type can be major, minor, or patch:
majorwhen you make backwards-incompatible API changes,minorwhen you add functionality in a backwards-compatible manner, orpatchwhen you make backwards-compatible bug fixes.
For instance, to bump a package from v1.0.0 to v1.1.0:
$ pulsar -p publish minor
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.