From e2b2f6e3d9ecd4d1ae22e93ab82ded4ef366312b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lenksj=C3=B6?= <5889538+lenkan@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:36:02 +0100 Subject: [PATCH] simplify prettier setup (#223) --- .jsdoc.json | 6 ++---- .prettierignore | 5 +++++ .prettierrc | 12 ++++++------ README.md | 13 +++++-------- codecov.yaml | 18 +++++++++--------- config/keria.json | 20 +++++++++----------- examples/integration-scripts/tsconfig.json | 12 ++++++------ package.json | 4 ++-- tsconfig.json | 12 ++++++------ tsconfig.node.json | 22 +++++++++++----------- types/index.d.ts | 2 +- 11 files changed, 62 insertions(+), 64 deletions(-) create mode 100644 .prettierignore diff --git a/.jsdoc.json b/.jsdoc.json index d0578e4e..894acd55 100644 --- a/.jsdoc.json +++ b/.jsdoc.json @@ -8,9 +8,7 @@ "includePattern": ".ts$", "excludePattern": "(node_modules/|docs|dist|examples|test)" }, - "plugins": [ - "plugins/markdown" - ], + "plugins": ["plugins/markdown"], "templates": { "cleverLinks": false, "monospaceLinks": true, @@ -24,4 +22,4 @@ "recurse": true, "template": "./node_modules/minami" } -} \ No newline at end of file +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..551153cb --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +diagrams/ +docs/ +package.json +package-lock.json +.github/ diff --git a/.prettierrc b/.prettierrc index 8875da91..ad9620ae 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { - "semi": true, - "trailingComma": "es5", - "singleQuote": true, - "printWidth": 80, - "tabWidth": 4 -} \ No newline at end of file + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "printWidth": 80, + "tabWidth": 4 +} diff --git a/README.md b/README.md index fe4a70e6..22635f96 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Project Name: signify-ts ## Signify - KERI Signing at the Edge -Of the five functions in a KERI agent, +Of the five functions in a KERI agent, 1. Key generation 2. Encrypted key storage @@ -19,20 +19,18 @@ Of the five functions in a KERI agent, Signify-TS splits off two, key generation and event signing into a TypeScript library to provide "signing at the edge". It accomplishes this by using [libsodium](https://doc.libsodium.org/) to generate ed25519 key pairs for signing and x25519 key pairs for encrypting the -private keys, next public keys and salts used to generate the private keys. The encrypted private key and salts are then stored on a -remote cloud agent that never has access to the decryption keys. New key pair sets (current and next) will be generated +private keys, next public keys and salts used to generate the private keys. The encrypted private key and salts are then stored on a +remote cloud agent that never has access to the decryption keys. New key pair sets (current and next) will be generated for inception and rotation events with only the public keys and blake3 hash of the next keys made available to the agent. The communication protocol between a Signify client and [KERI](https://github.com/WebOfTrust/keri) agent will encode all cryptographic primitives as CESR base64 -encoded strings for the initial implementation. Support for binary CESR can be added in the future. - +encoded strings for the initial implementation. Support for binary CESR can be added in the future. ### Environment Setup The code is built using Typescript and running code locally requires a Mac or Linux OS. -- Install [Node.js](https://nodejs.org) - +- Install [Node.js](https://nodejs.org) - Install dependencies: ```bash @@ -117,5 +115,4 @@ Account Creation Workflow ![Account Creation](/diagrams/account-creation-workflow.png) - ![Account Creation Webpage](/diagrams/account-creation-webpage-workflow.png) diff --git a/codecov.yaml b/codecov.yaml index 7c2af1c8..45ec0ff1 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -1,10 +1,10 @@ coverage: - status: - project: - default: - target: 55 - paths: ["src"] - patch: - default: - target: 75 - paths: ["src"] \ No newline at end of file + status: + project: + default: + target: 55 + paths: ['src'] + patch: + default: + target: 75 + paths: ['src'] diff --git a/config/keria.json b/config/keria.json index 2fcc8194..3094cf42 100755 --- a/config/keria.json +++ b/config/keria.json @@ -1,17 +1,15 @@ { "dt": "2023-12-01T10:05:25.062609+00:00", "keria": { - "dt": "2023-12-01T10:05:25.062609+00:00", - "curls": [ - "http://keria:3902/" - ] + "dt": "2023-12-01T10:05:25.062609+00:00", + "curls": ["http://keria:3902/"] }, "iurls": [ - "http://witness-demo:5642/oobi/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha/controller", - "http://witness-demo:5643/oobi/BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM/controller", - "http://witness-demo:5644/oobi/BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX/controller", - "http://witness-demo:5645/oobi/BM35JN8XeJSEfpxopjn5jr7tAHCE5749f0OobhMLCorE/controller", - "http://witness-demo:5646/oobi/BIj15u5V11bkbtAxMA7gcNJZcax-7TgaBMLsQnMHpYHP/controller", - "http://witness-demo:5647/oobi/BF2rZTW79z4IXocYRQnjjsOuvFUQv-ptCf8Yltd7PfsM/controller" + "http://witness-demo:5642/oobi/BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha/controller", + "http://witness-demo:5643/oobi/BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM/controller", + "http://witness-demo:5644/oobi/BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX/controller", + "http://witness-demo:5645/oobi/BM35JN8XeJSEfpxopjn5jr7tAHCE5749f0OobhMLCorE/controller", + "http://witness-demo:5646/oobi/BIj15u5V11bkbtAxMA7gcNJZcax-7TgaBMLsQnMHpYHP/controller", + "http://witness-demo:5647/oobi/BF2rZTW79z4IXocYRQnjjsOuvFUQv-ptCf8Yltd7PfsM/controller" ] - } \ No newline at end of file +} diff --git a/examples/integration-scripts/tsconfig.json b/examples/integration-scripts/tsconfig.json index 6c19b63b..e5423e88 100644 --- a/examples/integration-scripts/tsconfig.json +++ b/examples/integration-scripts/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../../tsconfig.node.json", - "compilerOptions": { - "noEmit": true, - "paths": { - "signify-ts": ["../../src"] + "extends": "../../tsconfig.node.json", + "compilerOptions": { + "noEmit": true, + "paths": { + "signify-ts": ["../../src"] + } } - } } diff --git a/package.json b/package.json index 80a3e017..b1bddadf 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "lint": "npx eslint src test examples/integration-scripts", "prepare": "npm run build", "generate-docs": "node_modules/.bin/jsdoc --configure .jsdoc.json --verbose", - "pretty": "prettier --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' 'examples/**/*.ts' --write", - "pretty:check": "prettier --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' 'examples/**/*.ts' --check" + "pretty": "prettier --write .", + "pretty:check": "prettier --check ." }, "name": "signify-ts", "author": "Phil Feairheller", diff --git a/tsconfig.json b/tsconfig.json index 75753aef..84df33bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { - "include": ["src", "types", "test", "examples/integration-scripts"], - "extends": "./tsconfig.node.json", - "compilerOptions": { - "noEmit": true, - "allowImportingTsExtensions": true - } + "include": ["src", "types", "test", "examples/integration-scripts"], + "extends": "./tsconfig.node.json", + "compilerOptions": { + "noEmit": true, + "allowImportingTsExtensions": true + } } diff --git a/tsconfig.node.json b/tsconfig.node.json index c305da5b..4f5481eb 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -1,13 +1,13 @@ { - "compilerOptions": { - "target": "ES2022", - "module": "ES2022", - "lib": ["dom", "esnext"], - "moduleResolution": "node", - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true - } + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "lib": ["dom", "esnext"], + "moduleResolution": "node", + "strict": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true + } } diff --git a/types/index.d.ts b/types/index.d.ts index 33e1af77..f9be4f0f 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1 +1 @@ -declare module 'ecdsa-secp256r1'; \ No newline at end of file +declare module 'ecdsa-secp256r1';