Skip to content

Commit 2b6e72f

Browse files
committed
start monorepo
1 parent 64b8f7a commit 2b6e72f

21 files changed

+20895
-80
lines changed

.prettierrc.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
overrides: [
3+
{
4+
files: '**/*.sol',
5+
options: {
6+
printWidth: 100,
7+
tabWidth: 2,
8+
},
9+
},
10+
{
11+
files: ['**/*.js', '**/*.ts', '**/*.vue'],
12+
options: {
13+
bracketSpacing: true,
14+
trailingComma: 'es5',
15+
tabWidth: 2,
16+
printWidth: 100,
17+
singleQuote: true,
18+
semi: true,
19+
},
20+
},
21+
],
22+
};

contracts/.prettierrc

-11
This file was deleted.

contracts/.prettierrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
...require('../.prettierrc.js'),
3+
};

contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "umbra-contracts",
2+
"name": "@umbra/contracts",
33
"version": "0.0.1",
44
"description": "Contracts for the Umbra Protocol",
55
"scripts": {

frontend/.prettierrc

-8
This file was deleted.

frontend/.prettierrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
...require('../.prettierrc.js'),
3+
};

frontend/package.json

+6-19
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
2-
"name": "umbra-frontend",
2+
"name": "@umbra/frontend",
33
"version": "0.0.1",
44
"description": "Send and receive stealth payments with the Umbra protocol",
55
"productName": "Umbra",
66
"author": "Matt Solomon <[email protected]>",
77
"private": true,
88
"scripts": {
99
"lint": "eslint --ext .js,.ts,.vue ./",
10-
"prettier": "npx prettier --write .",
10+
"prettier": "prettier --write .",
1111
"test": "echo \"No test specified\" && exit 0",
12-
"dev": "npx quasar dev",
13-
"build": "npx quasar build"
12+
"dev": "quasar dev",
13+
"build": "quasar build",
14+
"clean": "rimraf build"
1415
},
1516
"dependencies": {
1617
"@quasar/extras": "^1.0.0",
@@ -27,13 +28,8 @@
2728
"@typescript-eslint/eslint-plugin": "^3.3.0",
2829
"@typescript-eslint/parser": "^3.3.0",
2930
"babel-eslint": "^10.0.1",
30-
"eslint": "^6.8.0",
31-
"eslint-config-prettier": "^6.9.0",
3231
"eslint-loader": "^3.0.3",
33-
"eslint-plugin-vue": "^6.1.2",
34-
"husky": "^4.3.0",
35-
"lint-staged": ">=10",
36-
"prettier": "^2.1.1"
32+
"eslint-plugin-vue": "^6.1.2"
3733
},
3834
"browserslist": [
3935
"last 10 Chrome versions",
@@ -50,14 +46,5 @@
5046
"node": ">= 10.18.1",
5147
"npm": ">= 6.13.4",
5248
"yarn": ">= 1.21.1"
53-
},
54-
"husky": {
55-
"hooks": {
56-
"pre-commit": "lint-staged && yarn build"
57-
}
58-
},
59-
"lint-staged": {
60-
"*.{js,ts,vue}": "eslint --cache --fix",
61-
"*.{js,ts,css,md}": "prettier --write"
6249
}
6350
}

frontend/src/components/models.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ethers } from 'ethers';
2-
import KeyPairClass from '../../../umbra-js/classes/KeyPair.js';
2+
import { KeyPair } from '@umbra/umbra-js';
33

44
export type Signer = ethers.providers.JsonRpcSigner;
55
export type Provider = ethers.providers.Web3Provider;
66
export type Network = ethers.providers.Network;
77
export type BigNumber = ethers.BigNumber;
88
export type TransactionResponse = ethers.providers.TransactionResponse;
9-
export type KeyPair = KeyPairClass;
9+
export type KeyPair = typeof KeyPair;

frontend/src/store/keys.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { computed, ref } from '@vue/composition-api';
22
import { ethers } from 'ethers';
3-
import KeyPair from '../../../umbra-js/classes/KeyPair';
3+
import { KeyPair } from '@umbra/umbra-js';
44
import { Signer } from 'components/models';
5+
type KeyPairType = typeof KeyPair;
56

67
// ============================================= State =============================================
78
// We have two distinct key pairs generated from the same signature:
@@ -12,8 +13,8 @@ import { Signer } from 'components/models';
1213
// Public Key B used by sender for encrypting the announcement
1314
// Private Key B used by receiver for decrypting announcements
1415

15-
const keyPairStealthAddress = ref<KeyPair>();
16-
const keyPairEncryption = ref<KeyPair>();
16+
const keyPairStealthAddress = ref<KeyPairType>();
17+
const keyPairEncryption = ref<KeyPairType>();
1718

