Skip to content

Commit 2e88299

Browse files
committed
chore: package.json cleanup, preparing for release of kleros-app
1 parent f2efd34 commit 2e88299

File tree

9 files changed

+65
-29
lines changed

9 files changed

+65
-29
lines changed

bot-pinner/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "Pinning of the court data to decentralized storage.",
55
"author": "Kleros",
66
"license": "MIT",
7-
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
87
"volta": {
98
"node": "20.11.0"
109
},

contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "Smart contracts for Kleros version 2",
55
"main": "typechain-types/index.ts",
66
"repository": "[email protected]:kleros/kleros-v2.git",
7+
"homepage": "https://github.com/kleros/kleros-v2/tree/master/contracts#readme",
78
"author": "Kleros",
89
"license": "MIT",
9-
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
1010
"engines": {
1111
"node": ">=16.0.0"
1212
},

kleros-app/package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
{
22
"name": "@kleros/kleros-app",
33
"version": "1.0.0",
4-
"repository": {
5-
"type": "git",
6-
"url": "git+ssh://[email protected]/kleros/kleros-v2.git"
7-
},
8-
"keywords": [
9-
"kleros",
10-
"dapp",
11-
"atlas"
12-
],
4+
"description": "Library for Kleros DApps with reusable abstractions and components.",
5+
"repository": "[email protected]:kleros/kleros-v2.git",
6+
"homepage": "https://github.com/kleros/kleros-v2/tree/master/kleros-app#readme",
137
"author": "Kleros",
148
"license": "MIT",
15-
"bugs": {
16-
"url": "https://github.com/kleros/kleros-v2/issues"
17-
},
18-
"homepage": "https://github.com/kleros/kleros-v2#readme",
19-
"description": "Library for Kleros DApps with reusable abstractions and components.",
209
"source": "src/lib/index.ts",
21-
"module": "./dist/kleros-app.js",
2210
"types": "./dist/kleros-app.d.ts",
11+
"module": "./dist/kleros-app.js",
12+
"files": [
13+
"dist"
14+
],
2315
"type": "module",
16+
"volta": {
17+
"node": "20.11.0"
18+
},
19+
"publishConfig": {
20+
"access": "public",
21+
"tag": "latest"
22+
},
2423
"scripts": {
25-
"clean": "rm -rf dist",
24+
"clean": "rimraf dist",
2625
"check-style": "eslint 'src/**/*.{ts,tsx}'",
2726
"check-types": "tsc --noEmit",
2827
"start": "vite dev src/",
29-
"build": "yarn clean && vite build"
28+
"build": "yarn clean && vite build",
29+
"release:patch": "scripts/publish.sh patch",
30+
"release:minor": "scripts/publish.sh minor",
31+
"release:major": "scripts/publish.sh major"
3032
},
31-
"files": [
32-
"dist"
33-
],
3433
"prettier": "@kleros/kleros-v2-prettier-config",
3534
"devDependencies": {
3635
"@eslint/compat": "^1.2.3",
@@ -46,6 +45,7 @@
4645
"eslint-config-prettier": "^9.1.0",
4746
"eslint-plugin-import": "^2.31.0",
4847
"globals": "^15.12.0",
48+
"rimraf": "^6.0.1",
4949
"typescript": "^5.6.3",
5050
"vite": "^5.4.11",
5151
"vite-plugin-dts": "^4.3.0",

kleros-app/scripts/publish.sh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4+
5+
#--------------------------------------
6+
# Error handling
7+
#--------------------------------------
8+
9+
set -Ee
10+
function _catch {
11+
# Don't propagate to outer shell
12+
exit 0
13+
}
14+
function _finally {
15+
# TODO: rollback version bump
16+
rm -rf $SCRIPT_DIR/../dist
17+
}
18+
trap _catch ERR
19+
trap _finally EXIT
20+
21+
#--------------------------------------
22+
23+
# Check if any tracked files are currently changed, ignoring untracked files
24+
if [ -n "$(git status --porcelain -uno)" ]; then
25+
echo "Error: There are uncommitted changes in tracked files. Please commit or stash them before publishing."
26+
exit 1
27+
fi
28+
29+
yarn version $1
30+
31+
version=$(cat package.json | jq -r .version)
32+
echo "Publishing version $version"
33+
34+
git add package.json
35+
git commit -m "chore(kleros-app): release @kleros/kleros-app@$version"
36+
git tag "@kleros/kleros-app@$version" -m "@kleros/kleros-app@$version"
37+
git push
38+
git push --tags
39+
40+
yarn clean
41+
yarn build
42+
yarn npm publish

kleros-sdk/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.1.8",
44
"description": "SDK for Kleros version 2",
55
"repository": "[email protected]:kleros/kleros-v2.git",
6+
"homepage": "https://github.com/kleros/kleros-v2/tree/master/kleros-sdk#readme",
67
"author": "Kleros",
78
"license": "MIT",
89
"main": "./lib/src/index.js",
@@ -12,10 +13,6 @@
1213
"lib/**/*",
1314
"!lib/**/test/*"
1415
],
15-
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
16-
"engines": {
17-
"node": ">=16.0.0"
18-
},
1916
"type": "commonjs",
2017
"volta": {
2118
"node": "20.11.0"

subgraph/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"start-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml up -d && docker compose -f ../services/graph-node/docker-compose.yml logs -f",
6868
"stop-local-indexer": "docker compose -f ../services/graph-node/docker-compose.yml down && rm -rf ../services/graph-node/data"
6969
},
70-
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
7170
"volta": {
7271
"node": "20.11.0"
7372
},

web-devtools/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"author": "",
88
"license": "MIT",
99
"type": "module",
10-
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
1110
"volta": {
1211
"node": "20.11.0",
1312
"yarn": "4.5.1"

web/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"styles": "./src/styles",
2323
"svgs": "./src/assets/svgs"
2424
},
25-
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
2625
"scripts": {
2726
"start": "yarn start-devnet",
2827
"start-local": "scripts/runEnv.sh local 'yarn generate && vite'",

yarn.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4775,6 +4775,7 @@ __metadata:
47754775
eslint-plugin-import: "npm:^2.31.0"
47764776
globals: "npm:^15.12.0"
47774777
jose: "npm:^5.9.6"
4778+
rimraf: "npm:^6.0.1"
47784779
typescript: "npm:^5.6.3"
47794780
vite: "npm:^5.4.11"
47804781
vite-plugin-dts: "npm:^4.3.0"

0 commit comments

Comments
 (0)