Skip to content

Commit 1b046fd

Browse files
authored
perf: speed up local scripts (#810)
* chore: parallelize build scripts * chore: run tests concurrently * chore: group test log outputs * chore: execute lint and format scripts concurrently * refactor: do no use wildcard for test script`
1 parent 5fe6e4c commit 1b046fd

File tree

3 files changed

+68
-11
lines changed

3 files changed

+68
-11
lines changed

apps/subgraph/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"private": true,
77
"scripts": {
88
"codegen": "node scripts/generate-subgraph.js ${0} && graph codegen",
9-
"build": "graph build",
10-
"auth": "graph auth --studio ${0}",
11-
"deploy": "graph deploy --studio ${0}",
9+
"codegen:sepolia": "yarn codegen sepolia",
10+
"build": "yarn codegen:sepolia && graph build",
11+
"auth": "graph auth --studio",
12+
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ ${0}",
1213
"start-ipfs": "node scripts/start-ipfs.js",
1314
"create-local": "graph create --node http://localhost:8020/ semaphore",
1415
"remove-local": "graph remove --node http://localhost:8020/ semaphore",

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
"bugs": "https://github.com/semaphore-protocol/semaphore/issues",
88
"private": true,
99
"scripts": {
10-
"build": "yarn build:libraries && yarn build:subgraph",
11-
"build:libraries": "yarn workspaces foreach -A -t --no-private run build",
12-
"build:subgraph": "yarn workspace semaphore-subgraph codegen sepolia && yarn workspace semaphore-subgraph build",
10+
"build": "yarn workspaces foreach -Ap --topological-dev run build",
11+
"build:libraries": "yarn workspaces foreach -Apt --no-private run build",
12+
"build:subgraph": "yarn workspace semaphore-subgraph build",
1313
"compile:contracts": "yarn workspace semaphore-contracts compile",
14-
"test": "yarn test:libraries && yarn test:contracts && yarn test:circuits && yarn test:subgraph",
14+
"test": "concurrently -g -c auto -n circuits,contracts,libraries,subgraph \"yarn:test:circuits\" \"yarn:test:contracts\" \"yarn:test:libraries\" \"yarn test:subgraph\"",
1515
"test:libraries": "jest --coverage",
1616
"test:library": "jest packages/${0}",
1717
"test:subgraph": "yarn workspace semaphore-subgraph test",
1818
"test:contracts": "yarn workspace semaphore-contracts test:coverage",
1919
"test:circuits": "yarn workspace @semaphore-protocol/circuits test",
20-
"lint": "eslint . --ext .js,.ts,.tsx && yarn workspace semaphore-contracts lint",
21-
"format": "prettier -c . && yarn workspace semaphore-docs format",
22-
"format:write": "prettier -w . && yarn workspace semaphore-docs format:write",
20+
"lint": "concurrently -c auto -g -n eslint,solhint \"eslint . --ext .js,.ts,.tsx\" \"yarn workspace semaphore-contracts lint\"",
21+
"format": "concurrently -c auto -g -n prettier,embark \"prettier -c .\" \"yarn workspace semaphore-docs format\"",
22+
"format:write": "concurrently -c auto -g -n prettier,embark \"prettier -w .\" \"yarn workspace semaphore-docs format:write\"",
2323
"docs": "typedoc",
2424
"version:bump": "yarn workspaces foreach -A --no-private version -d ${0} && yarn version apply --all && yarn remove:stable-version-field && NO_HOOK=1 git commit -am \"chore: v${0}\" && git tag v${0}",
2525
"version:publish": "yarn build:libraries && yarn clean:cli-templates && yarn workspaces foreach -A --no-private npm publish --tolerate-republish --access public",
@@ -58,6 +58,7 @@
5858
"@typescript-eslint/eslint-plugin": "^7.0.2",
5959
"@typescript-eslint/parser": "^7.0.2",
6060
"changelogithub": "0.12.7",
61+
"concurrently": "^8.2.2",
6162
"czg": "^1.9.1",
6263
"dotenv": "^16.0.2",
6364
"eslint": "^8.56.0",

yarn.lock

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,15 @@ __metadata:
16911691
languageName: node
16921692
linkType: hard
16931693

1694+
"@babel/runtime@npm:^7.21.0":
1695+
version: 7.24.7
1696+
resolution: "@babel/runtime@npm:7.24.7"
1697+
dependencies:
1698+
regenerator-runtime: "npm:^0.14.0"
1699+
checksum: 10/7b77f566165dee62db3db0296e71d08cafda3f34e1b0dcefcd68427272e17c1704f4e4369bff76651b07b6e49d3ea5a0ce344818af9116e9292e4381e0918c76
1700+
languageName: node
1701+
linkType: hard
1702+
16941703
"@babel/template@npm:^7.22.15, @babel/template@npm:^7.24.0, @babel/template@npm:^7.3.3":
16951704
version: 7.24.0
16961705
resolution: "@babel/template@npm:7.24.0"
@@ -11174,6 +11183,26 @@ __metadata:
1117411183
languageName: node
1117511184
linkType: hard
1117611185

11186+
"concurrently@npm:^8.2.2":
11187+
version: 8.2.2
11188+
resolution: "concurrently@npm:8.2.2"
11189+
dependencies:
11190+
chalk: "npm:^4.1.2"
11191+
date-fns: "npm:^2.30.0"
11192+
lodash: "npm:^4.17.21"
11193+
rxjs: "npm:^7.8.1"
11194+
shell-quote: "npm:^1.8.1"
11195+
spawn-command: "npm:0.0.2"
11196+
supports-color: "npm:^8.1.1"
11197+
tree-kill: "npm:^1.2.2"
11198+
yargs: "npm:^17.7.2"
11199+
bin:
11200+
conc: dist/bin/concurrently.js
11201+
concurrently: dist/bin/concurrently.js
11202+
checksum: 10/dcb1aa69d9c611a7bda9d4fc0fe1e388f971d1744acec7e0d52dffa2ef55743f1266ec9292f414c5789b9f61734b3fce772bd005d4de9564a949fb121b97bae1
11203+
languageName: node
11204+
linkType: hard
11205+
1117711206
"confbox@npm:^0.1.3, confbox@npm:^0.1.7":
1117811207
version: 0.1.7
1117911208
resolution: "confbox@npm:0.1.7"
@@ -11886,6 +11915,15 @@ __metadata:
1188611915
languageName: node
1188711916
linkType: hard
1188811917

11918+
"date-fns@npm:^2.30.0":
11919+
version: 2.30.0
11920+
resolution: "date-fns@npm:2.30.0"
11921+
dependencies:
11922+
"@babel/runtime": "npm:^7.21.0"
11923+
checksum: 10/70b3e8ea7aaaaeaa2cd80bd889622a4bcb5d8028b4de9162cbcda359db06e16ff6e9309e54eead5341e71031818497f19aaf9839c87d1aba1e27bb4796e758a9
11924+
languageName: node
11925+
linkType: hard
11926+
1188911927
"death@npm:^1.1.0":
1189011928
version: 1.1.0
1189111929
resolution: "death@npm:1.1.0"
@@ -24624,6 +24662,7 @@ __metadata:
2462424662
"@typescript-eslint/eslint-plugin": "npm:^7.0.2"
2462524663
"@typescript-eslint/parser": "npm:^7.0.2"
2462624664
changelogithub: "npm:0.12.7"
24665+
concurrently: "npm:^8.2.2"
2462724666
czg: "npm:^1.9.1"
2462824667
dotenv: "npm:^16.0.2"
2462924668
eslint: "npm:^8.56.0"
@@ -25424,6 +25463,13 @@ __metadata:
2542425463
languageName: node
2542525464
linkType: hard
2542625465

25466+
"spawn-command@npm:0.0.2":
25467+
version: 0.0.2
25468+
resolution: "spawn-command@npm:0.0.2"
25469+
checksum: 10/f13e8c3c63abd4a0b52fb567eba5f7940d480c5ed3ec61781d38a1850f179b1196c39e6efa2bbd301f82c1bf1cd7807abc8fbd8fc8e44bcaa3975a124c0d1657
25470+
languageName: node
25471+
linkType: hard
25472+
2542725473
"spdx-correct@npm:^3.0.0":
2542825474
version: 3.2.0
2542925475
resolution: "spdx-correct@npm:3.2.0"
@@ -26454,6 +26500,15 @@ __metadata:
2645426500
languageName: node
2645526501
linkType: hard
2645626502

26503+
"tree-kill@npm:^1.2.2":
26504+
version: 1.2.2
26505+
resolution: "tree-kill@npm:1.2.2"
26506+
bin:
26507+
tree-kill: cli.js
26508+
checksum: 10/49117f5f410d19c84b0464d29afb9642c863bc5ba40fcb9a245d474c6d5cc64d1b177a6e6713129eb346b40aebb9d4631d967517f9fbe8251c35b21b13cd96c7
26509+
languageName: node
26510+
linkType: hard
26511+
2645726512
"trim-lines@npm:^3.0.0":
2645826513
version: 3.0.1
2645926514
resolution: "trim-lines@npm:3.0.1"
@@ -28579,7 +28634,7 @@ __metadata:
2857928634
languageName: node
2858028635
linkType: hard
2858128636

28582-
"yargs@npm:^17.0.0, yargs@npm:^17.3.1":
28637+
"yargs@npm:^17.0.0, yargs@npm:^17.3.1, yargs@npm:^17.7.2":
2858328638
version: 17.7.2
2858428639
resolution: "yargs@npm:17.7.2"
2858528640
dependencies:

0 commit comments

Comments
 (0)