Skip to content

Commit

Permalink
fix(deps): groom the build scripts and dependencies (#120)
Browse files Browse the repository at this point in the history
* chore(ci): upgrade CI workflows

* chore(build): use json config files

* fix(build): update build outputs

* fix(deps): bump did-resolver to 3.2.2 & cross-fetch

* chore(deps): bump dev dependencies

* chore(ci): run tests on push
  • Loading branch information
mirceanis authored Jun 7, 2022
1 parent 49a9c57 commit 757f6ec
Show file tree
Hide file tree
Showing 10 changed files with 2,769 additions and 4,110 deletions.
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"node": true,
"jest/globals": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"jest"
],
"rules": {}
}
22 changes: 8 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,26 @@ jobs:
build-test-publish:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
- name: "Setup node with cache"
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
node-version: 14
cache: 'yarn'

- run: yarn install --frozen-lockfile
- run: yarn run build

- name: setup git coordinates
- name: "Setup git coordinates"
run: |
git config user.name uport-automation-bot
git config user.email [email protected]
- name: Run semantic-release
- name: "Run semantic-release"
env:
GH_TOKEN: ${{secrets.GH_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
name: Build and Test NODE
on: [pull_request, workflow_dispatch]
on: [pull_request, workflow_dispatch, push]
jobs:
build-test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
- name: "Setup node with cache"
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
node-version: 14
cache: 'yarn'

- run: yarn install --frozen-lockfile
- run: yarn run build
- run: yarn run lint
- run: yarn run test:ci

- name: "Upload coverage reports"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ A minimal DID Document might contain the following information:
"publicKeyHex": "04ab0102bcae6c7c3a90b01a3879d9518081bc06123038488db9cb109b082a77d97ea3373e3dfde0eccd9adbdce11d0302ea5c098dbb0b310234c8689501749274"
}
],
"authentication": [
{
"type": "Secp256k1SignatureAuthentication2018",
"publicKey": "did:web:example.com#owner"
}
]
"assertionMethod": [ "did:web:example.com#owner" ],
"authentication": [ "did:web:example.com#owner" ]
}
```

Expand Down
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }], "@babel/preset-typescript"]
}
54 changes: 30 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
"name": "web-did-resolver",
"version": "2.0.17",
"description": "Resolve DID documents from an https domain",
"type": "module",
"source": "src/resolver.ts",
"main": "lib/resolver.js",
"module": "lib/resolver.module.js",
"types": "lib/resolver.d.ts",
"main": "./lib/resolver.cjs",
"module": "./lib/resolver.module.js",
"unpkg": "./lib/resolver.umd.js",
"types": "./lib/resolver.d.ts",
"umd:main": "./lib/resolver.umd.js",
"files": [
"lib",
"src",
"LICENSE"
],
"exports": {
".": {
"require": "./lib/resolver.cjs",
"import": "./lib/resolver.module.js"
}
},
"author": "Mike Xu",
"contributors": [
"Mircea Nistor <[email protected]>"
Expand All @@ -21,17 +30,15 @@
"url": "[email protected]:decentralized-identity/web-did-resolver.git"
},
"dependencies": {
"cross-fetch": "^3.1.2",
"did-resolver": "^3.1.5"
"cross-fetch": "^3.1.5",
"did-resolver": "^3.2.2"
},
"scripts": {
"test": "jest",
"test:ci": "jest --coverage && codecov",
"build:js": "microbundle --compress=false",
"build": "yarn lint && yarn build:js && yarn test",
"test:ci": "jest --coverage",
"build": "microbundle --compress=false",
"format": "prettier --write \"src/**/*.[jt]s\"",
"lint": "eslint --ignore-pattern \"src/**/*.test.[jt]s\" \"src/**/*.[jt]s\"",
"prepare": "yarn build",
"prepublishOnly": "yarn test:ci && yarn format && yarn lint",
"release": "semantic-release --debug"
},
Expand All @@ -49,25 +56,24 @@
]
},
"devDependencies": {
"@babel/core": "7.16.7",
"@babel/preset-env": "7.16.8",
"@babel/preset-typescript": "7.16.7",
"@babel/core": "7.18.2",
"@babel/preset-env": "7.17.12",
"@babel/preset-typescript": "7.17.12",
"@semantic-release/changelog": "6.0.1",
"@semantic-release/git": "10.0.1",
"@types/jest": "27.4.0",
"@typescript-eslint/eslint-plugin": "5.9.1",
"@typescript-eslint/parser": "5.9.1",
"babel-jest": "28.1.0",
"codecov": "3.8.3",
"eslint": "8.6.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-jest": "26.1.0",
"@types/jest": "28.1.1",
"@typescript-eslint/eslint-plugin": "5.27.1",
"@typescript-eslint/parser": "5.27.1",
"babel-jest": "28.1.1",
"eslint": "8.17.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest": "26.5.3",
"eslint-plugin-prettier": "4.0.0",
"jest": "28.1.0",
"microbundle": "0.14.2",
"prettier": "2.5.1",
"jest": "28.1.1",
"microbundle": "0.15.0",
"prettier": "2.6.2",
"regenerator-runtime": "0.13.9",
"semantic-release": "19.0.2",
"typescript": "4.5.4"
"typescript": "4.7.3"
}
}
4 changes: 2 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"devDependencies"
],
"groupName": "devDeps",
"schedule": [
"before 5am on Monday"
"extends": [
"schedule:earlyMondays"
]
}
]
Expand Down
Loading

0 comments on commit 757f6ec

Please sign in to comment.