pub enum Command {
Build(BuildOptions),
Pack {
path: Option<PathBuf>,
},
Generate {
name: String,
template: String,
mode: InstallMode,
},
Publish {
target: String,
access: Option<Access>,
tag: Option<String>,
path: Option<PathBuf>,
},
Login {
registry: Option<String>,
scope: Option<String>,
always_auth: bool,
auth_type: Option<String>,
},
Test(TestOptions),
}
Expand description
The various kinds of commands that wasm-pack
can execute.
Variants§
Build(BuildOptions)
🏗️ build your npm package!
Pack
Fields
🍱 create a tar of your npm package but don’t publish!
Generate
Fields
mode: InstallMode
Should we install or check the presence of binary tools. [possible values: no-install, normal, force]
🐑 create a new project with a template
Publish
Fields
🎆 pack up your npm package and publish!
Login
Fields
registry: Option<String>
Default: ‘https://registry.npmjs.org/’. The base URL of the npm package registry. If scope is also specified, this registry will only be used for packages with that scope. scope defaults to the scope of the project directory you’re currently in, if any.
scope: Option<String>
Default: none. If specified, the user and login credentials given will be associated with the specified scope.
👤 Add an npm registry user account! (aliases: adduser, add-user)
Test(TestOptions)
👩🔬 test your wasm!
Trait Implementations§
source§impl StructOpt for Command
impl StructOpt for Command
source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by StructOpt::clap
called on
the same type, otherwise it must panic.source§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere Self: Sized,
std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program.source§fn from_args_safe() -> Result<Self, Error>where
Self: Sized,
fn from_args_safe() -> Result<Self, Error>where Self: Sized,
std::env::args_os
).
Unlike StructOpt::from_args
, returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you.source§fn from_iter<I>(iter: I) -> Selfwhere
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter<I>(iter: I) -> Selfwhere Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making.
Print the error message and quit the program in case of failure. Read moresource§fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making. Read more