From 37d3c5b123bf8d2e0d02f793797b592fc154df61 Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Tue, 19 Apr 2022 01:50:36 +0200 Subject: [PATCH 01/35] upgrade nextra --- docs/components/Authors.js | 5 +++- docs/components/Avatar.js | 2 +- docs/components/Footer.tsx | 6 ++--- docs/components/Tabs.js | 27 ++++++++++++++++++++++ docs/pages/blog.mdx | 2 +- docs/pages/blog/meta.json | 3 ++- docs/pages/blog/turbo-1-2-0.mdx | 11 +++++---- docs/pages/docs/getting-started.mdx | 36 +++++++++++++++-------------- docs/pages/meta.json | 7 +++++- docs/theme.config.js | 21 ++++++++--------- 10 files changed, 78 insertions(+), 42 deletions(-) create mode 100644 docs/components/Tabs.js diff --git a/docs/components/Authors.js b/docs/components/Authors.js index da6a46bc69322..46658371878b2 100644 --- a/docs/components/Authors.js +++ b/docs/components/Authors.js @@ -25,7 +25,10 @@ const team = { export function Authors({ authors }) { return ( -
+
1 ? 2 : 1, + }}> {authors.map((username) => !!team[username] ? ( diff --git a/docs/components/Avatar.js b/docs/components/Avatar.js index 4ee689708bc86..7dd18199338ad 100644 --- a/docs/components/Avatar.js +++ b/docs/components/Avatar.js @@ -2,7 +2,7 @@ import Image from "next/image"; export const Avatar = ({ name, picture, twitterUsername }) => { return ( -
+
-
+
Support
    {navigation.support.map((item) => ( @@ -110,7 +110,7 @@ export function Footer() { ))}
-
+
Legal
    {navigation.legal.map((item) => ( @@ -122,7 +122,7 @@ export function Footer() {
-
+
Subscribe to our newsletter

Join the Turborepo newsletter and stay updated on new releases and diff --git a/docs/components/Tabs.js b/docs/components/Tabs.js new file mode 100644 index 0000000000000..a808a7f783962 --- /dev/null +++ b/docs/components/Tabs.js @@ -0,0 +1,27 @@ +import * as NextraTabs from 'nextra-theme-docs/tabs' +import useSWR from 'swr' + +export const Tab = NextraTabs.Tab + +export function Tabs ({storageKey = 'tab-index', items, ...props}) { + // Use SWR so all tabs with the same key can sync their states. + const { data, mutate } = useSWR(storageKey, key => { + try { + return JSON.parse(localStorage.getItem(key)) + } catch (e) { + return null + } + }) + + const selectedIndex = items.indexOf(data) + + return { + localStorage.setItem(storageKey, JSON.stringify(items[index])) + mutate(items[index], false) + }} + selectedIndex={selectedIndex === -1 ? undefined : selectedIndex} + items={items} + {...props} + /> +} diff --git a/docs/pages/blog.mdx b/docs/pages/blog.mdx index 03d2bf6995294..c1f2f4bb09cb4 100644 --- a/docs/pages/blog.mdx +++ b/docs/pages/blog.mdx @@ -32,7 +32,7 @@ export function BlogIndex({ more = "Read more" }) {

Blog

-

The latest updates and releases from the Turborepo team at Vercel.

+

The latest updates and releases from the Turborepo team at Vercel.

diff --git a/docs/pages/blog/meta.json b/docs/pages/blog/meta.json index 7f23d8a14bde1..03fdcc50e62a6 100644 --- a/docs/pages/blog/meta.json +++ b/docs/pages/blog/meta.json @@ -4,7 +4,8 @@ "hidden": true, "theme": { "toc": false, - "sidebar": false + "sidebar": false, + "typesetting": "article" } }, "turbo-1-2-0": "Turborepo 1.2", diff --git a/docs/pages/blog/turbo-1-2-0.mdx b/docs/pages/blog/turbo-1-2-0.mdx index 85a8b1f07015e..1e652514ca230 100644 --- a/docs/pages/blog/turbo-1-2-0.mdx +++ b/docs/pages/blog/turbo-1-2-0.mdx @@ -9,9 +9,8 @@ ogImage: /images/blog/turbo-1-2-0/twitter-card.png # Turborepo 1.2 import { Authors } from '../../components/Authors' -import Bleed from 'nextra-theme-docs/bleed' -
Friday, April 8th, 2022
+
Friday, April 8th, 2022
@@ -69,9 +68,11 @@ Dry runs are incredibly useful for two situations: - Debugging and testing run options - Using `turbo` filtering and task graphs for building automations - - ![Turborepo Dry Run](/images/blog/turbo-1-2-0/turbo-dry-run.png) - + +
+ ![Turborepo Dry Run](/images/blog/turbo-1-2-0/turbo-dry-run.png) +
+
We hope that this will improve visibility into what `turbo` is doing, speeding up debugging, and make it easier to leverage `turbo` in dynamic CI/CD systems. diff --git a/docs/pages/docs/getting-started.mdx b/docs/pages/docs/getting-started.mdx index dc3ad888513cf..6f32ed619f8ab 100644 --- a/docs/pages/docs/getting-started.mdx +++ b/docs/pages/docs/getting-started.mdx @@ -37,23 +37,25 @@ Turborepo works with [Yarn v1](https://classic.yarnpkg.com/lang/en/), [NPM](http Add `turbo` as a development dependency in the root of your project. -### Yarn - -```bash -yarn add turbo -DW -``` - -### NPM - -```bash -npm install turbo -D -``` - -### PNPM - -```bash -pnpm add turbo -DW -``` +import { Tabs, Tab } from '../../components/Tabs' + + + + ```bash + npm install turbo -D + ``` + + + ```bash + yarn add turbo -DW + ``` + + + ```bash + pnpm add turbo -DW + ``` + + The `turbo` package is a little shell that will install the proper `@turborepo/*` packages. diff --git a/docs/pages/meta.json b/docs/pages/meta.json index baf52840673ec..e9dac11402755 100644 --- a/docs/pages/meta.json +++ b/docs/pages/meta.json @@ -10,7 +10,12 @@ } }, "docs": "Docs", - "blog": "Blog", + "blog": { + "title": "Blog", + "theme": { + "typesetting": "article" + } + }, "enterprise": { "title": "Enterprise", "href": "https://vercel.com/contact/turborepo?utm_source=turborepo.org&utm_medium=referral&utm_campaign=header-enterpriseLink", diff --git a/docs/theme.config.js b/docs/theme.config.js index 395a83f9ac744..7d67c023275ba 100644 --- a/docs/theme.config.js +++ b/docs/theme.config.js @@ -133,19 +133,16 @@ const theme = { projectChatLink: "https://turborepo.org/discord", feedbackLink: "Question? Give us feedback →", banner: function Banner() { - // TODO return ( - + + Turborepo has joined Vercel. Read More → + ); }, logo: function LogoActual() { From 30054452ec670a3f7e3ae3568d2c005e90139265 Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Tue, 19 Apr 2022 01:50:44 +0200 Subject: [PATCH 02/35] upgrade nextra --- pnpm-lock.yaml | 146 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 138 insertions(+), 8 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a00e106e59fdd..71e4b338d70fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,8 +78,8 @@ importers: eslint-config-prettier: 8.4.0 js-cookie: 3.0.1 next: 12.1.0 - nextra: 2.0.0-alpha.48 - nextra-theme-docs: 2.0.0-alpha.48 + nextra: 2.0.0-alpha.49 + nextra-theme-docs: 2.0.0-alpha.50 postcss: 8.3.5 react: 17.0.2 react-dom: 17.0.2 @@ -101,8 +101,8 @@ importers: copy-to-clipboard: 3.3.1 js-cookie: 3.0.1 next: 12.1.0_dfc0b93d99fba272c9564d3139a2581a - nextra: 2.0.0-alpha.48_react@17.0.2 - nextra-theme-docs: 2.0.0-alpha.48_caa633a00319350dbda42996613fe26c + nextra: 2.0.0-alpha.49_react@17.0.2 + nextra-theme-docs: 2.0.0-alpha.50_caa633a00319350dbda42996613fe26c react: 17.0.2 react-dom: 17.0.2_react@17.0.2 react-hot-toast: 2.1.1_83aecc314a46186883faa129c0399856 @@ -1014,6 +1014,122 @@ packages: react: 17.0.2 dev: false + /@napi-rs/simple-git-android-arm-eabi/0.1.7: + resolution: {integrity: sha512-1ZNMZJ+3NhwI3HGB08nRsAzMP81du6RnZ1X9YhZ6uusuSH7p4EWs3d44TshJ+vHdjPi6eitfMN9jK5iw6dHKow==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-android-arm64/0.1.7: + resolution: {integrity: sha512-Xy3b8IfuIhwYx8xns7fUnJslbytjq4knTG9i0PhyF+o59se81RkLgcj86LmuD4GhzDrYQTwFgnPx3aKUUObn3Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-darwin-arm64/0.1.7: + resolution: {integrity: sha512-uHO0JOwHjc39rX6nEt/tctx7IcsS33HWlHYtjt8h8YlfdvwAidPMVZDwg/dBPMTl+mdAyuFUM8ce6S91OguGNQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-darwin-x64/0.1.7: + resolution: {integrity: sha512-33nWHRBMf+twLabVdxyj9c/xsAY4lgWip7Sa5ogpMWdzPDDZjPliz//7hScmcRcetfFoPpfqbbLW2YCEmhQYGA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-arm-gnueabihf/0.1.7: + resolution: {integrity: sha512-oqC/TngHfXaeynapp5YP+1PMoQXFP7IrCRlKbwkVxTXOW5O9A8KaeFn00WRLHvm/wkAbW7757mU6Nz5csy4qPw==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-arm64-gnu/0.1.7: + resolution: {integrity: sha512-T/QQIaQviWPfHUhPnQQQYuzlAHVlr68xK99Hd5b6xPp8LsLcDBsTg7P3pAilAkgzXKz1O6/pYVtwJD1BTayu9A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-arm64-musl/0.1.7: + resolution: {integrity: sha512-afbdrfmEGptPp+yBykR0uVWrKxvZwC5C80GYMROa63/BdzvODWsDt+FJcTWuj/kXHms7hGRLWCyOAnuLAjdBow==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-x64-gnu/0.1.7: + resolution: {integrity: sha512-pb2jPxPX0TCaJMuDbyWj87s5ylZExt2E8Nz0i9DT706LmcRrEsGjPVD/XITBDukPv2fPWwW7E4gw0fAQBYt4Ag==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-x64-musl/0.1.7: + resolution: {integrity: sha512-1tUBN6FdC5EmRkxaKA51IpbGdnJYSmPjKKaaLyMXpUcyc2PJxGymzYy5Oj2XfxUcu2BdO2SdIpt9N4APOERkSg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-win32-arm64-msvc/0.1.7: + resolution: {integrity: sha512-pGoGppekJ1T+J78g+oWpwOux9mQLy2vRZMAp7DM+8Wv0RkA41JROISlQHpkmxvNTB4VQ7OyP2ASeizBS4rNrhg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-win32-x64-msvc/0.1.7: + resolution: {integrity: sha512-/qHNi8TlEhjFTXl5CvlU5RhkibWAnFisLG6yKY8pNHaxEJMjE+HS58USDGtQ0gwgM3pmvJtaqRtMwQyoboTOXg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git/0.1.7: + resolution: {integrity: sha512-53fsesi8pmCh5ctuFMpSgfmYy4WtXJV5R5BW48B7P49ypvoTaySx0uKUN+cv6pRRWILWFIrPH2cJiPoiONM3vg==} + engines: {node: '>= 10'} + optionalDependencies: + '@napi-rs/simple-git-android-arm-eabi': 0.1.7 + '@napi-rs/simple-git-android-arm64': 0.1.7 + '@napi-rs/simple-git-darwin-arm64': 0.1.7 + '@napi-rs/simple-git-darwin-x64': 0.1.7 + '@napi-rs/simple-git-linux-arm-gnueabihf': 0.1.7 + '@napi-rs/simple-git-linux-arm64-gnu': 0.1.7 + '@napi-rs/simple-git-linux-arm64-musl': 0.1.7 + '@napi-rs/simple-git-linux-x64-gnu': 0.1.7 + '@napi-rs/simple-git-linux-x64-musl': 0.1.7 + '@napi-rs/simple-git-win32-arm64-msvc': 0.1.7 + '@napi-rs/simple-git-win32-x64-msvc': 0.1.7 + dev: false + /@next/env/12.1.0: resolution: {integrity: sha512-nrIgY6t17FQ9xxwH3jj0a6EOiQ/WDHUos35Hghtr+SWN/ntHIQ7UpuvSi0vaLzZVHQWaDupKI+liO5vANcDeTQ==} dev: false @@ -6296,8 +6412,8 @@ packages: - babel-plugin-macros dev: false - /nextra-theme-docs/2.0.0-alpha.48_caa633a00319350dbda42996613fe26c: - resolution: {integrity: sha512-eA1AmD8KVD7lgy+fq1aGjEv3NlNNAgx9UYE8Fsi9TimaIAuRMaqulNoG5m1HLcqUPtxjBkl/zM7gPgxfQg2d2A==} + /nextra-theme-docs/2.0.0-alpha.50_caa633a00319350dbda42996613fe26c: + resolution: {integrity: sha512-TkMvB8pCVN1LJV6NpXm/5MG2+IHFrMh7bf8E0J6QGRfYaLAhHEAbO7OZpXuE6q/MGGzaNjsXYfFVsC+0r/+/mQ==} peerDependencies: next: '>=9.5.3' react: '>=16.13.1' @@ -6321,15 +6437,17 @@ packages: title: 3.4.3 dev: false - /nextra/2.0.0-alpha.48_react@17.0.2: - resolution: {integrity: sha512-ZiAnQluH1k4Rojf0grBM4sjzZX87jGqKwnjhMd6wtflwpofXfYKDSXKMQrJei9Da8n/iZnz7STbQ2WPL1Fw+SQ==} + /nextra/2.0.0-alpha.49_react@17.0.2: + resolution: {integrity: sha512-dR52NUOH7amYQeRsQ0lENPjDrnx41NTmKMImAQQ9Nlx/PVBzEmdRo/bnX3GLIYeDWPt7pgzOoDhHRyMt04VdVw==} peerDependencies: react: '>=16.13.1' dependencies: '@mdx-js/mdx': 2.1.0 + '@napi-rs/simple-git': 0.1.7 github-slugger: 1.4.0 graceful-fs: 4.2.9 gray-matter: 4.0.3 + p-limit: 4.0.0 react: 17.0.2 rehype-pretty-code: 0.1.0_shiki@0.10.1 remark-gfm: 3.0.1 @@ -6594,6 +6712,13 @@ packages: yocto-queue: 0.1.0 dev: true + /p-limit/4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 + dev: false + /p-locate/2.0.0: resolution: {integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=} engines: {node: '>=4'} @@ -8677,6 +8802,11 @@ packages: engines: {node: '>=10'} dev: true + /yocto-queue/1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: false + /zwitch/2.0.2: resolution: {integrity: sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==} dev: false From a0bd021e46302653b723736b0af8f24b73f58f15 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Tue, 19 Apr 2022 07:48:10 -0400 Subject: [PATCH 03/35] Update lockfile --- pnpm-lock.yaml | 146 +++---------------------------------------------- 1 file changed, 8 insertions(+), 138 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71e4b338d70fb..a00e106e59fdd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,8 +78,8 @@ importers: eslint-config-prettier: 8.4.0 js-cookie: 3.0.1 next: 12.1.0 - nextra: 2.0.0-alpha.49 - nextra-theme-docs: 2.0.0-alpha.50 + nextra: 2.0.0-alpha.48 + nextra-theme-docs: 2.0.0-alpha.48 postcss: 8.3.5 react: 17.0.2 react-dom: 17.0.2 @@ -101,8 +101,8 @@ importers: copy-to-clipboard: 3.3.1 js-cookie: 3.0.1 next: 12.1.0_dfc0b93d99fba272c9564d3139a2581a - nextra: 2.0.0-alpha.49_react@17.0.2 - nextra-theme-docs: 2.0.0-alpha.50_caa633a00319350dbda42996613fe26c + nextra: 2.0.0-alpha.48_react@17.0.2 + nextra-theme-docs: 2.0.0-alpha.48_caa633a00319350dbda42996613fe26c react: 17.0.2 react-dom: 17.0.2_react@17.0.2 react-hot-toast: 2.1.1_83aecc314a46186883faa129c0399856 @@ -1014,122 +1014,6 @@ packages: react: 17.0.2 dev: false - /@napi-rs/simple-git-android-arm-eabi/0.1.7: - resolution: {integrity: sha512-1ZNMZJ+3NhwI3HGB08nRsAzMP81du6RnZ1X9YhZ6uusuSH7p4EWs3d44TshJ+vHdjPi6eitfMN9jK5iw6dHKow==} - engines: {node: '>= 10'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-android-arm64/0.1.7: - resolution: {integrity: sha512-Xy3b8IfuIhwYx8xns7fUnJslbytjq4knTG9i0PhyF+o59se81RkLgcj86LmuD4GhzDrYQTwFgnPx3aKUUObn3Q==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-darwin-arm64/0.1.7: - resolution: {integrity: sha512-uHO0JOwHjc39rX6nEt/tctx7IcsS33HWlHYtjt8h8YlfdvwAidPMVZDwg/dBPMTl+mdAyuFUM8ce6S91OguGNQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-darwin-x64/0.1.7: - resolution: {integrity: sha512-33nWHRBMf+twLabVdxyj9c/xsAY4lgWip7Sa5ogpMWdzPDDZjPliz//7hScmcRcetfFoPpfqbbLW2YCEmhQYGA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-linux-arm-gnueabihf/0.1.7: - resolution: {integrity: sha512-oqC/TngHfXaeynapp5YP+1PMoQXFP7IrCRlKbwkVxTXOW5O9A8KaeFn00WRLHvm/wkAbW7757mU6Nz5csy4qPw==} - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-linux-arm64-gnu/0.1.7: - resolution: {integrity: sha512-T/QQIaQviWPfHUhPnQQQYuzlAHVlr68xK99Hd5b6xPp8LsLcDBsTg7P3pAilAkgzXKz1O6/pYVtwJD1BTayu9A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-linux-arm64-musl/0.1.7: - resolution: {integrity: sha512-afbdrfmEGptPp+yBykR0uVWrKxvZwC5C80GYMROa63/BdzvODWsDt+FJcTWuj/kXHms7hGRLWCyOAnuLAjdBow==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-linux-x64-gnu/0.1.7: - resolution: {integrity: sha512-pb2jPxPX0TCaJMuDbyWj87s5ylZExt2E8Nz0i9DT706LmcRrEsGjPVD/XITBDukPv2fPWwW7E4gw0fAQBYt4Ag==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-linux-x64-musl/0.1.7: - resolution: {integrity: sha512-1tUBN6FdC5EmRkxaKA51IpbGdnJYSmPjKKaaLyMXpUcyc2PJxGymzYy5Oj2XfxUcu2BdO2SdIpt9N4APOERkSg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-win32-arm64-msvc/0.1.7: - resolution: {integrity: sha512-pGoGppekJ1T+J78g+oWpwOux9mQLy2vRZMAp7DM+8Wv0RkA41JROISlQHpkmxvNTB4VQ7OyP2ASeizBS4rNrhg==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git-win32-x64-msvc/0.1.7: - resolution: {integrity: sha512-/qHNi8TlEhjFTXl5CvlU5RhkibWAnFisLG6yKY8pNHaxEJMjE+HS58USDGtQ0gwgM3pmvJtaqRtMwQyoboTOXg==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@napi-rs/simple-git/0.1.7: - resolution: {integrity: sha512-53fsesi8pmCh5ctuFMpSgfmYy4WtXJV5R5BW48B7P49ypvoTaySx0uKUN+cv6pRRWILWFIrPH2cJiPoiONM3vg==} - engines: {node: '>= 10'} - optionalDependencies: - '@napi-rs/simple-git-android-arm-eabi': 0.1.7 - '@napi-rs/simple-git-android-arm64': 0.1.7 - '@napi-rs/simple-git-darwin-arm64': 0.1.7 - '@napi-rs/simple-git-darwin-x64': 0.1.7 - '@napi-rs/simple-git-linux-arm-gnueabihf': 0.1.7 - '@napi-rs/simple-git-linux-arm64-gnu': 0.1.7 - '@napi-rs/simple-git-linux-arm64-musl': 0.1.7 - '@napi-rs/simple-git-linux-x64-gnu': 0.1.7 - '@napi-rs/simple-git-linux-x64-musl': 0.1.7 - '@napi-rs/simple-git-win32-arm64-msvc': 0.1.7 - '@napi-rs/simple-git-win32-x64-msvc': 0.1.7 - dev: false - /@next/env/12.1.0: resolution: {integrity: sha512-nrIgY6t17FQ9xxwH3jj0a6EOiQ/WDHUos35Hghtr+SWN/ntHIQ7UpuvSi0vaLzZVHQWaDupKI+liO5vANcDeTQ==} dev: false @@ -6412,8 +6296,8 @@ packages: - babel-plugin-macros dev: false - /nextra-theme-docs/2.0.0-alpha.50_caa633a00319350dbda42996613fe26c: - resolution: {integrity: sha512-TkMvB8pCVN1LJV6NpXm/5MG2+IHFrMh7bf8E0J6QGRfYaLAhHEAbO7OZpXuE6q/MGGzaNjsXYfFVsC+0r/+/mQ==} + /nextra-theme-docs/2.0.0-alpha.48_caa633a00319350dbda42996613fe26c: + resolution: {integrity: sha512-eA1AmD8KVD7lgy+fq1aGjEv3NlNNAgx9UYE8Fsi9TimaIAuRMaqulNoG5m1HLcqUPtxjBkl/zM7gPgxfQg2d2A==} peerDependencies: next: '>=9.5.3' react: '>=16.13.1' @@ -6437,17 +6321,15 @@ packages: title: 3.4.3 dev: false - /nextra/2.0.0-alpha.49_react@17.0.2: - resolution: {integrity: sha512-dR52NUOH7amYQeRsQ0lENPjDrnx41NTmKMImAQQ9Nlx/PVBzEmdRo/bnX3GLIYeDWPt7pgzOoDhHRyMt04VdVw==} + /nextra/2.0.0-alpha.48_react@17.0.2: + resolution: {integrity: sha512-ZiAnQluH1k4Rojf0grBM4sjzZX87jGqKwnjhMd6wtflwpofXfYKDSXKMQrJei9Da8n/iZnz7STbQ2WPL1Fw+SQ==} peerDependencies: react: '>=16.13.1' dependencies: '@mdx-js/mdx': 2.1.0 - '@napi-rs/simple-git': 0.1.7 github-slugger: 1.4.0 graceful-fs: 4.2.9 gray-matter: 4.0.3 - p-limit: 4.0.0 react: 17.0.2 rehype-pretty-code: 0.1.0_shiki@0.10.1 remark-gfm: 3.0.1 @@ -6712,13 +6594,6 @@ packages: yocto-queue: 0.1.0 dev: true - /p-limit/4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - yocto-queue: 1.0.0 - dev: false - /p-locate/2.0.0: resolution: {integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=} engines: {node: '>=4'} @@ -8802,11 +8677,6 @@ packages: engines: {node: '>=10'} dev: true - /yocto-queue/1.0.0: - resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} - engines: {node: '>=12.20'} - dev: false - /zwitch/2.0.2: resolution: {integrity: sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==} dev: false From c3522095708edf1f80e9ccb5a4b951ac6ea19a9c Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Wed, 20 Apr 2022 09:25:46 -0400 Subject: [PATCH 04/35] Upgrade nextra --- docs/package.json | 4 +- docs/pages/docs/getting-started.mdx | 5 +- pnpm-lock.yaml | 146 ++++++++++++++++++++++++++-- 3 files changed, 142 insertions(+), 13 deletions(-) diff --git a/docs/package.json b/docs/package.json index 1c1739575fc28..1ad827da92d2f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -24,8 +24,8 @@ "copy-to-clipboard": "3.3.1", "js-cookie": "3.0.1", "next": "12.1.0", - "nextra": "2.0.0-alpha.48", - "nextra-theme-docs": "2.0.0-alpha.48", + "nextra": "2.0.0-alpha.49", + "nextra-theme-docs": "2.0.0-alpha.50", "react": "17.0.2", "react-dom": "17.0.2", "react-hot-toast": "2.1.1", diff --git a/docs/pages/docs/getting-started.mdx b/docs/pages/docs/getting-started.mdx index eadcbf393e18f..a7c566a9483e3 100644 --- a/docs/pages/docs/getting-started.mdx +++ b/docs/pages/docs/getting-started.mdx @@ -5,6 +5,7 @@ description: Create your first monorepo or add Turborepo to an existing project. import Callout from "../../components/callout"; import Beta from "../../components/beta"; +import { Tabs, Tab } from '../../components/Tabs' # Getting Started with Turborepo @@ -37,8 +38,6 @@ Turborepo works with [Yarn v1](https://classic.yarnpkg.com/lang/en/), [NPM](http Add `turbo` as a development dependency in the root of your project. -import { Tabs, Tab } from '../../components/Tabs' - ```bash @@ -86,7 +85,7 @@ Your pipeline both defines the way in which your NPM `package.json` scripts rela "build": { "dependsOn": ["^build"], // note: output globs are relative to each package's `package.json` - // (and not the monorepo root) + // (and not the monorepo root) "outputs": [".next/**"] }, "test": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a00e106e59fdd..71e4b338d70fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,8 +78,8 @@ importers: eslint-config-prettier: 8.4.0 js-cookie: 3.0.1 next: 12.1.0 - nextra: 2.0.0-alpha.48 - nextra-theme-docs: 2.0.0-alpha.48 + nextra: 2.0.0-alpha.49 + nextra-theme-docs: 2.0.0-alpha.50 postcss: 8.3.5 react: 17.0.2 react-dom: 17.0.2 @@ -101,8 +101,8 @@ importers: copy-to-clipboard: 3.3.1 js-cookie: 3.0.1 next: 12.1.0_dfc0b93d99fba272c9564d3139a2581a - nextra: 2.0.0-alpha.48_react@17.0.2 - nextra-theme-docs: 2.0.0-alpha.48_caa633a00319350dbda42996613fe26c + nextra: 2.0.0-alpha.49_react@17.0.2 + nextra-theme-docs: 2.0.0-alpha.50_caa633a00319350dbda42996613fe26c react: 17.0.2 react-dom: 17.0.2_react@17.0.2 react-hot-toast: 2.1.1_83aecc314a46186883faa129c0399856 @@ -1014,6 +1014,122 @@ packages: react: 17.0.2 dev: false + /@napi-rs/simple-git-android-arm-eabi/0.1.7: + resolution: {integrity: sha512-1ZNMZJ+3NhwI3HGB08nRsAzMP81du6RnZ1X9YhZ6uusuSH7p4EWs3d44TshJ+vHdjPi6eitfMN9jK5iw6dHKow==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-android-arm64/0.1.7: + resolution: {integrity: sha512-Xy3b8IfuIhwYx8xns7fUnJslbytjq4knTG9i0PhyF+o59se81RkLgcj86LmuD4GhzDrYQTwFgnPx3aKUUObn3Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-darwin-arm64/0.1.7: + resolution: {integrity: sha512-uHO0JOwHjc39rX6nEt/tctx7IcsS33HWlHYtjt8h8YlfdvwAidPMVZDwg/dBPMTl+mdAyuFUM8ce6S91OguGNQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-darwin-x64/0.1.7: + resolution: {integrity: sha512-33nWHRBMf+twLabVdxyj9c/xsAY4lgWip7Sa5ogpMWdzPDDZjPliz//7hScmcRcetfFoPpfqbbLW2YCEmhQYGA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-arm-gnueabihf/0.1.7: + resolution: {integrity: sha512-oqC/TngHfXaeynapp5YP+1PMoQXFP7IrCRlKbwkVxTXOW5O9A8KaeFn00WRLHvm/wkAbW7757mU6Nz5csy4qPw==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-arm64-gnu/0.1.7: + resolution: {integrity: sha512-T/QQIaQviWPfHUhPnQQQYuzlAHVlr68xK99Hd5b6xPp8LsLcDBsTg7P3pAilAkgzXKz1O6/pYVtwJD1BTayu9A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-arm64-musl/0.1.7: + resolution: {integrity: sha512-afbdrfmEGptPp+yBykR0uVWrKxvZwC5C80GYMROa63/BdzvODWsDt+FJcTWuj/kXHms7hGRLWCyOAnuLAjdBow==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-x64-gnu/0.1.7: + resolution: {integrity: sha512-pb2jPxPX0TCaJMuDbyWj87s5ylZExt2E8Nz0i9DT706LmcRrEsGjPVD/XITBDukPv2fPWwW7E4gw0fAQBYt4Ag==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-linux-x64-musl/0.1.7: + resolution: {integrity: sha512-1tUBN6FdC5EmRkxaKA51IpbGdnJYSmPjKKaaLyMXpUcyc2PJxGymzYy5Oj2XfxUcu2BdO2SdIpt9N4APOERkSg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-win32-arm64-msvc/0.1.7: + resolution: {integrity: sha512-pGoGppekJ1T+J78g+oWpwOux9mQLy2vRZMAp7DM+8Wv0RkA41JROISlQHpkmxvNTB4VQ7OyP2ASeizBS4rNrhg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git-win32-x64-msvc/0.1.7: + resolution: {integrity: sha512-/qHNi8TlEhjFTXl5CvlU5RhkibWAnFisLG6yKY8pNHaxEJMjE+HS58USDGtQ0gwgM3pmvJtaqRtMwQyoboTOXg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@napi-rs/simple-git/0.1.7: + resolution: {integrity: sha512-53fsesi8pmCh5ctuFMpSgfmYy4WtXJV5R5BW48B7P49ypvoTaySx0uKUN+cv6pRRWILWFIrPH2cJiPoiONM3vg==} + engines: {node: '>= 10'} + optionalDependencies: + '@napi-rs/simple-git-android-arm-eabi': 0.1.7 + '@napi-rs/simple-git-android-arm64': 0.1.7 + '@napi-rs/simple-git-darwin-arm64': 0.1.7 + '@napi-rs/simple-git-darwin-x64': 0.1.7 + '@napi-rs/simple-git-linux-arm-gnueabihf': 0.1.7 + '@napi-rs/simple-git-linux-arm64-gnu': 0.1.7 + '@napi-rs/simple-git-linux-arm64-musl': 0.1.7 + '@napi-rs/simple-git-linux-x64-gnu': 0.1.7 + '@napi-rs/simple-git-linux-x64-musl': 0.1.7 + '@napi-rs/simple-git-win32-arm64-msvc': 0.1.7 + '@napi-rs/simple-git-win32-x64-msvc': 0.1.7 + dev: false + /@next/env/12.1.0: resolution: {integrity: sha512-nrIgY6t17FQ9xxwH3jj0a6EOiQ/WDHUos35Hghtr+SWN/ntHIQ7UpuvSi0vaLzZVHQWaDupKI+liO5vANcDeTQ==} dev: false @@ -6296,8 +6412,8 @@ packages: - babel-plugin-macros dev: false - /nextra-theme-docs/2.0.0-alpha.48_caa633a00319350dbda42996613fe26c: - resolution: {integrity: sha512-eA1AmD8KVD7lgy+fq1aGjEv3NlNNAgx9UYE8Fsi9TimaIAuRMaqulNoG5m1HLcqUPtxjBkl/zM7gPgxfQg2d2A==} + /nextra-theme-docs/2.0.0-alpha.50_caa633a00319350dbda42996613fe26c: + resolution: {integrity: sha512-TkMvB8pCVN1LJV6NpXm/5MG2+IHFrMh7bf8E0J6QGRfYaLAhHEAbO7OZpXuE6q/MGGzaNjsXYfFVsC+0r/+/mQ==} peerDependencies: next: '>=9.5.3' react: '>=16.13.1' @@ -6321,15 +6437,17 @@ packages: title: 3.4.3 dev: false - /nextra/2.0.0-alpha.48_react@17.0.2: - resolution: {integrity: sha512-ZiAnQluH1k4Rojf0grBM4sjzZX87jGqKwnjhMd6wtflwpofXfYKDSXKMQrJei9Da8n/iZnz7STbQ2WPL1Fw+SQ==} + /nextra/2.0.0-alpha.49_react@17.0.2: + resolution: {integrity: sha512-dR52NUOH7amYQeRsQ0lENPjDrnx41NTmKMImAQQ9Nlx/PVBzEmdRo/bnX3GLIYeDWPt7pgzOoDhHRyMt04VdVw==} peerDependencies: react: '>=16.13.1' dependencies: '@mdx-js/mdx': 2.1.0 + '@napi-rs/simple-git': 0.1.7 github-slugger: 1.4.0 graceful-fs: 4.2.9 gray-matter: 4.0.3 + p-limit: 4.0.0 react: 17.0.2 rehype-pretty-code: 0.1.0_shiki@0.10.1 remark-gfm: 3.0.1 @@ -6594,6 +6712,13 @@ packages: yocto-queue: 0.1.0 dev: true + /p-limit/4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 + dev: false + /p-locate/2.0.0: resolution: {integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=} engines: {node: '>=4'} @@ -8677,6 +8802,11 @@ packages: engines: {node: '>=10'} dev: true + /yocto-queue/1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: false + /zwitch/2.0.2: resolution: {integrity: sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA==} dev: false From 94f50bf4f87590717d9d0bd664303443d0d92cdd Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Thu, 21 Apr 2022 16:05:53 -0400 Subject: [PATCH 05/35] Tweak getting started --- docs/pages/docs/features/pipelines.mdx | 22 ++-- docs/pages/docs/getting-started.mdx | 155 +++++++++++++++++++------ 2 files changed, 131 insertions(+), 46 deletions(-) diff --git a/docs/pages/docs/features/pipelines.mdx b/docs/pages/docs/features/pipelines.mdx index 562d287d2ff9e..55bb4829b152d 100644 --- a/docs/pages/docs/features/pipelines.mdx +++ b/docs/pages/docs/features/pipelines.mdx @@ -40,15 +40,15 @@ An example Pipeline configuration in `turbo.json`: }, "test": { "dependsOn": ["build"], - "outputs": [""], + "outputs": [], "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"] }, "lint": { - "outputs": [""] + "outputs": [] }, "deploy": { "dependsOn": ["build", "test", "lint"], - "outputs": [""] + "outputs": [] } } } @@ -88,7 +88,7 @@ What you are declaring here in the `pipeline` object of the `turbo` configuratio // A package's `test` task depends on that package's // own `build` task being completed first. "dependsOn": ["build"], - "outputs": [""], + "outputs": [], // A package's `test` task should only be rerun when // either a `.tsx` or `.ts` file has changed. "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"] @@ -96,14 +96,14 @@ What you are declaring here in the `pipeline` object of the `turbo` configuratio "lint": { // A package's `lint` task has no dependencies and // can be run whenever. - "outputs": [""] + "outputs": [] }, "deploy": { // A package's `deploy` task depends on the `build`, // `test`, and `lint` tasks of the same package // being completed. "dependsOn": ["build", "test", "lint"], - "outputs": [""] + "outputs": [] } } } @@ -142,7 +142,7 @@ An empty dependency list (`dependsOn` is either undefined or `[]`) means that a "lint": { // A package's `lint` command has no dependencies and can be run at // whenever. - "outputs": [""] + "outputs": [] } } } @@ -164,7 +164,7 @@ Specifying `inputs` lets us define which files are relevant for a particular tas // A package's `test` task depends on that package's // own `build` task being completed first. "dependsOn": ["build"], - "outputs": [""], + "outputs": [], // A package's `test` task should only be rerun when // either a `.tsx` or `.ts` file has changed. "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"] @@ -199,15 +199,15 @@ For these cases, you can express these relationships in your `pipeline` configur }, "test": { "dependsOn": ["^build"], - "outputs": [""], + "outputs": [], }, "deploy": { "dependsOn": ["test", "build"], - "outputs": [""] + "outputs": [] }, "frontend#deploy": { "dependsOn": ["ui#test", "backend#deploy"], - "outputs": [""] + "outputs": [] } } } diff --git a/docs/pages/docs/getting-started.mdx b/docs/pages/docs/getting-started.mdx index a7c566a9483e3..23fc57b83aa3e 100644 --- a/docs/pages/docs/getting-started.mdx +++ b/docs/pages/docs/getting-started.mdx @@ -25,7 +25,7 @@ To see more examples and starters, have a look at the [examples directory on Git Turborepo was designed to be incrementally adopted. Adding it to an existing monorepo takes only a few minutes. -Turborepo works with [Yarn v1](https://classic.yarnpkg.com/lang/en/), [NPM](https://npmjs.com), and [PNPM](https://pnpm.io/) workspaces. The `turbo` CLI works on the following operating systems. +`turbo` works with [Yarn](https://classic.yarnpkg.com/lang/en/), [npm](https://npmjs.com), and [pnpm](https://pnpm.io/) on the following operating systems: - macOS darwin 64-bit (Intel), ARM 64-bit (Apple Silicon) - Linux 32-bit, 64-bit, ARM, ARM 64-bit, MIPS 64-bit Little Endian, PowerPC 64-bit Little Endian, IBM Z 64-bit Big Endian @@ -34,6 +34,58 @@ Turborepo works with [Yarn v1](https://classic.yarnpkg.com/lang/en/), [NPM](http - NetBSD AMD64 - Android ARM 64-bit +### Ensure workspaces are configured + +**`turbo` is built on top of Workspaces**—A set of features implemented by [npm](https://docs.npmjs.com/cli/v8/using-npm/workspaces#description), [Yarn](https://classic.yarnpkg.com/lang/en/docs/workspaces/), and [pnpm](https://pnpm.io/workspaces) that allows you to manage multiple packages from your local files system from within a singular top-level, root package. Workspaces are required to use `turbo` + +When it comes to folder structure, we suggest is applications to be placed the `/apps` folder and packages to go in `/packages` folders, but that's not a requirement. + + + +
+Ensure that you have specified all `workspaces` in your root `package.json` like so: + +```json filename="package.json" +{ + "workspaces": [ + "packages/*", + "apps/*" + ] +} +``` + + + +
+Ensure that you have specified all `workspaces` in your root `package.json` like so: + +```json filename="package.json" +{ + "workspaces": [ + "packages/*", + "apps/*" + ] +} +``` + + + +
+Ensure that you have specified all `packages` in `pnpm-workspaces.yaml`. +```yaml filename="pnpm-workspace.yaml" +packages: + - "packages/*" + - "apps/*" +``` + + + +Now re-run your NPM client's install command just to be sure. + + + Note: Nested workspaces are not supported. You can flatten your workspaces as a workaround. + + ### Install `turbo` Add `turbo` as a development dependency in the root of your project. @@ -64,7 +116,7 @@ In your root directory, create an empty file named `turbo.json`. This will hold the configuration for Turborepo in your project. If your git repo's base branch is NOT `origin/master` then you need to specify a `baseBranch` too (for example, ours is set to `origin/main`). -```json +```json filename="./turbo.json" { "$schema": "https://turborepo.org/schema.json", "baseBranch": "origin/main" @@ -73,43 +125,64 @@ If your git repo's base branch is NOT `origin/master` then you need to specify a ### Create a `pipeline` -In `turbo.json`, add the commands you want to "turbocharge" to your pipeline. +To define your project's task dependency graph, use the [`pipeline`](./features/pipelines) key in the `turbo.json` configuration file at the root of your project. `turbo` interprets this configuration and conventions to properly schedule, execute, and cache the outputs of the `package.json` scripts defined in all of your workspaces in your monorepo. + +Each key in the [`pipeline`](./features/pipelines) object is the name of a `package.json` script that can be executed by [`turbo run`](./reference/command-line-reference#turbo-run-task1-task2-1). You can specify its dependencies with the [`dependsOn`](../reference/configuration#dependson) key beneath it as well as some other options related to [caching](./features/caching). -Your pipeline both defines the way in which your NPM `package.json` scripts relate to each other, and configures cache artifacts for those scripts. These relationships and cache settings are then fanned out and applied to all package tasks across your entire monorepo. +Packages that do not have have this script defined in their `package.json`'s list of `scripts` will be ignored and skipped over during `turbo run`. -```jsonc +```jsonc filename="./turbo.json" { "$schema": "https://turborepo.org/schema.json", - "baseBranch": "origin/main", "pipeline": { "build": { - "dependsOn": ["^build"], - // note: output globs are relative to each package's `package.json` - // (and not the monorepo root) - "outputs": [".next/**"] + // A package's `build` script depends on that package's + // topological dependencies' and devDependencies' + // `build` tasks being completed first + // (that's what the `^` symbol signifies). + "dependsOn": ["^build"] }, "test": { - "dependsOn": ["^build"], - "outputs": [] + // A package's `test` script depends on that package's + // own `build` script being completed first. + "dependsOn": ["build"], + "outputs": [], + // A package's `test` script should only be rerun when + // either a `.tsx` or `.ts` file has changed in `src` or `test` folders. + "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"] }, "lint": { + // A package's `lint` script has no dependencies and + // can be run whenever. It also has no filesystem outputs. "outputs": [] }, - "dev": { - "cache": false + "deploy": { + // A package's `deploy` script depends on the `build`, + // `test`, and `lint` scripts of the same package + // being completed. It also has no filesystem outputs. + "dependsOn": ["build", "test", "lint"], + "outputs": [] } } } ``` -In the above example, the `build` and `test` tasks are dependent on their packages `dependencies` and `devDependencies` being built first, this is denoted with the `^` prefix. +The rough execution order for a given package based on the `dependsOn` keys above will be: + +1. `build` once its dependencies have run their `build` commands +2. `test` once its _own_ `build` command is finished and has no filesystem outputs (just logs) +3. `lint` can run whenever and has no filesystem outputs (just logs) +4. `deploy` once its _own_ `build`, `test`, and `lint` commands have finished, no outputs -For each script in each workspace's `package.json`, Turborepo will cache files outputted to `dist/**` and `build/**` folders relative to each packages's `package.json` by default if an override isn't added. Using the [`outputs`](./features/caching#configuring-cache-outputs-1) array allows you to override the default cache folders, -like in the example above, where the `.next/**` folder is selected to be the default cache outputs folder for the `build` task for each package. Turborepo will automatically record and cache logs to `.turbo/turbo-