Skip to content

Commit

Permalink
fix: remove submodule for polygonid js-sdk (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 authored Aug 3, 2023
1 parent a64c1ae commit c8bc0d2
Show file tree
Hide file tree
Showing 23 changed files with 205 additions and 1,774 deletions.
6 changes: 6 additions & 0 deletions .changeset/afraid-beers-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@blockchain-lab-um/masca-connector': patch
'@blockchain-lab-um/dapp': patch
---

Use default import for mascaVersionJson
6 changes: 6 additions & 0 deletions .changeset/witty-swans-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@blockchain-lab-um/masca-types': patch
'@blockchain-lab-um/masca': patch
---

Replaces @0xpolygonid/js-sdk with stable version and removes the corresponding submodule
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ on:
jobs:
main:
name: Nx Cloud - Main Job
uses: blockchain-lab-um/ci/.github/workflows/[email protected].1
uses: nrwl/ci/.github/workflows/[email protected].0
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
pnpm-version: 8.6.10
node-version: 18.16.0
number-of-agents: 4
submodules: true
main-branch-name: 'develop'
init-commands: |
npx nx-cloud record -- pnpm exec prettier . --check
Expand All @@ -30,11 +29,10 @@ jobs:
agents:
name: Nx Cloud - Agents
uses: blockchain-lab-um/ci/.github/workflows/[email protected].1
uses: nrwl/ci/.github/workflows/[email protected].0
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
number-of-agents: 4
pnpm-version: 8.6.10
node-version: 18.16.0
submodules: true
2 changes: 0 additions & 2 deletions .github/workflows/deploy_issuer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Create nx-cloud.env
run: echo "NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN" > nx-cloud.env
Expand All @@ -51,7 +50,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Create nx-cloud.env
run: echo "NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN" > nx-cloud.env
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/deploy_verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Create nx-cloud.env
run: echo "NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN" > nx-cloud.env
Expand All @@ -51,7 +50,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Create nx-cloud.env
run: echo "NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN" > nx-cloud.env
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
with:
ref: master
fetch-depth: 0
submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
with:
ref: develop
fetch-depth: 0
submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
Expand Down Expand Up @@ -52,7 +51,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
Expand Down Expand Up @@ -88,7 +86,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
Expand Down Expand Up @@ -124,7 +121,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
Expand Down Expand Up @@ -160,7 +156,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
Expand Down Expand Up @@ -196,7 +191,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Scan connector
uses: SonarSource/sonarcloud-github-action@master
Expand All @@ -215,7 +209,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Scan dapp
uses: SonarSource/sonarcloud-github-action@master
Expand All @@ -234,7 +227,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Scan docs
uses: SonarSource/sonarcloud-github-action@master
Expand All @@ -253,7 +245,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/sync_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
ref: develop
- name: Git config
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/sync_fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
ref: ${{ github.head_ref || github.ref_name }}
- uses: webfactory/[email protected]
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
with:
ref: master
fetch-depth: 0
submodules: true

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion external/js-sdk
Submodule js-sdk deleted from 84e8ef
4 changes: 2 additions & 2 deletions packages/connector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import { isError, ResultObject, type Result } from '@blockchain-lab-um/utils';
import detectEthereumProvider from '@metamask/detect-provider';

import { mascaVersion } from './masca.json';
import mascaVersionJson from './masca.json';
import { Masca } from './snap.js';

export { Masca } from './snap.js';
Expand Down Expand Up @@ -38,7 +38,7 @@ export async function enableMasca(
): Promise<Result<Masca>> {
const {
snapId = defaultSnapOrigin,
version = mascaVersion,
version = mascaVersionJson.mascaVersion,
supportedMethods = availableMethods as unknown as Array<AvailableMethods>,
} = snapInstallationParams;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { enableMasca, isError } from '@blockchain-lab-um/masca-connector';
import detectEthereumProvider from '@metamask/detect-provider';
import { shallow } from 'zustand/shallow';

import { mascaVersion } from '@/utils/masca.json';
import mascaVersionJson from '@/utils/masca.json';
import { useGeneralStore, useMascaStore } from '@/stores';

const snapId =
Expand Down Expand Up @@ -119,7 +119,7 @@ const CheckMetaMaskCompatibility = () => {
const enableMascaHandler = async () => {
const enableResult = await enableMasca(address, {
snapId,
version: mascaVersion,
version: mascaVersionJson.mascaVersion,
});
if (isError(enableResult)) {
// FIXME: This error is shown as [Object object]
Expand Down
3 changes: 2 additions & 1 deletion packages/snap/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ esbuild.build({
treeShaking: true,
tsconfig: 'tsconfig.build.json',
alias: {
// "@0xpolygonid/js-sdk":'../../node_modules/.pnpm/github.com+0xPolygonID+js-sdk@b50447564b642c3835c811bd32e1350eb189578c_xr65kx4diede7av7icn3kqhvj4/node_modules/@0xpolygonid/js-sdk/dist/esm/index.js'
'@0xpolygonid/js-sdk':
'../../node_modules/.pnpm/@[email protected]/node_modules/@0xpolygonid/js-sdk/dist/esm/index.js',
},
plugins: [plugin(stdLibBrowser)],
inject: [require.resolve('node-stdlib-browser/helpers/esbuild/shim')],
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"test:ci": "pnpm run test --silent --coverage"
},
"dependencies": {
"@0xpolygonid/js-sdk": "2.0.0",
"@0xpolygonid/js-sdk": "1.0.1",
"@babel/runtime": "7.22.3",
"@blockchain-lab-um/did-provider-ebsi": "1.0.0",
"@blockchain-lab-um/did-provider-key": "1.0.2-beta.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"registry": "https://registry.npmjs.org"
}
},
"shasum": "4P3iXGLvQa5sVBGhUoyDNaRE5UTZqNQoOMoyPO98ScI="
"shasum": "tp9Yv257kKtVVaA6LEYquO6eMx4lx7/EduNbf8RN0yo="
},
"initialPermissions": {
"endowment:ethereum-provider": {},
Expand Down
3 changes: 1 addition & 2 deletions packages/snap/src/polygon-id/Polygon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ class PolygonService {
const { authHandler } = this.instance[method][blockchain][networkId];

const messageBytes = byteEncoder.encode(authorizationRequest);

try {
const did = DID.parse(await this.getIdentifier());

Expand Down Expand Up @@ -482,7 +481,7 @@ class PolygonService {
[
mapKey,
{
key: circuitData.verificationKey,
key: circuitData.verificationKey as Uint8Array,
verificationFn,
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"typia:generate": "pnpm typia generate --input typia-templates --output src/typia-generated --project tsconfig.json"
},
"dependencies": {
"@0xpolygonid/js-sdk": "2.0.0",
"@0xpolygonid/js-sdk": "1.0.1",
"@blockchain-lab-um/utils": "1.3.1-beta.0",
"@iden3/js-iden3-core": "1.0.0",
"@veramo/core": "5.2.0",
Expand Down
Loading

0 comments on commit c8bc0d2

Please sign in to comment.