mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
feat: add some config to taskrc.yml (#2389)
Co-authored-by: Pete Davison <pd93.uk@outlook.com>
This commit is contained in:
@@ -5,7 +5,8 @@ import { resolve } from 'path';
|
||||
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs';
|
||||
import {
|
||||
groupIconMdPlugin,
|
||||
groupIconVitePlugin
|
||||
groupIconVitePlugin,
|
||||
localIconLoader
|
||||
} from 'vitepress-plugin-group-icons';
|
||||
import { team } from './team.ts';
|
||||
import { taskDescription, taskName } from './meta.ts';
|
||||
@@ -99,7 +100,20 @@ export default defineConfig({
|
||||
}
|
||||
},
|
||||
vite: {
|
||||
plugins: [groupIconVitePlugin()],
|
||||
plugins: [
|
||||
groupIconVitePlugin({
|
||||
customIcon: {
|
||||
'.taskrc.yml': localIconLoader(
|
||||
import.meta.url,
|
||||
'./theme/icons/task.svg'
|
||||
),
|
||||
'Taskfile.yml': localIconLoader(
|
||||
import.meta.url,
|
||||
'./theme/icons/task.svg'
|
||||
)
|
||||
}
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
alias: [
|
||||
{
|
||||
|
||||
1
website/.vitepress/theme/icons/task.svg
Normal file
1
website/.vitepress/theme/icons/task.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500" viewBox="0 0 375 375"><path fill="#29beb0" d="M 187.570312 190.933594 L 187.570312 375 L 30.070312 279.535156 L 30.070312 95.464844 Z"/><path fill="#69d2c8" d="M 187.570312 190.933594 L 187.570312 375 L 345.070312 279.535156 L 345.070312 95.464844 Z"/><path fill="#94dfd8" d="M 187.570312 190.933594 L 30.070312 95.464844 L 187.570312 0 L 345.070312 95.464844 Z"/></svg>
|
||||
|
After Width: | Height: | Size: 435 B |
@@ -290,3 +290,64 @@ You can force Task to ignore the cache and download the latest version by using
|
||||
the `--download` flag.
|
||||
|
||||
You can use the `--clear-cache` flag to clear all cached remote files.
|
||||
|
||||
## Configuration
|
||||
This experiment adds a new `remote` section to the [configuration file](../reference/config.md).
|
||||
|
||||
- **Type**: `object`
|
||||
- **Description**: Remote configuration settings for handling remote Taskfiles
|
||||
|
||||
```yaml
|
||||
remote:
|
||||
insecure: false
|
||||
offline: false
|
||||
timeout: "30s"
|
||||
cache-expiry: "24h"
|
||||
```
|
||||
|
||||
#### `insecure`
|
||||
|
||||
- **Type**: `boolean`
|
||||
- **Default**: `false`
|
||||
- **Description**: Allow insecure connections when fetching remote Taskfiles
|
||||
|
||||
```yaml
|
||||
remote:
|
||||
insecure: true
|
||||
```
|
||||
|
||||
#### `offline`
|
||||
|
||||
- **Type**: `boolean`
|
||||
- **Default**: `false`
|
||||
- **Description**: Work in offline mode, preventing remote Taskfile fetching
|
||||
|
||||
```yaml
|
||||
remote:
|
||||
offline: true
|
||||
```
|
||||
|
||||
#### `timeout`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Default**: Not specified
|
||||
- **Pattern**: `^[0-9]+(ns|us|µs|ms|s|m|h)$`
|
||||
- **Description**: Timeout duration for remote operations (e.g., '30s', '5m')
|
||||
|
||||
```yaml
|
||||
remote:
|
||||
timeout: "1m"
|
||||
```
|
||||
|
||||
#### `cache-expiry`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Default**: Not specified
|
||||
- **Pattern**: `^[0-9]+(ns|us|µs|ms|s|m|h)$`
|
||||
- **Description**: Cache expiry duration for remote Taskfiles (e.g., '1h', '24h')
|
||||
|
||||
```yaml
|
||||
remote:
|
||||
cache-expiry: "6h"
|
||||
```
|
||||
|
||||
|
||||
@@ -73,3 +73,44 @@ option_3: foo # Taken from $XDG_CONFIG_HOME/task/.taskrc.yml
|
||||
The experiments section allows you to enable Task's experimental features. These
|
||||
options are not enumerated here. Instead, please refer to our
|
||||
[experiments documentation](../experiments/index.md) for more information.
|
||||
|
||||
```yaml
|
||||
experiments:
|
||||
feature_name: 1
|
||||
another_feature: 2
|
||||
```
|
||||
|
||||
### `verbose`
|
||||
|
||||
- **Type**: `boolean`
|
||||
- **Default**: `false`
|
||||
- **Description**: Enable verbose output for all tasks
|
||||
- **CLI equivalent**: [`-v, --verbose`](./cli.md#-v---verbose)
|
||||
|
||||
```yaml
|
||||
verbose: true
|
||||
```
|
||||
|
||||
### `concurrency`
|
||||
|
||||
- **Type**: `integer`
|
||||
- **Minimum**: `1`
|
||||
- **Description**: Number of concurrent tasks to run
|
||||
- **CLI equivalent**: [`-C, --concurrency`](./cli.md#-c---concurrency-number)
|
||||
|
||||
```yaml
|
||||
concurrency: 4
|
||||
```
|
||||
|
||||
## Example Configuration
|
||||
|
||||
Here's a complete example of a `.taskrc.yml` file with all available options:
|
||||
|
||||
```yaml
|
||||
# Global settings
|
||||
verbose: true
|
||||
concurrency: 2
|
||||
|
||||
# Enable experimental features
|
||||
experiments:
|
||||
REMOTE_TASKFILES: 1
|
||||
|
||||
@@ -20,6 +20,40 @@
|
||||
"enum": [0, 1]
|
||||
}
|
||||
}
|
||||
},
|
||||
"remote": {
|
||||
"type": "object",
|
||||
"description": "Remote configuration settings",
|
||||
"properties": {
|
||||
"insecure": {
|
||||
"type": "boolean",
|
||||
"description": "Forces Task to download Taskfiles over insecure connections."
|
||||
},
|
||||
"offline": {
|
||||
"type": "boolean",
|
||||
"description": "Forces Task to only use local or cached Taskfiles."
|
||||
},
|
||||
"timeout": {
|
||||
"type": "string",
|
||||
"description": "Timeout for downloading remote Taskfiles (e.g., '30s', '5m')",
|
||||
"pattern": "^[0-9]+(ns|us|µs|ms|s|m|h)$"
|
||||
},
|
||||
"cache-expiry": {
|
||||
"type": "string",
|
||||
"description": "Expiry duration for cached remote Taskfiles (e.g., '1h', '24h')",
|
||||
"pattern": "^[0-9]+(ns|us|µs|ms|s|m|h)$"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"verbose": {
|
||||
"type": "boolean",
|
||||
"description": "Enable verbose output"
|
||||
},
|
||||
"concurrency": {
|
||||
"type": "integer",
|
||||
"description": "Number of concurrent tasks to run",
|
||||
"minimum": 1
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
||||
Reference in New Issue
Block a user