Skip to content

Commit

Permalink
Merge branch 'release/1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Jul 30, 2022
2 parents 217d3fc + 3050203 commit 2030702
Show file tree
Hide file tree
Showing 11 changed files with 7,475 additions and 7,400 deletions.
54 changes: 17 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,27 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
version: 2.1

jobs:
build:
docker:
- image: circleci/node:latest
orbs:
node: circleci/node@4.7.0
codecov: codecov/codecov@3.2.0

jobs:
test:
executor:
name: node/default
tag: 'current'
steps:
- checkout

- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}

- run:
name: Install global packages
command: sudo npm install -g codecov

- run:
name: Install dependencies
command: npm install

- save_cache:
key: dependencies-{{ checksum "package.json" }}
paths:
- node_modules

- node/install-packages
- run:
name: Javascript Linter
command: npm run lint

- run:
name: All Unit Tests with Code Coverage
name: Unit tests with code coverage
command: npm run test:unit:cov

# Far too flakey to run on CI
# - run:
# name: Mutation Tests
# command: npm run test:mutants

- run:
name: Send reports to codecov.io
command: codecov
workflows:
node-tests:
jobs:
- test:
post-steps:
- codecov/upload
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['standard', 'prettier', 'prettier/standard'],
plugins: ['prettier', 'standard', 'import', 'promise'],
extends: ['standard', 'plugin:prettier/recommended'],
plugins: ['mocha'],
parserOptions: {
sourceType: 'module'
},
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install lint-staged
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See this handy, if ugly, [cheat sheet](http://danielkummer.github.io/git-flow-ch
2. clone your fork to your local development machine
3. Set this repo as the `upstream` repo `git remote add upstream git@github.com:davesag/jose-simple.git`
4. Disallow direct pushing to upstream `git remote set-url --push upstream no_push`
5. create a local `master` branch `git checkout -b master` and test it via `git pull upstream master`
5. create a local `main` branch `git checkout -b main` and test it via `git pull upstream main`
6. ensure you have installed the [`git-flow` command line helpers](https://github.com/nvie/gitflow) and [`git-flow-completion` utils](https://github.com/bobthecow/git-flow-completion) then run `git flow init -d`.

#### Optional Git Setup
Expand Down Expand Up @@ -46,15 +46,15 @@ git config user.email "username@domain.suffix"

#### Hotfixes and Support branches

It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do. Just keep in mind that any changes are going to happen to your fork, and not the upstream repo. If you need to merge a `hotfix` into upstream master you may only do it va a reviewed pull request.
It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do. Just keep in mind that any changes are going to happen to your fork, and not the upstream repo. If you need to merge a `hotfix` into upstream main you may only do it va a reviewed pull request.

### Releasing to production

1. `git flow release start {tag.number}` (using semantic versioning)
2. commit any changes to version info in `package.json` then `git flow release publish {tag.number}`
3. `git flow release finish {tag.number}` merges the release into `master` of your fork, tags it, merges that back into `develop` on your fork and removes the release branch.
4. Now go back to GitHub and raise a Pull Request to merge the upstream master from your fork's `master` branch. When that goes through you are done.
5. In your command-line go back and clean up any outstanding branches and `git pull upstream` your local `master` and `develop` branches to ensure everything on your local machine is up to date with everyone's changes.
3. `git flow release finish {tag.number}` merges the release into `main` of your fork, tags it, merges that back into `develop` on your fork and removes the release branch.
4. Now go back to GitHub and raise a Pull Request to merge the upstream main from your fork's `main` branch. When that goes through you are done.
5. In your command-line go back and clean up any outstanding branches and `git pull upstream` your local `main` and `develop` branches to ensure everything on your local machine is up to date with everyone's changes.

Note you will **never** push changes directly to the upstream project, _only to your own fork_.

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## jose-simple
# jose-simple

> Proper encryption ought to be simple, and widespread.
Expand All @@ -22,7 +22,7 @@ npm install jose-simple

- [Securing Tokens with help from JOSE](https://codeburst.io/securing-tokens-with-help-from-jose-33d8c31835a1).

## Useage
## Usage

```js
const jose = require('jose-simple')
Expand Down Expand Up @@ -71,17 +71,16 @@ const { encrypt, decrypt } = jose(privateKey, publicKey, {
| Branch | Status | Coverage | Audit | Comment |
| ------ | ------ | -------- | ----- | ------- |
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/jose-simple/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/jose-simple/tree/develop) | [![codecov](https://codecov.io/gh/davesag/jose-simple/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/jose-simple) | [![Vulnerabilities](https://snyk.io/test/github/davesag/jose-simple/develop/badge.svg)](https://snyk.io/test/github/davesag/jose-simple/develop) | Work in progress |
| `master` | [![CircleCI](https://circleci.com/gh/davesag/jose-simple/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/jose-simple/tree/master) | [![codecov](https://codecov.io/gh/davesag/jose-simple/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/jose-simple) | [![Vulnerabilities](https://snyk.io/test/github/davesag/jose-simple/master/badge.svg)](https://snyk.io/test/github/davesag/jose-simple/master) | Latest release |
| `main` | [![CircleCI](https://circleci.com/gh/davesag/jose-simple/tree/main.svg?style=svg)](https://circleci.com/gh/davesag/jose-simple/tree/main) | [![codecov](https://codecov.io/gh/davesag/jose-simple/branch/main/graph/badge.svg)](https://codecov.io/gh/davesag/jose-simple) | [![Vulnerabilities](https://snyk.io/test/github/davesag/jose-simple/main/badge.svg)](https://snyk.io/test/github/davesag/jose-simple/main) | Latest release |

### Prerequisites

- [NodeJS](https://nodejs.org) — Version `10.12.0` or better is needed to run the tests as they rely on `crypto.generateKeyPair`.
- [NodeJS](htps://nodejs.org), I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.

### Test it

- `npm test` — runs the unit tests. The tests give an example of how to create key pairs too. (Leverages the [`crypto.generateKeyPair`](https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_generatekeypair_type_options_callback) libraries introduced in Node `10.12.0`.)
- `npm run test:unit:cov` — runs the unit tests with code coverage
- `npm run test:mutants` — runs the mutation tests

### Lint it

Expand Down
Loading

0 comments on commit 2030702

Please sign in to comment.