Skip to content

Commit 53af746

Browse files
authored
feat: add turborepo for improved monorepo development experience (#1195)
feat: turborepo setup
1 parent 1e40815 commit 53af746

File tree

7 files changed

+165
-5
lines changed

7 files changed

+165
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,6 @@ packages/devreact/webpack.config.json
120120

121121
# Local Netlify folder
122122
.netlify
123+
124+
# Turborepo
125+
.turbo

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"postinstall": "patch-package",
3434
"link-packages": "./scripts/link-packages.sh",
3535
"prepare": "husky install",
36+
"dev:core": "turbo run dev --parallel --filter=@metamask/sdk-communication-layer --filter=@metamask/sdk --filter=@metamask/sdk-react",
3637
"lint": "yarn workspaces foreach --no-private run lint",
3738
"lint:changelogs": "yarn workspaces foreach --no-private run lint:changelog",
3839
"lint:eslint": "yarn workspaces foreach --no-private run lint:eslint",
@@ -86,6 +87,8 @@
8687
"rimraf": "^3.0.2",
8788
"serve": "^14.2.1",
8889
"ts-jest": "^29.0.3",
90+
"turbo": "^2.3.3",
91+
"turborepo": "^0.0.1",
8992
"typescript": "^4.3.5"
9093
},
9194
"engines": {

packages/sdk-communication-layer/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"build:clean": "yarn clean && yarn build",
2626
"build": "yarn build:types && rollup -c --bundleConfigAsCjs",
2727
"build:dev": "yarn build:types && NODE_ENV=dev rollup -c --bundleConfigAsCjs",
28+
"dev": "concurrently \"tsc --watch\" \"rollup -c --bundleConfigAsCjs -w\"",
2829
"build:post-tsc": "echo 'N/A'",
2930
"build:pre-tsc": "echo 'N/A'",
3031
"size": "size-limit",
@@ -69,6 +70,7 @@
6970
"@types/uuid": "^9.0.0",
7071
"@typescript-eslint/eslint-plugin": "^4.26.0",
7172
"@typescript-eslint/parser": "^4.26.0",
73+
"concurrently": "^9.1.2",
7274
"cross-fetch": "^4.0.0",
7375
"eciesjs": "^0.4.11",
7476
"eslint": "^7.30.0",

packages/sdk-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"build:post-tsc": "echo 'N/A'",
3535
"build:pre-tsc": "echo 'N/A'",
3636
"clean": "rimraf dist",
37-
"dev": "rollup -c -w",
37+
"dev": "rollup -c -w --bundleConfigAsCjs",
3838
"lint": "yarn lint:eslint && yarn lint:misc --check",
3939
"lint:changelog": "../../scripts/validate-changelog.sh @metamask/sdk-react",
4040
"lint:eslint": "eslint . --cache --ext js,ts",

packages/sdk/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly --outDir dist/types",
2626
"build": "yarn build:types && rollup -c --bundleConfigAsCjs",
2727
"build:clean": "yarn clean && yarn build",
28-
"build:dev": "yarn build:types && NODE_ENV=dev rollup -c --bundleConfigAsCjs",
2928
"build:post-tsc": "echo 'N/A'",
3029
"build:pre-tsc": "echo 'N/A'",
3130
"typecheck": "tsc --noEmit",
@@ -44,7 +43,9 @@
4443
"test:e2e": "jest --testPathPattern \"/e2e/\"",
4544
"test:ci": "jest --coverage --passWithNoTests --setupFilesAfterEnv ./jest-preload.js --testPathIgnorePatterns \"/e2e/\"",
4645
"test:dev": "jest -c ./jest.config.ts --detectOpenHandles --testPathIgnorePatterns \"/e2e/\"",
47-
"watch": "rollup -c -w"
46+
"watch": "rollup -c -w",
47+
"dev": "concurrently \"tsc --watch\" \"rollup -c -w --bundleConfigAsCjs\"",
48+
"build:dev": "yarn build:types && NODE_ENV=dev rollup -c --bundleConfigAsCjs"
4849
},
4950
"dependencies": {
5051
"@babel/runtime": "^7.26.0",
@@ -91,6 +92,7 @@
9192
"@typescript-eslint/parser": "^4.26.0",
9293
"browserify-zlib": "^0.2.0",
9394
"buffer": "^6.0.3",
95+
"concurrently": "^9.1.2",
9496
"crypto-browserify": "^3.12.0",
9597
"eslint": "^7.30.0",
9698
"eslint-config-prettier": "^8.3.0",

turbo.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"globalDependencies": [
4+
"**/.env.*local"
5+
],
6+
"globalEnv": [
7+
"NODE_ENV",
8+
"SITEED_NPM_TOKEN"
9+
],
10+
"tasks": {
11+
"build": {
12+
"dependsOn": [
13+
"^build"
14+
],
15+
"outputs": [
16+
"dist/**",
17+
".next/**"
18+
]
19+
},
20+
"check-types": {
21+
"dependsOn": [
22+
"^check-types"
23+
]
24+
},
25+
"lint": {
26+
"outputs": []
27+
},
28+
"dev": {
29+
"cache": false,
30+
"persistent": true,
31+
"outputs": ["dist/**"]
32+
}
33+
}
34+
}

