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

feat(types): update turbo.json schema #3821

Merged
Merged
Changes from 1 commit
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
47 changes: 29 additions & 18 deletions packages/turbo-types/src/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
/* This file generates the `schema.json` file. */
export interface Schema {
export type Schema = RootSchema | WorkspaceSchema;

export interface BaseSchema {
/** @default https://turbo.build/schema.json */
$schema?: string;
pipeline: {
/**
* The name of a task that can be executed by turbo. If turbo finds a workspace
* package with a package.json scripts object with a matching key, it will apply the
* pipeline task configuration to that npm script during execution.
*/
[script: string]: Pipeline;
};
}

export interface WorkspaceSchema extends BaseSchema {
/**
* This key is only available in Workspace Configs
* and cannot be used in your root turbo.json.
*
* Tells turbo to extend your root `turbo.json`
* and overrides with the keys provided
* in your Workspace Configs.
*
* Currently, only the "//" value is allowed.
*
* @default ["//"]
*/
extends: string[];
}

export interface RootSchema extends BaseSchema {
/**
* A list of globs to include in the set of implicit global hash dependencies.
*
Expand Down Expand Up @@ -34,23 +62,6 @@ export interface Schema {
*/
globalEnv?: string[];

/**
* An object representing the task dependency graph of your project. turbo interprets
* these conventions to schedule, execute, and cache the outputs of tasks in
* your project.
*
* Documentation: https://turbo.build/repo/docs/reference/configuration#pipeline
*
* @default {}
*/
pipeline: {
/**
* The name of a task that can be executed by turbo. If turbo finds a workspace
* package with a package.json scripts object with a matching key, it will apply the
* pipeline task configuration to that npm script during execution.
*/
[script: string]: Pipeline;
};
/**
* Configuration options that control how turbo interfaces with the remote cache.
*
Expand Down