Skip to content

Commit

Permalink
Merge pull request tkey#233 from tkey/feat/master-merge-mpc
Browse files Browse the repository at this point in the history
Feat/master merge mpc
  • Loading branch information
chaitanyapotti authored Oct 3, 2023
2 parents 977b239 + 6cb9cf4 commit 30b60b5
Show file tree
Hide file tree
Showing 85 changed files with 10,961 additions and 33,466 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
root: true,
extends: ["@toruslabs/typescript"],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: 2022,
project: "./tsconfig.json",
},
ignorePatterns: ["*.config.js", ".eslintrc.js"],
globals: {
atob: true,
btoa: true,
document: true,
fetch: true,
jest: true,
it: true,
beforeEach: true,
afterEach: true,
describe: true,
expect: true,
chrome: true,
FileSystem: true,
FileEntry: true,
},
};
25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

29 changes: 10 additions & 19 deletions .github/workflows/backward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Backward Compatibility Tests
strategy:
matrix:
node: ["16.x"]
node: ["20.x"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand All @@ -27,37 +27,28 @@ jobs:
- name: checkout tkey repo
uses: actions/checkout@v3
with:
repository: tkey/tkey
path: ./tkey
path: tkey

- name: switch path
run: |
cd ./tkey
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies, bootstrap, pack
- name: Install dependencies, pack
run: |
cd ./tkey
npm ci
npm run pack:lerna
- name: Clone comp tests
uses: actions/checkout@master
uses: actions/checkout@v3
with:
repository: tkey/backward-compatibility-tests
path: ./backward-compatibility-tests
path: backward-compatibility-tests

- name: Setup comp tests
run: |
Expand Down
27 changes: 8 additions & 19 deletions .github/workflows/browserTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on: [push]

env:
PLAYWRIGHT_BROWSERS_PATH: 0
NODE_VERSION: 16
NODE_VERSION: 20
FORCE_COLOR: 3

jobs:
test:
strategy:
max-parallel: 1
matrix:
browser: [chromium, firefox]
# browser: [chromium, firefox, webkit]
Expand All @@ -32,41 +33,29 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js dependencies
run: npm ci

- name: Browser Test Development Chrome (Mocked)
if: startsWith(matrix.browser, 'chromium')
run: yarn run browser-tests:local-mocked-chrome
run: npm run browser-tests:local-mocked-chrome

- name: Browser Test Development Firefox (Mocked)
if: startsWith(matrix.browser, 'firefox')
run: yarn run browser-tests:local-mocked-firefox
run: npm run browser-tests:local-mocked-firefox

# - name: Browser Test Development webkit (Mocked)
# if: startsWith(matrix.browser, 'webkit')
# run: yarn run browser-tests:local-mocked-webkit
# run: npm run browser-tests:local-mocked-webkit

- name: Browser Test Production Chrome (Prod)
if: startsWith(matrix.browser, 'chromium')
run: yarn run browser-tests:local-prod-chrome
run: npm run browser-tests:local-prod-chrome

# - name: Browser Test Production Firefox (prod)
# if: startsWith(matrix.browser, 'firefox')
# run: yarn run browser-tests:local-prod-firefox
# run: npm run browser-tests:local-prod-firefox

# - name: Browser Test Production webkit (prod)
# if: startsWith(matrix.browser, 'webkit')
# run: yarn run browser-tests:local-prod-webkit
# run: npm run browser-tests:local-prod-webkit
16 changes: 2 additions & 14 deletions .github/workflows/buildMocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Backward Compatibility Tests
strategy:
matrix:
node: ["16.x"]
node: ["20.x"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand All @@ -30,19 +30,7 @@ jobs:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies, bootstrap, pack
- name: Install dependencies, pack
run: |
cd ./tkey
npm ci
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
node: ["16.x"]
node: ["20.x"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand All @@ -21,26 +21,14 @@ jobs:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

- name: Build & Lint
run: yarn run build
run: npm run build

- name: Test Development
run: yarn run test
run: npm run test

- name: Test Production
run: yarn run test-production
run: npm run test-production
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
>=14.17
>=18.x
3 changes: 2 additions & 1 deletion .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# .prettierrc or .prettierrc.yaml
printWidth: 150
singleQuote: false
semi: true
semi: true
trailingComma: es5
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"eslint.workingDirectories": [
{
"directory": "packages/*",
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ user three shares: ShareA, ShareB, and ShareC.

Similar to existing 2FA systems, a user needs to prove ownership of at least 2 out of 3 (2/3) shares, in order to retrieve his private key.

For more information, check out the [technical overview](https://hackmd.io/Tej2tf83SZOxZmz70ObEpg). Before integrating you can also check out the example for [tKey](https://github.com/tkey/tkey-example).
For more information, check out the [technical overview](https://hackmd.io/Tej2tf83SZOxZmz70ObEpg). Before integrating you can also check out the example for [tKey](https://github.com/tkey/tkey-example).

### To use the SDK in your application, please refer to our [SDK Reference](https://web3auth.io/docs/sdk/self-host/installation) in Web3Auth Documentation

Expand Down Expand Up @@ -58,22 +58,21 @@ For more information, check out the [technical overview](https://hackmd.io/Tej2t
### Requirements

- This package requires a peer dependency of `@babel/runtime`
- Node 14+
- Node 18+

### Installation

```
npm run bootstrap
npm install
npm run pack:lerna
```

## Bundling

Each sub package is distributed in 4 formats
Each sub package is distributed in 3 formats

- `esm` build `dist/<MODULE_NAME>.esm.js` in es6 format
- `commonjs` build `dist/<MODULE_NAME>.cjs.js` in es5 format
- `commonjs` build `dist/<MODULE_NAME>-bundled.cjs.js` in es5 format with problematic packages bundled (benfits non-webpack users)
- `umd` build `dist/<MODULE_NAME>.umd.min.js` in es5 format without polyfilling corejs minified

By default, the appropriate format is used for your specified usecase
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@toruslabs/config/babel.config");
5 changes: 0 additions & 5 deletions babel.config.json

This file was deleted.

3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"version": "8.2.2",
"packages": ["packages/*"],
"npmClient": "npm",
"useWorkspaces": true
"npmClient": "npm"
}
Loading

0 comments on commit 30b60b5

Please sign in to comment.