Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): groom the build scripts and dependencies #156

Merged
merged 7 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"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
24 changes: 11 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
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
uses: actions/setup-node@v3
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
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ network. An example configuration for multi-network DID resolving would look lik
const providerConfig = {
networks: [
{ name: "mainnet", provider: web3.currentProvider },
{ name: "0x4", rpcUrl: "https://rinkeby.infura.io/v3/<YOUR PROJECT ID>" }
{ name: "rsk:testnet", chainId: "0x1f", rpcUrl: "https://did.testnet.rsk.co:4444" }
{ name: "development", rpcUrl: "http://localhost:7545", registry: "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b" }
{ name: "0x4", rpcUrl: "https://rinkeby.infura.io/v3/<YOUR PROJECT ID>" },
{ name: "rsk:testnet", chainId: "0x1f", rpcUrl: "https://did.testnet.rsk.co:4444" },
{ name: "development", rpcUrl: "http://localhost:7545", registry: "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b" },
{ name: "myprivatenet", chainId: 123456, rpcUrl: "https://my.private.net.json.rpc.url" }
]
}
Expand Down
13 changes: 0 additions & 13 deletions babel-preset.js

This file was deleted.

13 changes: 13 additions & 0 deletions babel-preset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"sourceMaps": true,
"plugins": [
[
"module-resolver",
{
"alias": {
"crypto": "crypto-browserify"
}
}
]
]
}
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"]
}
75 changes: 40 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
"name": "ethr-did-resolver",
"version": "6.0.0",
"description": "Resolve DID documents for ethereum addresses and public keys",
"type": "module",
"source": "src/index.ts",
"main": "lib/index.js",
"module": "lib/index.module.js",
"unpkg": "lib/index.umd.js",
"types": "lib/index.d.ts",
"umd:main": "lib/index.umd.js",
"main": "./lib/index.cjs",
"module": "./lib/index.module.js",
"unpkg": "./lib/index.umd.js",
"types": "./lib/index.d.ts",
"umd:main": "./lib/index.umd.js",
"exports": {
".": {
"require": "./lib/index.cjs",
"import": "./lib/index.module.js"
}
},
"repository": {
"type": "git",
"url": "[email protected]:decentralized-identity/ethr-did-resolver.git"
Expand Down Expand Up @@ -41,12 +48,11 @@
],
"scripts": {
"test": "jest",
"test:ci": "jest --coverage && codecov",
"build:js": "microbundle --compress=false",
"build": "yarn lint && yarn build:js",
"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\"",
"prepublishOnly": "yarn build:js && yarn test:ci && yarn format && yarn lint",
"prepublishOnly": "yarn test:ci && yarn format && yarn lint",
"release": "semantic-release --debug"
},
"jest": {
Expand All @@ -63,37 +69,36 @@
]
},
"devDependencies": {
"@babel/core": "7.16.7",
"@babel/preset-env": "7.16.7",
"@babel/preset-typescript": "7.16.7",
"@babel/core": "7.18.2",
"@babel/preset-env": "7.18.2",
"@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.8.1",
"@typescript-eslint/parser": "5.8.1",
"babel-jest": "27.4.5",
"codecov": "3.8.2",
"eslint": "8.6.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-jest": "25.3.4",
"@types/jest": "28.1.1",
"@typescript-eslint/eslint-plugin": "5.27.0",
"@typescript-eslint/parser": "5.27.0",
"babel-jest": "28.1.0",
"eslint": "8.17.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest": "26.5.3",
"eslint-plugin-prettier": "4.0.0",
"ganache-cli": "^6.12.2",
"jest": "27.4.5",
"microbundle": "0.14.2",
"prettier": "2.5.1",
"semantic-release": "18.0.1",
"typescript": "4.5.4"
"ganache": "7.2.0",
"jest": "28.1.0",
"microbundle": "0.15.0",
"prettier": "2.6.2",
"semantic-release": "19.0.2",
"typescript": "4.7.3"
},
"dependencies": {
"@ethersproject/abi": "^5.5.0",
"@ethersproject/abstract-signer": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/basex": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/contracts": "^5.5.0",
"@ethersproject/providers": "^5.5.0",
"@ethersproject/transactions": "^5.5.0",
"did-resolver": "^3.1.5",
"@ethersproject/abi": "^5.6.3",
"@ethersproject/abstract-signer": "^5.6.2",
"@ethersproject/address": "^5.6.1",
"@ethersproject/basex": "^5.6.1",
"@ethersproject/bignumber": "^5.6.2",
"@ethersproject/contracts": "^5.6.2",
"@ethersproject/providers": "^5.6.8",
"@ethersproject/transactions": "^5.6.2",
"did-resolver": "^3.2.2",
"ethr-did-registry": "^0.0.3"
}
}
40 changes: 8 additions & 32 deletions src/__tests__/networks.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ describe('ethrResolver (alt-chains)', () => {
contentType: 'application/did+ld+json',
},
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: 'did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388',
verificationMethod: [
{
Expand All @@ -52,10 +49,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocumentMetadata: {},
didResolutionMetadata: { contentType: 'application/did+ld+json' },
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [
{
Expand All @@ -82,10 +76,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocumentMetadata: {},
didResolutionMetadata: { contentType: 'application/did+ld+json' },
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [
{
Expand All @@ -112,10 +103,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocumentMetadata: {},
didResolutionMetadata: { contentType: 'application/did+ld+json' },
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [
{
Expand All @@ -140,10 +128,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocumentMetadata: {},
didResolutionMetadata: { contentType: 'application/did+ld+json' },
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [
{
Expand All @@ -168,10 +153,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocumentMetadata: {},
didResolutionMetadata: { contentType: 'application/did+ld+json' },
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [
{
Expand All @@ -196,10 +178,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocumentMetadata: {},
didResolutionMetadata: { contentType: 'application/did+ld+json' },
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [
{
Expand Down Expand Up @@ -242,10 +221,7 @@ describe('ethrResolver (alt-chains)', () => {
},
didResolutionMetadata: { contentType: 'application/did+ld+json' },
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [
{
Expand Down
Loading