Skip to content

Commit abd2382

Browse files
committed
docs: improve Publishing section
1 parent 67e10b7 commit abd2382

File tree

1 file changed

+29
-37
lines changed

1 file changed

+29
-37
lines changed

docs/developing-for-pulsar/publishing.md

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,60 @@ title: Publishing
33
layout: doc.ejs
44
---
55

6-
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.
6+
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.
77

88
See more in [Using PPM](/contributing-to-pulsar/using-ppm/).
99

10-
## Prepare your package
1110

1211
There are a few things you should double check before publishing:
1312

14-
- Your `package.json` file has `name`, `description`, and `repository` fields.
15-
- Your `package.json` `name` is URL-safe — meaning it contains no emoji or other special characters that are invalid in a URL.
16-
- Your `package.json` file has a `version` field with a value of `"0.0.0"`.
17-
- Your `package.json` `version` field is [SemVer v2](https://semver.org/spec/v2.0.0.html) compliant.
18-
- Your `package.json` file has an `engines` field that contains an entry for
19-
`atom` such as: `"engines": {"atom": ">=1.0.0 <2.0.0"}`.
2013
- Your package has a `README.md` file at the root.
21-
- Your `repository` URL in the `package.json` file is the same as the URL of
22-
your repository.
23-
- Your package is in a Git repository that has been pushed to
24-
[GitHub](https://github.com). Follow [this guide](https://help.github.com/articles/importing-a-git-repository-using-the-command-line/) if your package isn’t already on GitHub.
14+
- Your `package.json` file…
15+
- …has a “URL-safe” `name` field — without emoji or special characters.
16+
- …has a `description` field.
17+
- …has a `repository` field containing the URL of your repository.
18+
- …has a `version` field that is [Semver V2](https://semver.org/spec/v2.0.0.html) compliant and has a value of `"0.0.0"` before the first release.
19+
- has an `engine` field that contains an entry for `atom` such as:
20+
`"engines": {"atom": ">=1.0.0 <2.0.0"}`.
21+
- Your package is in a Git repository that has been pushed to [GitHub](https://github.com). Follow [this guide](https://help.github.com/articles/importing-a-git-repository-using-the-command-line/) if your package isn't already on GitHub.
2522

2623
## Publish your package
2724

28-
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](https://packages.pulsar-edit.dev/packages). 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.
25+
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](https://packages.pulsar-edit.dev). 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.
2926

30-
Now let’s review what the `pulsar -p publish` command does:
31-
32-
1. Registers the package name on Pulsar Package Registry if it is being published for the first time.
33-
2. Updates the `version` field in the `package.json` file and commits it.
34-
3. Creates a new [Git tag](https://git-scm.com/book/en/Git-Basics-Tagging) for the version being published.
35-
4. Pushes the tag and current branch up to GitHub.
36-
5. Updates Pulsar Package Registry with the new version being published.
37-
38-
Now run the following commands to publish your package:
27+
Now, run the following commands from your package folder to publish it:
3928

4029
```sh
41-
$ cd path-to-your-package
30+
$ pulsar -p login
4231
$ pulsar -p publish minor
4332
```
4433

45-
<!-- TODO: Rewrite this Section once Authentication Information is Public -->
34+
`pulsar -p login` will let you create and set an API token in your [keychain](<https://en.wikipedia.org/wiki/Keychain_(software)>) to permit interacting with GitHub API. This command is only needed for the first publication.
4635

47-
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](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) 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](<https://en.wikipedia.org/wiki/Keychain_(software)>) once you login.
36+
`pulsar -p publish minor` command does:
4837

49-
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.
38+
1. Register the package name on Pulsar Package Registry if it is being published for the first time.
39+
2. Update the `version` field in the `package.json` file applying the `minor` version increase (details below) and commits it.
40+
3. Create a new [Git tag](https://git-scm.com/book/en/Git-Basics-Tagging) for the version being published.
41+
4. Pushe the tag and current branch up to GitHub.
42+
5. Update Pulsar Package Registry with the new version being published.
43+
44+
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.
5045

5146
With `pulsar -p publish`, you can bump the version and publish by using
5247

5348
```sh
54-
$ pulsar -p publish <version-type>
49+
$ pulsar -p publish <type>
5550
```
5651

57-
where `version-type` can be `major`, `minor`, or `patch`:
58-
59-
- `major` when you make backwards-incompatible API changes,
60-
- `minor` when you add functionality in a backwards-compatible manner, or
61-
- `patch` when you make backwards-compatible bug fixes.
52+
where `type` can be `major`, `minor` and `patch`.
6253

63-
For instance, to bump a package from v1.**0**.0 to v1.**1**.0:
64-
65-
```sh
66-
$ pulsar -p publish minor
67-
```
54+
- **major** version when you make incompatible API changes
55+
- e.g. version `1.0.0` will become `2.0.0`
56+
- **minor** version when you add functionality in a backwards compatible manner
57+
- e.g. version `1.0.0` will become `1.1.0`
58+
- **patch** version when you make backwards compatible bug fixes
59+
- e.g. version `1.0.0` will become `1.0.1`
6860

6961
Check out [semantic versioning](https://semver.org/) to learn more about best practices for versioning your package releases.
7062

0 commit comments

Comments
 (0)