wasm_pack/
lib.rs

1//! Your favorite rust -> wasm workflow tool!
2
3#![deny(missing_docs)]
4
5extern crate anyhow;
6extern crate cargo_metadata;
7extern crate console;
8extern crate glob;
9extern crate parking_lot;
10extern crate semver;
11extern crate serde;
12extern crate strsim;
13extern crate which;
14#[macro_use]
15extern crate serde_derive;
16extern crate binary_install;
17extern crate chrono;
18extern crate dialoguer;
19extern crate log;
20extern crate serde_ignored;
21extern crate serde_json;
22extern crate toml;
23extern crate walkdir;
24
25pub mod bindgen;
26pub mod build;
27pub mod cache;
28pub mod child;
29pub mod command;
30pub mod emoji;
31pub mod generate;
32pub mod install;
33pub mod license;
34pub mod lockfile;
35pub mod manifest;
36pub mod npm;
37pub mod progressbar;
38pub mod readme;
39pub mod stamps;
40pub mod target;
41pub mod test;
42pub mod wasm_opt;
43
44use crate::progressbar::{LogLevel, ProgressOutput};
45use clap::builder::ArgAction;
46use clap::Parser;
47
48/// The global progress bar and user-facing message output.
49pub static PBAR: ProgressOutput = ProgressOutput::new();
50
51/// 📦 ✨  pack and publish your wasm!
52#[derive(Debug, Parser)]
53#[command(version)]
54pub struct Cli {
55    /// The subcommand to run.
56    #[clap(subcommand)] // Note that we mark a field as a subcommand
57    pub cmd: command::Command,
58
59    /// Log verbosity is based off the number of v used
60    #[clap(long = "verbose", short = 'v', action = ArgAction::Count)]
61    pub verbosity: u8,
62
63    #[clap(long = "quiet", short = 'q')]
64    /// No output printed to stdout
65    pub quiet: bool,
66
67    #[clap(long = "log-level", default_value = "info")]
68    /// The maximum level of messages that should be logged by wasm-pack. [possible values: info, warn, error]
69    pub log_level: LogLevel,
70}