Skip to content

Commit

Permalink
chore: cleanup (#112)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra authored Jun 24, 2024
1 parent 4dec778 commit b709b0e
Show file tree
Hide file tree
Showing 46 changed files with 98 additions and 169 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ jobs:
- name: Compile
run: pnpm build

- name: Linting
run: pnpm lint

- name: Formatting
run: pnpm format
- name: Check Style
run: pnpm style:check

- name: Check Types
run: pnpm check-types
run: pnpm types:check
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ The project is a monorepo managed using **pnpm**, which contains an **Expo React
The folder structure is as follows

- `apps` top level applications
- `expo` react native app for iOS & Android
- `paradym` Paradym Wallet - react native app for iOS & Android
- `funke` Funke Wallet - react native app for iOS & Android
- `packages` shared packages
- `ui` includes our custom UI kit that will be optimized by Tamagui
- `agent` includes the Aries Framework JavaScript (AFJ) agent and SSI capabilities
Expand All @@ -44,15 +45,15 @@ The folder structure is as follows

You can add other folders inside of `packages/` if you know what you're doing and have a good reason to.

## 🏁 Start the Paradym wallet
## 🏁 Start a wallet

First, start by installing all dependencies by running `pnpm install`.

Once all dependencies are installed, you need to make sure you have a development build of the app on your mobile device.
You can install this using the following commands:

```
cd apps/paradym
```sh
cd apps/paradym # or apps/funke
pnpm prebuild
pnpm ios # or android
```
Expand All @@ -65,7 +66,6 @@ Once installed you can run `pnpm start` from the root of the project to start yo

🚧 Soon documentation will be added on how to publish a new release to the Apple App Store and Google Play Stores. 🚧


## 🆕 Add new dependencies

### Pure JS dependencies
Expand Down
23 changes: 9 additions & 14 deletions apps/funke/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import type { OpenId4VcHolderAppAgent } from '@package/agent'

import { AgentProvider } from '@package/agent'
import { useTransparentNavigationBar, Provider, NoInternetToastProvider, isAndroid } from '@package/app'
import {
DeeplinkHandler,
NoInternetToastProvider,
Provider,
isAndroid,
useFonts,
useTransparentNavigationBar,
} from '@package/app'
import { Heading, Page, Paragraph, XStack, YStack, config, useToastController } from '@package/ui'
import { getSecureWalletKey } from '@package/utils'
import { DefaultTheme, ThemeProvider } from '@react-navigation/native'
import { useFonts } from 'expo-font'
import { Stack } from 'expo-router'
import * as SplashScreen from 'expo-splash-screen'
import { useEffect, useState } from 'react'
import { useSafeAreaInsets } from 'react-native-safe-area-context'

import { DeeplinkHandler } from './utils'

import { initializeAppAgent } from '.'

void SplashScreen.preventAutoHideAsync()
Expand All @@ -23,16 +27,7 @@ export const unstable_settings = {
}

export default function HomeLayout() {
const [fontLoaded] = useFonts({
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
InterRegular: require('@tamagui/font-inter/otf/Inter-Regular.otf'),
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Inter: require('@tamagui/font-inter/otf/Inter-Medium.otf'),
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
InterSemiBold: require('@tamagui/font-inter/otf/Inter-SemiBold.otf'),
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
InterBold: require('@tamagui/font-inter/otf/Inter-Bold.otf'),
})
const [fontLoaded] = useFonts()
const [agent, setAgent] = useState<OpenId4VcHolderAppAgent>()

const [agentInitializationFailed, setAgentInitializationFailed] = useState(false)
Expand Down
2 changes: 1 addition & 1 deletion apps/funke/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { OpenId4VcHolderAppAgent } from '@package/agent'

import { initializeOpenId4VcHolderAgent, useAgent } from '@package/agent'
import { XStack } from '@package/ui'
import { WalletScreen } from '@package/app'
import { XStack } from '@package/ui'
import { Stack } from 'expo-router'
import { useSafeAreaInsets } from 'react-native-safe-area-context'

Expand Down
1 change: 0 additions & 1 deletion apps/funke/app/utils/index.ts

This file was deleted.

16 changes: 5 additions & 11 deletions apps/paradym/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import type { FullAppAgent } from '@package/agent'

import { AgentProvider, hasMediationConfigured, setupMediationWithDid, useMessagePickup } from '@package/agent'
import {
AgentProvider,
hasMediationConfigured,
initializeFullAgent,
setupMediationWithDid,
useMessagePickup,
} from '@package/agent'
import {
useHasInternetConnection,
useTransparentNavigationBar,
Provider,
DeeplinkHandler,
NoInternetToastProvider,
Provider,
isAndroid,
useHasInternetConnection,
useTransparentNavigationBar,
} from '@package/app'
import { Heading, Page, Paragraph, XStack, YStack, config, useToastController } from '@package/ui'
import { getSecureWalletKey } from '@package/utils'
Expand All @@ -25,7 +20,6 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { initializeAppAgent } from '.'

import { mediatorDid } from './constants'
import { DeeplinkHandler } from './utils'

void SplashScreen.preventAutoHideAsync()

Expand Down
2 changes: 1 addition & 1 deletion apps/paradym/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { FullAppAgent } from '@package/agent'

import { initializeFullAgent, useAgent } from '@package/agent'
import { XStack } from '@package/ui'
import { WalletScreen } from '@package/app'
import { XStack } from '@package/ui'
import { Stack } from 'expo-router'
import { useSafeAreaInsets } from 'react-native-safe-area-context'

Expand Down
69 changes: 0 additions & 69 deletions apps/paradym/app/utils/DeeplinkHandler.tsx

This file was deleted.

1 change: 0 additions & 1 deletion apps/paradym/app/utils/index.ts

This file was deleted.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
"upgrade:tamagui:canary": "pnpm up '*tamagui*'@canary '@tamagui/*'@canary",
"deps:check": "check-dependency-version-consistency .",
"deps:fix": "pnpm deps:check --fix",
"check-types": "tsc --noEmit",
"lint": "biome lint .",
"lint:fix": "pnpm lint --write --unsafe",
"format": "biome format .",
"format:fix": "pnpm format --fix"
"types:check": "tsc --noEmit",
"style:check": "biome check --unsafe",
"style:fix": "biome check --write --unsafe"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/didcomm/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { OpenId4VcCredentialMetadata } from '../openid4vc/metadata'
import type { CredentialExchangeRecord, ProofExchangeRecord } from '@credo-ts/core'
import type { OpenId4VcCredentialMetadata } from '../openid4vc/metadata'

export interface DidCommCredentialExchangeDisplayMetadata {
issuerName?: string
Expand Down
6 changes: 3 additions & 3 deletions packages/agent/src/display.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { W3cCredentialRecord } from '@credo-ts/core'
import type { CredentialForDisplayId } from './hooks'
import type { OpenId4VcCredentialMetadata } from './openid4vc/metadata'
import type { W3cCredentialJson, W3cIssuerJson } from './types'
import type { W3cCredentialRecord } from '@credo-ts/core'

import { Hasher, SdJwtVcRecord, ClaimFormat, JsonTransformer } from '@credo-ts/core'
import { sanitizeString, getHostNameFromUrl } from '@package/utils'
import { ClaimFormat, Hasher, JsonTransformer, SdJwtVcRecord } from '@credo-ts/core'
import { getHostNameFromUrl, sanitizeString } from '@package/utils'
import { decodeSdJwtSync, getClaimsSync } from '@sd-jwt/decode'

import { getOpenId4VcCredentialMetadata } from './openid4vc/metadata'
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/fixtures/dbcCredential.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FullAppAgent } from '../agent'
import type { JwkDidCreateOptions } from '@credo-ts/core'
import type { FullAppAgent } from '../agent'

import { KeyType, TypedArrayEncoder, W3cJwtVerifiableCredential } from '@credo-ts/core'

Expand Down
4 changes: 2 additions & 2 deletions packages/agent/src/hooks/useDidCommCredentialActions.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { CredentialStateChangedEvent } from '@credo-ts/core'

import { W3cCredentialRepository, CredentialState, CredentialEventTypes } from '@credo-ts/core'
import { CredentialEventTypes, CredentialState, W3cCredentialRepository } from '@credo-ts/core'
import { useCredentialById } from '@credo-ts/react-hooks'
import { useMutation, useQuery } from '@tanstack/react-query'
import { firstValueFrom } from 'rxjs'
import { filter, first, timeout } from 'rxjs/operators'

import { useAgent } from '../agent'
import {
openIdCredentialMetadataFromDidCommCredentialExchangeMetadata,
getDidCommCredentialExchangeDisplayMetadata,
openIdCredentialMetadataFromDidCommCredentialExchangeMetadata,
} from '../didcomm/metadata'
import { setOpenId4VcCredentialMetadata } from '../openid4vc/metadata'

Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/hooks/useDidCommPresentationActions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { FormattedSubmission } from '../format/formatPresentation'
import type {
AnonCredsPredicateType,
AnonCredsRequestedAttributeMatch,
AnonCredsRequestedPredicate,
AnonCredsRequestedPredicateMatch,
} from '@credo-ts/anoncreds'
import type { ProofStateChangedEvent } from '@credo-ts/core'
import type { FormattedSubmission } from '../format/formatPresentation'

import { CredentialRepository, CredoError, ProofEventTypes, ProofState } from '@credo-ts/core'
import { useConnectionById, useProofById } from '@credo-ts/react-hooks'
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/hooks/useInboxNotifications.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CredentialState, ProofState } from '@credo-ts/core'
import { useConnections, useCredentialByState, useProofByState } from '@credo-ts/react-hooks'
import { useMemo, useEffect } from 'react'
import { useEffect, useMemo } from 'react'

import { useAgent } from '../agent'
import {
Expand Down
28 changes: 14 additions & 14 deletions packages/agent/src/invitation/handler.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
import type { FullAppAgent } from '../agent'
import type {
ConnectionRecord,
CredentialStateChangedEvent,
DifPexCredentialsForRequest,
JwkDidCreateOptions,
KeyDidCreateOptions,
OutOfBandInvitation,
OutOfBandRecord,
ProofStateChangedEvent,
DifPexCredentialsForRequest,
} from '@credo-ts/core'
import type { PlaintextMessage } from '@credo-ts/core/build/types'
import type {
OpenId4VciCredentialSupportedWithId,
OpenId4VcSiopVerifiedAuthorizationRequest,
OpenId4VciCredentialSupportedWithId,
} from '@credo-ts/openid4vc'
import type { FullAppAgent } from '../agent'

import { V1OfferCredentialMessage, V1RequestPresentationMessage } from '@credo-ts/anoncreds'
import {
DifPresentationExchangeService,
SdJwtVcRecord,
SdJwtVcRepository,
W3cCredentialRecord,
W3cCredentialRepository,
getJwkFromKey,
CredentialEventTypes,
CredentialState,
DidJwk,
DidKey,
DifPresentationExchangeService,
JwaSignatureAlgorithm,
OutOfBandRepository,
parseMessageType,
ProofEventTypes,
ProofState,
SdJwtVcRecord,
SdJwtVcRepository,
V2OfferCredentialMessage,
V2RequestPresentationMessage,
DidJwk,
DidKey,
JwaSignatureAlgorithm,
W3cCredentialRecord,
W3cCredentialRepository,
getJwkFromKey,
parseMessageType,
} from '@credo-ts/core'
import { supportsIncomingMessageType } from '@credo-ts/core/build/utils/messageType'
import { OpenId4VciCredentialFormatProfile } from '@credo-ts/openid4vc'
import { getHostNameFromUrl } from '@package/utils'
import { filter, firstValueFrom, merge, first, timeout } from 'rxjs'
import { filter, first, firstValueFrom, merge, timeout } from 'rxjs'

import { extractOpenId4VcCredentialMetadata, setOpenId4VcCredentialMetadata } from '../openid4vc/metadata'

Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/openid4vc/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { W3cCredentialRecord, SdJwtVcRecord } from '@credo-ts/core'
import type { SdJwtVcRecord, W3cCredentialRecord } from '@credo-ts/core'
import type { OpenId4VciCredentialSupported, OpenId4VciIssuerMetadataDisplay } from '@credo-ts/openid4vc'
import type { EndpointMetadataResult } from '@sphereon/oid4vci-common'

Expand Down
4 changes: 2 additions & 2 deletions packages/agent/src/providers/SdJwtVcsProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { FullAppAgent } from '../agent'
import type { PropsWithChildren } from 'react'
import type { FullAppAgent } from '../agent'

import { SdJwtVcRecord } from '@credo-ts/core'
import { recordsAddedByType, recordsRemovedByType, recordsUpdatedByType } from '@credo-ts/react-hooks/build/recordUtils'
import { useState, createContext, useContext, useEffect } from 'react'
import { createContext, useContext, useEffect, useState } from 'react'
import type * as React from 'react'

export { SdJwtVc, SdJwtVcRecord } from '@credo-ts/core'
Expand Down
4 changes: 2 additions & 2 deletions packages/agent/src/providers/W3cCredentialsProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { FullAppAgent } from '../agent'
import type { PropsWithChildren } from 'react'
import type { FullAppAgent } from '../agent'

import { W3cCredentialRecord } from '@credo-ts/core'
import { recordsAddedByType, recordsRemovedByType, recordsUpdatedByType } from '@credo-ts/react-hooks/build/recordUtils'
import { useState, createContext, useContext, useEffect } from 'react'
import { createContext, useContext, useEffect, useState } from 'react'
import type * as React from 'react'

export { W3cCredentialRecord, W3cVerifiableCredential } from '@credo-ts/core'
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/CredentialAttributes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { YStack, Paragraph, TableContainer, TableRow, CornerDownRight, XStack, Heading } from '@package/ui'
import { CornerDownRight, Heading, Paragraph, TableContainer, TableRow, XStack, YStack } from '@package/ui'

import { formatCredentialSubject } from '../utils'

Expand Down
Loading

0 comments on commit b709b0e

Please sign in to comment.