pub struct NodeMaintainerOptions { /* private fields */ }
Implementations§
Source§impl NodeMaintainerOptions
impl NodeMaintainerOptions
Sourcepub fn cache(self, cache: impl AsRef<Path>) -> Self
pub fn cache(self, cache: impl AsRef<Path>) -> Self
Configure the cache location that NodeMaintainer will use.
Sourcepub fn concurrency(self, concurrency: usize) -> Self
pub fn concurrency(self, concurrency: usize) -> Self
Controls number of concurrent operations during various apply steps (resolution fetches, extractions, etc). Tuning this might help reduce memory usage.
Sourcepub fn locked(self, locked: bool) -> Self
pub fn locked(self, locked: bool) -> Self
Make the resolver error if the newly-resolved tree would defer from an existing lockfile.
Sourcepub fn script_concurrency(self, concurrency: usize) -> Self
pub fn script_concurrency(self, concurrency: usize) -> Self
Controls number of concurrent script executions while running
run_script
. This option is separate from concurrency
because
executing concurrent scripts is a much heavier operation.
Sourcepub fn kdl_lock(
self,
kdl_lock: impl IntoKdl,
) -> Result<Self, NodeMaintainerError>
pub fn kdl_lock( self, kdl_lock: impl IntoKdl, ) -> Result<Self, NodeMaintainerError>
Configure the KDL lockfile that NodeMaintainer will use.
If this option is not specified, NodeMaintainer will try to read the
lockfile from <root>/package-lock.kdl
.
Sourcepub fn npm_lock(
self,
npm_lock: impl AsRef<str>,
) -> Result<Self, NodeMaintainerError>
pub fn npm_lock( self, npm_lock: impl AsRef<str>, ) -> Result<Self, NodeMaintainerError>
Configure the NPM lockfile that NodeMaintainer will use.
If this option is not specified, NodeMaintainer will try to read the
lockfile from <root>/package-lock.json
.
Sourcepub fn registry(self, registry: Url) -> Self
pub fn registry(self, registry: Url) -> Self
Registry used for unscoped packages.
Defaults to https://registry.npmjs.org.
Sourcepub fn scope_registry(self, scope: impl AsRef<str>, registry: Url) -> Self
pub fn scope_registry(self, scope: impl AsRef<str>, registry: Url) -> Self
Registry to use for a given @scope
. That is, what registry to use
when looking up a package like @foo/pkg
. This option can be provided
multiple times.
Sourcepub fn basic_auth(
self,
registry: Url,
username: impl AsRef<str>,
password: Option<impl AsRef<str>>,
) -> Self
pub fn basic_auth( self, registry: Url, username: impl AsRef<str>, password: Option<impl AsRef<str>>, ) -> Self
Sets basic auth credentials for a registry.
Sourcepub fn token_auth(self, registry: Url, token: impl AsRef<str>) -> Self
pub fn token_auth(self, registry: Url, token: impl AsRef<str>) -> Self
Sets bearer token credentials for a registry.
Sourcepub fn legacy_auth(
self,
registry: Url,
legacy_auth_token: impl AsRef<str>,
) -> Self
pub fn legacy_auth( self, registry: Url, legacy_auth_token: impl AsRef<str>, ) -> Self
Sets the legacy, pre-encoded auth token for a registry.
Sourcepub fn default_tag(self, tag: impl AsRef<str>) -> Self
pub fn default_tag(self, tag: impl AsRef<str>) -> Self
Default dist-tag to use when resolving package versions.
Sourcepub fn nassun(self, nassun: Nassun) -> Self
pub fn nassun(self, nassun: Nassun) -> Self
Provide a pre-configured Nassun instance. Using this option will disable all other nassun-related configurations.
Sourcepub fn prefer_copy(self, prefer_copy: bool) -> Self
pub fn prefer_copy(self, prefer_copy: bool) -> Self
When extracting packages, prefer to copy files instead of linking them.
This option has no effect if hard linking fails (for example, if the cache is on a different drive), or if the project is on a filesystem that supports Copy-on-Write (zfs, btrfs, APFS (macOS), etc).
Sourcepub fn hoisted(self, hoisted: bool) -> Self
pub fn hoisted(self, hoisted: bool) -> Self
Use the hoisted installation mode, where all dependencies and their
transitive dependencies are installed as high up in the node_modules
tree as possible. This can potentially mean that packages have access
to dependencies they did not specify in their package.json, but it
might be useful for compatibility.
pub fn proxy(self, proxy: bool) -> Self
pub fn proxy_url( self, proxy_url: impl AsRef<str>, ) -> Result<Self, NodeMaintainerError>
pub fn no_proxy_domain(self, no_proxy_domain: impl AsRef<str>) -> Self
pub fn on_resolution_added<F>(self, f: F) -> Self
pub fn on_resolve_progress<F>(self, f: F) -> Self
pub fn on_prune_progress<F>(self, f: F) -> Self
pub fn on_extract_progress<F>(self, f: F) -> Self
pub fn on_script_start<F>(self, f: F) -> Self
pub fn on_script_line<F>(self, f: F) -> Self
Sourcepub async fn resolve_manifest(
self,
root: CorgiManifest,
) -> Result<NodeMaintainer, NodeMaintainerError>
pub async fn resolve_manifest( self, root: CorgiManifest, ) -> Result<NodeMaintainer, NodeMaintainerError>
Resolves a NodeMaintainer
using an existing CorgiManifest
.
Sourcepub async fn resolve_spec(
self,
root_spec: impl AsRef<str>,
) -> Result<NodeMaintainer, NodeMaintainerError>
pub async fn resolve_spec( self, root_spec: impl AsRef<str>, ) -> Result<NodeMaintainer, NodeMaintainerError>
Resolves a NodeMaintainer
using a particular package spec (for
example, foo@1.2.3
or ./root
) as its “root” package.
Trait Implementations§
Source§impl Clone for NodeMaintainerOptions
impl Clone for NodeMaintainerOptions
Source§fn clone(&self) -> NodeMaintainerOptions
fn clone(&self) -> NodeMaintainerOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !Freeze for NodeMaintainerOptions
impl !RefUnwindSafe for NodeMaintainerOptions
impl Send for NodeMaintainerOptions
impl Sync for NodeMaintainerOptions
impl Unpin for NodeMaintainerOptions
impl !UnwindSafe for NodeMaintainerOptions
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more