Skip to content

Commit

Permalink
docs: add npm-publish docs for @dfinity/agent (#36)
Browse files Browse the repository at this point in the history
* [x] Add documentation an sdk releaser can use to release commits of @dfinity/agent npm package to npm registry
  • Loading branch information
Benjamin Goering authored Sep 21, 2020
1 parent c359639 commit 8f3b96a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git-tag-version=false
55 changes: 55 additions & 0 deletions docs/npm-publish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Publishing `@dfinity/agent` to registry.npmjs.org

The goal of this document is to serve as instructions for releasing a given git checkout of this repository to registry.npmjs.org.

It should be
* accurate/functional
* not too long or hard to manage
* as approachable as possible, so anyone can follow the instructions

## Prerequisites

* [`npm`](https://www.npmjs.com/get-npm) installed and available in your shell:
* test:
```
command -v npm && echo 'npm found' || echo 'ERROR: npm missing
```

## Instructions

1. Clone the agent-js-monorepo
```
pushd `mktemp -d`
git clone [email protected]:dfinity-lab/agent-js.git agent-js-monorepo
cd agent-js-monorepo
```
2. npm install (via `npm ci`) the monorepo root package
```
npm ci
```
2. Change directories into the `@dfinity/agent` package (the monorepo contains several npm packages)
```
cd packages/agent
```
3. Set the version number to something new:
```
new_agent_js_version_number='0.0.0-dev.0'
# You may use new_agent_js_version=$NEW_DFX_VERSION
npm version $new_agent_js_version
```
4. Publish to npm registry:
```
# If you haven't yet, you may need to `npm login` or request permissions from @gobengo or @hansl
npm publish
```
5. Verify the new version appears at https://www.npmjs.com/package/@dfinity/agent?activeTab=versions
Afterward:
* You may want to invoke `popd` until you're back to the directory you started in.

0 comments on commit 8f3b96a

Please sign in to comment.