From 5efa2177beef3fe838e6d2a2de7f773993d74271 Mon Sep 17 00:00:00 2001 From: Corban Brook Date: Wed, 5 Jun 2024 14:37:26 -0400 Subject: [PATCH] Turbo Repo v2 (#84) --- README.md | 2 +- examples/next/turbo.json | 11 ++++-- package.json | 6 ++-- packages/checkout/package.json | 1 + packages/connectors/package.json | 1 + packages/kit/package.json | 1 + packages/wallet/package.json | 1 + pnpm-lock.yaml | 58 ++++++++++++++++---------------- turbo.json | 15 ++++++--- 9 files changed, 56 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 4200af72..d0c0c108 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ The React example can be used to test the library locally. ``` 2. `pnpm install` -3. From the root folder, run `pnpm build` to build the packages. +3. From the root folder, run `pnpm build` to build the packages OR optionally run `pnpm dev` in a separate terminal to develop in watch mode. 4. From the root folder, run `pnpm dev:react` or `pnpm dev:next` to run the examples. ## What to do next? diff --git a/examples/next/turbo.json b/examples/next/turbo.json index efbfa99f..bca04ff0 100644 --- a/examples/next/turbo.json +++ b/examples/next/turbo.json @@ -1,8 +1,13 @@ { - "extends": ["//"], - "pipeline": { + "extends": [ + "//" + ], + "tasks": { "build": { - "outputs": [".next/**", "!.next/cache/**"] + "outputs": [ + ".next/**", + "!.next/cache/**" + ] } } } diff --git a/package.json b/package.json index cfa7fe65..7a967361 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "build": "turbo run build --filter={packages/*}", "build:clean": "turbo run build:clean", + "dev": "turbo run dev --filter={packages/*}", "reinstall": "rimraf -g ./**/node_modules && pnpm install", "test": "turbo run test", "lint": "eslint -c .eslintrc.js 'packages/**/src/**/*.{ts,tsx}'", @@ -45,9 +46,10 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "rimraf": "^5.0.7", - "turbo": "1.13.3", + "turbo": "2.0.1", "typescript": "~5.4.5", "wagmi": "^2.9.5" }, - "resolutions": {} + "resolutions": {}, + "packageManager": "pnpm@9.0.6" } diff --git a/packages/checkout/package.json b/packages/checkout/package.json index 719cb7a6..6af44a90 100644 --- a/packages/checkout/package.json +++ b/packages/checkout/package.json @@ -26,6 +26,7 @@ "build:esm": "tsc --module es2022 --outDir dist/esm/", "build:types": "tsc --declaration --declarationMap --emitDeclarationOnly --declarationDir dist/types/", "build:clean": "rimraf -g ./dist", + "dev": "tsc --watch --module es2022 --declaration --declarationMap --outDir dist/esm/ --declarationDir dist/types/", "test": "echo", "typecheck": "tsc --noEmit" }, diff --git a/packages/connectors/package.json b/packages/connectors/package.json index aec0629a..93137c46 100644 --- a/packages/connectors/package.json +++ b/packages/connectors/package.json @@ -26,6 +26,7 @@ "build:esm": "tsc --module es2022 --outDir dist/esm/", "build:types": "tsc --declaration --declarationMap --emitDeclarationOnly --declarationDir dist/types/", "build:clean": "rimraf -g ./dist", + "dev": "tsc --watch --module es2022 --declaration --declarationMap --outDir dist/esm/ --declarationDir dist/types/", "test": "echo", "typecheck": "tsc --noEmit" }, diff --git a/packages/kit/package.json b/packages/kit/package.json index 79ea8b5a..41f3deaf 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -31,6 +31,7 @@ "build:esm": "tsc --module es2022 --outDir dist/esm/", "build:types": "tsc --declaration --declarationMap --emitDeclarationOnly --declarationDir dist/types/", "build:clean": "rimraf -g ./dist", + "dev": "tsc --watch --module es2022 --declaration --declarationMap --outDir dist/esm/ --declarationDir dist/types/", "test": "echo", "typecheck": "tsc --noEmit" }, diff --git a/packages/wallet/package.json b/packages/wallet/package.json index 16ca6da3..f65a6484 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -26,6 +26,7 @@ "build:esm": "tsc --module es2022 --outDir dist/esm/", "build:types": "tsc --declaration --declarationMap --emitDeclarationOnly --declarationDir dist/types/", "build:clean": "rimraf -g ./dist", + "dev": "tsc --watch --module es2022 --declaration --declarationMap --outDir dist/esm/ --declarationDir dist/types/", "test": "echo", "typecheck": "tsc --noEmit" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6dcaff09..c4644034 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,8 +69,8 @@ importers: specifier: ^5.0.7 version: 5.0.7 turbo: - specifier: 1.13.3 - version: 1.13.3 + specifier: 2.0.1 + version: 2.0.1 typescript: specifier: ~5.4.5 version: 5.4.5 @@ -6798,38 +6798,38 @@ packages: engines: {node: '>=8.0.0'} hasBin: true - turbo-darwin-64@1.13.3: - resolution: {integrity: sha512-glup8Qx1qEFB5jerAnXbS8WrL92OKyMmg5Hnd4PleLljAeYmx+cmmnsmLT7tpaVZIN58EAAwu8wHC6kIIqhbWA==} + turbo-darwin-64@2.0.1: + resolution: {integrity: sha512-GO391pUmI6c6l/EpUIaXNzwbVDWRvYahm5oLB176dAWRYKYO+Osqs/XBdOM0G3l7ZFdR6nUtRJc8qinJp7qDUQ==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@1.13.3: - resolution: {integrity: sha512-/np2xD+f/+9qY8BVtuOQXRq5f9LehCFxamiQnwdqWm5iZmdjygC5T3uVSYuagVFsZKMvX3ycySwh8dylGTl6lg==} + turbo-darwin-arm64@2.0.1: + resolution: {integrity: sha512-rmjJoxeq7nmH/F2aWKapahrDE2zE2Uc15rvs4Rz6qHOzSqC8R5uyLpQyTKIPIZ95O/z9nKfLfVPyiRENuk5vpw==} cpu: [arm64] os: [darwin] - turbo-linux-64@1.13.3: - resolution: {integrity: sha512-G+HGrau54iAnbXLfl+N/PynqpDwi/uDzb6iM9hXEDG+yJnSJxaHMShhOkXYJPk9offm9prH33Khx2scXrYVW1g==} + turbo-linux-64@2.0.1: + resolution: {integrity: sha512-vwTOc4v4jm6tM+9WlsiDlN+zwHP8A2wlsAYiNqz2u0DZL55aCWaVdivh2VpVLN36Mr9HgREGH0Fw+jx6ObcNRg==} cpu: [x64] os: [linux] - turbo-linux-arm64@1.13.3: - resolution: {integrity: sha512-qWwEl5VR02NqRyl68/3pwp3c/olZuSp+vwlwrunuoNTm6JXGLG5pTeme4zoHNnk0qn4cCX7DFrOboArlYxv0wQ==} + turbo-linux-arm64@2.0.1: + resolution: {integrity: sha512-DkVt76fjwY940DfmqznWhpYIlKYduvKAoTtylkERrDlcWUpDYWwqNbcf9PRRIbnjnv9lIxvuom1KZmMY+cw/Ig==} cpu: [arm64] os: [linux] - turbo-windows-64@1.13.3: - resolution: {integrity: sha512-Nudr4bRChfJzBPzEmpVV85VwUYRCGKecwkBFpbp2a4NtrJ3+UP1VZES653ckqCu2FRyRuS0n03v9euMbAvzH+Q==} + turbo-windows-64@2.0.1: + resolution: {integrity: sha512-XskV34kYuXVIHbRbgH8jr35Y8uA6kJOQ0LJStU4jFk7piiyk0a4n2GNDymMtvIwAxYdbuTe+pKuPCThFdirHBQ==} cpu: [x64] os: [win32] - turbo-windows-arm64@1.13.3: - resolution: {integrity: sha512-ouJCgsVLd3icjRLmRvHQDDZnmGzT64GBupM1Y+TjtYn2LVaEBoV6hicFy8x5DUpnqdLy+YpCzRMkWlwhmkX7sQ==} + turbo-windows-arm64@2.0.1: + resolution: {integrity: sha512-R2/RmKr2uQxkOCtXK5LNxdD3Iv7lUm56iy2FrDwTDgPI7X7K6WRjrxdirmFIu/fABYE5n6EampU3ejbG5mmGtg==} cpu: [arm64] os: [win32] - turbo@1.13.3: - resolution: {integrity: sha512-n17HJv4F4CpsYTvKzUJhLbyewbXjq1oLCi90i5tW1TiWDz16ML1eDG7wi5dHaKxzh5efIM56SITnuVbMq5dk4g==} + turbo@2.0.1: + resolution: {integrity: sha512-sJhxfBaN14pYj//xxAG6zAyStkE2j4HI9JVXVMob35SGob6dz/HuSqV/4QlVqw0uKAkwc1lXIsnykbe8RLmOOw==} hasBin: true type-check@0.4.0: @@ -15783,32 +15783,32 @@ snapshots: wcwidth: 1.0.1 yargs: 17.7.2 - turbo-darwin-64@1.13.3: + turbo-darwin-64@2.0.1: optional: true - turbo-darwin-arm64@1.13.3: + turbo-darwin-arm64@2.0.1: optional: true - turbo-linux-64@1.13.3: + turbo-linux-64@2.0.1: optional: true - turbo-linux-arm64@1.13.3: + turbo-linux-arm64@2.0.1: optional: true - turbo-windows-64@1.13.3: + turbo-windows-64@2.0.1: optional: true - turbo-windows-arm64@1.13.3: + turbo-windows-arm64@2.0.1: optional: true - turbo@1.13.3: + turbo@2.0.1: optionalDependencies: - turbo-darwin-64: 1.13.3 - turbo-darwin-arm64: 1.13.3 - turbo-linux-64: 1.13.3 - turbo-linux-arm64: 1.13.3 - turbo-windows-64: 1.13.3 - turbo-windows-arm64: 1.13.3 + turbo-darwin-64: 2.0.1 + turbo-darwin-arm64: 2.0.1 + turbo-linux-64: 2.0.1 + turbo-linux-arm64: 2.0.1 + turbo-windows-64: 2.0.1 + turbo-windows-arm64: 2.0.1 type-check@0.4.0: dependencies: diff --git a/turbo.json b/turbo.json index 57f59878..815f97d5 100644 --- a/turbo.json +++ b/turbo.json @@ -1,14 +1,19 @@ { "$schema": "https://turbo.build/schema.json", - "experimentalUI": true, - "pipeline": { + "tasks": { "build": { - "dependsOn": ["^build"], - "outputs": ["dist/**"] + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**" + ] }, "build:clean": {}, "test": { - "dependsOn": ["build"] + "dependsOn": [ + "build" + ] }, "lint": {}, "dev": {