yarn.lock

Lines changed: 118 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10939,6 +10939,7 @@ __metadata:
1093910939
"@typescript-eslint/eslint-plugin": ^4.26.0
1094010940
"@typescript-eslint/parser": ^4.26.0
1094110941
bufferutil: ^4.0.8
10942+
concurrently: ^9.1.2
1094210943
cross-fetch: ^4.0.0
1094310944
date-fns: ^2.29.3
1094410945
debug: ^4.3.4
@@ -11580,6 +11581,7 @@ __metadata:
1158011581
bowser: ^2.9.0
1158111582
browserify-zlib: ^0.2.0
1158211583
buffer: ^6.0.3
11584+
concurrently: ^9.1.2
1158311585
cross-fetch: ^4.0.0
1158411586
crypto-browserify: ^3.12.0
1158511587
debug: ^4.3.4
@@ -25325,6 +25327,24 @@ __metadata:
2532525327
languageName: node
2532625328
linkType: hard
2532725329

25330+
"concurrently@npm:^9.1.2":
25331+
version: 9.1.2
25332+
resolution: "concurrently@npm:9.1.2"
25333+
dependencies:
25334+
chalk: ^4.1.2
25335+
lodash: ^4.17.21
25336+
rxjs: ^7.8.1
25337+
shell-quote: ^1.8.1
25338+
supports-color: ^8.1.1
25339+
tree-kill: ^1.2.2
25340+
yargs: ^17.7.2
25341+
bin:
25342+
conc: dist/bin/concurrently.js
25343+
concurrently: dist/bin/concurrently.js
25344+
checksum: 9e25e8ee6272ada26739aff1fb43e96ac458fafca82f45b8360bdd9115d60bbc679d282dfc52001b861b6e9f32b3063aed975691d8dec9e62807a9679763a1d8
25345+
languageName: node
25346+
linkType: hard
25347+
2532825348
"confusing-browser-globals@npm:^1.0.11":
2532925349
version: 1.0.11
2533025350
resolution: "confusing-browser-globals@npm:1.0.11"
@@ -38093,6 +38113,8 @@ __metadata:
3809338113
serve: ^14.2.1
3809438114
ts-jest: ^29.0.3
3809538115
ts-node: ^10.9.1
38116+
turbo: ^2.3.3
38117+
turborepo: ^0.0.1
3809638118
typescript: ^4.3.5
3809738119
languageName: unknown
3809838120
linkType: soft
@@ -45998,7 +46020,7 @@ __metadata:
4599846020
languageName: node
4599946021
linkType: hard
4600046022

46001-
"rxjs@npm:^7.5.5, rxjs@npm:^7.8.0":
46023+
"rxjs@npm:^7.5.5, rxjs@npm:^7.8.0, rxjs@npm:^7.8.1":
4600246024
version: 7.8.1
4600346025
resolution: "rxjs@npm:7.8.1"
4600446026
dependencies:
@@ -46687,6 +46709,13 @@ __metadata:
4668746709
languageName: node
4668846710
linkType: hard
4668946711

46712+
"shell-quote@npm:^1.8.1":
46713+
version: 1.8.2
46714+
resolution: "shell-quote@npm:1.8.2"
46715+
checksum: 1e97b62ced1c4c5135015978ebf273bed1f425a68cf84163e83fbb0f34b3ff9471e656720dab2b7cbb4ae0f58998e686d17d166c28dfb3662acd009e8bd7faed
46716+
languageName: node
46717+
linkType: hard
46718+
4669046719
"side-channel@npm:^1.0.4":
4669146720
version: 1.0.4
4669246721
resolution: "side-channel@npm:1.0.4"
@@ -48168,7 +48197,7 @@ __metadata:
4816848197
languageName: node
4816948198
linkType: hard
4817048199

48171-
"supports-color@npm:^8.0.0":
48200+
"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1":
4817248201
version: 8.1.1
4817348202
resolution: "supports-color@npm:8.1.1"
4817448203
dependencies:
@@ -49022,6 +49051,15 @@ __metadata:
4902249051
languageName: node
4902349052
linkType: hard
4902449053

