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

Feature/336 upgrade to veramo 2 #396

Merged
merged 65 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1d47f56
build: updated all packages to latest
theblockstalk Jun 6, 2024
6103dba
build: updated wharfkit dependancy
theblockstalk Jun 6, 2024
f93fd0b
build: updated to use did-jwt package
theblockstalk Jun 6, 2024
06654c3
test: testt showing uint8arrays error
theblockstalk Jun 6, 2024
39c3b8e
test: added veramo packages
theblockstalk Jun 7, 2024
c9ecc48
build: updated all packages to latest and now using DIF did-jwt-vc an…
theblockstalk Jun 18, 2024
f2c0b37
test: updated tsconfig and jest config for test using ESM from did-jw…
theblockstalk Jun 18, 2024
5dcdb91
test: fixed app tests
theblockstalk Jun 18, 2024
c76af1a
test: veramo tests passing
theblockstalk Jun 18, 2024
1df5fee
test: remove console veramo
theblockstalk Jun 18, 2024
a6e2a1d
build: compilation working
theblockstalk Jun 18, 2024
0c404b5
feat: cli to use esm not commonjs, removed unused bable, tsconfig and…
theblockstalk Jun 18, 2024
43a1868
test: fixed test with new jest
theblockstalk Jun 18, 2024
0236e81
fix: fixed JWTDecoded type import
theblockstalk Jun 18, 2024
c587148
ci: fixed node version
theblockstalk Jun 18, 2024
b113002
refactor: custom resolver to trace imports and fixed import for vc.ts
theblockstalk Jun 19, 2024
3e4b639
test: fixed all resolver errors for jest unit tests
theblockstalk Jun 19, 2024
a1210f7
test: fixed tests for new jest version
theblockstalk Jun 19, 2024
4ce1b3f
build: remove jsdom-url
theblockstalk Jun 19, 2024
48b4014
build: remove .yarnrc
theblockstalk Jun 19, 2024
5adf00a
Merge branch 'development' of github.com:Tonomy-Foundation/Tonomy-ID-…
theblockstalk Jun 19, 2024
18ce183
style: upgraded linter
theblockstalk Jun 19, 2024
951b766
refactor: added api export back
theblockstalk Jun 19, 2024
348254a
style: restored tsconfig
theblockstalk Jun 19, 2024
6b5c3ae
style: fix lint errors
theblockstalk Jun 19, 2024
51c9ca7
chore: cleanup of jest, tsconfig, packages and tests
theblockstalk Jun 19, 2024
329c201
style: fixed ts errors in veramo
theblockstalk Jun 19, 2024
4e68764
feat: better typescript compilation
theblockstalk Jun 19, 2024
c6d8eba
ci: added package check to CI=
theblockstalk Jun 20, 2024
db21439
test: fixed ts test issues
theblockstalk Jun 20, 2024
120568b
build: updated antelope-did-resolver
theblockstalk Jun 23, 2024
3b24afe
feat: using antelope-did-resolver exports
theblockstalk Jun 26, 2024
299db77
feat: replaced did:jwk with didd:key
theblockstalk Jun 27, 2024
3fba234
test: installed ws and pm2 as dev depandancies, and fixed lint erros
theblockstalk Jul 6, 2024
859d51e
build: using latest node 22.3.0 for CI and docs
theblockstalk Jul 7, 2024
033f43d
fix: fixed issue with ExternalUser.getIssuer()
theblockstalk Jul 7, 2024
d7c3539
docs: updated README with node version
theblockstalk Jul 10, 2024
1399086
ci: Better outdate packages message
theblockstalk Jul 11, 2024
ff54e7a
ci: fixed outdated packages exit code
theblockstalk Jul 11, 2024
b53ac8e
chore: removed unused tonomy.css export
theblockstalk Jul 18, 2024
83e6183
chore: removed unused exports
theblockstalk Jul 18, 2024
840c9d4
feat: removed unused base64 utils and tests
theblockstalk Jul 19, 2024
2f5cfb0
feat: veramo debug message
theblockstalk Jul 25, 2024
672691f
feat: antelope-did-resolver
theblockstalk Jul 26, 2024
51b003e
refactor: remove unused packages
theblockstalk Jul 29, 2024
da25c69
feat: Debug usage
theblockstalk Jul 30, 2024
5488d01
docs: finished debug commands
theblockstalk Jul 30, 2024
58d27f8
feat: ready for latest yarn
theblockstalk Aug 1, 2024
4326319
ci: Test on all push, and branch protection
theblockstalk Aug 2, 2024
6cd1c35
ci: enable corepack
theblockstalk Aug 2, 2024
a0f1f16
ci: corepack activate
theblockstalk Aug 2, 2024
128e792
ci: corepack before node
theblockstalk Aug 2, 2024
927cd29
ci: yarn run build
theblockstalk Aug 2, 2024
fbaf2d6
ci: check latest packages
theblockstalk Aug 2, 2024
c589629
ci: corepack before node
theblockstalk Aug 2, 2024
2bbf3cd
ci: fail on outdated packages
theblockstalk Aug 2, 2024
71a9f93
ci: error level 2
theblockstalk Aug 2, 2024
a3a122a
ci: removed outdated packages
theblockstalk Aug 2, 2024
5267497
ci: fixed corepack
theblockstalk Aug 2, 2024
50d70e9
Merge remote-tracking branch 'origin/development' into feature/336-up…
theblockstalk Aug 2, 2024
54fc9f9
test: fixed integration tests
theblockstalk Aug 2, 2024
54ac87d
chore: Required packages for Tonomy ID's babel.config.js require aliases
theblockstalk Aug 4, 2024
57a4fe7
style: change dependancies to higher
theblockstalk Aug 4, 2024
fb9f055
chore: remove LOG usage
theblockstalk Aug 4, 2024
0c06bd3
build: Remove unused dependancies
theblockstalk Aug 5, 2024
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
46 changes: 0 additions & 46 deletions .eslintrc.json

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/publish-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{secrets.MY_GITHUB_PERSONAL_ACCESS_TOKEN}}

