Download next.js/turbopack/crates/turbopack-cli/src/arguments.rs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 4.1 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-cli/src/arguments.rs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/turbopack/crates/turbopack-cli/src/arguments.rs
-
curl -L -o arguments.rs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-cli/src/arguments.rs
4.1 kB
| use std::{ | |
| net::IpAddr, | |
| path::{Path, PathBuf}, | |
| }; | |
| use clap::{Args, Parser, ValueEnum}; | |
| use serde::{Deserialize, Serialize}; | |
| use turbo_tasks::{NonLocalValue, TaskInput, trace::TraceRawVcs}; | |
| use turbopack_cli_utils::issue::IssueSeverityCliOption; | |
| pub enum Arguments { | |
| Build(BuildArguments), | |
| Dev(DevArguments), | |
| } | |
| impl Arguments { | |
| /// The directory of the application. see [CommonArguments]::dir | |
| pub fn dir(&self) -> Option<&Path> { | |
| match self { | |
| Arguments::Build(args) => args.common.dir.as_deref(), | |
| Arguments::Dev(args) => args.common.dir.as_deref(), | |
| } | |
| } | |
| } | |
| pub enum Target { | |
| Browser, | |
| Node, | |
| } | |
| pub struct CommonArguments { | |
| /// The entrypoints of the project. Resolved relative to the project's | |
| /// directory (`--dir`). | |
| pub entries: Option<Vec<String>>, | |
| /// The directory of the application. | |
| /// If no directory is provided, the current directory will be used. | |
| pub dir: Option<PathBuf>, | |
| /// The root directory of the project. Nothing outside of this directory can | |
| /// be accessed. e. g. the monorepo root. | |
| /// If no directory is provided, `dir` will be used. | |
| pub root: Option<PathBuf>, | |
| /// Filter by issue severity. | |
| pub log_level: Option<IssueSeverityCliOption>, | |
| /// Show all log messages without limit. | |
| pub show_all: bool, | |
| /// Expand the log details. | |
| pub log_detail: bool, | |
| /// Whether to enable full task stats recording in Turbo Engine. | |
| pub full_stats: bool, | |
| // Enable experimental garbage collection with the provided memory limit in | |
| // MB. | |
| // #[clap(long)] | |
| // pub memory_limit: Option<usize>, | |
| /// Whether to build for the `browser` or `node`` | |
| pub target: Option<Target>, | |
| } | |
| pub struct DevArguments { | |
| pub common: CommonArguments, | |
| /// The port number on which to start the application | |
| /// Note: setting env PORT allows to configure port without explicit cli | |
| /// args. However, this is temporary measure to conform with existing | |
| /// next.js devserver and can be removed in the future. | |
| pub port: u16, | |
| /// Hostname on which to start the application | |
| pub hostname: IpAddr, | |
| /// Compile all, instead of only compiling referenced assets when their | |
| /// parent asset is requested | |
| pub eager_compile: bool, | |
| /// Don't open the browser automatically when the dev server has started. | |
| pub no_open: bool, | |
| // == | |
| // = Inherited options from next-dev, need revisit later. | |
| // == | |
| /// If port is not explicitly specified, use different port if it's already | |
| /// in use. | |
| pub allow_retry: bool, | |
| } | |
| pub struct BuildArguments { | |
| pub common: CommonArguments, | |
| /// Don't generate sourcemaps. | |
| pub no_sourcemap: bool, | |
| /// Don't minify build output. | |
| pub no_minify: bool, | |
| /// Don't perform scope hoisting. | |
| pub no_scope_hoist: bool, | |
| /// Drop the `TurboTasks` object upon exit. By default we intentionally leak this memory, as | |
| /// we're about to exit the process anyways, but that can cause issues with valgrind or other | |
| /// leak detectors. | |
| pub force_memory_cleanup: bool, | |
| } | |