Skip to content

Commit aa66849

Browse files
committed
feat: 🎸 Added basic monorepo configuration
1 parent e2e9817 commit aa66849

14 files changed

+6275
-127
lines changed

‎.editorconfig

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# EditorConfig is awesome: https://EditorConfig.org
2-
31
root = true
42

53
[*]
4+
charset = utf-8
65
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
78
trim_trailing_whitespace = true
89
insert_final_newline = true
9-
indent_style = space
10-
indent_size = 2
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

‎.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ lib
66
coverage
77
typedoc
88
temp
9+
OLD_CODEBASE

‎.eslintrc.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:@typescript-eslint/recommended-type-checked",
7+
"plugin:prettier/recommended"
8+
],
9+
"plugins": ["@typescript-eslint"],
10+
"parserOptions": {
11+
"ecmaVersion": 2022,
12+
"sourceType": "module",
13+
"project": ["./tsconfig.json"]
14+
},
15+
"rules": {},
16+
"root": true,
17+
"overrides": [
18+
{
19+
"files": ["*.js"],
20+
"extends": ["plugin:@typescript-eslint/disable-type-checked"]
21+
}
22+
]
23+
}

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.yarn
12
.env
23
.env*
34
!.env.example

‎.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npx --no-install commitlint --edit ""
4+
npx --no-install commitlint --edit "$1"

‎.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
. "$(dirname "$0")/_/husky.sh"
33

44
npx lint-staged
5+
pnpm test

‎.lintstagedrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"*.{ts,js}": ["prettier --write", "eslint --fix"],
2+
"*.{ts,js}": ["prettier --write --ignore-unknown", "eslint --fix"],
33
"*.md": ["prettier --write"]
44
}

‎.prettierrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2
7+
}

‎README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@ The WindingTree market protocol SDK
99
1010
## Setup
1111

12+
> This repository uses [`pnpm` package manager](https://pnpm.io/installation).
13+
1214
```bash
13-
yarn
15+
pnpm install
1416
```
1517

1618
## Testing
1719

1820
```bash
19-
yarn test
21+
pnpm test
2022
```
2123

2224
## Tests coverage
2325

2426
```bash
25-
yarn coverage
27+
pnpm coverage
2628
```
2729

2830
After finishing of tests code coverage script, you can find reports in `./coverage/index.html`

‎lerna.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3+
"npmClient": "pnpm",
4+
"version": "independent",
5+
"packages": [
6+
"packages/*"
7+
],
8+
"command": {
9+
"version": {
10+
"conventionalCommits": true,
11+
"createRelease": "github",
12+
"exact": true,
13+
"message": "chore(release): %s"
14+
}
15+
}
16+
}

‎package.json