- name: Enable Corepack before setting up Node
run: corepack enable

- name: 📦 Install
uses: actions/setup-node@v4
with:
node-version: 18.12.1
node-version: 22.3.0
registry-url: https://registry.npmjs.org/

- name: 🚀 Build and publish SDK
uses: actions/setup-node@v4
with:
node-version: 18.12.1
node-version: 22.3.0
- name: Check branch name
run: echo ${GITHUB_REF#refs/*/}
- run: |
Expand All @@ -41,6 +45,7 @@ jobs:
yarn config set tag rc
fi
- run: yarn install --immutable
- run: yarn run build
- run: yarn run release
env:
GITHUB_TOKEN: ${{secrets.MY_GITHUB_PERSONAL_ACCESS_TOKEN}}
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
name: Run Tonomy-ID-SDK Tests

on:
pull_request:
branches:
- development
push

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Enable Corepack before setting up Node
run: corepack enable

- name: Run lint and test
uses: actions/setup-node@v4
with:
node-version: 18.12.1
node-version: 22.3.0
cache: yarn
- run: yarn install --immutable
- run: yarn run build
- run: yarn run lint
- run: yarn run test:unit

compile-contracts:
name: Compiles contracts needed for bootstrap script
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -89,19 +91,23 @@ jobs:
with:
name: Tonomy-Contracts
path: ./Tonomy-Contracts

- name: Enable Corepack before setting up Node
run: corepack enable

- name: Install SDK and Bootstrap blockchain
uses: actions/setup-node@v4
with:
node-version: 18.12.1
node-version: 22.3.0
cache: yarn
- run: yarn install --immutable
- run: yarn run build
- run: yarn run cli bootstrap

- name: Run integration and governance tests
uses: actions/setup-node@v4
with:
node-version: 18.12.1
node-version: 22.3.0
cache: yarn
- run: yarn run test:integration
- run: yarn run test:governance
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
build
site
.yarn
.pnp.*
.pnp.*
database.sqlite
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@
"markdownlint.config": {
"default": true,
"MD033": false
}
},
"git.branchPrefix": "feature/",
"git.branchProtection": [
"master",
"main",
"development"
],
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ The SDK is written in typescript with jest to run tests.
## Dependencies