49054+
"tree-kill@npm:^1.2.2":
49055+
version: 1.2.2
49056+
resolution: "tree-kill@npm:1.2.2"
49057+
bin:
49058+
tree-kill: cli.js
49059+
checksum: 49117f5f410d19c84b0464d29afb9642c863bc5ba40fcb9a245d474c6d5cc64d1b177a6e6713129eb346b40aebb9d4631d967517f9fbe8251c35b21b13cd96c7
49060+
languageName: node
49061+
linkType: hard
49062+
4902549063
"trim-newlines@npm:^3.0.0":
4902649064
version: 3.0.1
4902749065
resolution: "trim-newlines@npm:3.0.1"
@@ -49247,13 +49285,91 @@ __metadata:
4924749285
languageName: node
4924849286
linkType: hard
4924949287

49288+
"turbo-darwin-64@npm:2.3.3":
49289+
version: 2.3.3
49290+
resolution: "turbo-darwin-64@npm:2.3.3"
49291+
conditions: os=darwin & cpu=x64
49292+
languageName: node
49293+
linkType: hard
49294+
49295+
"turbo-darwin-arm64@npm:2.3.3":
49296+
version: 2.3.3
49297+
resolution: "turbo-darwin-arm64@npm:2.3.3"
49298+
conditions: os=darwin & cpu=arm64
49299+
languageName: node
49300+
linkType: hard
49301+
49302+
"turbo-linux-64@npm:2.3.3":
49303+
version: 2.3.3
49304+
resolution: "turbo-linux-64@npm:2.3.3"
49305+
conditions: os=linux & cpu=x64
49306+
languageName: node
49307+
linkType: hard
49308+
49309+
"turbo-linux-arm64@npm:2.3.3":
49310+
version: 2.3.3
49311+
resolution: "turbo-linux-arm64@npm:2.3.3"
49312+
conditions: os=linux & cpu=arm64
49313+
languageName: node
49314+
linkType: hard
49315+
4925049316
"turbo-stream@npm:^2.0.0":
4925149317
version: 2.2.0
4925249318
resolution: "turbo-stream@npm:2.2.0"
4925349319
checksum: c8006f601ff851e0ec8d2a4e983712f5c3e06805f0fc291c8b5d4004b51bee587dd7f92b059e8ad0b05572ed5c44a91c8e9ea1fbf2d4c29bef23f79fdf7e1099
4925449320
languageName: node
4925549321
linkType: hard
4925649322

49323+
"turbo-windows-64@npm:2.3.3":
49324+
version: 2.3.3
49325+
resolution: "turbo-windows-64@npm:2.3.3"
49326+
conditions: os=win32 & cpu=x64
49327+
languageName: node
49328+
linkType: hard
49329+
49330+
"turbo-windows-arm64@npm:2.3.3":
49331+
version: 2.3.3
49332+
resolution: "turbo-windows-arm64@npm:2.3.3"
49333+
conditions: os=win32 & cpu=arm64
49334+
languageName: node
49335+
linkType: hard
49336+
49337+
"turbo@npm:^2.3.3":
49338+
version: 2.3.3
49339+
resolution: "turbo@npm:2.3.3"
49340+
dependencies:
49341+
turbo-darwin-64: 2.3.3
49342+
turbo-darwin-arm64: 2.3.3
49343+
turbo-linux-64: 2.3.3
49344+
turbo-linux-arm64: 2.3.3
49345+
turbo-windows-64: 2.3.3
49346+
turbo-windows-arm64: 2.3.3
49347+
dependenciesMeta:
49348+
turbo-darwin-64:
49349+
optional: true
49350+
turbo-darwin-arm64:
49351+
optional: true
49352+
turbo-linux-64:
49353+
optional: true
49354+
turbo-linux-arm64:
49355+
optional: true
49356+
turbo-windows-64:
49357+
optional: true
49358+
turbo-windows-arm64:
49359+
optional: true
49360+
bin:
49361+
turbo: bin/turbo
49362+
checksum: b495ad024c2586fd090d3aabcc1263a89d72ee96d93b2259b553d9c931e22056a388e030a51bd70a11ec8bec373d1cb0a6ef0931806e8a283cb8360c000d0538
49363+
languageName: node
49364+
linkType: hard
49365+
49366+
"turborepo@npm:^0.0.1":
49367+
version: 0.0.1
49368+
resolution: "turborepo@npm:0.0.1"
49369+
checksum: 4975a23063185a87729f5de4fdb42c2118b52d88263128fa1416fe651798725a8d9f3e8a10a099d1188bd5ae04a39a93fe39810ced7e9187230ae9aa3ba645cf
49370+
languageName: node
49371+
linkType: hard
49372+
4925749373
"tweetnacl-util@npm:^0.15.1":
4925849374
version: 0.15.1
4925949375
resolution: "tweetnacl-util@npm:0.15.1"

0 commit comments

Comments
 (0)