+21-112
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2+
"private": true,
23
"name": "@windingtree/sdk",
3-
"version": "0.0.0-semantic-release",
4+
"version": "0.0.0",
45
"description": "The WindingTree market protocol SDK",
56
"repository": "[email protected]:windingtree/sdk.git",
67
"author": "Kostiantyn Smyrnov <[email protected]>",
78
"contributors": [
8-
"Kostiantyn Smyrnov <[email protected]>"
9+
"Kostiantyn Smyrnov <[email protected]>",
10+
"Evgenij Novikov <[email protected]>"
911
],
1012
"bugs": "https://github.com/windingtree/sdk/issues",
1113
"homepage": "https://github.com/windingtree/sdk#readme",
@@ -23,123 +25,30 @@
2325
],
2426
"license": "MIT",
2527
"type": "module",
26-
"types": "./lib/index.d.ts",
27-
"main": "./lib/index.js",
28-
"typesVersions": {
29-
"*": {
30-
"*": [
31-
"*",
32-
"lib/*",
33-
"lib/*/index"
34-
]
35-
}
36-
},
37-
"files": [
38-
"src",
39-
"lib",
40-
"!**/*.tsbuildinfo"
41-
],
42-
"exports": {
43-
".": {
44-
"types": "./lib/index.d.ts",
45-
"import": "./lib/index.js"
46-
},
47-
"./utils": {
48-
"types": "./lib/utils/index.d.ts",
49-
"import": "./lib/utils/index.js"
50-
},
51-
"./server": {
52-
"types": "./lib/server/index.d.ts",
53-
"import": "./lib/server/index.js"
54-
},
55-
"./client": {
56-
"types": "./lib/client/index.d.ts",
57-
"import": "./lib/client/index.js"
58-
},
59-
"./node": {
60-
"types": "./lib/node/index.d.ts",
61-
"import": "./lib/node/index.js"
62-
}
63-
},
64-
"release": {
65-
"branches": [
66-
{
67-
"name": "master"
68-
},
69-
{
70-
"name": "beta",
71-
"channel": "beta",
72-
"prerelease": true
73-
}
74-
],
75-
"plugins": [
76-
"@semantic-release/commit-analyzer",
77-
"@semantic-release/changelog",
78-
"@semantic-release/release-notes-generator",
79-
"@semantic-release/npm",
80-
"@semantic-release/github"
81-
]
82-
},
83-
"publishConfig": {
84-
"access": "public"
85-
},
8628
"devDependencies": {
87-
"@types/node": "^18.16.19",
88-
"@types/debug": "^4.1.8",
89-
"@types/luxon": "^3.3.0",
90-
"ts-node": "^10.9.1",
91-
"typescript": "^5.1.6",
92-
"semantic-release": "^21.0.6",
93-
"semantic-release-cli": "^5.4.4",
94-
"@semantic-release/changelog": "^6.0.3",
29+
"@commitlint/cli": "^17.6.6",
30+
"@commitlint/config-conventional": "^17.6.6",
31+
"@typescript-eslint/eslint-plugin": "^6.0.0",
32+
"@typescript-eslint/parser": "^6.0.0",
9533
"eslint": "^8.44.0",
96-
"@typescript-eslint/eslint-plugin": "^5.60.1",
97-
"@typescript-eslint/parser": "^5.60.1",
98-
"prettier": "^2.8.8",
99-
"husky": "^8.0.3",
34+
"eslint-config-prettier": "^8.8.0",
35+
"eslint-plugin-prettier": "^5.0.0",
10036
"git-cz": "^4.9.0",
101-
"@commitlint/config-conventional": "^17.6.6",
102-
"@commitlint/cli": "^17.6.6",
37+
"husky": "^8.0.3",
38+
"lerna": "^7.1.3",
10339
"lint-staged": "^13.2.3",
104-
"c8": "^8.0.0",
105-
"typedoc": "^0.24.8",
106-
"dotenv": "^16.3.1",
107-
"vitest": "^0.32.4"
108-
},
109-
"dependencies": {
110-
"libp2p": "^0.45.9",
111-
"@chainsafe/libp2p-gossipsub": "^9.1.0",
112-
"@chainsafe/libp2p-noise": "^12.0.1",
113-
"@chainsafe/libp2p-yamux": "^4.0.2",
114-
"@libp2p/mplex": "^8.0.4",
115-
"@libp2p/websockets": "^6.0.3",
116-
"viem": "^1.2.9",
117-
"luxon": "^3.3.0",
118-
"h3-js": "^4.1.0",
119-
"debug": "^4.3.4",
120-
"@windingtree/contracts": "^1.0.0-beta.12",
121-
"@trpc/server": "^10.33.0",
122-
"@trpc/client": "^10.33.0",
123-
"jose": "^4.14.4",
124-
"zod": "^3.21.4",
125-
"bcrypt-ts": "^4.0.0",
126-
"superjson": "^1.12.4"
40+
"prettier": "^3.0.0",
41+
"typescript": "^5.1.6",
42+
"vite": "^4.4.3",
43+
"vite-plugin-dts": "^3.2.0",
44+
"vitest": "^0.33.0"
12745
},
12846
"scripts": {
129-
"clean": "rm -rf ./lib",
130-
"build": "npm run clean && tsc -p ./tsconfig.build.json",
131-
"test": "vitest --run test",
132-
"test:rel": "vitest related --run",
133-
"semantic-release": "semantic-release",
134-
"lint": "eslint . --ext .ts",
135-
"lint:fix": "eslint . --ext .ts --fix && prettier --write .",
13647
"prepare": "husky install",
13748
"commit": "git-cz -S",
138-
"coverage": "c8 --all --exclude coverage --exclude lib --exclude test --exclude examples --exclude temp yarn test && c8 report -r html",
139-
"example:server": "node --experimental-specifier-resolution=node --loader ts-node/esm ./examples/server/index.ts",
140-
"example:client": "yarn --cwd ./examples/client dev",
141-
"example:node": "node --experimental-specifier-resolution=node --loader ts-node/esm ./examples/node/index.ts",
142-
"example:manager": "yarn --cwd ./examples/manager dev",
143-
"typedoc": "typedoc --options ./typedoc.json"
49+
"build": "lerna run build",
50+
"lint": "lerna run lint",
51+
"lint:fix": "lerna run lint:fix",
52+
"test": "lerna run test"
14453
}
14554
}

0 commit comments

Comments
 (0)