Skip to content

Commit 22d18bf

Browse files
committed
WIP 0ff36
1 parent 16a912e commit 22d18bf

File tree

3 files changed

+26
-66
lines changed

3 files changed

+26
-66
lines changed

packages/turbo-types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"scripts": {
1919
"build": "tsc",
2020
"lint:prettier": "prettier -c . --cache",
21-
"generate-schema": "cargo run -p turborepo-schema-gen -- schema -o schemas/schema.json && cargo run -p turborepo-schema-gen -- typescript -o src/types/config-v2.ts",
21+
"generate-schema": "cargo run -p turborepo-schema-gen -- schema -o schemas/schema.json && cargo run -p turborepo-schema-gen -- typescript -o src/types/config-v2.ts && pnpm exec oxfmt schemas/schema.json src/types/config-v2.ts",
2222
"generate-schema:legacy": "tsx scripts/generate-schema.ts",
2323
"verify-schema": "cargo run -p turborepo-schema-gen -- verify --schema schemas/schema.json --typescript src/types/config-v2.ts",
2424
"copy-schema": "cp schemas/schema.json ../turbo/schema.json",

packages/turbo-types/schemas/schema.json

Lines changed: 19 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -105,30 +105,21 @@
105105
},
106106
"globalDependencies": {
107107
"description": "A list of globs to include in the set of implicit global hash dependencies.\n\nThe contents of these files will be included in the global hashing algorithm and affect the hashes of all tasks.\n\nThis is useful for busting the cache based on: - `.env` files (not in Git) - Any root level file that impacts package tasks that are not represented in the traditional dependency graph (e.g. a root `tsconfig.json`, `jest.config.ts`, `.eslintrc`, etc.)\n\nDocumentation: https://turborepo.com/docs/reference/configuration#globaldependencies",
108-
"type": [
109-
"array",
110-
"null"
111-
],
108+
"type": ["array", "null"],
112109
"items": {
113110
"$ref": "#/definitions/String"
114111
}
115112
},
116113
"globalEnv": {
117114
"description": "A list of environment variables for implicit global hash dependencies.\n\nThe variables included in this list will affect all task hashes.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#globalenv",
118-
"type": [
119-
"array",
120-
"null"
121-
],
115+
"type": ["array", "null"],
122116
"items": {
123117
"$ref": "#/definitions/String"
124118
}
125119
},
126120
"globalPassThroughEnv": {
127121
"description": "An allowlist of environment variables that should be made to all tasks, but should not contribute to the task's cache key, e.g. `AWS_SECRET_KEY`.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#globalpassthroughenv",
128-
"type": [
129-
"array",
130-
"null"
131-
],
122+
"type": ["array", "null"],
132123
"items": {
133124
"$ref": "#/definitions/String"
134125
}
@@ -168,10 +159,7 @@
168159
},
169160
"tasks": {
170161
"description": "An object representing the task dependency graph of your project.\n\nturbo interprets these conventions to schedule, execute, and cache the outputs of tasks in your project.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#tasks",
171-
"type": [
172-
"object",
173-
"null"
174-
],
162+
"type": ["object", "null"],
175163
"additionalProperties": {
176164
"$ref": "#/definitions/Pipeline"
177165
}
@@ -254,16 +242,12 @@
254242
{
255243
"description": "Allow all environment variables for the process to be available.",
256244
"type": "string",
257-
"enum": [
258-
"loose"
259-
]
245+
"enum": ["loose"]
260246
},
261247
{
262248
"description": "Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.",
263249
"type": "string",
264-
"enum": [
265-
"strict"
266-
]
250+
"enum": ["strict"]
267251
}
268252
]
269253
},
@@ -283,37 +267,27 @@
283267
{
284268
"description": "Displays all output.",
285269
"type": "string",
286-
"enum": [
287-
"full"
288-
]
270+
"enum": ["full"]
289271
},
290272
{
291273
"description": "Hides all task output.",
292274
"type": "string",
293-
"enum": [
294-
"none"
295-
]
275+
"enum": ["none"]
296276
},
297277
{
298278
"description": "Show only the hashes of the tasks.",
299279
"type": "string",
300-
"enum": [
301-
"hash-only"
302-
]
280+
"enum": ["hash-only"]
303281
},
304282
{
305283
"description": "Only show output from cache misses.",
306284
"type": "string",
307-
"enum": [
308-
"new-only"
309-
]
285+
"enum": ["new-only"]
310286
},
311287
{
312288
"description": "Only show output from task failures.",
313289
"type": "string",
314-
"enum": [
315-
"errors-only"
316-
]
290+
"enum": ["errors-only"]
317291
}
318292
]
319293
},
@@ -373,20 +347,14 @@
373347
},
374348
"env": {
375349
"description": "A list of environment variables that this task depends on.\n\nNote: If you are migrating from a turbo version 1.5 or below, you may be used to prefixing your variables with a `$`. You no longer need to use the `$` prefix.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#env",
376-
"type": [
377-
"array",
378-
"null"
379-
],
350+
"type": ["array", "null"],
380351
"items": {
381352
"$ref": "#/definitions/String"
382353
}
383354
},
384355
"inputs": {
385356
"description": "The set of glob patterns to consider as inputs to this task.\n\nChanges to files covered by these globs will cause a cache miss and the task will be rerun. If a file has been changed that is **not** included in the set of globs, it will not cause a cache miss. If omitted or empty, all files in the package are considered as inputs.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#inputs",
386-
"type": [
387-
"array",
388-
"null"
389-
],
357+
"type": ["array", "null"],
390358
"items": {
391359
"$ref": "#/definitions/String"
392360
}
@@ -426,20 +394,14 @@
426394
},
427395
"outputs": {
428396
"description": "The set of glob patterns indicating a task's cacheable filesystem outputs.\n\nTurborepo captures task logs for all tasks. This enables us to cache tasks whose runs produce no artifacts other than logs (such as linters). Logs are always treated as a cacheable artifact and never need to be specified.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#outputs",
429-
"type": [
430-
"array",
431-
"null"
432-
],
397+
"type": ["array", "null"],
433398
"items": {
434399
"$ref": "#/definitions/String"
435400
}
436401
},
437402
"passThroughEnv": {
438403
"description": "An allowlist of environment variables that should be made available in this task's environment, but should not contribute to the task's cache key, e.g. `AWS_SECRET_KEY`.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#passthroughenv",
439-
"type": [
440-
"array",
441-
"null"
442-
],
404+
"type": ["array", "null"],
443405
"items": {
444406
"$ref": "#/definitions/String"
445407
}
@@ -457,10 +419,7 @@
457419
},
458420
"with": {
459421
"description": "A list of tasks that will run alongside this task.\n\nTasks in this list will not be run until completion before this task starts execution.\n\nDocumentation: https://turborepo.com/docs/reference/configuration#with",
460-
"type": [
461-
"array",
462-
"null"
463-
],
422+
"type": ["array", "null"],
464423
"items": {
465424
"$ref": "#/definitions/String"
466425
}
@@ -609,16 +568,12 @@
609568
{
610569
"description": "Use the terminal user interface.",
611570
"type": "string",
612-
"enum": [
613-
"tui"
614-
]
571+
"enum": ["tui"]
615572
},
616573
{
617574
"description": "Use the standard output stream.",
618575
"type": "string",
619-
"enum": [
620-
"stream"
621-
]
576+
"enum": ["stream"]
622577
}
623578
]
624579
},
@@ -628,4 +583,4 @@
628583
"minimum": 0.0
629584
}
630585
}
631-
}
586+
}

packages/turbo-types/src/types/config-v2.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
export type OutputLogs = "full" | "none" | "hash-only" | "new-only" | "errors-only";
1+
export type OutputLogs =
2+
| "full"
3+
| "none"
4+
| "hash-only"
5+
| "new-only"
6+
| "errors-only";
27
export type EnvMode = "loose" | "strict";
38
export type UI = "tui" | "stream";
49
/**

0 commit comments

Comments
 (0)