1819
// ======================================= Helper Functions ========================================
1920
/**

frontend/tsconfig.json

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
{
2-
"extends": "@quasar/app/tsconfig-preset",
2+
// "extends": "@quasar/app/tsconfig-preset",
3+
"extends": "../tsconfig.settings.json",
34
"compilerOptions": {
5+
"composite": true,
6+
"outDir": "build",
7+
"rootDir": "src",
48
"baseUrl": ".",
5-
"skipLibCheck": true,
6-
"strict": true
9+
"paths": {
10+
"src/*": ["src/*"],
11+
"app/*": ["*"],
12+
"components/*": ["src/components/*"],
13+
"layouts/*": ["src/layouts/*"],
14+
"pages/*": ["src/pages/*"],
15+
"assets/*": ["src/assets/*"],
16+
"boot/*": ["src/boot/*"]
17+
}
718
},
8-
"exclude": ["./node_modules", "./dist"]
19+
"include": ["src"]
920
}

lerna.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"packages": ["frontend", "contracts", "umbra-js"],
3+
"npmClient": "yarn",
4+
"version": "0.0.1",
5+
"useWorkspaces": true,
6+
"stream": true
7+
}

package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "umbra",
3+
"version": "0.0.1",
4+
"description": "Send and receive stealth payments with the Umbra protocol",
5+
"author": "mds <[email protected]>",
6+
"private": true,
7+
"workspaces": [
8+
"frontend",
9+
"contracts",
10+
"umbra-js"
11+
],
12+
"devDependencies": {
13+
"eslint": "^7.12.0",
14+
"eslint-config-prettier": "^6.14.0",
15+
"husky": "^4.3.0",
16+
"lerna": "^3.22.1",
17+
"lint-staged": "^10.5.1",
18+
"prettier": "^2.1.2",
19+
"rimraf": "^3.0.2",
20+
"typescript": "^4.0.3"
21+
},
22+
"scripts": {
23+
"build": "lerna run build:declarations; lerna run build",
24+
"clean": "lerna run clean",
25+
"postinstall": "lerna run build:declarations"
26+
},
27+
"husky": {
28+
"hooks": {
29+
"pre-commit": "lint-staged"
30+
}
31+
},
32+
"lint-staged": {
33+
"*.{js,ts,vue}": "eslint --cache --fix",
34+
"*.{js,ts,css,md}": "prettier --write"
35+
},
36+
"volta": {
37+
"node": "12.19.0",
38+
"yarn": "1.22.10"
39+
}
40+
}

tsconfig.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files": [],
3+
"references": [{ "path": "frontend" }, { "path": "umbra-js" }],
4+
"exclude": ["node_modules"]
5+
}

tsconfig.settings.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"module": "CommonJS",
4+
"sourceMap": true,
5+
"target": "ES2018",
6+
"strict": true,
7+
"allowJs": true,
8+
"esModuleInterop": true,
9+
"noUnusedLocals": true,
10+
"noUnusedParameters": true,
11+
"noImplicitReturns": true,
12+
"declaration": true
13+
}
14+
}

umbra-js/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
build
1+
build

umbra-js/.prettierrc

-8
This file was deleted.

umbra-js/.prettierrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
...require('../.prettierrc.js'),
3+
};

umbra-js/index.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const KeyPair = require('./classes/KeyPair');
2+
const RandomNumber = require('./classes/RandomNumber');
3+
const DomainService = require('./classes/DomainService');
4+
const ens = require('./utils/ens');
5+
const cns = require('./utils/ens');
6+
const utils = require('./utils/utils');
7+
const constants = require('./constants.json');
8+
9+
module.exports = {
10+
KeyPair,
11+
RandomNumber,
12+
DomainService,
13+
ens,
14+
cns,
15+
utils,
16+
constants,
17+
};

umbra-js/package.json

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "umbra-js",
2+
"name": "@umbra/umbra-js",
33
"version": "0.0.1",
44
"description": "Send and receive stealth payments",
55
"main": "build/index.js",
@@ -31,14 +31,11 @@
3131
"@types/elliptic": "^6.4.12",
3232
"@types/mocha": "^8.0.4",
3333
"chai": "^4.2.0",
34-
"eslint": "^7.13.0",
35-
"eslint-config-prettier": "^6.15.0",
34+
"eslint-config-prettier": "^6.11.0",
3635
"eslint-plugin-chai-friendly": "^0.6.0",
37-
"eslint-plugin-import": "^2.22.1",
38-
"mocha": "^8.2.1",
39-
"prettier": "^2.2.0",
40-
"ts-node": "^9.0.0",
41-
"typescript": "^4.1.2"
36+
"eslint-plugin-import": "^2.20.2",
37+
"mocha": "^7.1.2",
38+
"ts-node": "^9.0.0"
4239
},
4340
"keywords": [
4441
"ethereum",

umbra-js/tsconfig.json

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
{
2+
"extends": "../tsconfig.settings.json",
23
"compilerOptions": {
4+
"composite": true,
5+
"outDir": "build",
36
"declaration": true,
4-
"forceConsistentCasingInFileNames": true,
5-
"lib": ["es2015", "dom"],
6-
"module": "commonjs",
7-
"moduleResolution": "node",
8-
"noEmitOnError": true,
9-
"noFallthroughCasesInSwitch": true,
10-
"noImplicitAny": true,
11-
"noImplicitReturns": true,
12-
"noUnusedLocals": true,
13-
"noUnusedParameters": true,
14-
"outDir": "./build",
15-
"resolveJsonModule": true,
16-
"sourceMap": true,
17-
"strict": true,
18-
"target": "es5"
7+
"emitDeclarationOnly": true
198
},
209
"include": ["./src/**/*"]
2110
}

0 commit comments

Comments
 (0)