diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 45cf2c1..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - root: true, - extends: ['universe/native', 'universe/web'], - ignorePatterns: ['build'], -}; diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5e6a32b..80e1549 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,9 +35,15 @@ jobs: - name: Install dependencies run: pnpm install + - name: Style + run: pnpm style:check + - name: Build run: pnpm build + - name: Check types + run: pnpm types:check + continuous-deployment: if: github.event_name == 'workflow_dispatch' diff --git a/.release-it.json b/.release-it.json index da9bcc6..de3f599 100644 --- a/.release-it.json +++ b/.release-it.json @@ -4,6 +4,7 @@ }, "npm": { "skipChecks": true, + "ignoreVersion": true, "tag": "latest" }, "git": { diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..27e72e9 --- /dev/null +++ b/biome.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.1/schema.json", + "formatter": { + "lineWidth": 120, + "indentStyle": "space" + }, + "javascript": { + "parser": { + "unsafeParameterDecoratorsEnabled": true + }, + "formatter": { + "semicolons": "asNeeded", + "quoteStyle": "single", + "trailingCommas": "es5", + "lineWidth": 120, + "indentStyle": "space" + } + }, + "json": { + "parser": { + "allowComments": true + } + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true + }, + "vcs": { + "useIgnoreFile": true, + "clientKind": "git", + "enabled": true + } +} diff --git a/example/App.tsx b/example/App.tsx index 5fca13c..d241eee 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -1,74 +1,70 @@ -import { - ariesAskar, - KeyAlgs, - LocalKeyHandle, -} from "@hyperledger/aries-askar-react-native"; -import { - sign, - generateKeypair, - getPublicBytesForKeyId, -} from "expo-secure-environment"; -import { Button } from "react-native"; -import { StyleSheet, View } from "react-native"; +import { generateKeypair, getPublicBytesForKeyId, sign } from '@animo-id/expo-secure-environment' +import { KeyAlgs, LocalKeyHandle, ariesAskar } from '@hyperledger/aries-askar-react-native' +import { Button } from 'react-native' +import { StyleSheet, View } from 'react-native' export default function App() { const testBiometrics = async () => { - try{ - const id = new Date().toString(); - generateKeypair(id, true); - const publicKey = getPublicBytesForKeyId(id); - const key = ariesAskar.keyFromPublicBytes({ - algorithm: KeyAlgs.EcSecp256r1, - publicKey, - }); - const kHandle = new LocalKeyHandle(key.handle); - const message = new Uint8Array(10).fill(10); - const signature = await sign(id, new Uint8Array(message), true); - const isValid = ariesAskar.keyVerifySignature({ - message, - signature, - localKeyHandle: kHandle, - }); + try { + const id = new Date().toString() + generateKeypair(id, true) + const publicKey = getPublicBytesForKeyId(id) + const key = ariesAskar.keyFromPublicBytes({ + algorithm: KeyAlgs.EcSecp256r1, + publicKey, + }) + const kHandle = new LocalKeyHandle(key.handle) + const message = new Uint8Array(10).fill(10) + const signature = await sign(id, new Uint8Array(message), true) + const isValid = ariesAskar.keyVerifySignature({ + message, + signature, + localKeyHandle: kHandle, + }) - console.log(isValid); - }catch(e) { - console.error('ERRRRRR', e) + console.log('Signing with biometrics enabled isValid: ', isValid) + } catch (e) { + console.error('Error signing with biometrics enabled', e) } - }; + } const testNoBiometrics = async () => { - const id = new Date().toString(); - generateKeypair(id, false); - const publicKey = getPublicBytesForKeyId(id); - const key = ariesAskar.keyFromPublicBytes({ - algorithm: KeyAlgs.EcSecp256r1, - publicKey, - }); - const kHandle = new LocalKeyHandle(key.handle); - const message = new Uint8Array(10).fill(10); - const signature = await sign(id, new Uint8Array(message), false); - const isValid = ariesAskar.keyVerifySignature({ - message, - signature, - localKeyHandle: kHandle, - }); + try { + const id = new Date().toString() + generateKeypair(id, false) + const publicKey = getPublicBytesForKeyId(id) + const key = ariesAskar.keyFromPublicBytes({ + algorithm: KeyAlgs.EcSecp256r1, + publicKey, + }) + const kHandle = new LocalKeyHandle(key.handle) + const message = new Uint8Array(10).fill(10) + const signature = await sign(id, new Uint8Array(message), false) + const isValid = ariesAskar.keyVerifySignature({ + message, + signature, + localKeyHandle: kHandle, + }) - console.log(isValid); - }; + console.log('Signing with biometrics disabled isValid: ', isValid) + } catch (e) { + console.error('Error signing with biometrics disabled', e) + } + } return (