- Linux debian distribution (Ubuntu 20.0.4 LTS used)
- [Nodejs](https://nodejs.org) v18.12.1+ suggested installed with [nvm](https://github.com/nvm-sh/nvm)
- [Nodejs](https://nodejs.org) v20+ suggested installed with [nvm](https://github.com/nvm-sh/nvm)

Integration tests:

- [Docker](http://docs.docker.com) v20.10+

Documentation:

- [mkdocs](https://www.mkdocs.org) with [material](https://squidfunk.github.io/mkdocs-material) theme

## Sub-Repositories

- [Contracts](https://github.com/Tonomy-Foundation/Tonomy-Contracts) (inside SDK repo) - Smart contracts to run the governance, identity, DAO, token and other ecosystem tools. This is used to run the integration tests
Expand All @@ -32,7 +28,7 @@ Build notes:

- Build just the sdk `yarn run build:sdk`
- Build just the cli `yarn run build:cli`
- Cli has dependency of `argon2` package, which is not needed by SDK and should be moved to a devDependency if these softwares are ever separated.
- TODO: cli has dependency of `argon2` package, which is not needed by SDK and should be moved to a devDependency if these softwares are ever separated.

## Run

Expand All @@ -44,10 +40,6 @@ This builds to `/build` and runs the project in watch mode so any edits you save

To do a one-off build, use `yarn run build`.

## Tests

To show logs during tests `export LOG=true`

### Unit tests

Tests individual class and function logic within the SDK.
Expand Down Expand Up @@ -112,15 +104,6 @@ yarn run lint

See [errors.ts](./src/services/errors.ts). All errors have a registered unique enumeration code.

## Documentation

Documentation is in the `./docs` folder and runs with [mkdocs](https://www.mkdocs.org) with [material](https://squidfunk.github.io/mkdocs-material) theme.

Install with

```bash
sudo apt-get -y install mkdocs
pip install mkdocs-material
```
## Debugging

Then `yarn run docs:serve`
Uses [debug](https://www.npmjs.com/package/debug) package. Use `export DEBUG="tonomy*"` to see all debug logs.
6 changes: 0 additions & 6 deletions babel.config.json

This file was deleted.

31 changes: 0 additions & 31 deletions custom-test-env.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/guides/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Please <a href="https://tonomy.io/contact" target="_blank">contact us</a> for as
## Prerequisites

- Tonomy ID services run exclusively in `Linux`, we recommend Ubuntu 20.04 or 22.04.
- `npm` with `corepack enabled`, we recommend v18.12.1. Suggested to install with nvm v0.35+
- `npm` with `corepack enabled`, we recommend v22.3.0. Suggested to install with nvm v0.35+

## Services to run Tonomy ID

Expand Down
12 changes: 1 addition & 11 deletions docs/start/single-sign-on.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,7 @@ Currently, only the `username` is able to be requested. We are working on suppor

### Styling the Tonomy login button

To use the Tonomy login button styles, import the stylesheet and use the class `tonomy-login-button` on your button.

```typescript
import "@tonomy/tonomy-id-sdk/build/api/tonomy.css";
```

or

```html
<link href="https://unpkg.com/@tonomy/tonomy-id-sdk/build/api/tonomy.css" />
```
TODO: need to provide this in the gitbook docs

## 3. Callback page

Expand Down
51 changes: 51 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-plugin-prettier/recommended';
import globals from 'globals';

export default [
eslint.configs.recommended,
...tseslint.configs.recommended,
prettier,
{
rules: {
eqeqeq: 'error',
'no-console': 'warn',
indent: ['error', 4, { SwitchCase: 1 }],
camelcase: 'error',
'prettier/prettier': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'padding-line-between-statements': [
'warn',
{ blankLine: 'always', prev: 'block-like', next: '*' },
{ blankLine: 'always', prev: 'block', next: '*' },
{ blankLine: 'always', prev: '*', next: ['block', 'block-like'] },
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'always', prev: ['export', 'import'], next: '*' },
{ blankLine: 'any', prev: 'import', next: 'import' },
{ blankLine: 'any', prev: 'export', next: 'export' },
],
},
languageOptions: {
ecmaVersion: 6,
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.es6,
...globals.jest,
},
},
files: ['**/*.js', '**/*.ts'],
ignores: ['build/**'],
},
];
Loading
Loading