From 3a2f344ce5ce55fdba757ed9075bc5f7eb86fbb0 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Wed, 15 Feb 2023 19:57:07 -0700 Subject: [PATCH 1/6] Outputs are your friend. --- docs/pages/repo/docs/ci/circleci.mdx | 1 + docs/pages/repo/docs/ci/github-actions.mdx | 1 + docs/pages/repo/docs/ci/gitlabci.mdx | 1 + docs/pages/repo/docs/ci/travisci.mdx | 1 + docs/pages/repo/docs/core-concepts/caching.mdx | 1 + .../core-concepts/monorepos/running-tasks.mdx | 18 +++++++++++++----- .../repo/docs/reference/configuration.mdx | 5 ++++- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/pages/repo/docs/ci/circleci.mdx b/docs/pages/repo/docs/ci/circleci.mdx index a51793d9ec556..af548aade9bf7 100644 --- a/docs/pages/repo/docs/ci/circleci.mdx +++ b/docs/pages/repo/docs/ci/circleci.mdx @@ -31,6 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { + "outputs": [".next/**", ".svelte-kit/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/ci/github-actions.mdx b/docs/pages/repo/docs/ci/github-actions.mdx index 6076abea24552..d353a3341d87c 100644 --- a/docs/pages/repo/docs/ci/github-actions.mdx +++ b/docs/pages/repo/docs/ci/github-actions.mdx @@ -31,6 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { + "outputs": [".next/**", ".svelte-kit/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/ci/gitlabci.mdx b/docs/pages/repo/docs/ci/gitlabci.mdx index a1b327e73a60d..f7ebf3ed978a7 100644 --- a/docs/pages/repo/docs/ci/gitlabci.mdx +++ b/docs/pages/repo/docs/ci/gitlabci.mdx @@ -31,6 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { + "outputs": [".next/**", ".svelte-kit/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/ci/travisci.mdx b/docs/pages/repo/docs/ci/travisci.mdx index 443cdf3e70a81..4eb7a918030e7 100644 --- a/docs/pages/repo/docs/ci/travisci.mdx +++ b/docs/pages/repo/docs/ci/travisci.mdx @@ -31,6 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { + "outputs": [".next/**", ".svelte-kit/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/core-concepts/caching.mdx b/docs/pages/repo/docs/core-concepts/caching.mdx index 180a516275d09..18e4a92c6398d 100644 --- a/docs/pages/repo/docs/core-concepts/caching.mdx +++ b/docs/pages/repo/docs/core-concepts/caching.mdx @@ -315,6 +315,7 @@ For example, consider a monorepo with three workspaces: a Next.js project, a Cre { "pipeline": { "build": { + "outputs": [".next/**", "dist/**"], "dependsOn": ["^build"] } } diff --git a/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx b/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx index 7910fd4067089..a214410b1bcd0 100644 --- a/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx +++ b/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx @@ -45,6 +45,7 @@ First, we declare our tasks inside `turbo.json`: "build": { // ^build means build must be run in dependencies // before it can be run in this workspace + "outputs": [".svelte/**"], "dependsOn": ["^build"] }, "test": {}, @@ -83,7 +84,8 @@ The `pipeline` configuration declares which tasks depend on each other in your m // topological dependencies' and devDependencies' // `build` tasks being completed first. The `^` symbol // indicates an upstream dependency. - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "outputs": [".next/**", ".svelte-kit/**"] }, "test": { // A workspace's `test` task depends on that workspace's @@ -120,7 +122,10 @@ If both tasks are in the same workspace, you can specify the relationship like t { "$schema": "https://turbo.build/schema.json", "pipeline": { - "build": {}, + "build": { + "dependsOn": ["^build"], + "outputs": [".next/**", ".svelte-kit/**"] + }, "deploy": { // A workspace's `deploy` task depends on the `build`, // task of the same workspace being completed. @@ -145,7 +150,8 @@ The `^` symbol explicitly declares that the task has a dependency on a task in a "build": { // "A workspace's `build` command depends on its dependencies' // and devDependencies' `build` commands being completed first" - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "outputs": [".next/**", ".svelte-kit/**"] } } } @@ -179,7 +185,8 @@ The example below describes the `deploy` script of a `frontend` application that "pipeline": { // Standard configuration "build": { - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "outputs": [".next/**", ".svelte-kit/**"] }, "test": { "dependsOn": ["^build"] @@ -224,7 +231,8 @@ A sample pipeline that defines the root task `format` and opts the root into `te "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "outputs": [".next/**", ".svelte-kit/**"] }, "test": { "dependsOn": ["^build"], diff --git a/docs/pages/repo/docs/reference/configuration.mdx b/docs/pages/repo/docs/reference/configuration.mdx index 7564ae717f163..51f6bb3b72432 100644 --- a/docs/pages/repo/docs/reference/configuration.mdx +++ b/docs/pages/repo/docs/reference/configuration.mdx @@ -109,6 +109,7 @@ Items in `dependsOn` without `^` prefix, express the relationships between tasks "build": { // "A workspace's `build` command depends on its dependencies' // or devDependencies' `build` command being completed first" + "outputs": ["dist/**", ".next/**"], "dependsOn": ["^build"] }, "test": { @@ -230,6 +231,7 @@ Defaults to `true`. Whether or not to cache the task [`outputs`](#outputs). Sett "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { + "outputs": ["dist/**", ".svelte-kit/**"], "dependsOn": ["^build"] }, "test": { @@ -269,7 +271,7 @@ Specifying `[]` will cause the task to be rerun when any file in the workspace c // A workspace's `test` task depends on that workspace's // own `build` task being completed first. "dependsOn": ["build"], - "outputs": [""], + "outputs": ["dist/**", ".next/**"], // A workspace's `test` task should only be rerun when // either a `.tsx` or `.ts` file has changed. "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"] @@ -299,6 +301,7 @@ Set type of output logging. "pipeline": { "build": { "dependsOn": ["^build"], + "outputs": ["dist/**", ".svelte-kit/**"], "outputMode": "new-only" }, "test": { From 99c66b6c5e240fba390e123b9c4e985bfcac445c Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Thu, 16 Feb 2023 10:47:46 -0700 Subject: [PATCH 2/6] Fixes --- docs/pages/repo/docs/ci/circleci.mdx | 2 +- docs/pages/repo/docs/ci/github-actions.mdx | 2 +- docs/pages/repo/docs/ci/gitlabci.mdx | 2 +- docs/pages/repo/docs/ci/travisci.mdx | 2 +- docs/pages/repo/docs/core-concepts/caching.mdx | 2 +- .../docs/core-concepts/monorepos/running-tasks.mdx | 12 ++++++------ docs/pages/repo/docs/reference/configuration.mdx | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/pages/repo/docs/ci/circleci.mdx b/docs/pages/repo/docs/ci/circleci.mdx index af548aade9bf7..c102dabd73771 100644 --- a/docs/pages/repo/docs/ci/circleci.mdx +++ b/docs/pages/repo/docs/ci/circleci.mdx @@ -31,7 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "outputs": [".next/**", ".svelte-kit/**"], + "outputs": [".next/**", "!.next/cache/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/ci/github-actions.mdx b/docs/pages/repo/docs/ci/github-actions.mdx index d353a3341d87c..3b69a94e7ddef 100644 --- a/docs/pages/repo/docs/ci/github-actions.mdx +++ b/docs/pages/repo/docs/ci/github-actions.mdx @@ -31,7 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "outputs": [".next/**", ".svelte-kit/**"], + "outputs": [".next/**", "!.next/cache/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/ci/gitlabci.mdx b/docs/pages/repo/docs/ci/gitlabci.mdx index f7ebf3ed978a7..f8321d0999485 100644 --- a/docs/pages/repo/docs/ci/gitlabci.mdx +++ b/docs/pages/repo/docs/ci/gitlabci.mdx @@ -31,7 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "outputs": [".next/**", ".svelte-kit/**"], + "outputs": [".svelte-kit/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/ci/travisci.mdx b/docs/pages/repo/docs/ci/travisci.mdx index 4eb7a918030e7..29a09e596b531 100644 --- a/docs/pages/repo/docs/ci/travisci.mdx +++ b/docs/pages/repo/docs/ci/travisci.mdx @@ -31,7 +31,7 @@ And a `turbo.json`: "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "outputs": [".next/**", ".svelte-kit/**"], + "outputs": [".svelte-kit/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/core-concepts/caching.mdx b/docs/pages/repo/docs/core-concepts/caching.mdx index 18e4a92c6398d..9a229018a466f 100644 --- a/docs/pages/repo/docs/core-concepts/caching.mdx +++ b/docs/pages/repo/docs/core-concepts/caching.mdx @@ -61,7 +61,7 @@ To override the default cache output behavior, pass an array of globs to a [`pip "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "outputs": ["dist/**", ".next/**"], + "outputs": [".next/**", "!.next/cache/**"], "dependsOn": ["^build"] }, "test": { diff --git a/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx b/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx index a214410b1bcd0..91974d2b7162c 100644 --- a/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx +++ b/docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx @@ -45,7 +45,7 @@ First, we declare our tasks inside `turbo.json`: "build": { // ^build means build must be run in dependencies // before it can be run in this workspace - "outputs": [".svelte/**"], + "outputs": [".next/**", "!.next/cache/**",".svelte-kit/**"], "dependsOn": ["^build"] }, "test": {}, @@ -85,7 +85,7 @@ The `pipeline` configuration declares which tasks depend on each other in your m // `build` tasks being completed first. The `^` symbol // indicates an upstream dependency. "dependsOn": ["^build"], - "outputs": [".next/**", ".svelte-kit/**"] + "outputs": [".next/**", "!.next/cache/**", ".svelte-kit/**"] }, "test": { // A workspace's `test` task depends on that workspace's @@ -124,7 +124,7 @@ If both tasks are in the same workspace, you can specify the relationship like t "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": [".next/**", ".svelte-kit/**"] + "outputs": [".next/**", "!.next/cache/**", ".svelte-kit/**"] }, "deploy": { // A workspace's `deploy` task depends on the `build`, @@ -151,7 +151,7 @@ The `^` symbol explicitly declares that the task has a dependency on a task in a // "A workspace's `build` command depends on its dependencies' // and devDependencies' `build` commands being completed first" "dependsOn": ["^build"], - "outputs": [".next/**", ".svelte-kit/**"] + "outputs": [".next/**", "!.next/cache/**", ".svelte-kit/**"] } } } @@ -186,7 +186,7 @@ The example below describes the `deploy` script of a `frontend` application that // Standard configuration "build": { "dependsOn": ["^build"], - "outputs": [".next/**", ".svelte-kit/**"] + "outputs": [".next/**", "!.next/cache/**", ".svelte-kit/**"] }, "test": { "dependsOn": ["^build"] @@ -232,7 +232,7 @@ A sample pipeline that defines the root task `format` and opts the root into `te "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": [".next/**", ".svelte-kit/**"] + "outputs": [".next/**", "!.next/cache/**", ".svelte-kit/**"] }, "test": { "dependsOn": ["^build"], diff --git a/docs/pages/repo/docs/reference/configuration.mdx b/docs/pages/repo/docs/reference/configuration.mdx index 51f6bb3b72432..2784f26161359 100644 --- a/docs/pages/repo/docs/reference/configuration.mdx +++ b/docs/pages/repo/docs/reference/configuration.mdx @@ -271,7 +271,7 @@ Specifying `[]` will cause the task to be rerun when any file in the workspace c // A workspace's `test` task depends on that workspace's // own `build` task being completed first. "dependsOn": ["build"], - "outputs": ["dist/**", ".next/**"], + "outputs": [".next/**", "!.next/cache/**"], // A workspace's `test` task should only be rerun when // either a `.tsx` or `.ts` file has changed. "inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"] From 1495619120bc9bbd26d21b3017ea572b21d538b5 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Thu, 16 Feb 2023 10:50:27 -0700 Subject: [PATCH 3/6] A couple more. --- docs/pages/repo/docs/core-concepts/caching.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/repo/docs/core-concepts/caching.mdx b/docs/pages/repo/docs/core-concepts/caching.mdx index 9a229018a466f..e833771367445 100644 --- a/docs/pages/repo/docs/core-concepts/caching.mdx +++ b/docs/pages/repo/docs/core-concepts/caching.mdx @@ -315,7 +315,7 @@ For example, consider a monorepo with three workspaces: a Next.js project, a Cre { "pipeline": { "build": { - "outputs": [".next/**", "dist/**"], + "outputs": [".next/**", "!.next/cache/**" "dist/**"], "dependsOn": ["^build"] } } From e766806daa5e4bab6ad8ea8c3cb0e90d0b8b47c9 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Thu, 16 Feb 2023 10:51:01 -0700 Subject: [PATCH 4/6] Update docs/pages/repo/docs/reference/configuration.mdx Co-authored-by: Nathan Hammond --- docs/pages/repo/docs/reference/configuration.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/repo/docs/reference/configuration.mdx b/docs/pages/repo/docs/reference/configuration.mdx index 2784f26161359..22c5cb10eed78 100644 --- a/docs/pages/repo/docs/reference/configuration.mdx +++ b/docs/pages/repo/docs/reference/configuration.mdx @@ -109,7 +109,7 @@ Items in `dependsOn` without `^` prefix, express the relationships between tasks "build": { // "A workspace's `build` command depends on its dependencies' // or devDependencies' `build` command being completed first" - "outputs": ["dist/**", ".next/**"], + "outputs": [".next/**", "!.next/cache/**", "dist/**"] "dependsOn": ["^build"] }, "test": { From c4f61e026330e9ca3b646e501ca51667a8323e24 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Thu, 16 Feb 2023 10:51:07 -0700 Subject: [PATCH 5/6] Update docs/pages/repo/docs/reference/configuration.mdx Co-authored-by: Nathan Hammond --- docs/pages/repo/docs/reference/configuration.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/repo/docs/reference/configuration.mdx b/docs/pages/repo/docs/reference/configuration.mdx index 22c5cb10eed78..3e3e74a5cac2d 100644 --- a/docs/pages/repo/docs/reference/configuration.mdx +++ b/docs/pages/repo/docs/reference/configuration.mdx @@ -301,7 +301,7 @@ Set type of output logging. "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**", ".svelte-kit/**"], + "outputs": [".svelte-kit/**", "dist/**"], "outputMode": "new-only" }, "test": { From cb6b9b11b26a746187b01172579c27801c6108be Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Thu, 16 Feb 2023 10:51:25 -0700 Subject: [PATCH 6/6] Update docs/pages/repo/docs/reference/configuration.mdx Co-authored-by: Nathan Hammond --- docs/pages/repo/docs/reference/configuration.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/repo/docs/reference/configuration.mdx b/docs/pages/repo/docs/reference/configuration.mdx index 3e3e74a5cac2d..5510864d9190a 100644 --- a/docs/pages/repo/docs/reference/configuration.mdx +++ b/docs/pages/repo/docs/reference/configuration.mdx @@ -231,7 +231,7 @@ Defaults to `true`. Whether or not to cache the task [`outputs`](#outputs). Sett "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "outputs": ["dist/**", ".svelte-kit/**"], + "outputs": [".svelte-kit/**", "dist/**"], "dependsOn": ["^build"] }, "test": {