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

fix(turborepo): Unhide flags #6021

Merged
merged 5 commits into from
Oct 3, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ pub struct RunArgs {
#[clap(alias = "dry", long = "dry-run", num_args = 0..=1, default_missing_value = "text")]
pub dry_run: Option<DryRunMode>,
/// Run turbo in single-package mode
#[clap(long, global = true)]
#[clap(long)]
pub single_package: bool,
/// Use the given selector to specify package(s) to act as
/// entry points. The syntax mirrors pnpm's syntax, and
Expand All @@ -458,9 +458,11 @@ pub struct RunArgs {
#[clap(long, num_args = 0..=1, default_missing_value = "")]
pub graph: Option<String>,
/// Environment variable mode.
/// Loose passes the entire environment.
/// Strict uses an allowlist specified in turbo.json.
#[clap(long = "env-mode", default_value = "infer", num_args = 0..=1, default_missing_value = "infer", hide = true)]
/// Use "loose" to pass the entire existing environment.
/// Use "strict" to use an allowlist specified in turbo.json.
/// Use "infer" to defer to existence of "passThroughEnv" or
/// "globalPassThroughEnv" in turbo.json. (default infer)
#[clap(long = "env-mode", default_value = "infer", num_args = 0..=1, default_missing_value = "infer")]
pub env_mode: EnvMode,
/// Files to ignore when calculating changed files (i.e. --since).
/// Supports globs.
Expand Down Expand Up @@ -493,8 +495,8 @@ pub struct RunArgs {
/// turbo decide based on its own heuristics. (default auto)
#[clap(long, env = "TURBO_LOG_ORDER", value_enum, default_value_t = LogOrder::Auto)]
pub log_order: LogOrder,

#[clap(long, hide = true)]
/// Only executes the tasks specified, does not execute parent tasks.
#[clap(long)]
pub only: bool,
/// Execute all tasks in parallel.
#[clap(long)]
Expand Down
2 changes: 2 additions & 0 deletions turborepo-tests/integration/tests/no_args.t
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ Make sure exit code is 2 when no args are passed
--framework-inference [<BOOL>] Specify whether or not to do framework inference for tasks [default: true] [possible values: true, false]
--global-deps <GLOBAL_DEPS> Specify glob of global filesystem dependencies to be hashed. Useful for .env and files
--graph [<GRAPH>] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided
--env-mode [<ENV_MODE>] Environment variable mode. Use "loose" to pass the entire existing environment. Use "strict" to use an allowlist specified in turbo.json. Use "infer" to defer to existence of "passThroughEnv" or "globalPassThroughEnv" in turbo.json. (default infer) [default: infer] [possible values: infer, loose, strict]
--ignore <IGNORE> Files to ignore when calculating changed files (i.e. --since). Supports globs
--include-dependencies Include the dependencies of tasks in execution
--no-cache Avoid saving task results to the cache. Useful for development/watch tasks
--no-daemon Run without using turbo's daemon process
--no-deps Exclude dependent task consumers from execution
--output-logs <OUTPUT_LOGS> Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [possible values: full, none, hash-only, new-only, errors-only]
--log-order <LOG_ORDER> Set type of task output order. Use "stream" to show output as soon as it is available. Use "grouped" to show output when a command has finished execution. Use "auto" to let turbo decide based on its own heuristics. (default auto) [env: TURBO_LOG_ORDER=] [default: auto] [possible values: auto, stream, grouped]
--only Only executes the tasks specified, does not execute parent tasks
--parallel Execute all tasks in parallel
--profile <PROFILE> File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow
--remote-only [<BOOL>] Ignore the local filesystem cache for all tasks. Only allow reading and caching artifacts using the remote cache [env: TURBO_REMOTE_ONLY=] [default: false] [possible values: true, false]
Expand Down
16 changes: 4 additions & 12 deletions turborepo-tests/integration/tests/turbo_help.t
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ Test help flag
--framework-inference [<BOOL>] Specify whether or not to do framework inference for tasks [default: true] [possible values: true, false]
--global-deps <GLOBAL_DEPS> Specify glob of global filesystem dependencies to be hashed. Useful for .env and files
--graph [<GRAPH>] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided
--env-mode [<ENV_MODE>] Environment variable mode. Use "loose" to pass the entire existing environment. Use "strict" to use an allowlist specified in turbo.json. Use "infer" to defer to existence of "passThroughEnv" or "globalPassThroughEnv" in turbo.json. (default infer) [default: infer] [possible values: infer, loose, strict]
--ignore <IGNORE> Files to ignore when calculating changed files (i.e. --since). Supports globs
--include-dependencies Include the dependencies of tasks in execution
--no-cache Avoid saving task results to the cache. Useful for development/watch tasks
--no-daemon Run without using turbo's daemon process
--no-deps Exclude dependent task consumers from execution
--output-logs <OUTPUT_LOGS> Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [possible values: full, none, hash-only, new-only, errors-only]
--log-order <LOG_ORDER> Set type of task output order. Use "stream" to show output as soon as it is available. Use "grouped" to show output when a command has finished execution. Use "auto" to let turbo decide based on its own heuristics. (default auto) [env: TURBO_LOG_ORDER=] [default: auto] [possible values: auto, stream, grouped]
--only Only executes the tasks specified, does not execute parent tasks
--parallel Execute all tasks in parallel
--profile <PROFILE> File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow
--remote-only [<BOOL>] Ignore the local filesystem cache for all tasks. Only allow reading and caching artifacts using the remote cache [env: TURBO_REMOTE_ONLY=] [default: false] [possible values: true, false]
Expand Down Expand Up @@ -118,13 +120,15 @@ Test help flag
--framework-inference [<BOOL>] Specify whether or not to do framework inference for tasks [default: true] [possible values: true, false]
--global-deps <GLOBAL_DEPS> Specify glob of global filesystem dependencies to be hashed. Useful for .env and files
--graph [<GRAPH>] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided
--env-mode [<ENV_MODE>] Environment variable mode. Use "loose" to pass the entire existing environment. Use "strict" to use an allowlist specified in turbo.json. Use "infer" to defer to existence of "passThroughEnv" or "globalPassThroughEnv" in turbo.json. (default infer) [default: infer] [possible values: infer, loose, strict]
--ignore <IGNORE> Files to ignore when calculating changed files (i.e. --since). Supports globs
--include-dependencies Include the dependencies of tasks in execution
--no-cache Avoid saving task results to the cache. Useful for development/watch tasks
--no-daemon Run without using turbo's daemon process
--no-deps Exclude dependent task consumers from execution
--output-logs <OUTPUT_LOGS> Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [possible values: full, none, hash-only, new-only, errors-only]
--log-order <LOG_ORDER> Set type of task output order. Use "stream" to show output as soon as it is available. Use "grouped" to show output when a command has finished execution. Use "auto" to let turbo decide based on its own heuristics. (default auto) [env: TURBO_LOG_ORDER=] [default: auto] [possible values: auto, stream, grouped]
--only Only executes the tasks specified, does not execute parent tasks
--parallel Execute all tasks in parallel
--profile <PROFILE> File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow
--remote-only [<BOOL>] Ignore the local filesystem cache for all tasks. Only allow reading and caching artifacts using the remote cache [env: TURBO_REMOTE_ONLY=] [default: false] [possible values: true, false]
Expand Down Expand Up @@ -159,9 +163,6 @@ Test help flag for link command
--trace <TRACE> Specify a file to save a pprof trace
--verbosity <COUNT> Verbosity level
-h, --help Print help

Run Arguments:
--single-package Run turbo in single-package mode

Test help flag for unlink command
$ ${TURBO} unlink -h
Expand All @@ -188,9 +189,6 @@ Test help flag for unlink command
--trace <TRACE> Specify a file to save a pprof trace
--verbosity <COUNT> Verbosity level
-h, --help Print help

Run Arguments:
--single-package Run turbo in single-package mode

Test help flag for login command
$ ${TURBO} login -h
Expand All @@ -217,9 +215,6 @@ Test help flag for login command
--trace <TRACE> Specify a file to save a pprof trace
--verbosity <COUNT> Verbosity level
-h, --help Print help

Run Arguments:
--single-package Run turbo in single-package mode

Test help flag for logout command
$ ${TURBO} logout -h
Expand All @@ -245,6 +240,3 @@ Test help flag for logout command
--trace <TRACE> Specify a file to save a pprof trace
--verbosity <COUNT> Verbosity level
-h, --help Print help

Run Arguments:
--single-package Run turbo in single-package mode