Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updating with PR feedback
  • Loading branch information
aruneshchandra authored May 25, 2017
commit a9f9b84876d7ae0af323017ead7103cbd936a9b9
29 changes: 17 additions & 12 deletions locale/en/docs/guides/publishing-napi-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ The following steps are illustrated using the package `iotivity-node`:
- Go through the release checklist (ensure tests/demos/docs are OK)
- `npm publish`
- Then, publish the N-API version:
- Update the version in `package.json`. For `iotivity-node`, the version
becomes `1.2.0-3`. For version number, the field after the dash (-) allows
quite a bit of flexibility to insert any text. e.g. `1.2.0-napi`.
- Update the version in `package.json`. In the case of `iotivity-node`,
the version becomes `1.2.0-3`. For versioning, we recommend following
the pre-release version scheme as described by
[semver.org](http://semver.org/#spec-item-9) e.g. `1.2.0-napi`.
- Go through the release checklist (ensure tests/demos/docs are OK)
- `npm publish --tag n-api`

Expand All @@ -19,7 +20,7 @@ will not be installed if someone chooses to install `iotivity-node` by simply
running `npm install iotivity-node`. This will install the non-N-API version
by default. The user will have to run `npm install iotivity-node@n-api` to
receive the N-API version. For more information on using tags with npm check
out https://docs.npmjs.com/getting-started/using-tags
out ["Using dist-tags"][].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: what do you think about adding a link to https://docs.npmjs.com/getting-started/using-tags?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Thanx

## To introduce a dependency on an N-API version of a package

Expand All @@ -32,17 +33,21 @@ will look like this:
}
```

Note that, unlike regular versions, tagged versions cannot be addressed by
version ranges such as `"^2.0.0"` inside `package.json`. The reason for this
is that the tag refers to exactly one version. So, if the package maintainer
chooses to tag a later version of the package using the same tag, `npm update`
will receive the later version. This should be acceptable given the currently
experimental nature of N-API. To depend on an N-API-enabled version other than
the latest published, the `package.json` dependency will have to refer to the
exact version like the following:
**Note:** As explained in
["Using dist-tags"][], unlike regular versions, tagged versions cannot be
addressed by version ranges such as `"^2.0.0"` inside `package.json`. The
reason for this is that the tag refers to exactly one version. So, if the
package maintainer chooses to tag a later version of the package using the
same tag, `npm update` will receive the later version. This should be acceptable
given the currently experimental nature of N-API. To depend on an N-API-enabled
version other than the latest published, the `package.json` dependency will
have to refer to the exact version like the following:

```JSON
"dependencies": {
"iotivity-node": "1.2.0-3"
}
```


["Using dist-tags"]: https://docs.npmjs.com/getting-started/using-tags