Skip to content

Commit

Permalink
chore: setup the github action, add release action, update package name
Browse files Browse the repository at this point in the history
  • Loading branch information
thangddvmo committed Oct 9, 2024
1 parent d68d9ce commit da12484
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 17 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ESLint check

on:
pull_request:
types: [opened, synchronize]
branches: ['main']

jobs:
run-eslint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- run: yarn install
- run: yarn lint
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deployment CI

on:
push:
branches: ['release']

permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install
- run: yarn build && touch dist/.nojekyll

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
run: npm publish --//registry.npmjs.org/:_authToken="${{ secrets.NPM_TOKEN }}"
28 changes: 28 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Test case

on:
pull_request:
types: [opened, synchronize]
branches: ['main']

jobs:
run-test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- run: yarn install
- run: yarn test
3 changes: 2 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"branches": [
"main",
"master"
"master",
"release"
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# dentity-ens-client
# @dentity/ens-client

A combination of [Denitty](https://dentity.com) and [ENS domains](https://ens.domains) to verify basic information for ENS domain owners.

Expand All @@ -7,15 +7,15 @@ A combination of [Denitty](https://dentity.com) and [ENS domains](https://ens.d
## Install

``` sh
npm i dentity-ens-client
npm i @dentity/ens-client
```

## Getting started

The simplest example is to get all verifcations shared by Dentity users with their ENS domain. You can easily get all those verifications by initially add to their ENS domain.
``` ts
import { EnsPublicClient, createEnsPublicClient } from '@ensdomains/ensjs';
import { CredentialTemplate, EnsDentityClient } from 'dentity-ens-client';
import { CredentialTemplate, EnsDentityClient } from '@dentity/ens-client';
import { http } from 'viem';
import { mainnet } from 'viem/chains';

Expand All @@ -40,7 +40,7 @@ EnsDentityClient.initialize(client as any, 'moisesj.eth').then((ensClient) => {
Currently Dentity is supporting sharing a number of verification types for ENS domain. You can specifically get any verification by passing in a specific credential template. You can then verify the correctness of that verification.
``` ts
import { EnsPublicClient, createEnsPublicClient } from '@ensdomains/ensjs';
import { CredentialTemplate, DentityEnsClient } from 'dentity-ens-client';
import { CredentialTemplate, DentityEnsClient } from '@dentity/ens-client';
import { http } from 'viem';
import { mainnet } from 'viem/chains';

Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EnsPublicClient, createEnsPublicClient } from '@ensdomains/ensjs';
import { CredentialTemplate, DentityEnsClient } from 'dentity-ens-client';
import { CredentialTemplate, DentityEnsClient } from '@dentity/ens-client';
import { http } from 'viem';
import { mainnet } from 'viem/chains';

Expand Down
6 changes: 3 additions & 3 deletions examples/nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "ISC",
"dependencies": {
"@ensdomains/ensjs": "^4.0.1",
"dentity-ens-client": "link:../../"
"@dentity/ens-client": "link:../../"
},
"devDependencies": {
"ts-node": "^10.9.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==

"dentity-ens-client@link:../..":
"@dentity/ens-client@link:../..":
version "0.0.0"
uid ""

Expand Down
2 changes: 1 addition & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@ensdomains/ensjs": "^4.0.1",
"copy-to-clipboard": "^3.3.3",
"dentity-ens-client": "link:../../",
"@dentity/ens-client": "link:../../",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-json-view": "^1.21.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import MiniLoading from '../Icon/MiniLoading';
import {
DentityEnsClient,
VerifiableCredentialPresentationResponse,
} from 'dentity-ens-client';
} from '@dentity/ens-client';
import { toast } from 'react-toastify';
import Tick from '../Icon/Tick';

Expand Down
2 changes: 1 addition & 1 deletion examples/react/src/pages/EnsDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
DentityEnsClient,
VerifiableCredentialPresentation,
CredentialTemplate,
} from 'dentity-ens-client';
} from '@dentity/ens-client';
import { useLayoutEffect, useMemo, useState } from 'react';
import Discord from '../../components/Icon/Discord';
import Email from '../../components/Icon/Email';
Expand Down
2 changes: 1 addition & 1 deletion examples/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export default defineConfig({
port: 3000,
},
optimizeDeps: {
include: ['dentity-ens-client'],
include: ['@dentity/ens-client'],
},
});
2 changes: 1 addition & 1 deletion examples/react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==

"dentity-ens-client@link:../..":
"@dentity/ens-client@link:../..":
version "0.0.0"
uid ""

Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dentity/ens-client",
"repository": {
"url": "https://github.com/Dentity-Development/ens-client.git"
"url": "git+https://github.com/Dentity-Development/ens-client.git"
},
"version": "1.0.0",
"author": "Dentity",
Expand Down Expand Up @@ -66,5 +66,13 @@
"resolutions": {
"wrap-ansi": "7.0.0",
"string-width": "4.2.3"
},
"bugs": {
"url": "https://github.com/Dentity-Development/ens-client/issues"
},
"homepage": "https://github.com/Dentity-Development/ens-client#readme",
"directories": {
"example": "examples",
"test": "tests"
}
}

0 comments on commit da12484

Please sign in to comment.