Skip to content

Commit a40e2d4

Browse files
committed
chore: Update tooling
- Move CI/CD to GitHub Actions - Use semantic-release for deployment - Update dependencies - Use Dependabot to track dependencies updates BREAKING CHANGE: none, releasing v1 to follow SemVer (now enforced by semantic-release).
1 parent 172cb02 commit a40e2d4

File tree

10 files changed

+1393
-1024
lines changed

10 files changed

+1393
-1024
lines changed

.dependabot/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 1
2+
update_configs:
3+
# Dependencies
4+
- package_manager: javascript
5+
directory: /
6+
update_schedule: live
7+
default_assignees:
8+
- franky47
9+
automerged_updates:
10+
- match:
11+
dependency_type: development
12+
update_type: all
13+
- match:
14+
dependency_type: production
15+
update_type: in_range
16+
- match:
17+
dependency_type: production
18+
update_type: security:patch
19+
# GitHub Actions
20+
- package_manager: github_actions
21+
directory: /
22+
update_schedule: weekly
23+
default_reviewers:
24+
- franky47
25+
default_assignees:
26+
- franky47

.github/workflows/cd.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Continuous Delivery
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
cd:
10+
name: Continuous Delivery
11+
runs-on: ubuntu-latest
12+
steps:
13+
- id: yarn-cache
14+
name: Get Yarn cache path
15+
run: echo "::set-output name=dir::$(yarn cache dir)"
16+
- uses: actions/checkout@722adc6
17+
- uses: actions/setup-node@1c5c137
18+
with:
19+
node-version: 12.x
20+
- uses: actions/cache@70655ec
21+
name: Load Yarn cache
22+
with:
23+
path: ${{ steps.yarn-cache.outputs.dir }}
24+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-yarn-
27+
- run: yarn install --ignore-scripts
28+
name: Install dependencies
29+
- run: yarn build
30+
name: Build package
31+
32+
# Continuous Delivery Pipeline --
33+
34+
- uses: codfish/semantic-release-action@a313b22
35+
name: Semantic Release
36+
id: semantic
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
- feature/*
8+
- dependabot/*
9+
pull_request:
10+
types: [opened, edited, reopened]
11+
12+
jobs:
13+
ci:
14+
name: Continuous Integration
15+
runs-on: ubuntu-latest
16+
steps:
17+
- id: yarn-cache
18+
name: Get Yarn cache path
19+
run: echo "::set-output name=dir::$(yarn cache dir)"
20+
- uses: actions/checkout@722adc6
21+
- uses: actions/setup-node@1c5c137
22+
with:
23+
node-version: 12.x
24+
- uses: actions/cache@70655ec
25+
name: Load Yarn cache
26+
with:
27+
path: ${{ steps.yarn-cache.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
- run: yarn install --ignore-scripts
32+
name: Install dependencies
33+
- run: yarn ci
34+
name: Run integration tests
35+
- uses: coverallsapp/github-action@832e70b
36+
name: Report code coverage
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
- uses: 8398a7/action-slack@78391c2
40+
name: Notify on Slack
41+
if: always() # Pick up events even if the job fails or is canceled.
42+
with:
43+
status: ${{ job.status }}
44+
author_name: Continuous Integration
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ dist/
33
.env
44
yarn-error.log
55
.cache
6-
7-
# Docker containers with persistance
8-
.volumes/
6+
coverage/

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ nodemon.json
44
.env
55
.volumes/
66
yarn-error.log
7+
coverage/

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# `cloak`
22

33
[![NPM](https://img.shields.io/npm/v/@47ng/cloak?color=red)](https://www.npmjs.com/package/@47ng/cloak)
4-
[![MIT License](https://img.shields.io/github/license/47ng/cloak.svg?color=blue)](https://github.com/47ng/cloak/blob/master/LICENSE)
5-
[![Travis CI Build](https://img.shields.io/travis/com/47ng/cloak.svg)](https://travis-ci.com/47ng/cloak)
4+
[![MIT License](https://img.shields.io/github/license/47ng/cloak.svg?color=blue)](https://github.com/47ng/cloak/blob/next/LICENSE)
5+
[![Continuous Integration](https://github.com/47ng/cloak/workflows/Continuous%20Integration/badge.svg?branch=next)](https://github.com/47ng/cloak/actions)
6+
[![Coverage Status](https://coveralls.io/repos/github/47ng/cloak/badge.svg?branch=next)](https://coveralls.io/github/47ng/cloak?branch=next)
67
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=47ng/cloak)](https://dependabot.com)
7-
[![Average issue resolution time](https://isitmaintained.com/badge/resolution/47ng/cloak.svg)](https://isitmaintained.com/project/47ng/cloak)
8-
[![Number of open issues](https://isitmaintained.com/badge/open/47ng/cloak.svg)](https://isitmaintained.com/project/47ng/cloak)
98

109
Serialized AES-GCM 256 encryption, decryption and key management in the browser & Node.js.
1110

nodemon.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@47ng/cloak",
3-
"version": "0.15.1",
3+
"version": "0.0.0-semantically-released",
44
"description": "Serialized AES-GCM 256 encryption, decryption and key management in the browser & Node.js",
55
"main": "dist/index.js",
66
"bin": {
@@ -24,40 +24,41 @@
2424
"access": "public"
2525
},
2626
"scripts": {
27-
"test": "jest --verbose",
28-
"test:watch": "jest --verbose --watch",
27+
"test": "jest --coverage",
28+
"test:watch": "jest --watch",
2929
"test:browser": "parcel ./test/index.html",
30-
"dev": "nodemon -e ts,.env -w .env -w . -x 'run-s build:ts test'",
3130
"link:cli": "chmod +x ./dist/cli.js && ln -s $(pwd)/dist/cli.js ./node_modules/.bin/cloak",
3231
"build:clean": "rm -rf ./dist && rm -f ./node_modules/.bin/cloak",
3332
"build:ts": "tsc",
3433
"build": "run-s build:clean build:ts",
35-
"ci": "run-s test build"
34+
"ci": "run-s build test"
3635
},
3736
"dependencies": {
3837
"@47ng/codec": "^1.0.0",
3938
"@stablelib/base64": "^1.0.0",
4039
"@stablelib/hex": "^1.0.0",
4140
"@stablelib/utf8": "^1.0.0",
4241
"chalk": "^4.0.0",
43-
"commander": "^5.0.0",
42+
"commander": "^5.1.0",
4443
"dotenv": "^8.2.0",
4544
"s-ago": "^2.1.0"
4645
},
4746
"devDependencies": {
48-
"@types/jest": "^25.1.1",
49-
"@types/node": "^13.1.8",
50-
"husky": "^4.0.10",
51-
"jest": "^25.1.0",
52-
"jest-extended": "^0.11.2",
53-
"nodemon": "^2.0.2",
47+
"@commitlint/config-conventional": "^8.3.4",
48+
"@types/jest": "^25.2.2",
49+
"@types/node": "^14.0.1",
50+
"commitlint": "^8.3.5",
51+
"husky": "^4.2.5",
52+
"jest": "^26.0.1",
53+
"jest-extended": "^0.11.5",
5454
"npm-run-all": "^4.1.5",
5555
"parcel-bundler": "^1.12.4",
56-
"ts-jest": "^25.2.0",
57-
"ts-node": "^8.6.2",
58-
"typescript": "^3.7.5"
56+
"ts-jest": "^25.5.1",
57+
"ts-node": "^8.10.1",
58+
"typescript": "^3.9.2"
5959
},
6060
"jest": {
61+
"verbose": true,
6162
"preset": "ts-jest/presets/js-with-ts",
6263
"roots": [
6364
"<rootDir>/src"
@@ -67,9 +68,52 @@
6768
],
6869
"testEnvironment": "node"
6970
},
71+
"prettier": {
72+
"arrowParens": "avoid",
73+
"semi": false,
74+
"singleQuote": true,
75+
"tabWidth": 2,
76+
"trailingComma": "none",
77+
"useTabs": false
78+
},
7079
"husky": {
7180
"hooks": {
72-
"pre-push": "yarn ci"
81+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
82+
}
83+
},
84+
"commitlint": {
85+
"extends": [
86+
"@commitlint/config-conventional"
87+
],
88+
"rules": {
89+
"type-enum": [
90+
2,
91+
"always",
92+
[
93+
"build",
94+
"chore",
95+
"ci",
96+
"clean",
97+
"doc",
98+
"feat",
99+
"fix",
100+
"perf",
101+
"ref",
102+
"revert",
103+
"style",
104+
"test"
105+
]
106+
],
107+
"subject-case": [
108+
0,
109+
"always",
110+
"sentence-case"
111+
],
112+
"body-leading-blank": [
113+
2,
114+
"always",
115+
true
116+
]
73117
}
74118
}
75119
}

0 commit comments

Comments
 (0)