Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation for for cacheDir, daemon, and envMode (config values, and env vars) #9018

Merged
merged 4 commits into from
Aug 21, 2024
Merged
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
41 changes: 41 additions & 0 deletions docs/repo-docs/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,47 @@ To help with incremental migration or in situations where you can't use the `pac
environment variable.
</Callout>

### `cacheDir`

Default: `".turbo/cache"`

Specify the filesystem cache directory.

```jsonc title="./turbo.json"
{
"cacheDir": ".turbo/cache"
}
```

### `daemon`

Default: `true`

Turborepo runs a background process to pre-calculate some expensive operations. This standalone process (daemon) is a performance optimization, and not required for proper functioning of `turbo`.

```jsonc title="./turbo.json"
{
"daemon": true
}
```

### `envMode`

Default: `"strict"`

Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:
dimitropoulos marked this conversation as resolved.
Show resolved Hide resolved

- `"strict"`: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.
- `"loose"`: Allow all environment variables for the process to be available.

Read more about [Environment Modes](/repo/docs/crafting-your-repository/using-environment-variables#environment-modes).

```jsonc title="./turbo.json"
{
"envMode": "strict"
}
```

## Defining tasks

### `tasks`
Expand Down
12 changes: 8 additions & 4 deletions docs/repo-docs/reference/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ turbo run build --cache-dir="./my-cache"
Ensure the directory is in your `.gitignore` when changing it.
</Callout>

The same behavior can also be set via the `TURBO_CACHE_DIR=example/path` system variable.

### `--concurrency <number | percentage>`

Default: `10`
Expand Down Expand Up @@ -137,6 +139,8 @@ Controls the available environment variables in the task's runtime.
turbo run build --env-mode=loose
```

The same behavior can also be set via the `TURBO_ENV_MODE=strict` system variable.

#### `strict`

Only environment variables specified in the following keys are
Expand Down Expand Up @@ -320,13 +324,13 @@ Do not cache results of the task.
turbo run dev --no-cache
```

### `--no-daemon`

Default: `false`
### `--daemon` and `--no-daemon`

`turbo` can run a background process to pre-calculate values used for determining work that needs to be done. This standalone process (daemon) is an optimization, and not required for proper functioning of `turbo`.

Passing `--no-daemon` instructs `turbo` to avoid using or creating the standalone process.
Passing `--daemon` instructs `turbo` to use the standalone process, while `--no-daemon` instructs `turbo` to avoid using or creating the standalone process.

The same behavior can also be set via the `TURBO_DAEMON=true` system variable.

### `--output-logs <option>`

Expand Down
6 changes: 3 additions & 3 deletions packages/turbo-types/schemas/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
},
"cacheDir": {
"$ref": "#/definitions/RelativeUnixPath",
"description": "Specify the filesystem cache directory.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#tasks"
"description": "Specify the filesystem cache directory.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#cachedir"
},
"daemon": {
"type": "boolean",
"description": "Turbo can run a background process to pre-calculate values used for determining work that needs to be done. This standalone process (daemon) is an optimization, and not required for proper functioning of turbo.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#daemon"
"description": "Turborepo runs a background process to pre-calculate some expensive operations. This standalone process (daemon) is a performance optimization, and not required for proper functioning of `turbo`.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#daemon"
},
"envMode": {
"$ref": "#/definitions/EnvMode",
"description": "Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:\n\n- **Strict Mode**: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.\n- **Loose Mode**: Allow all environment variables for the process to be available.\n\nDocumentation: https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#environment-modes"
"description": "Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:\n\n- `\"strict\"`: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.\n- `\"loose\"`: Allow all environment variables for the process to be available.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#envmode"
}
},
"additionalProperties": false,
Expand Down
6 changes: 3 additions & 3 deletions packages/turbo-types/schemas/schema.v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
},
"cacheDir": {
"$ref": "#/definitions/RelativeUnixPath",
"description": "Specify the filesystem cache directory.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#tasks"
"description": "Specify the filesystem cache directory.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#cachedir"
},
"daemon": {
"type": "boolean",
"description": "Turbo can run a background process to pre-calculate values used for determining work that needs to be done. This standalone process (daemon) is an optimization, and not required for proper functioning of turbo.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#daemon"
"description": "Turborepo runs a background process to pre-calculate some expensive operations. This standalone process (daemon) is a performance optimization, and not required for proper functioning of `turbo`.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#daemon"
},
"envMode": {
"$ref": "#/definitions/EnvMode",
"description": "Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:\n\n- **Strict Mode**: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.\n- **Loose Mode**: Allow all environment variables for the process to be available.\n\nDocumentation: https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#environment-modes"
"description": "Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:\n\n- `\"strict\"`: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.\n- `\"loose\"`: Allow all environment variables for the process to be available.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#envmode"
}
},
"additionalProperties": false,
Expand Down
12 changes: 6 additions & 6 deletions packages/turbo-types/src/types/config-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ export interface RootSchema extends BaseSchema {
/**
* Specify the filesystem cache directory.
*
* Documentation: https://turbo.build/repo/docs/reference/configuration#tasks
* Documentation: https://turbo.build/repo/docs/reference/configuration#cachedir
*
* @defaultValue `"".turbo/cache"`
* @defaultValue `".turbo/cache"`
*/
cacheDir?: RelativeUnixPath;

/**
* Turbo can run a background process to pre-calculate values used for determining work that needs to be done. This standalone process (daemon) is an optimization, and not required for proper functioning of turbo.
* Turborepo runs a background process to pre-calculate some expensive operations. This standalone process (daemon) is a performance optimization, and not required for proper functioning of `turbo`.
*
* Documentation: https://turbo.build/repo/docs/reference/configuration#daemon
*
Expand All @@ -147,10 +147,10 @@ export interface RootSchema extends BaseSchema {
/**
* Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:
*
* - **Strict Mode**: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.
* - **Loose Mode**: Allow all environment variables for the process to be available.
* - `"strict"`: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.
* - `"loose"`: Allow all environment variables for the process to be available.
*
* Documentation: https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#environment-modes
* Documentation: https://turbo.build/repo/docs/reference/configuration#envmode
*
* @defaultValue `"strict"`
*/
Expand Down
Loading