@moonrepo/types 1.33.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/common.d.ts +9 -7
- package/cjs/common.d.ts.map +1 -1
- package/cjs/events.d.ts +29 -74
- package/cjs/events.d.ts.map +1 -1
- package/cjs/extensions-config.d.ts +26 -0
- package/cjs/extensions-config.d.ts.map +1 -0
- package/cjs/index.d.ts +3 -1
- package/cjs/index.d.ts.map +1 -1
- package/cjs/mcp.d.ts +6 -6
- package/cjs/mcp.d.ts.map +1 -1
- package/cjs/pipeline.d.ts +61 -72
- package/cjs/pipeline.d.ts.map +1 -1
- package/cjs/project-config.d.ts +129 -173
- package/cjs/project-config.d.ts.map +1 -1
- package/cjs/project.d.ts +8 -119
- package/cjs/project.d.ts.map +1 -1
- package/cjs/task.d.ts +83 -0
- package/cjs/task.d.ts.map +1 -0
- package/cjs/tasks-config.d.ts +380 -139
- package/cjs/tasks-config.d.ts.map +1 -1
- package/cjs/template-config.d.ts +24 -12
- package/cjs/template-config.d.ts.map +1 -1
- package/cjs/toolchains-config.d.ts +128 -0
- package/cjs/toolchains-config.d.ts.map +1 -0
- package/cjs/workspace-config.d.ts +381 -290
- package/cjs/workspace-config.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/common.ts +11 -9
- package/src/events.ts +30 -100
- package/src/extensions-config.ts +31 -0
- package/src/index.ts +3 -1
- package/src/mcp.ts +8 -8
- package/src/pipeline.ts +67 -82
- package/src/project-config.ts +138 -181
- package/src/project.ts +8 -140
- package/src/task.ts +106 -0
- package/src/tasks-config.ts +388 -142
- package/src/template-config.ts +24 -12
- package/src/toolchains-config.ts +143 -0
- package/src/workspace-config.ts +387 -297
- package/src/toolchain-config.ts +0 -814
package/src/tasks-config.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
5
|
import type { ExtendsFrom, Id } from './common';
|
|
6
|
+
import type { LanguageType, LayerType, StackType } from './project-config';
|
|
6
7
|
|
|
7
8
|
/** The task-to-task relationship of the dependency. */
|
|
8
9
|
export type TaskDependencyType = 'cleanup' | 'required' | 'optional';
|
|
@@ -81,15 +82,16 @@ export interface ProjectInput {
|
|
|
81
82
|
|
|
82
83
|
export type Input = string | FileInput | FileGroupInput | GlobInput | ProjectInput;
|
|
83
84
|
|
|
84
|
-
export type TaskArgs = null | string | string[];
|
|
85
|
-
|
|
86
85
|
/** Expanded information about a task dependency. */
|
|
87
86
|
export interface TaskDependencyConfig {
|
|
88
87
|
/** Additional arguments to pass to this dependency when it's ran. */
|
|
89
|
-
args:
|
|
90
|
-
/** A
|
|
91
|
-
env: Record<string, string>;
|
|
92
|
-
/**
|
|
88
|
+
args: string[];
|
|
89
|
+
/** A map of environment variables specific to this dependency. */
|
|
90
|
+
env: Record<string, string | null>;
|
|
91
|
+
/**
|
|
92
|
+
* Marks the dependency as optional when being inherited from the top-level.
|
|
93
|
+
* @since 1.20.0
|
|
94
|
+
*/
|
|
93
95
|
optional: boolean | null;
|
|
94
96
|
/** The target of the depended on task. */
|
|
95
97
|
target: string;
|
|
@@ -97,6 +99,95 @@ export interface TaskDependencyConfig {
|
|
|
97
99
|
|
|
98
100
|
export type TaskDependency = string | TaskDependencyConfig;
|
|
99
101
|
|
|
102
|
+
/**
|
|
103
|
+
* A condition that utilizes a combination of logical operators
|
|
104
|
+
* to match against. When matching, all clauses must be satisfied.
|
|
105
|
+
*/
|
|
106
|
+
export interface InheritedClauseConfig {
|
|
107
|
+
/** Require all values to match, using an AND operator. */
|
|
108
|
+
and: Id | Id[] | null;
|
|
109
|
+
/** Require no values to match, using a NOT operator. */
|
|
110
|
+
not: Id | Id[] | null;
|
|
111
|
+
/** Require any values to match, using an OR operator. */
|
|
112
|
+
or: Id | Id[] | null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type InheritedConditionConfig = Id | Id[] | InheritedClauseConfig;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Configures conditions that must match against a project for tasks
|
|
119
|
+
* to be inherited. If multiple conditions are defined, then all must match
|
|
120
|
+
* for inheritance to occur. If no conditions are defined, then tasks will
|
|
121
|
+
* be inherited by all projects.
|
|
122
|
+
*/
|
|
123
|
+
export interface InheritedByConfig {
|
|
124
|
+
/**
|
|
125
|
+
* Condition that matches against literal files within a project.
|
|
126
|
+
* If multiple values are provided, at least 1 file needs to exist.
|
|
127
|
+
*/
|
|
128
|
+
file?: string | string[] | null;
|
|
129
|
+
/**
|
|
130
|
+
* Condition that matches against literal files within a project.
|
|
131
|
+
* If multiple values are provided, at least 1 file needs to exist.
|
|
132
|
+
*/
|
|
133
|
+
files: string | string[] | null;
|
|
134
|
+
/**
|
|
135
|
+
* Condition that matches against a project's `language`.
|
|
136
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
137
|
+
*
|
|
138
|
+
* @default 'unknown'
|
|
139
|
+
*/
|
|
140
|
+
language?: LanguageType | LanguageType[] | null;
|
|
141
|
+
/**
|
|
142
|
+
* Condition that matches against a project's `language`.
|
|
143
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
144
|
+
*
|
|
145
|
+
* @default 'unknown'
|
|
146
|
+
*/
|
|
147
|
+
languages: LanguageType | LanguageType[] | null;
|
|
148
|
+
/**
|
|
149
|
+
* Condition that matches against a project's `layer`.
|
|
150
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
151
|
+
*
|
|
152
|
+
* @default 'unknown'
|
|
153
|
+
*/
|
|
154
|
+
layer?: LayerType | LayerType[] | null;
|
|
155
|
+
/**
|
|
156
|
+
* Condition that matches against a project's `layer`.
|
|
157
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
158
|
+
*
|
|
159
|
+
* @default 'unknown'
|
|
160
|
+
*/
|
|
161
|
+
layers: LayerType | LayerType[] | null;
|
|
162
|
+
/**
|
|
163
|
+
* The order in which this configuration is inherited by a project.
|
|
164
|
+
* Lower is inherited first, while higher is last.
|
|
165
|
+
*/
|
|
166
|
+
order: number | null;
|
|
167
|
+
/**
|
|
168
|
+
* Condition that matches against a project's `stack`.
|
|
169
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
170
|
+
*
|
|
171
|
+
* @default 'unknown'
|
|
172
|
+
*/
|
|
173
|
+
stack?: StackType | StackType[] | null;
|
|
174
|
+
/**
|
|
175
|
+
* Condition that matches against a project's `stack`.
|
|
176
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
177
|
+
*
|
|
178
|
+
* @default 'unknown'
|
|
179
|
+
*/
|
|
180
|
+
stacks: StackType | StackType[] | null;
|
|
181
|
+
/** Condition that matches against a tag within the project. */
|
|
182
|
+
tag?: InheritedConditionConfig | null;
|
|
183
|
+
/** Condition that matches against a tag within the project. */
|
|
184
|
+
tags: InheritedConditionConfig | null;
|
|
185
|
+
/** Condition that matches against a toolchain detected for a project. */
|
|
186
|
+
toolchain?: InheritedConditionConfig | null;
|
|
187
|
+
/** Condition that matches against a toolchain detected for a project. */
|
|
188
|
+
toolchains: InheritedConditionConfig | null;
|
|
189
|
+
}
|
|
190
|
+
|
|
100
191
|
export type TaskOptionEnvFile = boolean | string | string[];
|
|
101
192
|
|
|
102
193
|
/** The strategy in which to merge a specific task option. */
|
|
@@ -108,7 +199,10 @@ export type TaskOperatingSystem = 'linux' | 'macos' | 'windows';
|
|
|
108
199
|
/** The style in which task output will be printed to the console. */
|
|
109
200
|
export type TaskOutputStyle = 'buffer' | 'buffer-only-failure' | 'hash' | 'none' | 'stream';
|
|
110
201
|
|
|
111
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* The priority levels a task can be bucketed into when running
|
|
204
|
+
* in the action pipeline.
|
|
205
|
+
*/
|
|
112
206
|
export type TaskPriority = 'critical' | 'high' | 'normal' | 'low';
|
|
113
207
|
|
|
114
208
|
/** A list of available shells on Unix. */
|
|
@@ -126,20 +220,23 @@ export type TaskUnixShell =
|
|
|
126
220
|
/** A list of available shells on Windows. */
|
|
127
221
|
export type TaskWindowsShell = 'bash' | 'elvish' | 'fish' | 'murex' | 'nu' | 'pwsh' | 'xonsh';
|
|
128
222
|
|
|
129
|
-
/** Options to control task inheritance and
|
|
223
|
+
/** Options to control task inheritance, execution, and more. */
|
|
130
224
|
export interface TaskOptionsConfig {
|
|
131
225
|
/** The pattern in which affected files will be passed to the task. */
|
|
132
226
|
affectedFiles: boolean | 'args' | 'env' | null;
|
|
133
227
|
/**
|
|
134
|
-
* When affected and no files are matching, pass the task inputs
|
|
228
|
+
* When affected and no files are matching, pass the task's inputs
|
|
135
229
|
* as arguments to the command, instead of `.`.
|
|
136
230
|
*/
|
|
137
231
|
affectedPassInputs: boolean | null;
|
|
138
|
-
/**
|
|
232
|
+
/**
|
|
233
|
+
* Allow the task to fail without failing the entire action pipeline.
|
|
234
|
+
* @since 1.13.0
|
|
235
|
+
*/
|
|
139
236
|
allowFailure: boolean | null;
|
|
140
237
|
/**
|
|
141
|
-
*
|
|
142
|
-
* are configured for the task.
|
|
238
|
+
* Cache the `outputs` of the task for incremental builds.
|
|
239
|
+
* Defaults to `true` if outputs are configured for the task.
|
|
143
240
|
*/
|
|
144
241
|
cache: boolean | 'local' | 'remote' | null;
|
|
145
242
|
/**
|
|
@@ -150,26 +247,30 @@ export interface TaskOptionsConfig {
|
|
|
150
247
|
/**
|
|
151
248
|
* Lifetime to cache the task itself, in the format of "1h", "30m", etc.
|
|
152
249
|
* If not defined, caches live forever, or until inputs change.
|
|
250
|
+
* @since 1.29.0
|
|
153
251
|
*/
|
|
154
252
|
cacheLifetime: string | null;
|
|
155
253
|
/**
|
|
156
|
-
* Loads and sets environment variables from the `.env` file when
|
|
254
|
+
* Loads and sets environment variables from the `.env` file(s) when
|
|
157
255
|
* running the task.
|
|
158
256
|
*/
|
|
159
257
|
envFile: TaskOptionEnvFile | null;
|
|
160
258
|
/**
|
|
161
259
|
* Automatically infer inputs from file groups or environment variables
|
|
162
260
|
* that were utilized within `command`, `script`, `args`, and `env`.
|
|
261
|
+
* @since 1.31.0
|
|
163
262
|
*/
|
|
164
263
|
inferInputs: boolean | null;
|
|
165
264
|
/**
|
|
166
265
|
* Marks the task as interactive, so that it will run in isolation,
|
|
167
266
|
* and have direct access to stdin.
|
|
267
|
+
* @since 1.12.0
|
|
168
268
|
*/
|
|
169
269
|
interactive: boolean | null;
|
|
170
270
|
/**
|
|
171
|
-
* Marks the task as internal, which disables it from
|
|
172
|
-
* from the command line, but can be depended on.
|
|
271
|
+
* Marks the task as internal, which disables it from being ran
|
|
272
|
+
* from the command line, but can still be depended on by other tasks.
|
|
273
|
+
* @since 1.23.0
|
|
173
274
|
*/
|
|
174
275
|
internal: boolean | null;
|
|
175
276
|
/**
|
|
@@ -210,9 +311,17 @@ export interface TaskOptionsConfig {
|
|
|
210
311
|
* @default 'append'
|
|
211
312
|
*/
|
|
212
313
|
mergeOutputs: TaskMergeStrategy | null;
|
|
314
|
+
/**
|
|
315
|
+
* The strategy to use when merging `toolchains` with an inherited task.
|
|
316
|
+
* @since 2.0.0
|
|
317
|
+
*
|
|
318
|
+
* @default 'append'
|
|
319
|
+
*/
|
|
320
|
+
mergeToolchains: TaskMergeStrategy | null;
|
|
213
321
|
/**
|
|
214
322
|
* Creates an exclusive lock on a virtual resource, preventing other
|
|
215
323
|
* tasks using the same resource from running concurrently.
|
|
324
|
+
* @since 1.24.0
|
|
216
325
|
*/
|
|
217
326
|
mutex: string | null;
|
|
218
327
|
/** The operating system in which to only run this task on. */
|
|
@@ -221,17 +330,18 @@ export interface TaskOptionsConfig {
|
|
|
221
330
|
* The style in which task output will be printed to the console.
|
|
222
331
|
*
|
|
223
332
|
* @default 'buffer'
|
|
224
|
-
* @
|
|
333
|
+
* @env MOON_OUTPUT_STYLE
|
|
225
334
|
*/
|
|
226
335
|
outputStyle: TaskOutputStyle | null;
|
|
227
336
|
/**
|
|
228
337
|
* Marks the task as persistent (continuously running). This is ideal
|
|
229
338
|
* for watchers, servers, or never-ending processes.
|
|
339
|
+
* @since 1.6.0
|
|
230
340
|
*/
|
|
231
341
|
persistent: boolean | null;
|
|
232
342
|
/**
|
|
233
343
|
* Marks the task with a certain priority, which determines the order
|
|
234
|
-
* in which it is ran within the pipeline.
|
|
344
|
+
* in which it is ran within the action pipeline.
|
|
235
345
|
*
|
|
236
346
|
* @default 'normal'
|
|
237
347
|
*/
|
|
@@ -239,7 +349,7 @@ export interface TaskOptionsConfig {
|
|
|
239
349
|
/**
|
|
240
350
|
* The number of times a failing task will be retried to succeed.
|
|
241
351
|
*
|
|
242
|
-
* @
|
|
352
|
+
* @env MOON_RETRY_COUNT
|
|
243
353
|
*/
|
|
244
354
|
retryCount: number | null;
|
|
245
355
|
/**
|
|
@@ -249,29 +359,36 @@ export interface TaskOptionsConfig {
|
|
|
249
359
|
runDepsInParallel: boolean | null;
|
|
250
360
|
/** Runs the task from the workspace root, instead of the project root. */
|
|
251
361
|
runFromWorkspaceRoot: boolean | null;
|
|
252
|
-
/**
|
|
362
|
+
/**
|
|
363
|
+
* Whether to run the task in CI or not, when executing `moon ci`,
|
|
364
|
+
* `moon check`, or `moon run`.
|
|
365
|
+
*/
|
|
253
366
|
runInCI: boolean | 'always' | 'affected' | 'only' | 'skip' | null;
|
|
254
367
|
/**
|
|
255
368
|
* Runs the task within a shell. When not defined, runs the task
|
|
256
|
-
* directly while relying on `PATH` resolution.
|
|
369
|
+
* directly while relying on native `PATH` resolution.
|
|
257
370
|
*/
|
|
258
371
|
shell: boolean | null;
|
|
259
372
|
/** The maximum time in seconds that a task can run before being cancelled. */
|
|
260
373
|
timeout: number | null;
|
|
261
374
|
/**
|
|
262
375
|
* The shell to run the task in when on a Unix-based machine.
|
|
376
|
+
* @since 1.21.0
|
|
263
377
|
*
|
|
264
378
|
* @default 'bash'
|
|
265
379
|
*/
|
|
266
380
|
unixShell: TaskUnixShell | null;
|
|
267
381
|
/**
|
|
268
382
|
* The shell to run the task in when on a Windows machine.
|
|
383
|
+
* @since 1.21.0
|
|
269
384
|
*
|
|
270
385
|
* @default 'pwsh'
|
|
271
386
|
*/
|
|
272
387
|
windowsShell: TaskWindowsShell | null;
|
|
273
388
|
}
|
|
274
389
|
|
|
390
|
+
export type TaskArgs = null | string | string[];
|
|
391
|
+
|
|
275
392
|
/** A file path output. */
|
|
276
393
|
export interface FileOutput {
|
|
277
394
|
/** The literal file path. */
|
|
@@ -296,11 +413,8 @@ export interface GlobOutput {
|
|
|
296
413
|
|
|
297
414
|
export type Output = string | FileOutput | GlobOutput;
|
|
298
415
|
|
|
299
|
-
/** Platforms that each programming language can belong to. */
|
|
300
|
-
export type PlatformType = 'bun' | 'deno' | 'node' | 'python' | 'rust' | 'system' | 'unknown';
|
|
301
|
-
|
|
302
416
|
/** Preset options to inherit. */
|
|
303
|
-
export type TaskPreset = '
|
|
417
|
+
export type TaskPreset = 'utility' | 'server';
|
|
304
418
|
|
|
305
419
|
/** The type of task. */
|
|
306
420
|
export type TaskType = 'build' | 'run' | 'test';
|
|
@@ -313,79 +427,75 @@ export interface TaskConfig {
|
|
|
313
427
|
*/
|
|
314
428
|
args: TaskArgs;
|
|
315
429
|
/**
|
|
316
|
-
* The command
|
|
317
|
-
* Supports the command
|
|
318
|
-
* defined as a string, or a list of individual arguments.
|
|
430
|
+
* The command line to execute when the task is ran.
|
|
431
|
+
* Supports the command (executable) with or without arguments.
|
|
432
|
+
* Can be defined as a string, or a list of individual arguments.
|
|
319
433
|
*/
|
|
320
434
|
command: TaskArgs;
|
|
435
|
+
/**
|
|
436
|
+
* Other tasks that this task depends on, and must run to completion
|
|
437
|
+
* before this task is ran. Can depend on sibling tasks, or tasks in
|
|
438
|
+
* other projects, using targets.
|
|
439
|
+
*/
|
|
440
|
+
dependsOn?: TaskDependency[] | null;
|
|
321
441
|
/**
|
|
322
442
|
* Other tasks that this task depends on, and must run to completion
|
|
323
443
|
* before this task is ran. Can depend on sibling tasks, or tasks in
|
|
324
444
|
* other projects, using targets.
|
|
325
445
|
*/
|
|
326
446
|
deps: TaskDependency[] | null;
|
|
327
|
-
/** A human-readable description about the task. */
|
|
328
|
-
description: string | null;
|
|
329
447
|
/**
|
|
330
|
-
* A
|
|
331
|
-
*
|
|
448
|
+
* A human-readable description about the task.
|
|
449
|
+
* @since 1.22.0
|
|
332
450
|
*/
|
|
333
|
-
|
|
334
|
-
/** Extends settings from a sibling task by ID. */
|
|
335
|
-
extends: Id | null;
|
|
451
|
+
description: string | null;
|
|
336
452
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* are considered an input. When an empty list, no files are considered.
|
|
340
|
-
* Otherwise, an explicit list of inputs are considered.
|
|
453
|
+
* A map of environment variables that will be set in the child
|
|
454
|
+
* process when the task is ran.
|
|
341
455
|
*/
|
|
342
|
-
|
|
456
|
+
env: Record<string, string | null> | null;
|
|
457
|
+
/** Extends settings from a sibling task by identifier. */
|
|
458
|
+
extends: Id | null;
|
|
343
459
|
/**
|
|
344
|
-
*
|
|
345
|
-
*
|
|
460
|
+
* A list of inputs that will be hashing and compared against changed files
|
|
461
|
+
* to determine affected status. If affected, the task will run, otherwise
|
|
462
|
+
* it will exit early. An input can be a literal file path, a glob pattern,
|
|
463
|
+
* environment variable, and more.
|
|
346
464
|
*
|
|
347
|
-
*
|
|
465
|
+
* When not provided, all files within the project are considered inputs.
|
|
466
|
+
* When an empty list, no files are considered. Otherwise, an
|
|
467
|
+
* explicit list of inputs are considered.
|
|
348
468
|
*/
|
|
349
|
-
|
|
350
|
-
/** Options to control task inheritance and
|
|
469
|
+
inputs: Input[] | null;
|
|
470
|
+
/** Options to control task inheritance, execution, and more. */
|
|
351
471
|
options: TaskOptionsConfig;
|
|
352
472
|
/**
|
|
353
|
-
*
|
|
354
|
-
*
|
|
473
|
+
* A list of outputs that will be created when the task has successfully ran.
|
|
474
|
+
* An output can be a literal file path, or a glob pattern.
|
|
355
475
|
*/
|
|
356
476
|
outputs: Output[] | null;
|
|
357
|
-
/**
|
|
358
|
-
* The platform in which the task will be ran in. The platform determines
|
|
359
|
-
* available binaries, lookup paths, and more. When not provided, will
|
|
360
|
-
* be automatically detected.
|
|
361
|
-
*
|
|
362
|
-
* @default 'unknown'
|
|
363
|
-
* @type {'bun' | 'deno' | 'node' | 'python' | 'rust' | 'system' | 'unknown'}
|
|
364
|
-
*/
|
|
365
|
-
platform: PlatformType;
|
|
366
477
|
/** The preset to apply for the task. Will inherit default options. */
|
|
367
478
|
preset: TaskPreset | null;
|
|
368
479
|
/**
|
|
369
480
|
* A script to run within a shell. A script is anything from a single command,
|
|
370
|
-
* to multiple commands
|
|
371
|
-
* arguments, merging, or inheritance.
|
|
481
|
+
* to multiple commands, or shell specific syntax. Does not support
|
|
482
|
+
* arguments, merging, or inheritance. This overrides `command` and `args`.
|
|
483
|
+
* @since 1.27.0
|
|
372
484
|
*/
|
|
373
485
|
script: string | null;
|
|
374
486
|
/**
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
* This list will be merged with detected toolchains.
|
|
487
|
+
* A toolchain, or list of toolchains, in which the task will inherit
|
|
488
|
+
* functionality from.
|
|
378
489
|
*/
|
|
379
|
-
|
|
490
|
+
toolchain?: Id | Id[] | null;
|
|
380
491
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* This list will be merged with detected toolchains.
|
|
492
|
+
* A toolchain, or list of toolchains, in which the task will inherit
|
|
493
|
+
* functionality from.
|
|
384
494
|
*/
|
|
385
|
-
|
|
495
|
+
toolchains: Id | Id[] | null;
|
|
386
496
|
/**
|
|
387
497
|
* The type of task, primarily used for categorical reasons. When not provided,
|
|
388
|
-
* will be automatically determined.
|
|
498
|
+
* will be automatically determined based on configured outputs.
|
|
389
499
|
*
|
|
390
500
|
* @default 'test'
|
|
391
501
|
*/
|
|
@@ -398,43 +508,57 @@ export interface TaskConfig {
|
|
|
398
508
|
* Docs: https://moonrepo.dev/docs/config/tasks
|
|
399
509
|
*/
|
|
400
510
|
export interface InheritedTasksConfig {
|
|
401
|
-
/** @default '
|
|
511
|
+
/** @default '../cache/schemas/tasks.json' */
|
|
402
512
|
$schema?: string;
|
|
403
513
|
/**
|
|
404
|
-
* Extends one or many
|
|
405
|
-
* file path or a secure URL.
|
|
514
|
+
* Extends one or many tasks configuration files.
|
|
515
|
+
* Supports a relative file path or a secure URL.
|
|
516
|
+
* @since 1.12.0
|
|
406
517
|
*/
|
|
407
518
|
extends: ExtendsFrom | null;
|
|
408
519
|
/**
|
|
409
|
-
* A
|
|
520
|
+
* A map of group identifiers to a list of file paths, globs, and
|
|
410
521
|
* environment variables, that can be referenced from tasks.
|
|
411
522
|
*/
|
|
412
523
|
fileGroups: Record<Id, Input[]>;
|
|
413
524
|
/**
|
|
414
|
-
* Task dependencies that
|
|
525
|
+
* Task dependencies (`deps`) that will be automatically injected into every
|
|
415
526
|
* task that inherits this configuration.
|
|
416
527
|
*/
|
|
417
528
|
implicitDeps: TaskDependency[];
|
|
418
529
|
/**
|
|
419
|
-
* Task inputs that
|
|
530
|
+
* Task inputs (`inputs`) that will be automatically injected into every
|
|
420
531
|
* task that inherits this configuration.
|
|
421
532
|
*/
|
|
422
533
|
implicitInputs: Input[];
|
|
423
|
-
/**
|
|
534
|
+
/**
|
|
535
|
+
* A map of conditions that define which projects will inherit these
|
|
536
|
+
* tasks and configuration. If not defined, will be inherited by all projects.
|
|
537
|
+
* @since 2.0.0
|
|
538
|
+
*/
|
|
539
|
+
inheritedBy: InheritedByConfig | null;
|
|
540
|
+
/**
|
|
541
|
+
* Default task options for all inherited tasks.
|
|
542
|
+
* @since 1.20.0
|
|
543
|
+
*/
|
|
424
544
|
taskOptions: TaskOptionsConfig | null;
|
|
425
|
-
/**
|
|
545
|
+
/**
|
|
546
|
+
* A map of identifiers to task objects. Tasks represent the work-unit
|
|
547
|
+
* of a project, and can be ran in the action pipeline.
|
|
548
|
+
*/
|
|
426
549
|
tasks: Record<Id, TaskConfig>;
|
|
427
550
|
}
|
|
428
551
|
|
|
429
|
-
export type PartialTaskArgs = null | string | string[];
|
|
430
|
-
|
|
431
552
|
/** Expanded information about a task dependency. */
|
|
432
553
|
export interface PartialTaskDependencyConfig {
|
|
433
554
|
/** Additional arguments to pass to this dependency when it's ran. */
|
|
434
|
-
args?:
|
|
435
|
-
/** A
|
|
436
|
-
env?: Record<string, string> | null;
|
|
437
|
-
/**
|
|
555
|
+
args?: string[] | null;
|
|
556
|
+
/** A map of environment variables specific to this dependency. */
|
|
557
|
+
env?: Record<string, string | null> | null;
|
|
558
|
+
/**
|
|
559
|
+
* Marks the dependency as optional when being inherited from the top-level.
|
|
560
|
+
* @since 1.20.0
|
|
561
|
+
*/
|
|
438
562
|
optional?: boolean | null;
|
|
439
563
|
/** The target of the depended on task. */
|
|
440
564
|
target?: string | null;
|
|
@@ -442,20 +566,112 @@ export interface PartialTaskDependencyConfig {
|
|
|
442
566
|
|
|
443
567
|
export type PartialTaskDependency = string | PartialTaskDependencyConfig;
|
|
444
568
|
|
|
445
|
-
/**
|
|
569
|
+
/**
|
|
570
|
+
* A condition that utilizes a combination of logical operators
|
|
571
|
+
* to match against. When matching, all clauses must be satisfied.
|
|
572
|
+
*/
|
|
573
|
+
export interface PartialInheritedClauseConfig {
|
|
574
|
+
/** Require all values to match, using an AND operator. */
|
|
575
|
+
and?: Id | Id[] | null;
|
|
576
|
+
/** Require no values to match, using a NOT operator. */
|
|
577
|
+
not?: Id | Id[] | null;
|
|
578
|
+
/** Require any values to match, using an OR operator. */
|
|
579
|
+
or?: Id | Id[] | null;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export type PartialInheritedConditionConfig = Id | Id[] | PartialInheritedClauseConfig;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Configures conditions that must match against a project for tasks
|
|
586
|
+
* to be inherited. If multiple conditions are defined, then all must match
|
|
587
|
+
* for inheritance to occur. If no conditions are defined, then tasks will
|
|
588
|
+
* be inherited by all projects.
|
|
589
|
+
*/
|
|
590
|
+
export interface PartialInheritedByConfig {
|
|
591
|
+
/**
|
|
592
|
+
* Condition that matches against literal files within a project.
|
|
593
|
+
* If multiple values are provided, at least 1 file needs to exist.
|
|
594
|
+
*/
|
|
595
|
+
file?: string | string[] | null;
|
|
596
|
+
/**
|
|
597
|
+
* Condition that matches against literal files within a project.
|
|
598
|
+
* If multiple values are provided, at least 1 file needs to exist.
|
|
599
|
+
*/
|
|
600
|
+
files?: string | string[] | null;
|
|
601
|
+
/**
|
|
602
|
+
* Condition that matches against a project's `language`.
|
|
603
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
604
|
+
*
|
|
605
|
+
* @default 'unknown'
|
|
606
|
+
*/
|
|
607
|
+
language?: LanguageType | LanguageType[] | null;
|
|
608
|
+
/**
|
|
609
|
+
* Condition that matches against a project's `language`.
|
|
610
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
611
|
+
*
|
|
612
|
+
* @default 'unknown'
|
|
613
|
+
*/
|
|
614
|
+
languages?: LanguageType | LanguageType[] | null;
|
|
615
|
+
/**
|
|
616
|
+
* Condition that matches against a project's `layer`.
|
|
617
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
618
|
+
*
|
|
619
|
+
* @default 'unknown'
|
|
620
|
+
*/
|
|
621
|
+
layer?: LayerType | LayerType[] | null;
|
|
622
|
+
/**
|
|
623
|
+
* Condition that matches against a project's `layer`.
|
|
624
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
625
|
+
*
|
|
626
|
+
* @default 'unknown'
|
|
627
|
+
*/
|
|
628
|
+
layers?: LayerType | LayerType[] | null;
|
|
629
|
+
/**
|
|
630
|
+
* The order in which this configuration is inherited by a project.
|
|
631
|
+
* Lower is inherited first, while higher is last.
|
|
632
|
+
*/
|
|
633
|
+
order?: number | null;
|
|
634
|
+
/**
|
|
635
|
+
* Condition that matches against a project's `stack`.
|
|
636
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
637
|
+
*
|
|
638
|
+
* @default 'unknown'
|
|
639
|
+
*/
|
|
640
|
+
stack?: StackType | StackType[] | null;
|
|
641
|
+
/**
|
|
642
|
+
* Condition that matches against a project's `stack`.
|
|
643
|
+
* If multiple values are provided, it matches using an OR operator.
|
|
644
|
+
*
|
|
645
|
+
* @default 'unknown'
|
|
646
|
+
*/
|
|
647
|
+
stacks?: StackType | StackType[] | null;
|
|
648
|
+
/** Condition that matches against a tag within the project. */
|
|
649
|
+
tag?: PartialInheritedConditionConfig | null;
|
|
650
|
+
/** Condition that matches against a tag within the project. */
|
|
651
|
+
tags?: PartialInheritedConditionConfig | null;
|
|
652
|
+
/** Condition that matches against a toolchain detected for a project. */
|
|
653
|
+
toolchain?: PartialInheritedConditionConfig | null;
|
|
654
|
+
/** Condition that matches against a toolchain detected for a project. */
|
|
655
|
+
toolchains?: PartialInheritedConditionConfig | null;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/** Options to control task inheritance, execution, and more. */
|
|
446
659
|
export interface PartialTaskOptionsConfig {
|
|
447
660
|
/** The pattern in which affected files will be passed to the task. */
|
|
448
661
|
affectedFiles?: boolean | 'args' | 'env' | null;
|
|
449
662
|
/**
|
|
450
|
-
* When affected and no files are matching, pass the task inputs
|
|
663
|
+
* When affected and no files are matching, pass the task's inputs
|
|
451
664
|
* as arguments to the command, instead of `.`.
|
|
452
665
|
*/
|
|
453
666
|
affectedPassInputs?: boolean | null;
|
|
454
|
-
/**
|
|
667
|
+
/**
|
|
668
|
+
* Allow the task to fail without failing the entire action pipeline.
|
|
669
|
+
* @since 1.13.0
|
|
670
|
+
*/
|
|
455
671
|
allowFailure?: boolean | null;
|
|
456
672
|
/**
|
|
457
|
-
*
|
|
458
|
-
* are configured for the task.
|
|
673
|
+
* Cache the `outputs` of the task for incremental builds.
|
|
674
|
+
* Defaults to `true` if outputs are configured for the task.
|
|
459
675
|
*/
|
|
460
676
|
cache?: boolean | 'local' | 'remote' | null;
|
|
461
677
|
/**
|
|
@@ -466,26 +682,30 @@ export interface PartialTaskOptionsConfig {
|
|
|
466
682
|
/**
|
|
467
683
|
* Lifetime to cache the task itself, in the format of "1h", "30m", etc.
|
|
468
684
|
* If not defined, caches live forever, or until inputs change.
|
|
685
|
+
* @since 1.29.0
|
|
469
686
|
*/
|
|
470
687
|
cacheLifetime?: string | null;
|
|
471
688
|
/**
|
|
472
|
-
* Loads and sets environment variables from the `.env` file when
|
|
689
|
+
* Loads and sets environment variables from the `.env` file(s) when
|
|
473
690
|
* running the task.
|
|
474
691
|
*/
|
|
475
692
|
envFile?: TaskOptionEnvFile | null;
|
|
476
693
|
/**
|
|
477
694
|
* Automatically infer inputs from file groups or environment variables
|
|
478
695
|
* that were utilized within `command`, `script`, `args`, and `env`.
|
|
696
|
+
* @since 1.31.0
|
|
479
697
|
*/
|
|
480
698
|
inferInputs?: boolean | null;
|
|
481
699
|
/**
|
|
482
700
|
* Marks the task as interactive, so that it will run in isolation,
|
|
483
701
|
* and have direct access to stdin.
|
|
702
|
+
* @since 1.12.0
|
|
484
703
|
*/
|
|
485
704
|
interactive?: boolean | null;
|
|
486
705
|
/**
|
|
487
|
-
* Marks the task as internal, which disables it from
|
|
488
|
-
* from the command line, but can be depended on.
|
|
706
|
+
* Marks the task as internal, which disables it from being ran
|
|
707
|
+
* from the command line, but can still be depended on by other tasks.
|
|
708
|
+
* @since 1.23.0
|
|
489
709
|
*/
|
|
490
710
|
internal?: boolean | null;
|
|
491
711
|
/**
|
|
@@ -526,9 +746,17 @@ export interface PartialTaskOptionsConfig {
|
|
|
526
746
|
* @default 'append'
|
|
527
747
|
*/
|
|
528
748
|
mergeOutputs?: TaskMergeStrategy | null;
|
|
749
|
+
/**
|
|
750
|
+
* The strategy to use when merging `toolchains` with an inherited task.
|
|
751
|
+
* @since 2.0.0
|
|
752
|
+
*
|
|
753
|
+
* @default 'append'
|
|
754
|
+
*/
|
|
755
|
+
mergeToolchains?: TaskMergeStrategy | null;
|
|
529
756
|
/**
|
|
530
757
|
* Creates an exclusive lock on a virtual resource, preventing other
|
|
531
758
|
* tasks using the same resource from running concurrently.
|
|
759
|
+
* @since 1.24.0
|
|
532
760
|
*/
|
|
533
761
|
mutex?: string | null;
|
|
534
762
|
/** The operating system in which to only run this task on. */
|
|
@@ -537,17 +765,18 @@ export interface PartialTaskOptionsConfig {
|
|
|
537
765
|
* The style in which task output will be printed to the console.
|
|
538
766
|
*
|
|
539
767
|
* @default 'buffer'
|
|
540
|
-
* @
|
|
768
|
+
* @env MOON_OUTPUT_STYLE
|
|
541
769
|
*/
|
|
542
770
|
outputStyle?: TaskOutputStyle | null;
|
|
543
771
|
/**
|
|
544
772
|
* Marks the task as persistent (continuously running). This is ideal
|
|
545
773
|
* for watchers, servers, or never-ending processes.
|
|
774
|
+
* @since 1.6.0
|
|
546
775
|
*/
|
|
547
776
|
persistent?: boolean | null;
|
|
548
777
|
/**
|
|
549
778
|
* Marks the task with a certain priority, which determines the order
|
|
550
|
-
* in which it is ran within the pipeline.
|
|
779
|
+
* in which it is ran within the action pipeline.
|
|
551
780
|
*
|
|
552
781
|
* @default 'normal'
|
|
553
782
|
*/
|
|
@@ -555,7 +784,7 @@ export interface PartialTaskOptionsConfig {
|
|
|
555
784
|
/**
|
|
556
785
|
* The number of times a failing task will be retried to succeed.
|
|
557
786
|
*
|
|
558
|
-
* @
|
|
787
|
+
* @env MOON_RETRY_COUNT
|
|
559
788
|
*/
|
|
560
789
|
retryCount?: number | null;
|
|
561
790
|
/**
|
|
@@ -565,29 +794,36 @@ export interface PartialTaskOptionsConfig {
|
|
|
565
794
|
runDepsInParallel?: boolean | null;
|
|
566
795
|
/** Runs the task from the workspace root, instead of the project root. */
|
|
567
796
|
runFromWorkspaceRoot?: boolean | null;
|
|
568
|
-
/**
|
|
797
|
+
/**
|
|
798
|
+
* Whether to run the task in CI or not, when executing `moon ci`,
|
|
799
|
+
* `moon check`, or `moon run`.
|
|
800
|
+
*/
|
|
569
801
|
runInCI?: boolean | 'always' | 'affected' | 'only' | 'skip' | null;
|
|
570
802
|
/**
|
|
571
803
|
* Runs the task within a shell. When not defined, runs the task
|
|
572
|
-
* directly while relying on `PATH` resolution.
|
|
804
|
+
* directly while relying on native `PATH` resolution.
|
|
573
805
|
*/
|
|
574
806
|
shell?: boolean | null;
|
|
575
807
|
/** The maximum time in seconds that a task can run before being cancelled. */
|
|
576
808
|
timeout?: number | null;
|
|
577
809
|
/**
|
|
578
810
|
* The shell to run the task in when on a Unix-based machine.
|
|
811
|
+
* @since 1.21.0
|
|
579
812
|
*
|
|
580
813
|
* @default 'bash'
|
|
581
814
|
*/
|
|
582
815
|
unixShell?: TaskUnixShell | null;
|
|
583
816
|
/**
|
|
584
817
|
* The shell to run the task in when on a Windows machine.
|
|
818
|
+
* @since 1.21.0
|
|
585
819
|
*
|
|
586
820
|
* @default 'pwsh'
|
|
587
821
|
*/
|
|
588
822
|
windowsShell?: TaskWindowsShell | null;
|
|
589
823
|
}
|
|
590
824
|
|
|
825
|
+
export type PartialTaskArgs = null | string | string[];
|
|
826
|
+
|
|
591
827
|
/** Configures a task to be ran within the action pipeline. */
|
|
592
828
|
export interface PartialTaskConfig {
|
|
593
829
|
/**
|
|
@@ -596,78 +832,75 @@ export interface PartialTaskConfig {
|
|
|
596
832
|
*/
|
|
597
833
|
args?: PartialTaskArgs | null;
|
|
598
834
|
/**
|
|
599
|
-
* The command
|
|
600
|
-
* Supports the command
|
|
601
|
-
* defined as a string, or a list of individual arguments.
|
|
835
|
+
* The command line to execute when the task is ran.
|
|
836
|
+
* Supports the command (executable) with or without arguments.
|
|
837
|
+
* Can be defined as a string, or a list of individual arguments.
|
|
602
838
|
*/
|
|
603
839
|
command?: PartialTaskArgs | null;
|
|
840
|
+
/**
|
|
841
|
+
* Other tasks that this task depends on, and must run to completion
|
|
842
|
+
* before this task is ran. Can depend on sibling tasks, or tasks in
|
|
843
|
+
* other projects, using targets.
|
|
844
|
+
*/
|
|
845
|
+
dependsOn?: PartialTaskDependency[] | null;
|
|
604
846
|
/**
|
|
605
847
|
* Other tasks that this task depends on, and must run to completion
|
|
606
848
|
* before this task is ran. Can depend on sibling tasks, or tasks in
|
|
607
849
|
* other projects, using targets.
|
|
608
850
|
*/
|
|
609
851
|
deps?: PartialTaskDependency[] | null;
|
|
610
|
-
/** A human-readable description about the task. */
|
|
611
|
-
description?: string | null;
|
|
612
852
|
/**
|
|
613
|
-
* A
|
|
614
|
-
*
|
|
853
|
+
* A human-readable description about the task.
|
|
854
|
+
* @since 1.22.0
|
|
615
855
|
*/
|
|
616
|
-
|
|
617
|
-
/** Extends settings from a sibling task by ID. */
|
|
618
|
-
extends?: Id | null;
|
|
856
|
+
description?: string | null;
|
|
619
857
|
/**
|
|
620
|
-
*
|
|
621
|
-
*
|
|
622
|
-
* are considered an input. When an empty list, no files are considered.
|
|
623
|
-
* Otherwise, an explicit list of inputs are considered.
|
|
858
|
+
* A map of environment variables that will be set in the child
|
|
859
|
+
* process when the task is ran.
|
|
624
860
|
*/
|
|
625
|
-
|
|
861
|
+
env?: Record<string, string | null> | null;
|
|
862
|
+
/** Extends settings from a sibling task by identifier. */
|
|
863
|
+
extends?: Id | null;
|
|
626
864
|
/**
|
|
627
|
-
*
|
|
628
|
-
*
|
|
865
|
+
* A list of inputs that will be hashing and compared against changed files
|
|
866
|
+
* to determine affected status. If affected, the task will run, otherwise
|
|
867
|
+
* it will exit early. An input can be a literal file path, a glob pattern,
|
|
868
|
+
* environment variable, and more.
|
|
629
869
|
*
|
|
630
|
-
*
|
|
870
|
+
* When not provided, all files within the project are considered inputs.
|
|
871
|
+
* When an empty list, no files are considered. Otherwise, an
|
|
872
|
+
* explicit list of inputs are considered.
|
|
631
873
|
*/
|
|
632
|
-
|
|
633
|
-
/** Options to control task inheritance and
|
|
874
|
+
inputs?: Input[] | null;
|
|
875
|
+
/** Options to control task inheritance, execution, and more. */
|
|
634
876
|
options?: PartialTaskOptionsConfig | null;
|
|
635
877
|
/**
|
|
636
|
-
*
|
|
637
|
-
*
|
|
878
|
+
* A list of outputs that will be created when the task has successfully ran.
|
|
879
|
+
* An output can be a literal file path, or a glob pattern.
|
|
638
880
|
*/
|
|
639
881
|
outputs?: Output[] | null;
|
|
640
|
-
/**
|
|
641
|
-
* The platform in which the task will be ran in. The platform determines
|
|
642
|
-
* available binaries, lookup paths, and more. When not provided, will
|
|
643
|
-
* be automatically detected.
|
|
644
|
-
*
|
|
645
|
-
* @default 'unknown'
|
|
646
|
-
*/
|
|
647
|
-
platform?: PlatformType | null;
|
|
648
882
|
/** The preset to apply for the task. Will inherit default options. */
|
|
649
883
|
preset?: TaskPreset | null;
|
|
650
884
|
/**
|
|
651
885
|
* A script to run within a shell. A script is anything from a single command,
|
|
652
|
-
* to multiple commands
|
|
653
|
-
* arguments, merging, or inheritance.
|
|
886
|
+
* to multiple commands, or shell specific syntax. Does not support
|
|
887
|
+
* arguments, merging, or inheritance. This overrides `command` and `args`.
|
|
888
|
+
* @since 1.27.0
|
|
654
889
|
*/
|
|
655
890
|
script?: string | null;
|
|
656
891
|
/**
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
* This list will be merged with detected toolchains.
|
|
892
|
+
* A toolchain, or list of toolchains, in which the task will inherit
|
|
893
|
+
* functionality from.
|
|
660
894
|
*/
|
|
661
|
-
|
|
895
|
+
toolchain?: Id | Id[] | null;
|
|
662
896
|
/**
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
* This list will be merged with detected toolchains.
|
|
897
|
+
* A toolchain, or list of toolchains, in which the task will inherit
|
|
898
|
+
* functionality from.
|
|
666
899
|
*/
|
|
667
|
-
|
|
900
|
+
toolchains?: Id | Id[] | null;
|
|
668
901
|
/**
|
|
669
902
|
* The type of task, primarily used for categorical reasons. When not provided,
|
|
670
|
-
* will be automatically determined.
|
|
903
|
+
* will be automatically determined based on configured outputs.
|
|
671
904
|
*
|
|
672
905
|
* @default 'test'
|
|
673
906
|
*/
|
|
@@ -680,30 +913,43 @@ export interface PartialTaskConfig {
|
|
|
680
913
|
* Docs: https://moonrepo.dev/docs/config/tasks
|
|
681
914
|
*/
|
|
682
915
|
export interface PartialInheritedTasksConfig {
|
|
683
|
-
/** @default '
|
|
916
|
+
/** @default '../cache/schemas/tasks.json' */
|
|
684
917
|
$schema?: string | null;
|
|
685
918
|
/**
|
|
686
|
-
* Extends one or many
|
|
687
|
-
* file path or a secure URL.
|
|
919
|
+
* Extends one or many tasks configuration files.
|
|
920
|
+
* Supports a relative file path or a secure URL.
|
|
921
|
+
* @since 1.12.0
|
|
688
922
|
*/
|
|
689
923
|
extends?: ExtendsFrom | null;
|
|
690
924
|
/**
|
|
691
|
-
* A
|
|
925
|
+
* A map of group identifiers to a list of file paths, globs, and
|
|
692
926
|
* environment variables, that can be referenced from tasks.
|
|
693
927
|
*/
|
|
694
928
|
fileGroups?: Record<Id, Input[]> | null;
|
|
695
929
|
/**
|
|
696
|
-
* Task dependencies that
|
|
930
|
+
* Task dependencies (`deps`) that will be automatically injected into every
|
|
697
931
|
* task that inherits this configuration.
|
|
698
932
|
*/
|
|
699
933
|
implicitDeps?: PartialTaskDependency[] | null;
|
|
700
934
|
/**
|
|
701
|
-
* Task inputs that
|
|
935
|
+
* Task inputs (`inputs`) that will be automatically injected into every
|
|
702
936
|
* task that inherits this configuration.
|
|
703
937
|
*/
|
|
704
938
|
implicitInputs?: Input[] | null;
|
|
705
|
-
/**
|
|
939
|
+
/**
|
|
940
|
+
* A map of conditions that define which projects will inherit these
|
|
941
|
+
* tasks and configuration. If not defined, will be inherited by all projects.
|
|
942
|
+
* @since 2.0.0
|
|
943
|
+
*/
|
|
944
|
+
inheritedBy?: PartialInheritedByConfig | null;
|
|
945
|
+
/**
|
|
946
|
+
* Default task options for all inherited tasks.
|
|
947
|
+
* @since 1.20.0
|
|
948
|
+
*/
|
|
706
949
|
taskOptions?: PartialTaskOptionsConfig | null;
|
|
707
|
-
/**
|
|
950
|
+
/**
|
|
951
|
+
* A map of identifiers to task objects. Tasks represent the work-unit
|
|
952
|
+
* of a project, and can be ran in the action pipeline.
|
|
953
|
+
*/
|
|
708
954
|
tasks?: Record<Id, PartialTaskConfig> | null;
|
|
709
955
|
}
|