Struct deno_config::ConfigFile

source ·
pub struct ConfigFile {
    pub specifier: Url,
    pub json: ConfigFileJson,
}

Fields§

§specifier: Url§json: ConfigFileJson

Implementations§

source§

impl ConfigFile

source

pub fn discover( config_flag: &ConfigFlag, maybe_config_path_args: Option<Vec<PathBuf>>, cwd: &Path ) -> Result<Option<ConfigFile>, AnyError>

source

pub fn discover_from( start: &Path, checked: &mut HashSet<PathBuf> ) -> Result<Option<ConfigFile>, AnyError>

source

pub fn read(config_path: &Path) -> Result<Self, AnyError>

source

pub fn from_specifier(specifier: Url) -> Result<Self, AnyError>

source

pub fn new(text: &str, specifier: Url) -> Result<Self, AnyError>

source

pub fn dir_path(&self) -> PathBuf

source

pub fn get_check_js(&self) -> bool

Returns true if the configuration indicates that JavaScript should be type checked, otherwise false.

source

pub fn to_compiler_options( &self ) -> Result<(Value, Option<IgnoredCompilerOptions>), AnyError>

Parse compilerOptions and return a serde Value. The result also contains any options that were ignored.

source

pub fn to_import_map_path(&self) -> Option<String>

source

pub fn node_modules_dir_flag(&self) -> Option<bool>

source

pub fn vendor_dir_flag(&self) -> Option<bool>

source

pub fn vendor_dir_path(&self) -> Option<PathBuf>

source

pub fn to_import_map_value(&self) -> Value

source

pub fn is_an_import_map(&self) -> bool

source

pub fn has_unstable(&self, name: &str) -> bool

source

pub fn to_exports_config(&self) -> Result<ExportsConfig, AnyError>

source

pub fn to_files_config(&self) -> Result<Option<FilePatterns>, AnyError>

source

pub fn to_fmt_config(&self) -> Result<Option<FmtConfig>, AnyError>

source

pub fn to_lint_config(&self) -> Result<Option<LintConfig>, AnyError>

source

pub fn to_test_config(&self) -> Result<Option<TestConfig>, AnyError>

source

pub fn to_publish_config(&self) -> Result<Option<PublishConfig>, AnyError>

source

pub fn to_workspace_config(&self) -> Result<Option<WorkspaceConfig>, AnyError>

source

pub fn to_bench_config(&self) -> Result<Option<BenchConfig>, AnyError>

source

pub fn to_lsp_tasks(&self) -> Option<Value>

Return any tasks that are defined in the configuration file as a sequence of JSON objects providing the name of the task and the arguments of the task in a detail field.

source

pub fn to_tasks_config( &self ) -> Result<Option<IndexMap<String, String>>, AnyError>

source

pub fn to_maybe_imports(&self) -> Result<Vec<(Url, Vec<String>)>, AnyError>

If the configuration file contains “extra” modules (like TypeScript "types") options, return them as imports to be added to a module graph.

source

pub fn to_maybe_jsx_import_source_config( &self ) -> Result<Option<JsxImportSourceConfig>, AnyError>

Based on the compiler options in the configuration file, return the JSX import source configuration.

source

pub fn resolve_tasks_config(&self) -> Result<IndexMap<String, String>, AnyError>

source

pub fn to_lock_config(&self) -> Result<Option<LockConfig>, AnyError>

source

pub fn resolve_lockfile_path(&self) -> Result<Option<PathBuf>, AnyError>

Trait Implementations§

source§

impl Clone for ConfigFile

source§

fn clone(&self) -> ConfigFile

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConfigFile

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.