Skip to content
This repository has been archived by the owner on Nov 8, 2020. It is now read-only.

Commit

Permalink
Publish to npm.
Browse files Browse the repository at this point in the history
  • Loading branch information
lourot committed May 29, 2018
1 parent 1929fe3 commit c1e0e88
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
yarn.lock
/node_modules/
/yarn.lock
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.travis.yml
/maintain.md
/test.js
/yarn.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dracula/gitk

```bash
$ sudo npm install -g github-contribs
$ sudo npm install -g @ghuser/github-contribs
```

## Team
Expand Down
74 changes: 74 additions & 0 deletions maintain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Release a new version

## Run all the checks

```bash
$ npm test
```

## Increase the version number

In [package.json](package.json) to `7.8.9` in this example.

## Generate the package to be published

```bash
$ npm pack
```

And check that the resulting `ghuser-github-contribs-7.8.9.tgz` looks well-formed. Finally clean up:

```bash
$ rm ghuser-github-contribs-7.8.9.tgz
```

## Install the package locally

```bash
$ sudo npm install . -g
```

and test it briefly, e.g.

```bash
$ github-contribs --version
$ github-contribs --since 2018-05-29 AurelienLourot
```

## Commit your changes, create a git tag and push

```bash
$ git commit -am "Version 7.8.9"
$ git push
$ git tag "7.8.9"
$ git push --tags
```

## Publish the package

```bash
$ npm login --scope=@ghuser
Username: lourot
...
$ npm publish
```

> **NOTES**:
>
> * If it fails with 301, see
> [publish - npm login error 301](https://stackoverflow.com/a/50580349/1855917).
> * On the first publication do `npm publish --access public` instead.
and check that the package looks well-formed at
`https://www.npmjs.com/package/@ghuser/github-contribs/v/7.8.9`

Finally check that the package can be installed from npm:

```bash
$ sudo npm uninstall -g @ghuser/github-contribs
$ sudo npm install -g @ghuser/github-contribs
```

## Add release notes

to [https://github.com/AurelienLourot/github-contribs/tags](https://github.com/AurelienLourot/github-contribs/tags)
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "github-contribs",
"name": "@ghuser/github-contribs",
"version": "0.0.1",
"description": "List all GitHub repos a user has contributed to since the beginning of time.",
"license": "Unlicense",
Expand All @@ -19,10 +19,6 @@
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js",
"cli.js"
],
"keywords": [
"cli-app",
"cli",
Expand Down

0 comments on commit c1e0e88

Please sign in to comment.