Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion docs/site/content/docs/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,27 @@ Configure the behavior of `turbo` by using a `turbo.json` file in your Workspace
Extend from the root `turbo.json` to create specific configuration for a package using [Package Configurations](/docs/reference/package-configurations).

- The only valid value for `extends` is `["//"]` to inherit configuration from the root `turbo.json`.
- If `extends` is used in the root `turbo.json`, it will be ignored.
- If `extends` is used in the root `turbo.json`, an error will be thrown.

#### `$TURBO_EXTENDS`

<Callout type="good-to-know">
Two Future Flags exist to opt into new features to allow for more
configuration flexibility.
</Callout>

By default, keys are completely overridden when using [Package Configurations](/docs/reference/package-configurations). To append to parent configuration, use the `$TURBO_EXTENDS` microsyntax:

```json title="packages/ui/turbo.json"
{
"extends": ["//"],
"tasks": {
"build": {
"dependsOn": ["$TURBO_EXTENDS$", "special-task"]
}
}
}
```

### `globalDependencies`

Expand Down Expand Up @@ -199,6 +219,15 @@ Adds a tag to a package for use with [Boundaries](/docs/reference/boundaries).

This key only works in [Package Configurations](/docs/reference/package-configurations). Using this key in a root `turbo.json` will result in an error.

### `futureFlags`

"Future flags" allow you to opt into experimental and beta features, and breaking changes prior to major releases.

Current Future Flags:

- `turboExtendsKeyword`: Enable usage of [`$TURBO_EXTENDS$` microsyntax](#turbo_extends)
- `nonRootExtends`: Enable [extending Package Configurations from other packages](#TODO)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `nonRootExtends`: Enable [extending Package Configurations from other packages](#TODO)
- `nonRootExtends`: Enable [extending Package Configurations from other packages](/docs/reference/package-configurations)

The documentation contains a placeholder #TODO link that should be replaced with the actual URL for the "extending Package Configurations from other packages" documentation.

View Details

Analysis

Broken documentation link in futureFlags section

What fails: nonRootExtends future flag description contains placeholder link [extending Package Configurations from other packages](#TODO) on line 229 of docs/site/content/docs/reference/configuration.mdx

How to reproduce:

  1. Navigate to the configuration documentation
  2. Find the futureFlags section
  3. Click on the "extending Package Configurations from other packages" link

Result: Browser attempts to navigate to anchor #TODO which doesn't exist, resulting in broken link behavior

Expected: Link should navigate to the Package Configurations documentation at /docs/reference/package-configurations

Fix: Replaced placeholder #TODO with correct path /docs/reference/package-configurations


## Defining tasks

### `tasks`
Expand Down
12 changes: 11 additions & 1 deletion packages/turbo-types/schemas/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@
},
"futureFlags": {
"type": "object",
"additionalProperties": {},
"properties": {
"turboExtendsKeyword": {
"type": "boolean",
"description": "Enable `$TURBO_EXTENDS$`\n\n When enabled, allows using `$TURBO_EXTENDS$` in array fields. This will change the default behavior of overriding the field to instead append."
},
"nonRootExtends": {
"type": "boolean",
"description": "Enable extending from a non-root `turbo.json`\n\nWhen enabled, allows using extends targeting `turbo.json`s other than root. All `turbo.json` must still extend from the root `turbo.json` first."
}
},
"additionalProperties": false,
"description": "Opt into breaking changes prior to major releases, experimental features, and beta features.",
"default": {}
}
Expand Down
12 changes: 11 additions & 1 deletion packages/turbo-types/schemas/schema.v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@
},
"futureFlags": {
"type": "object",
"additionalProperties": {},
"properties": {
"turboExtendsKeyword": {
"type": "boolean",
"description": "Enable `$TURBO_EXTENDS$`\n\n When enabled, allows using `$TURBO_EXTENDS$` in array fields. This will change the default behavior of overriding the field to instead append."
},
"nonRootExtends": {
"type": "boolean",
"description": "Enable extending from a non-root `turbo.json`\n\nWhen enabled, allows using extends targeting `turbo.json`s other than root. All `turbo.json` must still extend from the root `turbo.json` first."
}
},
"additionalProperties": false,
"description": "Opt into breaking changes prior to major releases, experimental features, and beta features.",
"default": {}
}
Expand Down
16 changes: 15 additions & 1 deletion packages/turbo-types/src/types/config-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,21 @@ export interface RootSchema extends BaseSchema {
*
* @defaultValue `{}`
*/
futureFlags?: Record<string, unknown>;
futureFlags?: {
/** Enable `$TURBO_EXTENDS$`
*
* When enabled, allows using `$TURBO_EXTENDS$` in array fields.
* This will change the default behavior of overriding the field to instead append.
*/
turboExtendsKeyword?: boolean;

/** Enable extending from a non-root `turbo.json`
*
* When enabled, allows using extends targeting `turbo.json`s other than
* root. All `turbo.json` must still extend from the root `turbo.json` first.
*/
nonRootExtends?: boolean;
};
}

export interface Pipeline {
Expand Down
Loading