From aebf6678a8ea81ef48ac24c0a259130d9ab9e42e Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 7 Jul 2021 16:54:14 -0400 Subject: [PATCH 001/330] wip: move out of dioxus main --- .gitignore | 2 + .vscode/settings.json | 3 + Cargo.toml | 33 ++++++++++ README.md | 48 ++++++++++++++ src/builder.rs | 146 ++++++++++++++++++++++++++++++++++++++++++ src/cargo.rs | 69 ++++++++++++++++++++ src/cli.rs | 62 ++++++++++++++++++ src/config.rs | 92 ++++++++++++++++++++++++++ src/develop.rs | 111 ++++++++++++++++++++++++++++++++ src/error.rs | 34 ++++++++++ src/lib.rs | 8 +++ src/logging.rs | 49 ++++++++++++++ src/main.rs | 28 ++++++++ src/watch.rs | 11 ++++ 14 files changed, 696 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 Cargo.toml create mode 100644 README.md create mode 100644 src/builder.rs create mode 100644 src/cargo.rs create mode 100644 src/cli.rs create mode 100644 src/config.rs create mode 100644 src/develop.rs create mode 100644 src/error.rs create mode 100644 src/lib.rs create mode 100644 src/logging.rs create mode 100644 src/main.rs create mode 100644 src/watch.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..96ef6c0b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..80f51cff8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "rust-analyzer.inlayHints.enable": false +} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..299a26ae6 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "dioxus-studio" +version = "0.1.0" +authors = ["Jonathan Kelley "] +edition = "2018" +description = "CLI tool for developing, testing, and publishing Dioxus apps" +"license" = "MIT/Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +thiserror = "1.0.23" +log = "0.4.13" +fern = { version="0.6.0", features=["colored"] } +wasm-bindgen-cli-support = "0.2.73" +anyhow = "1.0.38" +argh = "0.1.4" +serde = "1.0.120" +serde_json = "1.0.61" +async-std = { version="1.9.0", features=["attributes"] } +tide = "0.15.0" +fs_extra = "1.2.0" + +cargo_toml = "0.8.1" +futures = "0.3.12" +notify = "5.0.0-pre.4" +rjdebounce = "0.2.1" +tempfile = "3.2.0" + +[[bin]] + +path = "src/main.rs" +name = "dioxus" diff --git a/README.md b/README.md new file mode 100644 index 000000000..bf2e3310a --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +
+

📦✨ dioxus-cli

+

+ Tooling to supercharge dioxus projects +

+
+ +# About +--- +dioxus-cli (inspired by wasm-pack and webpack) is a tool to help get dioxus projects off the ground. It handles all the build, development, bundling, and publishing to make web development just a simple two commands: `cargo init` and `dioxus-cli publish`. + +Best thing: +- No NPM. +- No Webpack. +- No `node_modules`. +- No Babel +- No parcel +- No rollup +- No ESLint + +Just install Rust, dioxus-cli, and you're good to go. +`cargo install --git github.com/jkelleyrtp/dioxus-cli` + +Need a development server? +`dioxus develop` + +Need to run an example? +`dioxus develop --example textbox` + +Need to benchmark a component? +`dioxus bench` + +Need to test your code? +`dioxus test` + +Need to build your code into a bundle? +`dioxus build --outdir public` + +Need to publish your code to GitHub pages, Netlify, etc? +`dioxus publish --ghpages myrepo.git` + +# Use in your project +--- +Sometimes you'll want to include static assets without bundling them into your .wasm content. dioxus-cli provides a few ways of doing this: + +- Load in dynamic content using `dioxus::asset("./static/images/blah.svg")` +- Live-reload HTML templates without rebuilding your .wasm with `dioxus::template("./templates/blah.html")` +- Use a CSS library like tailwind in your dioxus configuration with diff --git a/src/builder.rs b/src/builder.rs new file mode 100644 index 000000000..1d06b3ae8 --- /dev/null +++ b/src/builder.rs @@ -0,0 +1,146 @@ +use crate::{ + cli::BuildOptions, + config::{Config, ExecutableType}, + error::Result, +}; +use log::{info, warn}; +use std::{io::Write, process::Command}; +use wasm_bindgen_cli_support::Bindgen; + +pub struct BuildConfig {} +impl Into for BuildOptions { + fn into(self) -> BuildConfig { + BuildConfig {} + } +} +impl Default for BuildConfig { + fn default() -> Self { + Self {} + } +} + +pub fn build(config: &Config, _build_config: &BuildConfig) -> Result<()> { + /* + [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) + [2] Generate the appropriate build folders + [3] Wasm-bindgen the .wasm fiile, and move it into the {builddir}/modules/xxxx/xxxx_bg.wasm + [4] Wasm-opt the .wasm file with whatever optimizations need to be done + [5] Link up the html page to the wasm module + */ + + let Config { + out_dir, + crate_dir, + target_dir, + static_dir, + executable, + .. + } = config; + + let t_start = std::time::Instant::now(); + + // [1] Build the .wasm module + info!("Running build commands..."); + let mut cmd = Command::new("cargo"); + cmd.current_dir(&crate_dir) + .arg("build") + .arg("--target") + .arg("wasm32-unknown-unknown") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()); + + if config.release { + cmd.arg("--release"); + } + + match executable { + ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), + ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), + ExecutableType::Example(name) => cmd.arg("--example").arg(name), + }; + + let mut child = cmd.spawn()?; + let _err_code = child.wait()?; + + info!("Build complete!"); + + // [2] Establish the output directory structure + let bindgen_outdir = out_dir.join("wasm"); + + // [3] Bindgen the final binary for use easy linking + let mut bindgen_builder = Bindgen::new(); + + let release_type = match config.release { + true => "release", + false => "debug", + }; + + let input_path = match executable { + ExecutableType::Binary(name) | ExecutableType::Lib(name) => target_dir + // .join("wasm32-unknown-unknown/release") + .join(format!("wasm32-unknown-unknown/{}", release_type)) + .join(format!("{}.wasm", name)), + + ExecutableType::Example(name) => target_dir + // .join("wasm32-unknown-unknown/release/examples") + .join(format!("wasm32-unknown-unknown/{}/examples", release_type)) + .join(format!("{}.wasm", name)), + }; + + bindgen_builder + .input_path(input_path) + .web(true)? + .debug(true) + .demangle(true) + .keep_debug(true) + .remove_name_section(false) + .remove_producers_section(false) + .out_name("module") + .generate(&bindgen_outdir)?; + + // [4] + // TODO: wasm-opt + + // [5] Generate the html file with the module name + // TODO: support names via options + info!("Writing to '{:#?}' directory...", out_dir); + let mut file = std::fs::File::create(out_dir.join("index.html"))?; + file.write_all(gen_page("./wasm/module.js").as_str().as_bytes())?; + + let copy_options = fs_extra::dir::CopyOptions::new(); + match fs_extra::dir::copy(static_dir, out_dir, ©_options) { + Ok(_) => {} + Err(_e) => { + warn!("Error copying dir"); + } + } + + let t_end = std::time::Instant::now(); + log::info!("Done in {}ms! 🎉", (t_end - t_start).as_millis()); + Ok(()) +} + +fn gen_page(module: &str) -> String { + format!( + r#" + + + + + + + + + + + +"#, + module + ) +} diff --git a/src/cargo.rs b/src/cargo.rs new file mode 100644 index 000000000..3a911a81e --- /dev/null +++ b/src/cargo.rs @@ -0,0 +1,69 @@ +//! Utilities for working with cargo and rust files +use crate::error::{Error, Result}; +use std::{env, fs, path::PathBuf, process::Command, str}; + +/// How many parent folders are searched for a `Cargo.toml` +const MAX_ANCESTORS: u32 = 10; + +/// Returns the root of the crate that the command is run from +/// +/// If the command is run from the workspace root, this will return the top-level Cargo.toml +pub fn crate_root() -> Result { + // From the current directory we work our way up, looking for `Cargo.toml` + env::current_dir() + .ok() + .and_then(|mut wd| { + for _ in 0..MAX_ANCESTORS { + if contains_manifest(&wd) { + return Some(wd); + } + if !wd.pop() { + break; + } + } + None + }) + .ok_or_else(|| Error::CargoError("Failed to find the cargo directory".to_string())) +} + +/// Returns the root of a workspace +/// TODO @Jon, find a different way that doesn't rely on the cargo metadata command (it's slow) +pub fn workspace_root() -> Result { + let output = Command::new("cargo") + .args(&["metadata"]) + .output() + .map_err(|_| Error::CargoError("Manifset".to_string()))?; + + if !output.status.success() { + let mut msg = str::from_utf8(&output.stderr).unwrap().trim(); + if msg.starts_with("error: ") { + msg = &msg[7..]; + } + + return Err(Error::CargoError(msg.to_string())); + } + + let stdout = str::from_utf8(&output.stdout).unwrap(); + for line in stdout.lines() { + let meta: serde_json::Value = serde_json::from_str(line) + .map_err(|_| Error::CargoError("InvalidOutput".to_string()))?; + + let root = meta["workspace_root"] + .as_str() + .ok_or_else(|| Error::CargoError("InvalidOutput".to_string()))?; + return Ok(root.into()); + } + + Err(Error::CargoError("InvalidOutput".to_string())) +} + +/// Checks if the directory contains `Cargo.toml` +fn contains_manifest(path: &PathBuf) -> bool { + fs::read_dir(path) + .map(|entries| { + entries + .filter_map(Result::ok) + .any(|ent| &ent.file_name() == "Cargo.toml") + }) + .unwrap_or(false) +} diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 000000000..852d4ee71 --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,62 @@ +use argh::FromArgs; + +#[derive(FromArgs, PartialEq, Debug)] +/// Top-level command. +pub struct LaunchOptions { + #[argh(subcommand)] + pub command: LaunchCommand, +} + +/// The various kinds of commands that `wasm-pack` can execute. +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand)] +pub enum LaunchCommand { + Develop(DevelopOptions), + Build(BuildOptions), + Test(TestOptions), + Publish(PublishOptions), +} + +/// Publish your yew application to Github Pages, Netlify, or S3 +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand, name = "publish")] +pub struct PublishOptions {} + +/// 🔬 test your yew application! +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand, name = "test")] +pub struct TestOptions { + /// an example in the crate + #[argh(option)] + pub example: Option, +} + +/// 🏗️ Build your yew application +#[derive(FromArgs, PartialEq, Debug, Clone)] +#[argh(subcommand, name = "build")] +pub struct BuildOptions { + /// an optional direction which is "up" by default + #[argh(option, short = 'o', default = "String::from(\"public\")")] + pub outdir: String, + + /// an example in the crate + #[argh(option)] + pub example: Option, + + /// develop in release mode + #[argh(switch, short = 'r')] + pub release: bool, +} + +/// 🛠 Start a development server +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand, name = "develop")] +pub struct DevelopOptions { + /// an example in the crate + #[argh(option)] + pub example: Option, + + /// develop in release mode + #[argh(switch, short = 'r')] + pub release: bool, +} diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 000000000..02a04eaf7 --- /dev/null +++ b/src/config.rs @@ -0,0 +1,92 @@ +use crate::{ + cli::{BuildOptions, DevelopOptions}, + error::Result, +}; +use std::{io::Write, path::PathBuf, process::Command}; + +#[derive(Debug, Clone)] +pub struct Config { + pub out_dir: PathBuf, + pub crate_dir: PathBuf, + pub workspace_dir: PathBuf, + pub target_dir: PathBuf, + pub static_dir: PathBuf, + pub manifest: cargo_toml::Manifest, + pub executable: ExecutableType, + pub release: bool, +} + +#[derive(Debug, Clone)] +pub enum ExecutableType { + Binary(String), + Lib(String), + Example(String), +} + +impl Config { + pub fn new() -> Result { + let crate_dir = crate::cargo::crate_root()?; + let workspace_dir = crate::cargo::workspace_root()?; + let target_dir = workspace_dir.join("target"); + let out_dir = crate_dir.join("public"); + let cargo_def = &crate_dir.join("Cargo.toml"); + let static_dir = crate_dir.join("static"); + + let manifest = cargo_toml::Manifest::from_path(&cargo_def).unwrap(); + + // We just assume they're using a 'main.rs' + // Anyway, we've already parsed the manifest, so it should be easy to change the type + let output_filename = (&manifest) + .lib + .as_ref() + .and_then(|lib| lib.name.clone()) + .or_else(|| { + (&manifest) + .package + .as_ref() + .and_then(|pkg| Some(pkg.name.replace("-", "_"))) + .clone() + }) + .expect("No lib found from cargo metadata"); + let executable = ExecutableType::Binary(output_filename); + + let release = false; + + Ok(Self { + out_dir, + crate_dir, + workspace_dir, + target_dir, + static_dir, + manifest, + executable, + release, + }) + } + + pub fn as_example(&mut self, example_name: String) -> &mut Self { + self.executable = ExecutableType::Example(example_name); + self + } + + pub fn with_release(&mut self, release: bool) -> &mut Self { + self.release = release; + self + } + + pub fn with_build_options(&mut self, options: &BuildOptions) { + if let Some(name) = &options.example { + self.as_example(name.clone()); + } + self.release = options.release; + self.out_dir = options.outdir.clone().into(); + } + + pub fn with_develop_options(&mut self, options: &DevelopOptions) { + if let Some(name) = &options.example { + self.as_example(name.clone()); + } + self.release = options.release; + self.out_dir = tempfile::Builder::new().tempdir().expect("").into_path(); + } +} diff --git a/src/develop.rs b/src/develop.rs new file mode 100644 index 000000000..1ae016b0d --- /dev/null +++ b/src/develop.rs @@ -0,0 +1,111 @@ +use crate::{builder::BuildConfig, cli::DevelopOptions, config::Config, error::Result}; +use async_std::prelude::FutureExt; + +use async_std::future; +use async_std::prelude::*; + +use log::info; +use notify::{RecommendedWatcher, RecursiveMode, Watcher}; +use std::path::PathBuf; +use std::time::Duration; + +pub struct DevelopConfig {} +impl Into for DevelopOptions { + fn into(self) -> DevelopConfig { + DevelopConfig {} + } +} + +pub async fn start(config: &Config, _options: &DevelopConfig) -> Result<()> { + log::info!("Starting development server 🚀"); + + let Config { out_dir, .. } = config; + + // Spawn the server onto a seperate task + // This lets the task progress while we handle file updates + let server = async_std::task::spawn(launch_server(out_dir.clone())); + let watcher = async_std::task::spawn(watch_directory(config.clone())); + + match server.race(watcher).await { + Err(e) => log::warn!("Error running development server, {:?}", e), + _ => {} + } + + Ok(()) +} + +async fn watch_directory(config: Config) -> Result<()> { + // Create a channel to receive the events. + let (watcher_tx, watcher_rx) = async_std::channel::bounded(100); + + // Automatically select the best implementation for your platform. + // You can also access each implementation directly e.g. INotifyWatcher. + let mut watcher: RecommendedWatcher = Watcher::new_immediate(move |res| { + async_std::task::block_on(watcher_tx.send(res)); + }) + .expect("failed to make watcher"); + + let src_dir = crate::cargo::crate_root()?; + + // Add a path to be watched. All files and directories at that path and + // below will be monitored for changes. + watcher + .watch(src_dir.join("src"), RecursiveMode::Recursive) + .expect("Failed to watch dir"); + + watcher + .watch(src_dir.join("examples"), RecursiveMode::Recursive) + .expect("Failed to watch dir"); + + let build_config = BuildConfig::default(); + + 'run: loop { + crate::builder::build(&config, &build_config)?; + + // Wait for the message with a debounce + let _msg = watcher_rx + .recv() + .join(future::ready(1_usize).delay(Duration::from_millis(2000))) + .await; + + info!("File updated, rebuilding app"); + } + Ok(()) +} + +async fn launch_server(outdir: PathBuf) -> Result<()> { + let _crate_dir = crate::cargo::crate_root()?; + let _workspace_dir = crate::cargo::workspace_root()?; + + let mut app = tide::with_state(ServerState::new(outdir.to_owned())); + let p = outdir.display().to_string(); + + app.at("/") + .get(|req: tide::Request| async move { + log::info!("Connected to development server"); + let state = req.state(); + Ok(tide::Body::from_file(state.serv_path.clone().join("index.html")).await?) + }) + .serve_dir(p)?; + + let port = "8080"; + let serve_addr = format!("0.0.0.0:{}", port); + // let serve_addr = format!("127.0.0.1:{}", port); + + info!("App available at http://{}", serve_addr); + app.listen(serve_addr).await?; + Ok(()) +} + +/// https://github.com/http-rs/tide/blob/main/examples/state.rs +/// Tide seems to prefer using state instead of injecting into the app closure +/// The app closure needs to be static and +#[derive(Clone)] +struct ServerState { + serv_path: PathBuf, +} +impl ServerState { + fn new(serv_path: PathBuf) -> Self { + Self { serv_path } + } +} diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 000000000..80a884956 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,34 @@ +use thiserror::Error as ThisError; + +pub type Result = std::result::Result; + +#[derive(ThisError, Debug)] +pub enum Error { + /// Used when errors need to propogate but are too unique to be typed + #[error("{0}")] + Unique(String), + + #[error("I/O Error: {0}")] + IO(#[from] std::io::Error), + + #[error("Failed to write error")] + FailedToWrite, + + #[error("Failed to write error")] + CargoError(String), + + #[error(transparent)] + Other(#[from] anyhow::Error), +} + +impl From<&str> for Error { + fn from(s: &str) -> Self { + Error::Unique(s.to_string()) + } +} + +impl From for Error { + fn from(s: String) -> Self { + Error::Unique(s) + } +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 000000000..d6e7c838d --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,8 @@ +pub mod builder; +pub mod cargo; +pub mod cli; +pub mod config; +pub mod develop; +pub mod error; +pub mod logging; +pub mod watch; diff --git a/src/logging.rs b/src/logging.rs new file mode 100644 index 000000000..94a9ce85b --- /dev/null +++ b/src/logging.rs @@ -0,0 +1,49 @@ +use fern::colors::{Color, ColoredLevelConfig}; +use log::debug; + +pub fn set_up_logging() { + // configure colors for the whole line + let colors_line = ColoredLevelConfig::new() + .error(Color::Red) + .warn(Color::Yellow) + // we actually don't need to specify the color for debug and info, they are white by default + .info(Color::White) + .debug(Color::White) + // depending on the terminals color scheme, this is the same as the background color + .trace(Color::BrightBlack); + + // configure colors for the name of the level. + // since almost all of them are the same as the color for the whole line, we + // just clone `colors_line` and overwrite our changes + let colors_level = colors_line.clone().info(Color::Green); + // here we set up our fern Dispatch + fern::Dispatch::new() + .format(move |out, message, record| { + out.finish(format_args!( + "{color_line}[{level}{color_line}] {message}\x1B[0m", + color_line = format_args!( + "\x1B[{}m", + colors_line.get_color(&record.level()).to_fg_str() + ), + level = colors_level.color(record.level()), + message = message, + )); + }) + // set the default log level. to filter out verbose log messages from dependencies, set + // this to Warn and overwrite the log level for your crate. + .level(log::LevelFilter::Info) + // .level(log::LevelFilter::Warn) + // change log levels for individual modules. Note: This looks for the record's target + // field which defaults to the module path but can be overwritten with the `target` + // parameter: + // `info!(target="special_target", "This log message is about special_target");` + // .level_for("dioxus", log::LevelFilter::Debug) + // .level_for("dioxus", log::LevelFilter::Info) + // .level_for("pretty_colored", log::LevelFilter::Trace) + // output to stdout + .chain(std::io::stdout()) + .apply() + .unwrap(); + + debug!("finished setting up logging! yay!"); +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 000000000..7a5df372c --- /dev/null +++ b/src/main.rs @@ -0,0 +1,28 @@ +use diopack::cli::{LaunchCommand, LaunchOptions}; +use dioxus_cli as diopack; + +#[async_std::main] +async fn main() -> diopack::error::Result<()> { + diopack::logging::set_up_logging(); + + let opts: LaunchOptions = argh::from_env(); + let mut config = diopack::config::Config::new()?; + + match opts.command { + LaunchCommand::Build(options) => { + config.with_build_options(&options); + diopack::builder::build(&config, &(options.into()))?; + } + + LaunchCommand::Develop(options) => { + config.with_develop_options(&options); + diopack::develop::start(&config, &(options.into())).await?; + } + + _ => { + todo!("Command not currently implemented"); + } + } + + Ok(()) +} diff --git a/src/watch.rs b/src/watch.rs new file mode 100644 index 000000000..ae39bc670 --- /dev/null +++ b/src/watch.rs @@ -0,0 +1,11 @@ +pub struct Watcher {} + +impl Watcher { + // Spawns a new notify instance that alerts us of changes + pub fn new() -> Self { + Self {} + } + + /// Subsribe to the watcher + pub fn subscribe() {} +} From 7a67964a2fdd81563633635d62f8e3d2e60e0c95 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 7 Jul 2021 16:54:40 -0400 Subject: [PATCH 002/330] wip: rename docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf2e3310a..fc1e5796b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-

📦✨ dioxus-cli

+

📦✨ dioxus-Studio

Tooling to supercharge dioxus projects

From e2a4efeb9ee9ee9d50238514ef7f98eca90a07d4 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 23 Sep 2021 13:33:22 -0400 Subject: [PATCH 003/330] wip: bump versions --- Cargo.toml | 6 +++--- src/develop.rs | 6 +++--- src/main.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 299a26ae6..b57f28140 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,13 +11,13 @@ description = "CLI tool for developing, testing, and publishing Dioxus apps" [dependencies] thiserror = "1.0.23" log = "0.4.13" -fern = { version="0.6.0", features=["colored"] } -wasm-bindgen-cli-support = "0.2.73" +fern = { version = "0.6.0", features = ["colored"] } +wasm-bindgen-cli-support = "0.2.78" anyhow = "1.0.38" argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" -async-std = { version="1.9.0", features=["attributes"] } +async-std = { version = "1.9.0", features = ["attributes"] } tide = "0.15.0" fs_extra = "1.2.0" diff --git a/src/develop.rs b/src/develop.rs index 1ae016b0d..48565e311 100644 --- a/src/develop.rs +++ b/src/develop.rs @@ -40,7 +40,7 @@ async fn watch_directory(config: Config) -> Result<()> { // Automatically select the best implementation for your platform. // You can also access each implementation directly e.g. INotifyWatcher. - let mut watcher: RecommendedWatcher = Watcher::new_immediate(move |res| { + let mut watcher: RecommendedWatcher = Watcher::new(move |res| { async_std::task::block_on(watcher_tx.send(res)); }) .expect("failed to make watcher"); @@ -50,11 +50,11 @@ async fn watch_directory(config: Config) -> Result<()> { // Add a path to be watched. All files and directories at that path and // below will be monitored for changes. watcher - .watch(src_dir.join("src"), RecursiveMode::Recursive) + .watch(&src_dir.join("src"), RecursiveMode::Recursive) .expect("Failed to watch dir"); watcher - .watch(src_dir.join("examples"), RecursiveMode::Recursive) + .watch(&src_dir.join("examples"), RecursiveMode::Recursive) .expect("Failed to watch dir"); let build_config = BuildConfig::default(); diff --git a/src/main.rs b/src/main.rs index 7a5df372c..8b7ce240d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ -use diopack::cli::{LaunchCommand, LaunchOptions}; -use dioxus_cli as diopack; +use dioxus_studio as diopack; +use dioxus_studio::cli::{LaunchCommand, LaunchOptions}; #[async_std::main] async fn main() -> diopack::error::Result<()> { From f81183e2a6bd12224afa840a233b3fbbeb38c164 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sun, 10 Oct 2021 15:42:16 -0400 Subject: [PATCH 004/330] feat: remove tailwind from tempalte --- src/builder.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 1d06b3ae8..6b61c8665 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -127,10 +127,6 @@ fn gen_page(module: &str) -> String { - @@ -138,6 +134,7 @@ fn gen_page(module: &str) -> String { import init from "{}"; init("./wasm/module_bg.wasm"); +
"#, From 0966653630a5b2ee06fd4a66f98e3c5b4196aa25 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 29 Dec 2021 11:57:30 -0500 Subject: [PATCH 005/330] docs: fix readme --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fc1e5796b..9f436199c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # About --- -dioxus-cli (inspired by wasm-pack and webpack) is a tool to help get dioxus projects off the ground. It handles all the build, development, bundling, and publishing to make web development just a simple two commands: `cargo init` and `dioxus-cli publish`. +dioxus-studio (inspired by wasm-pack and webpack) is a tool to help get dioxus projects off the ground. It handles all the build, development, bundling, and publishing to make web development just a simple two commands: `cargo init` and `dioxus-cli publish`. Best thing: - No NPM. @@ -18,6 +18,17 @@ Best thing: - No rollup - No ESLint + +## Visual Studio +Dioxus Studio features a command-line driven visual interface to manage your project. It's a great way to get started with dioxus projects. + +To start the visual environment, simply type `dioxus studio` in your terminal. + +From there, you can explore all the options to build, bundle, and deploy your app. + + +## Features + Just install Rust, dioxus-cli, and you're good to go. `cargo install --git github.com/jkelleyrtp/dioxus-cli` @@ -33,12 +44,12 @@ Need to benchmark a component? Need to test your code? `dioxus test` +Need to convert some html into rsx? +`dioxus convert file.html >> file.rs` + Need to build your code into a bundle? `dioxus build --outdir public` -Need to publish your code to GitHub pages, Netlify, etc? -`dioxus publish --ghpages myrepo.git` - # Use in your project --- Sometimes you'll want to include static assets without bundling them into your .wasm content. dioxus-cli provides a few ways of doing this: From 5fdb14446bb88cddd89179e909081d757204c924 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 29 Dec 2021 12:03:18 -0500 Subject: [PATCH 006/330] wip: studio upgrades --- .vscode/settings.json | 4 +- Cargo.toml | 9 +- src/builder.rs | 26 ++++-- src/cli.rs | 45 ++++++++-- src/config.rs | 5 +- src/develop.rs | 76 ++++++++++++----- src/err.html | 19 +++++ src/error.rs | 3 + src/lib.rs | 29 +++++-- src/logging.rs | 2 - src/main.rs | 24 +----- src/studio.rs | 194 ++++++++++++++++++++++++++++++++++++++++++ src/translate.rs | 101 ++++++++++++++++++++++ tests/test.html | 32 +++++++ 14 files changed, 499 insertions(+), 70 deletions(-) create mode 100644 src/err.html create mode 100644 src/studio.rs create mode 100644 src/translate.rs create mode 100644 tests/test.html diff --git a/.vscode/settings.json b/.vscode/settings.json index 80f51cff8..1c68f97cc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "rust-analyzer.inlayHints.enable": false -} \ No newline at end of file + "rust-analyzer.inlayHints.enable": true +} diff --git a/Cargo.toml b/Cargo.toml index b57f28140..99d6ff539 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,14 +18,19 @@ argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" async-std = { version = "1.9.0", features = ["attributes"] } -tide = "0.15.0" +tide = "0.16.0" fs_extra = "1.2.0" -cargo_toml = "0.8.1" +cargo_toml = "0.10.0" futures = "0.3.12" notify = "5.0.0-pre.4" rjdebounce = "0.2.1" tempfile = "3.2.0" +html_parser = "0.6.2" + +tui = { version = "0.15.0", features = ["crossterm"] } +crossterm = "0.19.0" +tui-template = { git = "https://github.com/jkelleyrtp/tui-builder.git" } [[bin]] diff --git a/src/builder.rs b/src/builder.rs index 6b61c8665..83a6d1de5 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1,10 +1,13 @@ use crate::{ cli::BuildOptions, - config::{Config, ExecutableType}, - error::Result, + config::{CrateConfig, ExecutableType}, + error::{Error, Result}, }; use log::{info, warn}; -use std::{io::Write, process::Command}; +use std::{ + io::{Read, Write}, + process::Command, +}; use wasm_bindgen_cli_support::Bindgen; pub struct BuildConfig {} @@ -19,7 +22,7 @@ impl Default for BuildConfig { } } -pub fn build(config: &Config, _build_config: &BuildConfig) -> Result<()> { +pub fn build(config: &CrateConfig, _build_config: &BuildConfig) -> Result<()> { /* [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) [2] Generate the appropriate build folders @@ -28,7 +31,7 @@ pub fn build(config: &Config, _build_config: &BuildConfig) -> Result<()> { [5] Link up the html page to the wasm module */ - let Config { + let CrateConfig { out_dir, crate_dir, target_dir, @@ -60,9 +63,16 @@ pub fn build(config: &Config, _build_config: &BuildConfig) -> Result<()> { }; let mut child = cmd.spawn()?; - let _err_code = child.wait()?; + let output = child.wait()?; - info!("Build complete!"); + if output.success() { + info!("Build complete!"); + } else { + log::error!("Build failed!"); + let mut reason = String::new(); + child.stderr.unwrap().read_to_string(&mut reason)?; + return Err(Error::BuildFailed(reason)); + } // [2] Establish the output directory structure let bindgen_outdir = out_dir.join("wasm"); @@ -129,6 +139,8 @@ fn gen_page(module: &str) -> String { +
+
diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index f4b69d5d7..58d797485 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -13,8 +13,7 @@ pub struct Build { impl Build { pub fn build(self) -> anyhow::Result<()> { - - let mut crate_config = crate::CrateConfig::new()?; + let mut crate_config = crate::CrateConfig::new()?; // change the relase state. crate_config.with_release(self.build.release); @@ -23,4 +22,4 @@ impl Build { Ok(()) } -} \ No newline at end of file +} diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index feab0e61f..5736ebc19 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -67,6 +67,26 @@ pub struct ConfigOptsBuild { pub pattern_params: Option>, } +#[derive(Clone, Debug, Default, Deserialize, StructOpt)] +pub struct ConfigOptsServe { + /// The index HTML file to drive the bundling process [default: index.html] + #[structopt(parse(from_os_str))] + pub target: Option, + + /// Build in release mode [default: false] + #[structopt(long)] + #[serde(default)] + pub release: bool, + + /// The output dir for all final assets [default: dist] + #[structopt(short, long, parse(from_os_str))] + pub dist: Option, + + /// The public URL from which assets are to be served [default: /] + #[structopt(long, parse(from_str=parse_public_url))] + pub public_url: Option, +} + /// Ensure the given value for `--public-url` is formatted correctly. pub fn parse_public_url(val: &str) -> String { let prefix = if !val.starts_with('/') { "/" } else { "" }; diff --git a/src/cli/mod.rs b/src/cli/mod.rs index fa3bd2c77..32492459a 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -35,7 +35,6 @@ pub enum Commands { Translate(translate::Translate), // /// Build, watch & serve the Rust WASM app and all of its assets. Serve(serve::Serve), - // /// Clean output artifacts. // Clean(clean::Clean), diff --git a/src/cli/serve/develop.rs b/src/cli/serve/develop.rs index dd386b14e..27aba99ee 100644 --- a/src/cli/serve/develop.rs +++ b/src/cli/serve/develop.rs @@ -1,145 +1,145 @@ -use crate::{cli::DevelopOptions, config::CrateConfig, error::Result}; -use async_std::prelude::FutureExt; +// use crate::{cli::DevelopOptions, config::CrateConfig, error::Result}; +// use async_std::prelude::FutureExt; -use log::info; -use notify::{RecommendedWatcher, RecursiveMode, Watcher}; -use std::path::PathBuf; -use std::sync::atomic::AtomicBool; -use std::sync::Arc; -use tide::http::mime::HTML; -use tide::http::Mime; +// use log::info; +// use notify::{RecommendedWatcher, RecursiveMode, Watcher}; +// use std::path::PathBuf; +// use std::sync::atomic::AtomicBool; +// use std::sync::Arc; +// use tide::http::mime::HTML; +// use tide::http::Mime; -pub struct DevelopState { - // - reload_on_change: bool, -} +// pub struct DevelopState { +// // +// reload_on_change: bool, +// } -pub async fn develop(options: DevelopOptions) -> Result<()> { - // - log::info!("Starting development server 🚀"); - let mut cfg = CrateConfig::new()?; - cfg.with_develop_options(&options); +// pub async fn develop(options: DevelopOptions) -> Result<()> { +// // +// log::info!("Starting development server 🚀"); +// let mut cfg = CrateConfig::new()?; +// cfg.with_develop_options(&options); - let out_dir = cfg.out_dir.clone(); +// let out_dir = cfg.out_dir.clone(); - let is_err = Arc::new(AtomicBool::new(false)); +// let is_err = Arc::new(AtomicBool::new(false)); - // Spawn the server onto a seperate task - // This lets the task progress while we handle file updates - let server = async_std::task::spawn(launch_server(out_dir, is_err.clone())); - let watcher = async_std::task::spawn(watch_directory(cfg.clone(), is_err.clone())); +// // Spawn the server onto a seperate task +// // This lets the task progress while we handle file updates +// let server = async_std::task::spawn(launch_server(out_dir, is_err.clone())); +// let watcher = async_std::task::spawn(watch_directory(cfg.clone(), is_err.clone())); - match server.race(watcher).await { - Err(e) => log::warn!("Error running development server, {:?}", e), - _ => {} - } +// match server.race(watcher).await { +// Err(e) => log::warn!("Error running development server, {:?}", e), +// _ => {} +// } - Ok(()) -} +// Ok(()) +// } -async fn watch_directory(config: CrateConfig, is_err: ErrStatus) -> Result<()> { - // Create a channel to receive the events. - let (watcher_tx, watcher_rx) = async_std::channel::bounded(100); +// async fn watch_directory(config: CrateConfig, is_err: ErrStatus) -> Result<()> { +// // Create a channel to receive the events. +// let (watcher_tx, watcher_rx) = async_std::channel::bounded(100); - // Automatically select the best implementation for your platform. - // You can also access each implementation directly e.g. INotifyWatcher. - let mut watcher: RecommendedWatcher = Watcher::new(move |res| { - async_std::task::block_on(watcher_tx.send(res)); - // send an event - let _ = async_std::task::block_on(watcher_tx.send(res)); - }) - .expect("failed to make watcher"); +// // Automatically select the best implementation for your platform. +// // You can also access each implementation directly e.g. INotifyWatcher. +// let mut watcher: RecommendedWatcher = Watcher::new(move |res| { +// async_std::task::block_on(watcher_tx.send(res)); +// // send an event +// let _ = async_std::task::block_on(watcher_tx.send(res)); +// }) +// .expect("failed to make watcher"); - let src_dir = crate::cargo::crate_root()?; +// let src_dir = crate::cargo::crate_root()?; - // Add a path to be watched. All files and directories at that path and - // below will be monitored for changes. - watcher - .watch(&src_dir.join("src"), RecursiveMode::Recursive) - .expect("Failed to watch dir"); +// // Add a path to be watched. All files and directories at that path and +// // below will be monitored for changes. +// watcher +// .watch(&src_dir.join("src"), RecursiveMode::Recursive) +// .expect("Failed to watch dir"); - match watcher.watch(&src_dir.join("examples"), RecursiveMode::Recursive) { - Ok(_) => {} - Err(e) => log::warn!("Failed to watch examples dir, {:?}", e), - } +// match watcher.watch(&src_dir.join("examples"), RecursiveMode::Recursive) { +// Ok(_) => {} +// Err(e) => log::warn!("Failed to watch examples dir, {:?}", e), +// } - 'run: loop { - match crate::builder::build(&config) { - Ok(_) => { - is_err.store(false, std::sync::atomic::Ordering::Relaxed); - async_std::task::sleep(std::time::Duration::from_millis(500)).await; - } - Err(err) => is_err.store(true, std::sync::atomic::Ordering::Relaxed), - }; +// 'run: loop { +// match crate::builder::build(&config) { +// Ok(_) => { +// is_err.store(false, std::sync::atomic::Ordering::Relaxed); +// async_std::task::sleep(std::time::Duration::from_millis(500)).await; +// } +// Err(err) => is_err.store(true, std::sync::atomic::Ordering::Relaxed), +// }; - let mut msg = None; - loop { - let new_msg = watcher_rx.recv().await.unwrap().unwrap(); - if !watcher_rx.is_empty() { - msg = Some(new_msg); - break; - } - } +// let mut msg = None; +// loop { +// let new_msg = watcher_rx.recv().await.unwrap().unwrap(); +// if !watcher_rx.is_empty() { +// msg = Some(new_msg); +// break; +// } +// } - info!("File updated, rebuilding app"); - } - Ok(()) -} +// info!("File updated, rebuilding app"); +// } +// Ok(()) +// } -async fn launch_server(outdir: PathBuf, is_err: ErrStatus) -> Result<()> { - let _crate_dir = crate::cargo::crate_root()?; - let _workspace_dir = crate::cargo::workspace_root()?; +// async fn launch_server(outdir: PathBuf, is_err: ErrStatus) -> Result<()> { +// let _crate_dir = crate::cargo::crate_root()?; +// let _workspace_dir = crate::cargo::workspace_root()?; - let mut app = tide::with_state(ServerState::new(outdir.to_owned(), is_err)); +// let mut app = tide::with_state(ServerState::new(outdir.to_owned(), is_err)); - let file_path = format!("{}/index.html", outdir.display()); - log::info!("Serving {}", file_path); - let p = outdir.display().to_string(); +// let file_path = format!("{}/index.html", outdir.display()); +// log::info!("Serving {}", file_path); +// let p = outdir.display().to_string(); - app.at("/") - .get(|req: tide::Request| async move { - log::info!("Connected to development server"); - let state = req.state(); +// app.at("/") +// .get(|req: tide::Request| async move { +// log::info!("Connected to development server"); +// let state = req.state(); - match state.is_err.load(std::sync::atomic::Ordering::Relaxed) { - true => { - // - let mut resp = - tide::Body::from_string(format!(include_str!("../err.html"), err = "_")); - resp.set_mime(HTML); +// match state.is_err.load(std::sync::atomic::Ordering::Relaxed) { +// true => { +// // +// let mut resp = +// tide::Body::from_string(format!(include_str!("../err.html"), err = "_")); +// resp.set_mime(HTML); - Ok(resp) - } - false => { - Ok(tide::Body::from_file(state.serv_path.clone().join("index.html")).await?) - } - } - }) - .serve_dir(p)?; - // .serve_file(file_path) - // .unwrap(); +// Ok(resp) +// } +// false => { +// Ok(tide::Body::from_file(state.serv_path.clone().join("index.html")).await?) +// } +// } +// }) +// .serve_dir(p)?; +// // .serve_file(file_path) +// // .unwrap(); - let port = "8080"; - let serve_addr = format!("127.0.0.1:{}", port); +// let port = "8080"; +// let serve_addr = format!("127.0.0.1:{}", port); - info!("App available at http://{}/", serve_addr); - app.listen(serve_addr).await?; - Ok(()) -} +// info!("App available at http://{}/", serve_addr); +// app.listen(serve_addr).await?; +// Ok(()) +// } -/// https://github.com/http-rs/tide/blob/main/examples/state.rs -/// Tide seems to prefer using state instead of injecting into the app closure -/// The app closure needs to be static and -#[derive(Clone)] -struct ServerState { - serv_path: PathBuf, - is_err: ErrStatus, -} +// /// https://github.com/http-rs/tide/blob/main/examples/state.rs +// /// Tide seems to prefer using state instead of injecting into the app closure +// /// The app closure needs to be static and +// #[derive(Clone)] +// struct ServerState { +// serv_path: PathBuf, +// is_err: ErrStatus, +// } -type ErrStatus = Arc; +// type ErrStatus = Arc; -impl ServerState { - fn new(serv_path: PathBuf, is_err: ErrStatus) -> Self { - Self { serv_path, is_err } - } -} +// impl ServerState { +// fn new(serv_path: PathBuf, is_err: ErrStatus) -> Self { +// Self { serv_path, is_err } +// } +// } diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 9695870c0..36c050bd3 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,9 +1,36 @@ -use crate::cfg::ConfigOptsBuild; +use crate::{cfg::ConfigOptsServe, server}; use anyhow::Result; use std::path::PathBuf; +use std::io::Write; use structopt::StructOpt; -/// Build the Rust WASM app and all of its assets. +mod develop; + +/// Run the WASM project on dev-server #[derive(Clone, Debug, StructOpt)] #[structopt(name = "serve")] -pub struct Serve {} +pub struct Serve { + #[structopt(flatten)] + pub serve: ConfigOptsServe, +} + +impl Serve { + pub async fn serve(self) -> anyhow::Result<()> { + + let mut crate_config = crate::CrateConfig::new()?; + // change the relase state. + crate_config.with_release(self.serve.release); + + crate::builder::build(&crate_config).expect("build failed"); + + let serve_html = String::from(include_str!("../../server/serve.html")); + + let mut file = std::fs::File::create(crate_config.out_dir.join("index.html"))?; + file.write_all(serve_html.as_bytes())?; + + // start the develop server + server::startup(crate_config.clone()).await?; + + Ok(()) + } +} diff --git a/src/lib.rs b/src/lib.rs index ea8393484..d4d3d7953 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ pub mod builder; +pub mod server; pub use builder::*; pub mod cargo; @@ -16,4 +17,4 @@ pub use error::*; pub mod logging; pub use logging::*; -pub mod watch; \ No newline at end of file +pub mod watch; diff --git a/src/main.rs b/src/main.rs index 2ec44eb97..a58794783 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,30 +3,28 @@ use structopt::StructOpt; #[tokio::main] async fn main() -> Result<()> { - let args = Cli::from_args(); set_up_logging(); match args.action { Commands::Translate(opts) => { opts.translate(); - } - + } + Commands::Build(opts) => { opts.build(); } - // Commands::Clean(_) => { - // // - // } + // Commands::Clean(_) => { + // // + // } - // Commands::Config(_) => { - // // - // } - - Commands::Serve(_) => { - // - } + // Commands::Config(_) => { + // // + // } + Commands::Serve(opts) => { + opts.serve().await; + } } Ok(()) diff --git a/src/server/mod.rs b/src/server/mod.rs new file mode 100644 index 000000000..2e937dbb8 --- /dev/null +++ b/src/server/mod.rs @@ -0,0 +1,87 @@ +use axum::{ + extract::{ + ws::{Message, WebSocket}, + Extension, TypedHeader, WebSocketUpgrade, + }, + http::StatusCode, + response::IntoResponse, + routing::{get, get_service}, + AddExtensionLayer, Router, +}; +use notify::{watcher, Watcher, DebouncedEvent}; +use std::sync::{mpsc::channel, Arc, Mutex}; +use std::time::Duration; +use tower_http::services::ServeDir; + +use crate::{CrateConfig, builder}; + +struct WsRelodState { + update: bool, +} + +impl WsRelodState { fn change(&mut self) { self.update = !self.update } } + +pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { + + log::info!("Starting development server 🚀"); + + let (tx, rx) = channel(); + + let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap(); + watcher.watch(config.crate_dir.join("src").clone(), notify::RecursiveMode::Recursive).unwrap(); + + let ws_reload_state = Arc::new(Mutex::new(WsRelodState { update: false })); + + let watcher_conf = config.clone(); + let watcher_ws_state = ws_reload_state.clone(); + tokio::spawn(async move { + loop { + if let Ok(v) = rx.recv() { + match v { + DebouncedEvent::Create(_) | DebouncedEvent::Write(_) | + DebouncedEvent::Remove(_) | DebouncedEvent::Rename(_, _) => { + builder::build(&watcher_conf).unwrap(); + watcher_ws_state.lock().unwrap().change(); + }, + _ => {} + } + } + } + }); + + let app = Router::new() + .route("/ws", get(ws_handler)) + .fallback( + get_service(ServeDir::new(config.out_dir)).handle_error( + |error: std::io::Error| async move { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Unhandled internal error: {}", error), + ) + }, + ), + ) + .layer(AddExtensionLayer::new(ws_reload_state.clone())); + + let port = "8080"; + axum::Server::bind(&format!("0.0.0.0:{}", port).parse().unwrap()) + .serve(app.into_make_service()) + .await?; + + Ok(()) +} + +async fn ws_handler( + ws: WebSocketUpgrade, + _: Option>, + Extension(state): Extension>>, +) -> impl IntoResponse { + ws.on_upgrade(|mut socket| async move { + loop { + if state.lock().unwrap().update { + socket.send(Message::Text(String::from("reload"))).await.unwrap(); + state.lock().unwrap().change(); + } + } + }) +} diff --git a/src/server/serve.html b/src/server/serve.html new file mode 100644 index 000000000..98997403b --- /dev/null +++ b/src/server/serve.html @@ -0,0 +1,28 @@ + + + + + Dioxus-CLI Dev Server + + +
+ + + + + + + From d18a93f129132bd1ea59344fe757389eae603edc Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sat, 22 Jan 2022 22:19:59 +0800 Subject: [PATCH 022/330] fix: fixed warn info --- src/builder.rs | 24 +++++++++++------------- src/cli/build/mod.rs | 4 +--- src/cli/cfg.rs | 5 +---- src/cli/clean/mod.rs | 3 --- src/cli/mod.rs | 2 -- src/cli/serve/mod.rs | 2 -- src/cli/translate/to_component.rs | 1 + src/config.rs | 2 +- src/main.rs | 6 +++--- src/server/mod.rs | 11 ++++++----- src/server/serve.html | 27 +++++++++++++++++++-------- 11 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 89451e163..101d31ee5 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -3,7 +3,7 @@ use crate::{ error::{Error, Result}, }; use std::{ - io::{Read, Write}, + io::Write, process::Command, }; use wasm_bindgen_cli_support::Bindgen; @@ -29,14 +29,15 @@ pub fn build(config: &CrateConfig) -> Result<()> { let t_start = std::time::Instant::now(); // [1] Build the .wasm module - log::info!("Running build commands..."); + log::info!("🚅 Running build commands..."); let mut cmd = Command::new("cargo"); cmd.current_dir(&crate_dir) .arg("build") .arg("--target") .arg("wasm32-unknown-unknown") - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()); + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()) + ; if config.release { cmd.arg("--release"); @@ -48,16 +49,13 @@ pub fn build(config: &CrateConfig) -> Result<()> { ExecutableType::Example(name) => cmd.arg("--example").arg(name), }; - let mut child = cmd.spawn()?; + let output = cmd.output()?; - let output = child.wait()?; - - if output.success() { - log::info!("Build complete!"); + if output.status.success() { + std::io::stdout().write_all(&output.stdout).unwrap(); } else { log::error!("Build failed!"); - let mut reason = String::new(); - child.stderr.unwrap().read_to_string(&mut reason)?; + let reason = String::from_utf8_lossy(&output.stderr).to_string(); return Err(Error::BuildFailed(reason)); } @@ -98,8 +96,8 @@ pub fn build(config: &CrateConfig) -> Result<()> { // [5] Generate the html file with the module name // TODO: support names via options - log::info!("Writing to '{:#?}' directory...", out_dir); + // log::info!("Writing to '{:#?}' directory...", out_dir); let copy_options = fs_extra::dir::CopyOptions::new(); if static_dir.is_dir() { match fs_extra::dir::copy(static_dir, out_dir, ©_options) { @@ -111,7 +109,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { } let t_end = std::time::Instant::now(); - log::info!("Done in {}ms! 🎉", (t_end - t_start).as_millis()); + log::info!("🏁 Done in {}ms!", (t_end - t_start).as_millis()); Ok(()) } diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 58d797485..fc329a305 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,6 +1,4 @@ use crate::cfg::ConfigOptsBuild; -use anyhow::Result; -use std::path::PathBuf; use structopt::StructOpt; /// Build the Rust WASM app and all of its assets. @@ -18,7 +16,7 @@ impl Build { // change the relase state. crate_config.with_release(self.build.release); - crate::builder::build(&crate_config); + crate::builder::build(&crate_config)?; Ok(()) } diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 5736ebc19..2c5f42a26 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -1,11 +1,8 @@ -use anyhow::Result; use std::path::PathBuf; use structopt::StructOpt; -use serde::{Deserialize, Serialize}; +use serde::Deserialize; use std::collections::HashMap; -use std::str::FromStr; -use std::sync::Arc; /// Config options for the build system. #[derive(Clone, Debug, Default, Deserialize, StructOpt)] diff --git a/src/cli/clean/mod.rs b/src/cli/clean/mod.rs index aeeedf523..1edcd053a 100644 --- a/src/cli/clean/mod.rs +++ b/src/cli/clean/mod.rs @@ -1,6 +1,3 @@ -use crate::cfg::ConfigOptsBuild; -use anyhow::Result; -use std::path::PathBuf; use structopt::StructOpt; /// Build the Rust WASM app and all of its assets. diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 32492459a..a739f9a01 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -1,5 +1,3 @@ -use anyhow::{Context, Result}; -use std::path::PathBuf; use structopt::StructOpt; pub mod build; diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 36c050bd3..f2ac2b69f 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,6 +1,4 @@ use crate::{cfg::ConfigOptsServe, server}; -use anyhow::Result; -use std::path::PathBuf; use std::io::Write; use structopt::StructOpt; diff --git a/src/cli/translate/to_component.rs b/src/cli/translate/to_component.rs index b08161e9c..d64854d37 100644 --- a/src/cli/translate/to_component.rs +++ b/src/cli/translate/to_component.rs @@ -20,6 +20,7 @@ pub fn convert_html_to_component(html: &str) -> Result { }) } +#[allow(dead_code)] pub struct ComponentRenderer { dom: Dom, icon_index: usize, diff --git a/src/config.rs b/src/config.rs index 47920c583..d17294b18 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,5 @@ use crate::error::Result; -use std::{io::Write, path::PathBuf, process::Command}; +use std::path::PathBuf; #[derive(Debug, Clone)] pub struct CrateConfig { diff --git a/src/main.rs b/src/main.rs index a58794783..41fa5835b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,11 +8,11 @@ async fn main() -> Result<()> { match args.action { Commands::Translate(opts) => { - opts.translate(); + opts.translate()?; } Commands::Build(opts) => { - opts.build(); + opts.build()?; } // Commands::Clean(_) => { @@ -23,7 +23,7 @@ async fn main() -> Result<()> { // // // } Commands::Serve(opts) => { - opts.serve().await; + opts.serve().await?; } } diff --git a/src/server/mod.rs b/src/server/mod.rs index 2e937dbb8..6c6c08c1f 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,6 +1,6 @@ use axum::{ extract::{ - ws::{Message, WebSocket}, + ws::Message, Extension, TypedHeader, WebSocketUpgrade, }, http::StatusCode, @@ -19,11 +19,11 @@ struct WsRelodState { update: bool, } -impl WsRelodState { fn change(&mut self) { self.update = !self.update } } +impl WsRelodState { fn change(&mut self) { self.update = !self.update; } } pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { - log::info!("Starting development server 🚀"); + log::info!("🚀 Starting development server..."); let (tx, rx) = channel(); @@ -40,8 +40,9 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { match v { DebouncedEvent::Create(_) | DebouncedEvent::Write(_) | DebouncedEvent::Remove(_) | DebouncedEvent::Rename(_, _) => { - builder::build(&watcher_conf).unwrap(); - watcher_ws_state.lock().unwrap().change(); + if let Ok(_) = builder::build(&watcher_conf) { + watcher_ws_state.lock().unwrap().change(); + } }, _ => {} } diff --git a/src/server/serve.html b/src/server/serve.html index 98997403b..b5268bd68 100644 --- a/src/server/serve.html +++ b/src/server/serve.html @@ -14,15 +14,26 @@ From 0e2c05be66fc994ad8ac2e03b34c0e48632c3296 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 23 Jan 2022 01:29:36 +0800 Subject: [PATCH 023/330] feat: add `init` command --- README.md | 5 +- src/builder.rs | 8 +- src/cli/init/mod.rs | 61 +++++++++++++ src/cli/mod.rs | 8 +- src/cli/serve/develop.rs | 145 ------------------------------ src/cli/serve/events.rs | 0 src/cli/serve/mod.rs | 3 - src/cli/translate/to_component.rs | 1 + src/lib.rs | 4 +- src/main.rs | 18 +++- src/{ => server}/err.html | 0 src/server/mod.rs | 64 +++++++------ src/template/config.toml | 9 ++ src/template/default.rs | 16 ++++ src/watch.rs | 1 - 15 files changed, 151 insertions(+), 192 deletions(-) create mode 100644 src/cli/init/mod.rs delete mode 100644 src/cli/serve/develop.rs delete mode 100644 src/cli/serve/events.rs rename src/{ => server}/err.html (100%) create mode 100644 src/template/config.toml create mode 100644 src/template/default.rs delete mode 100644 src/watch.rs diff --git a/README.md b/README.md index 34be58eda..75e05b3cf 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ # About -dioxus-studio (inspired by wasm-pack and webpack) is a tool to help get dioxus projects off the ground. It handles all the build, development, bundling, and publishing to make web development simple. +dioxus-cli (inspired by wasm-pack and webpack) is a tool to help get dioxus projects off the ground. It handles all the build, development, bundling, and publishing to make web development simple. ## Installation @@ -19,5 +19,4 @@ dioxus-studio (inspired by wasm-pack and webpack) is a tool to help get dioxus p $ cargo install dioxus-cli ``` -Now, `dioxus` is in your path. - +Now, `dioxus` is in your path. \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index 101d31ee5..24d9c3151 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -2,10 +2,7 @@ use crate::{ config::{CrateConfig, ExecutableType}, error::{Error, Result}, }; -use std::{ - io::Write, - process::Command, -}; +use std::{io::Write, process::Command}; use wasm_bindgen_cli_support::Bindgen; pub fn build(config: &CrateConfig) -> Result<()> { @@ -36,8 +33,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { .arg("--target") .arg("wasm32-unknown-unknown") .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()) - ; + .stderr(std::process::Stdio::inherit()); if config.release { cmd.arg("--release"); diff --git a/src/cli/init/mod.rs b/src/cli/init/mod.rs new file mode 100644 index 000000000..2325d9c31 --- /dev/null +++ b/src/cli/init/mod.rs @@ -0,0 +1,61 @@ +use std::{process::{Command, Stdio}, fs::File, path::PathBuf, io::Write}; + +use structopt::StructOpt; + +use crate::{error::{Error, Result}, cargo}; + +/// Build the Rust WASM app and all of its assets. +#[derive(Clone, Debug, StructOpt)] +#[structopt(name = "init")] +pub struct Init { + + /// Init project path + #[structopt(default_value = ".")] + path: String, + + /// Template path + #[structopt(default_value = "default", long)] + template: String, + +} + +impl Init { + pub fn init(self) -> Result<()> { + + log::info!("🔧 Start to init a new project '{}'.", self.path); + + let project_path = PathBuf::from(&self.path); + + let output = Command::new("cargo") + .arg("init") + .arg(&self.path) + .arg("--bin") + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .output()? + ; + + if !output.status.success() { + return Err(Error::CargoError("Cargo init failed".into())); + } + + // get the template code + let template_str = match self.template { + _ => include_str!("../../template/default.rs"), + }; + + let main_rs_file = project_path.join("src").join("main.rs"); + if !main_rs_file.is_file() { + return Err(Error::FailedToWrite); + } + + let mut file = File::create(main_rs_file)?; + file.write_all(&template_str.as_bytes())?; + + // log::info!("🎯 Project initialization completed."); + + + + Ok(()) + } +} \ No newline at end of file diff --git a/src/cli/mod.rs b/src/cli/mod.rs index a739f9a01..ddc55d5c4 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -5,6 +5,7 @@ pub mod cfg; pub mod clean; pub mod serve; pub mod translate; +pub mod init; /// Build, bundle, & ship your Dioxus app. /// @@ -27,12 +28,15 @@ pub struct Cli { #[derive(StructOpt)] pub enum Commands { - // /// Build the Rust WASM app and all of its assets. + /// Build the Rust WASM app and all of its assets. Build(build::Build), /// Translate some source file into Dioxus code. Translate(translate::Translate), - // /// Build, watch & serve the Rust WASM app and all of its assets. + /// Build, watch & serve the Rust WASM app and all of its assets. Serve(serve::Serve), + /// Init a new project for Dioxus. + Init(init::Init), + // /// Clean output artifacts. // Clean(clean::Clean), diff --git a/src/cli/serve/develop.rs b/src/cli/serve/develop.rs deleted file mode 100644 index 27aba99ee..000000000 --- a/src/cli/serve/develop.rs +++ /dev/null @@ -1,145 +0,0 @@ -// use crate::{cli::DevelopOptions, config::CrateConfig, error::Result}; -// use async_std::prelude::FutureExt; - -// use log::info; -// use notify::{RecommendedWatcher, RecursiveMode, Watcher}; -// use std::path::PathBuf; -// use std::sync::atomic::AtomicBool; -// use std::sync::Arc; -// use tide::http::mime::HTML; -// use tide::http::Mime; - -// pub struct DevelopState { -// // -// reload_on_change: bool, -// } - -// pub async fn develop(options: DevelopOptions) -> Result<()> { -// // -// log::info!("Starting development server 🚀"); -// let mut cfg = CrateConfig::new()?; -// cfg.with_develop_options(&options); - -// let out_dir = cfg.out_dir.clone(); - -// let is_err = Arc::new(AtomicBool::new(false)); - -// // Spawn the server onto a seperate task -// // This lets the task progress while we handle file updates -// let server = async_std::task::spawn(launch_server(out_dir, is_err.clone())); -// let watcher = async_std::task::spawn(watch_directory(cfg.clone(), is_err.clone())); - -// match server.race(watcher).await { -// Err(e) => log::warn!("Error running development server, {:?}", e), -// _ => {} -// } - -// Ok(()) -// } - -// async fn watch_directory(config: CrateConfig, is_err: ErrStatus) -> Result<()> { -// // Create a channel to receive the events. -// let (watcher_tx, watcher_rx) = async_std::channel::bounded(100); - -// // Automatically select the best implementation for your platform. -// // You can also access each implementation directly e.g. INotifyWatcher. -// let mut watcher: RecommendedWatcher = Watcher::new(move |res| { -// async_std::task::block_on(watcher_tx.send(res)); -// // send an event -// let _ = async_std::task::block_on(watcher_tx.send(res)); -// }) -// .expect("failed to make watcher"); - -// let src_dir = crate::cargo::crate_root()?; - -// // Add a path to be watched. All files and directories at that path and -// // below will be monitored for changes. -// watcher -// .watch(&src_dir.join("src"), RecursiveMode::Recursive) -// .expect("Failed to watch dir"); - -// match watcher.watch(&src_dir.join("examples"), RecursiveMode::Recursive) { -// Ok(_) => {} -// Err(e) => log::warn!("Failed to watch examples dir, {:?}", e), -// } - -// 'run: loop { -// match crate::builder::build(&config) { -// Ok(_) => { -// is_err.store(false, std::sync::atomic::Ordering::Relaxed); -// async_std::task::sleep(std::time::Duration::from_millis(500)).await; -// } -// Err(err) => is_err.store(true, std::sync::atomic::Ordering::Relaxed), -// }; - -// let mut msg = None; -// loop { -// let new_msg = watcher_rx.recv().await.unwrap().unwrap(); -// if !watcher_rx.is_empty() { -// msg = Some(new_msg); -// break; -// } -// } - -// info!("File updated, rebuilding app"); -// } -// Ok(()) -// } - -// async fn launch_server(outdir: PathBuf, is_err: ErrStatus) -> Result<()> { -// let _crate_dir = crate::cargo::crate_root()?; -// let _workspace_dir = crate::cargo::workspace_root()?; - -// let mut app = tide::with_state(ServerState::new(outdir.to_owned(), is_err)); - -// let file_path = format!("{}/index.html", outdir.display()); -// log::info!("Serving {}", file_path); -// let p = outdir.display().to_string(); - -// app.at("/") -// .get(|req: tide::Request| async move { -// log::info!("Connected to development server"); -// let state = req.state(); - -// match state.is_err.load(std::sync::atomic::Ordering::Relaxed) { -// true => { -// // -// let mut resp = -// tide::Body::from_string(format!(include_str!("../err.html"), err = "_")); -// resp.set_mime(HTML); - -// Ok(resp) -// } -// false => { -// Ok(tide::Body::from_file(state.serv_path.clone().join("index.html")).await?) -// } -// } -// }) -// .serve_dir(p)?; -// // .serve_file(file_path) -// // .unwrap(); - -// let port = "8080"; -// let serve_addr = format!("127.0.0.1:{}", port); - -// info!("App available at http://{}/", serve_addr); -// app.listen(serve_addr).await?; -// Ok(()) -// } - -// /// https://github.com/http-rs/tide/blob/main/examples/state.rs -// /// Tide seems to prefer using state instead of injecting into the app closure -// /// The app closure needs to be static and -// #[derive(Clone)] -// struct ServerState { -// serv_path: PathBuf, -// is_err: ErrStatus, -// } - -// type ErrStatus = Arc; - -// impl ServerState { -// fn new(serv_path: PathBuf, is_err: ErrStatus) -> Self { -// Self { serv_path, is_err } -// } -// } diff --git a/src/cli/serve/events.rs b/src/cli/serve/events.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index f2ac2b69f..d6287f07d 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -2,8 +2,6 @@ use crate::{cfg::ConfigOptsServe, server}; use std::io::Write; use structopt::StructOpt; -mod develop; - /// Run the WASM project on dev-server #[derive(Clone, Debug, StructOpt)] #[structopt(name = "serve")] @@ -14,7 +12,6 @@ pub struct Serve { impl Serve { pub async fn serve(self) -> anyhow::Result<()> { - let mut crate_config = crate::CrateConfig::new()?; // change the relase state. crate_config.with_release(self.serve.release); diff --git a/src/cli/translate/to_component.rs b/src/cli/translate/to_component.rs index d64854d37..972da7a25 100644 --- a/src/cli/translate/to_component.rs +++ b/src/cli/translate/to_component.rs @@ -4,6 +4,7 @@ //! - [ ] Extracts svgs //! - [ ] Attempts to extract lists +#[allow(unused_imports)] use std::{ fmt::{Display, Formatter}, io::Write, diff --git a/src/lib.rs b/src/lib.rs index d4d3d7953..15c10a3b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,6 +15,4 @@ pub mod error; pub use error::*; pub mod logging; -pub use logging::*; - -pub mod watch; +pub use logging::*; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 41fa5835b..69636c6e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,11 +8,15 @@ async fn main() -> Result<()> { match args.action { Commands::Translate(opts) => { - opts.translate()?; + if let Err(e) = opts.translate() { + log::error!("translate error: {}", e); + } } Commands::Build(opts) => { - opts.build()?; + if let Err(e) = opts.build() { + log::error!("build error: {}", e); + } } // Commands::Clean(_) => { @@ -23,7 +27,15 @@ async fn main() -> Result<()> { // // // } Commands::Serve(opts) => { - opts.serve().await?; + if let Err(e) = opts.serve().await { + log::error!("serve error: {}", e); + } + } + + Commands::Init(opts) => { + if let Err(e) = opts.init() { + log::error!("init error: {}", e); + } } } diff --git a/src/err.html b/src/server/err.html similarity index 100% rename from src/err.html rename to src/server/err.html diff --git a/src/server/mod.rs b/src/server/mod.rs index 6c6c08c1f..7c0713c8d 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,34 +1,40 @@ use axum::{ - extract::{ - ws::Message, - Extension, TypedHeader, WebSocketUpgrade, - }, + extract::{ws::Message, Extension, TypedHeader, WebSocketUpgrade}, http::StatusCode, response::IntoResponse, routing::{get, get_service}, AddExtensionLayer, Router, }; -use notify::{watcher, Watcher, DebouncedEvent}; +use notify::{watcher, DebouncedEvent, Watcher}; use std::sync::{mpsc::channel, Arc, Mutex}; use std::time::Duration; use tower_http::services::ServeDir; -use crate::{CrateConfig, builder}; +use crate::{builder, CrateConfig}; struct WsRelodState { update: bool, } -impl WsRelodState { fn change(&mut self) { self.update = !self.update; } } +impl WsRelodState { + fn change(&mut self) { + self.update = !self.update; + } +} pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { - log::info!("🚀 Starting development server..."); - + let (tx, rx) = channel(); + // file watcher: check file change let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap(); - watcher.watch(config.crate_dir.join("src").clone(), notify::RecursiveMode::Recursive).unwrap(); + watcher + .watch( + config.crate_dir.join("src").clone(), + notify::RecursiveMode::Recursive, + ) + .unwrap(); let ws_reload_state = Arc::new(Mutex::new(WsRelodState { update: false })); @@ -38,37 +44,40 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { loop { if let Ok(v) = rx.recv() { match v { - DebouncedEvent::Create(_) | DebouncedEvent::Write(_) | - DebouncedEvent::Remove(_) | DebouncedEvent::Rename(_, _) => { + DebouncedEvent::Create(_) + | DebouncedEvent::Write(_) + | DebouncedEvent::Remove(_) + | DebouncedEvent::Rename(_, _) => { if let Ok(_) = builder::build(&watcher_conf) { + // change the websocket reload state to true; + // the page will auto-reload. watcher_ws_state.lock().unwrap().change(); } - }, + } _ => {} } } - } + } }); let app = Router::new() .route("/ws", get(ws_handler)) - .fallback( - get_service(ServeDir::new(config.out_dir)).handle_error( - |error: std::io::Error| async move { - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Unhandled internal error: {}", error), - ) - }, - ), - ) + .fallback(get_service(ServeDir::new(config.out_dir)).handle_error( + |error: std::io::Error| async move { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Unhandled internal error: {}", error), + ) + }, + )) .layer(AddExtensionLayer::new(ws_reload_state.clone())); + // start serve dev-server at 0.0.0.0:8080 let port = "8080"; + log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); axum::Server::bind(&format!("0.0.0.0:{}", port).parse().unwrap()) .serve(app.into_make_service()) .await?; - Ok(()) } @@ -80,7 +89,10 @@ async fn ws_handler( ws.on_upgrade(|mut socket| async move { loop { if state.lock().unwrap().update { - socket.send(Message::Text(String::from("reload"))).await.unwrap(); + socket + .send(Message::Text(String::from("reload"))) + .await + .unwrap(); state.lock().unwrap().change(); } } diff --git a/src/template/config.toml b/src/template/config.toml new file mode 100644 index 000000000..4c6c2be9c --- /dev/null +++ b/src/template/config.toml @@ -0,0 +1,9 @@ +[package] +name = "{project}" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +dioxus = { version = "0.1.7", features = ["web"] } diff --git a/src/template/default.rs b/src/template/default.rs new file mode 100644 index 000000000..c0fa412ea --- /dev/null +++ b/src/template/default.rs @@ -0,0 +1,16 @@ +use dioxus::prelude::*; + +fn main() { + dioxus::desktop::launch(app); +} + +fn app(cx: Scope) -> Element { + cx.render(rsx! ( + div { + style: "text-align: center;", + h2 { "🌗🚀 Dioxus" } + p { strong { "Frontend that scales." } } + p { "Dioxus is a portable, performant, and ergonomic framework for building cross-platform user interfaces in Rust." } + } + )) +} diff --git a/src/watch.rs b/src/watch.rs deleted file mode 100644 index 8b1378917..000000000 --- a/src/watch.rs +++ /dev/null @@ -1 +0,0 @@ - From 5395e7693c05caf5446a1cc6671de7e870366569 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 23 Jan 2022 10:54:24 +0800 Subject: [PATCH 024/330] fix: `dist` setting --- src/builder.rs | 9 +++++---- src/cli/build/mod.rs | 7 ++++++- src/cli/init/mod.rs | 38 +++++++++++++++++++++++++++++--------- src/cli/mod.rs | 3 +-- src/cli/serve/mod.rs | 11 +++++++---- src/lib.rs | 2 +- src/server/mod.rs | 13 ++++++++++--- src/template/config.toml | 2 +- src/template/default.rs | 2 +- 9 files changed, 61 insertions(+), 26 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 24d9c3151..aad275ff2 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -2,10 +2,10 @@ use crate::{ config::{CrateConfig, ExecutableType}, error::{Error, Result}, }; -use std::{io::Write, process::Command}; +use std::{io::Write, path::PathBuf, process::Command}; use wasm_bindgen_cli_support::Bindgen; -pub fn build(config: &CrateConfig) -> Result<()> { +pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { /* [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) [2] Generate the appropriate build folders @@ -15,7 +15,6 @@ pub fn build(config: &CrateConfig) -> Result<()> { */ let CrateConfig { - out_dir, crate_dir, target_dir, static_dir, @@ -23,10 +22,12 @@ pub fn build(config: &CrateConfig) -> Result<()> { .. } = config; + let out_dir = crate_dir.join(dist); + let t_start = std::time::Instant::now(); // [1] Build the .wasm module - log::info!("🚅 Running build commands..."); + log::info!("🚅 Running build command..."); let mut cmd = Command::new("cargo"); cmd.current_dir(&crate_dir) .arg("build") diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index fc329a305..760c2fd8e 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use crate::cfg::ConfigOptsBuild; use structopt::StructOpt; @@ -16,7 +18,10 @@ impl Build { // change the relase state. crate_config.with_release(self.build.release); - crate::builder::build(&crate_config)?; + crate::builder::build( + &crate_config, + self.build.dist.unwrap_or(PathBuf::from("dist")), + )?; Ok(()) } diff --git a/src/cli/init/mod.rs b/src/cli/init/mod.rs index 2325d9c31..dde0ccca3 100644 --- a/src/cli/init/mod.rs +++ b/src/cli/init/mod.rs @@ -1,14 +1,18 @@ -use std::{process::{Command, Stdio}, fs::File, path::PathBuf, io::Write}; +use std::{ + fs::{File, OpenOptions}, + io::Write, + path::PathBuf, + process::{Command, Stdio}, +}; use structopt::StructOpt; -use crate::{error::{Error, Result}, cargo}; +use crate::error::{Error, Result}; /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, StructOpt)] #[structopt(name = "init")] pub struct Init { - /// Init project path #[structopt(default_value = ".")] path: String, @@ -16,24 +20,26 @@ pub struct Init { /// Template path #[structopt(default_value = "default", long)] template: String, - } impl Init { pub fn init(self) -> Result<()> { - log::info!("🔧 Start to init a new project '{}'.", self.path); let project_path = PathBuf::from(&self.path); + if project_path.join("Cargo.toml").is_file() { + log::warn!("Path '{}' is initialized.", self.path); + return Ok(()); + } + let output = Command::new("cargo") .arg("init") .arg(&self.path) .arg("--bin") .stdout(Stdio::piped()) .stderr(Stdio::piped()) - .output()? - ; + .output()?; if !output.status.success() { return Err(Error::CargoError("Cargo init failed".into())); @@ -54,8 +60,22 @@ impl Init { // log::info!("🎯 Project initialization completed."); - + if !Command::new("cargo") + .args(["add", "dioxus", "--features web"]) + .output()? + .status + .success() + { + let mut file = OpenOptions::new() + .append(true) + .open(project_path.join("Cargo.toml"))?; + file.write_all("dioxus = { version = \"0.1.7\", features = [\"web\"] }".as_bytes())?; + } + + log::info!("\n💡 Project initialized:"); + log::info!("🎯> cd {}", self.path); + log::info!("🎯> dioxus serve"); Ok(()) } -} \ No newline at end of file +} diff --git a/src/cli/mod.rs b/src/cli/mod.rs index ddc55d5c4..93cbfef28 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -3,9 +3,9 @@ use structopt::StructOpt; pub mod build; pub mod cfg; pub mod clean; +pub mod init; pub mod serve; pub mod translate; -pub mod init; /// Build, bundle, & ship your Dioxus app. /// @@ -36,7 +36,6 @@ pub enum Commands { Serve(serve::Serve), /// Init a new project for Dioxus. Init(init::Init), - // /// Clean output artifacts. // Clean(clean::Clean), diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index d6287f07d..586d49b7c 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,5 +1,5 @@ use crate::{cfg::ConfigOptsServe, server}; -use std::io::Write; +use std::{io::Write, path::PathBuf}; use structopt::StructOpt; /// Run the WASM project on dev-server @@ -16,15 +16,18 @@ impl Serve { // change the relase state. crate_config.with_release(self.serve.release); - crate::builder::build(&crate_config).expect("build failed"); + let dist_path = self.serve.dist.clone().unwrap_or(PathBuf::from("dist")); + + crate::builder::build(&crate_config, dist_path.clone()).expect("build failed"); let serve_html = String::from(include_str!("../../server/serve.html")); - let mut file = std::fs::File::create(crate_config.out_dir.join("index.html"))?; + let mut file = + std::fs::File::create(crate_config.crate_dir.join(dist_path).join("index.html"))?; file.write_all(serve_html.as_bytes())?; // start the develop server - server::startup(crate_config.clone()).await?; + server::startup(crate_config.clone(), &self.serve).await?; Ok(()) } diff --git a/src/lib.rs b/src/lib.rs index 15c10a3b3..395cbc8dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,4 +15,4 @@ pub mod error; pub use error::*; pub mod logging; -pub use logging::*; \ No newline at end of file +pub use logging::*; diff --git a/src/server/mod.rs b/src/server/mod.rs index 7c0713c8d..4f04d3268 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -6,8 +6,11 @@ use axum::{ AddExtensionLayer, Router, }; use notify::{watcher, DebouncedEvent, Watcher}; -use std::sync::{mpsc::channel, Arc, Mutex}; use std::time::Duration; +use std::{ + path::PathBuf, + sync::{mpsc::channel, Arc, Mutex}, +}; use tower_http::services::ServeDir; use crate::{builder, CrateConfig}; @@ -22,7 +25,10 @@ impl WsRelodState { } } -pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { +pub async fn startup( + config: CrateConfig, + opts: &crate::cfg::ConfigOptsServe, +) -> anyhow::Result<()> { log::info!("🚀 Starting development server..."); let (tx, rx) = channel(); @@ -40,6 +46,7 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { let watcher_conf = config.clone(); let watcher_ws_state = ws_reload_state.clone(); + let dist_path = opts.dist.clone().unwrap_or(PathBuf::from("dist")); tokio::spawn(async move { loop { if let Ok(v) = rx.recv() { @@ -48,7 +55,7 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { | DebouncedEvent::Write(_) | DebouncedEvent::Remove(_) | DebouncedEvent::Rename(_, _) => { - if let Ok(_) = builder::build(&watcher_conf) { + if let Ok(_) = builder::build(&watcher_conf, dist_path.clone()) { // change the websocket reload state to true; // the page will auto-reload. watcher_ws_state.lock().unwrap().change(); diff --git a/src/template/config.toml b/src/template/config.toml index 4c6c2be9c..9644babc1 100644 --- a/src/template/config.toml +++ b/src/template/config.toml @@ -6,4 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus = { version = "0.1.7", features = ["web"] } +dioxus = { version = "0.1.7", features = ["web"] } \ No newline at end of file diff --git a/src/template/default.rs b/src/template/default.rs index c0fa412ea..ac1614fc4 100644 --- a/src/template/default.rs +++ b/src/template/default.rs @@ -1,7 +1,7 @@ use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(app); + dioxus::web::launch(app); } fn app(cx: Scope) -> Element { From 70adff7e443500e05ce8ff32a803971c4f816aff Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 23 Jan 2022 12:11:17 +0800 Subject: [PATCH 025/330] feat: add `dioxus.toml` support --- Cargo.toml | 1 + Dioxus.toml | 42 ++++++++++++++++++++++++++++++++++++++++++ src/builder.rs | 13 ++----------- src/config.rs | 40 +++++++++++++++++++++++++++++++++++++++- src/server/mod.rs | 24 ++++++++++++++---------- 5 files changed, 98 insertions(+), 22 deletions(-) create mode 100644 Dioxus.toml diff --git a/Cargo.toml b/Cargo.toml index cd1dec98b..8bb6fd3ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ wasm-bindgen-cli-support = "0.2.79" anyhow = "1.0.38" serde = { version = "1.0.133", features = ["derive"] } serde_json = "1" +toml = "0.5.8" fs_extra = "1.2.0" cargo_toml = "0.10.0" futures = "0.3.12" diff --git a/Dioxus.toml b/Dioxus.toml new file mode 100644 index 000000000..abd2d1ee4 --- /dev/null +++ b/Dioxus.toml @@ -0,0 +1,42 @@ +[application] + +# App (Project) Name +name = "dioxus-cli" + +# Dioxus App Support Platform +# desktop, web, mobile, ssr +platforms = ["web"] + +[web.app] + +# Web `build` & `serve` dist path +out_dir = "dist" + +# resource (static) file folder +static_dir = "static" + +[web.watcher] + + +watch_path = ["src"] + +# include `assets` in web platform +[web.resource] + +# CSS style file +style = [ + "./my-style.css" +] + +# Javascript code file +script = [ + "./app.js" +] + +[web.resource.dev] + +# Javascript code file +# serve: [dev-server] only +script = [ + "./debug.js" +] \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index aad275ff2..58ee085fc 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -48,14 +48,12 @@ pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { let output = cmd.output()?; - if output.status.success() { - std::io::stdout().write_all(&output.stdout).unwrap(); - } else { + if !output.status.success() { log::error!("Build failed!"); let reason = String::from_utf8_lossy(&output.stderr).to_string(); return Err(Error::BuildFailed(reason)); } - + // [2] Establish the output directory structure let bindgen_outdir = out_dir.join("assets"); @@ -88,13 +86,6 @@ pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { .out_name("module") .generate(&bindgen_outdir)?; - // [4] - // TODO: wasm-opt - - // [5] Generate the html file with the module name - // TODO: support names via options - - // log::info!("Writing to '{:#?}' directory...", out_dir); let copy_options = fs_extra::dir::CopyOptions::new(); if static_dir.is_dir() { match fs_extra::dir::copy(static_dir, out_dir, ©_options) { diff --git a/src/config.rs b/src/config.rs index d17294b18..9d38160f2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,44 @@ use crate::error::Result; +use serde::{Deserialize, Serialize}; use std::path::PathBuf; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DioxusConfig { + application: ApplicationConfig, + web: WebConfig, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ApplicationConfig { + name: String, + platform: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct WebConfig { + app: WebAppConfing, + watcher: WebWatcherConfing, + resource: WebResourceConfing, +} + + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct WebAppConfing { + +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct WebWatcherConfing { + +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct WebResourceConfing { + +} + + #[derive(Debug, Clone)] pub struct CrateConfig { pub out_dir: PathBuf, @@ -86,4 +124,4 @@ impl CrateConfig { // self.release = options.release; // self.out_dir = tempfile::Builder::new().tempdir().expect("").into_path(); // } -} +} \ No newline at end of file diff --git a/src/server/mod.rs b/src/server/mod.rs index 4f04d3268..6b91a2e71 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -33,6 +33,8 @@ pub async fn startup( let (tx, rx) = channel(); + let dist_path = opts.dist.clone().unwrap_or(PathBuf::from("dist")); + // file watcher: check file change let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap(); watcher @@ -46,7 +48,7 @@ pub async fn startup( let watcher_conf = config.clone(); let watcher_ws_state = ws_reload_state.clone(); - let dist_path = opts.dist.clone().unwrap_or(PathBuf::from("dist")); + let watcher_dist_path = dist_path.clone(); tokio::spawn(async move { loop { if let Ok(v) = rx.recv() { @@ -55,7 +57,7 @@ pub async fn startup( | DebouncedEvent::Write(_) | DebouncedEvent::Remove(_) | DebouncedEvent::Rename(_, _) => { - if let Ok(_) = builder::build(&watcher_conf, dist_path.clone()) { + if let Ok(_) = builder::build(&watcher_conf, watcher_dist_path.clone()) { // change the websocket reload state to true; // the page will auto-reload. watcher_ws_state.lock().unwrap().change(); @@ -69,14 +71,16 @@ pub async fn startup( let app = Router::new() .route("/ws", get(ws_handler)) - .fallback(get_service(ServeDir::new(config.out_dir)).handle_error( - |error: std::io::Error| async move { - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Unhandled internal error: {}", error), - ) - }, - )) + .fallback( + get_service(ServeDir::new(config.crate_dir.join(&dist_path))).handle_error( + |error: std::io::Error| async move { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Unhandled internal error: {}", error), + ) + }, + ), + ) .layer(AddExtensionLayer::new(ws_reload_state.clone())); // start serve dev-server at 0.0.0.0:8080 From 9bb10c65a3cbabef127f6af5c0d1eadab1d01531 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 23 Jan 2022 17:35:59 +0800 Subject: [PATCH 026/330] feat: add `Dioxus.toml` --- src/assets/autoreload.js | 25 +++++++++++++ src/assets/index.html | 18 +++++++++ src/builder.rs | 81 ++++++++++++++++++++++++++-------------- src/cli/build/mod.rs | 7 +--- src/cli/cfg.rs | 16 -------- src/cli/init/mod.rs | 27 ++++++++++---- src/cli/serve/mod.rs | 28 ++++++++++---- src/config.rs | 78 ++++++++++++++++++++++++++++++-------- src/server/err.html | 19 ---------- src/server/mod.rs | 54 ++++++++++++++++----------- src/server/serve.html | 39 ------------------- src/template/config.toml | 43 +++++++++++++++++---- src/template/default.rs | 4 +- 13 files changed, 269 insertions(+), 170 deletions(-) create mode 100644 src/assets/autoreload.js create mode 100644 src/assets/index.html delete mode 100644 src/server/err.html delete mode 100644 src/server/serve.html diff --git a/src/assets/autoreload.js b/src/assets/autoreload.js new file mode 100644 index 000000000..ff4444085 --- /dev/null +++ b/src/assets/autoreload.js @@ -0,0 +1,25 @@ +(function () { + var protocol = window.location.protocol === "https:" ? "wss:" : "ws:"; + + var url = protocol + "//" + window.location.host + "/_dioxus/ws"; + + var poll_interval = 2000; + + var reload_upon_connect = () => { + window.setTimeout(() => { + var ws = new WebSocket(url); + ws.onopen = () => window.location.reload(); + ws.onclose = reload_upon_connect; + }, poll_interval); + }; + + var ws = new WebSocket(url); + + ws.onmessage = (ev) => { + if (ev.data == "reload") { + window.location.reload(); + } + }; + + ws.onclose = reload_upon_connect; +})(); \ No newline at end of file diff --git a/src/assets/index.html b/src/assets/index.html new file mode 100644 index 000000000..12e1e5678 --- /dev/null +++ b/src/assets/index.html @@ -0,0 +1,18 @@ + + + {app_title} + + + {style_include} + + + +
+ + + {script_include} + + diff --git a/src/builder.rs b/src/builder.rs index 58ee085fc..381ef8b28 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1,11 +1,12 @@ use crate::{ config::{CrateConfig, ExecutableType}, error::{Error, Result}, + DioxusConfig, }; -use std::{io::Write, path::PathBuf, process::Command}; +use std::process::Command; use wasm_bindgen_cli_support::Bindgen; -pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { +pub fn build(config: &CrateConfig) -> Result<()> { /* [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) [2] Generate the appropriate build folders @@ -15,15 +16,15 @@ pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { */ let CrateConfig { + out_dir, crate_dir, target_dir, static_dir, executable, + dioxus_config, .. } = config; - let out_dir = crate_dir.join(dist); - let t_start = std::time::Instant::now(); // [1] Build the .wasm module @@ -53,7 +54,7 @@ pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { let reason = String::from_utf8_lossy(&output.stderr).to_string(); return Err(Error::BuildFailed(reason)); } - + // [2] Establish the output directory structure let bindgen_outdir = out_dir.join("assets"); @@ -83,7 +84,7 @@ pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { .keep_debug(true) .remove_name_section(false) .remove_producers_section(false) - .out_name("module") + .out_name(&dioxus_config.application.name) .generate(&bindgen_outdir)?; let copy_options = fs_extra::dir::CopyOptions::new(); @@ -101,28 +102,52 @@ pub fn build(config: &CrateConfig, dist: PathBuf) -> Result<()> { Ok(()) } -pub fn gen_page(module: &str) -> String { - format!( - r#" - - - - - - -
-
- - -
- - -"#, - module - ) +pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { + let mut html = String::from(include_str!("./assets/index.html")); + + let resouces = config.web.resource.clone(); + + let mut style_list = resouces.style.unwrap_or(vec![]); + let mut script_list = resouces.script.unwrap_or(vec![]); + + if serve { + let mut dev_style = resouces.dev.style.clone().unwrap_or(vec![]); + let mut dev_script = resouces.dev.script.clone().unwrap_or(vec![]); + style_list.append(&mut dev_style); + script_list.append(&mut dev_script); + } + + let mut style_str = String::new(); + for style in style_list { + style_str.push_str(&format!( + "\n", + &style.to_str().unwrap(), + )) + } + html = html.replace("{style_include}", &style_str); + + let mut script_str = String::new(); + for script in script_list { + script_str.push_str(&format!( + "\n", + &script.to_str().unwrap(), + )) + } + + html = html.replace("{script_include}", &script_str); + + if serve { + html += &format!( + "", + include_str!("./assets/autoreload.js") + ); + } + + html = html.replace("{app_name}", &config.application.name); + + let title = config.web.app.title.clone().unwrap_or("dioxus | ⛺".into()); + + html.replace("{app_title}", &title) } // use binary_install::{Cache, Download}; diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 760c2fd8e..fc329a305 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,5 +1,3 @@ -use std::path::PathBuf; - use crate::cfg::ConfigOptsBuild; use structopt::StructOpt; @@ -18,10 +16,7 @@ impl Build { // change the relase state. crate_config.with_release(self.build.release); - crate::builder::build( - &crate_config, - self.build.dist.unwrap_or(PathBuf::from("dist")), - )?; + crate::builder::build(&crate_config)?; Ok(()) } diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 2c5f42a26..ab68ce4f9 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -16,14 +16,6 @@ pub struct ConfigOptsBuild { #[serde(default)] pub release: bool, - /// The output dir for all final assets [default: dist] - #[structopt(short, long, parse(from_os_str))] - pub dist: Option, - - /// The public URL from which assets are to be served [default: /] - #[structopt(long, parse(from_str=parse_public_url))] - pub public_url: Option, - /// Optional pattern for the app loader script [default: None] /// /// Patterns should include the sequences `{base}`, `{wasm}`, and `{js}` in order to @@ -74,14 +66,6 @@ pub struct ConfigOptsServe { #[structopt(long)] #[serde(default)] pub release: bool, - - /// The output dir for all final assets [default: dist] - #[structopt(short, long, parse(from_os_str))] - pub dist: Option, - - /// The public URL from which assets are to be served [default: /] - #[structopt(long, parse(from_str=parse_public_url))] - pub public_url: Option, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/src/cli/init/mod.rs b/src/cli/init/mod.rs index dde0ccca3..52dcf4c14 100644 --- a/src/cli/init/mod.rs +++ b/src/cli/init/mod.rs @@ -13,9 +13,9 @@ use crate::error::{Error, Result}; #[derive(Clone, Debug, StructOpt)] #[structopt(name = "init")] pub struct Init { - /// Init project path + /// Init project name #[structopt(default_value = ".")] - path: String, + name: String, /// Template path #[structopt(default_value = "default", long)] @@ -24,18 +24,23 @@ pub struct Init { impl Init { pub fn init(self) -> Result<()> { - log::info!("🔧 Start to init a new project '{}'.", self.path); + if self.name.contains(".") { + log::error!("❗Unsupported project name."); + return Ok(()); + } - let project_path = PathBuf::from(&self.path); + log::info!("🔧 Start to init a new project '{}'.", self.name); + + let project_path = PathBuf::from(&self.name); if project_path.join("Cargo.toml").is_file() { - log::warn!("Path '{}' is initialized.", self.path); + log::warn!("Folder '{}' is initialized.", self.name); return Ok(()); } let output = Command::new("cargo") .arg("init") - .arg(&self.path) + .arg(&format!("./{}", self.name)) .arg("--bin") .stdout(Stdio::piped()) .stderr(Stdio::piped()) @@ -58,6 +63,11 @@ impl Init { let mut file = File::create(main_rs_file)?; file.write_all(&template_str.as_bytes())?; + let mut file = File::create(project_path.join("Dioxus.toml"))?; + let dioxus_conf = String::from(include_str!("../../template/config.toml")) + .replace("{project-name}", &self.name); + file.write_all(dioxus_conf.as_bytes())?; + // log::info!("🎯 Project initialization completed."); if !Command::new("cargo") @@ -72,8 +82,9 @@ impl Init { file.write_all("dioxus = { version = \"0.1.7\", features = [\"web\"] }".as_bytes())?; } - log::info!("\n💡 Project initialized:"); - log::info!("🎯> cd {}", self.path); + println!(""); + log::info!("💡 Project initialized:"); + log::info!("🎯> cd ./{}", self.name); log::info!("🎯> dioxus serve"); Ok(()) diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 586d49b7c..7d580f7fb 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,4 +1,4 @@ -use crate::{cfg::ConfigOptsServe, server}; +use crate::{cfg::ConfigOptsServe, gen_page, server}; use std::{io::Write, path::PathBuf}; use structopt::StructOpt; @@ -16,19 +16,31 @@ impl Serve { // change the relase state. crate_config.with_release(self.serve.release); - let dist_path = self.serve.dist.clone().unwrap_or(PathBuf::from("dist")); + crate::builder::build(&crate_config).expect("build failed"); - crate::builder::build(&crate_config, dist_path.clone()).expect("build failed"); + let serve_html = gen_page(&crate_config.dioxus_config, true); - let serve_html = String::from(include_str!("../../server/serve.html")); - - let mut file = - std::fs::File::create(crate_config.crate_dir.join(dist_path).join("index.html"))?; + let mut file = std::fs::File::create( + crate_config + .crate_dir + .join( + crate_config + .dioxus_config + .web + .app + .out_dir + .clone() + .unwrap_or(PathBuf::from("dist")), + ) + .join("index.html"), + )?; file.write_all(serve_html.as_bytes())?; // start the develop server - server::startup(crate_config.clone(), &self.serve).await?; + server::startup(crate_config.clone()).await?; Ok(()) } + + pub fn regen_page() {} } diff --git a/src/config.rs b/src/config.rs index 9d38160f2..39a3d2038 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,43 +1,76 @@ use crate::error::Result; use serde::{Deserialize, Serialize}; -use std::path::PathBuf; - +use std::{fs::File, io::Read, path::PathBuf}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DioxusConfig { - application: ApplicationConfig, - web: WebConfig, + pub application: ApplicationConfig, + pub web: WebConfig, +} + +impl DioxusConfig { + pub fn load() -> crate::error::Result { + let crate_dir = crate::cargo::crate_root()?; + + if !crate_dir.join("Dioxus.toml").is_file() { + return Err(crate::error::Error::CargoError( + "Dioxus.toml not found".into(), + )); + } + + let mut dioxus_conf_file = File::open(crate_dir.join("Dioxus.toml"))?; + let mut meta_str = String::new(); + dioxus_conf_file.read_to_string(&mut meta_str)?; + + match toml::from_str::(&meta_str) { + Ok(v) => return Ok(v), + Err(e) => { + log::error!("{}", e); + return Err(crate::error::Error::Unique( + "Dioxus.toml parse failed".into(), + )); + } + } + } } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ApplicationConfig { - name: String, - platform: Vec, + pub name: String, + pub platforms: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebConfig { - app: WebAppConfing, - watcher: WebWatcherConfing, - resource: WebResourceConfing, + pub app: WebAppConfing, + pub watcher: WebWatcherConfing, + pub resource: WebResourceConfing, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebAppConfing { - + pub title: Option, + pub out_dir: Option, + pub static_dir: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebWatcherConfing { - + pub watch_path: Option>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebResourceConfing { - + pub dev: WebDevResourceConfing, + pub style: Option>, + pub script: Option>, } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct WebDevResourceConfing { + pub style: Option>, + pub script: Option>, +} #[derive(Debug, Clone)] pub struct CrateConfig { @@ -48,6 +81,7 @@ pub struct CrateConfig { pub static_dir: PathBuf, pub manifest: cargo_toml::Manifest, pub executable: ExecutableType, + pub dioxus_config: DioxusConfig, pub release: bool, } @@ -60,12 +94,23 @@ pub enum ExecutableType { impl CrateConfig { pub fn new() -> Result { + let dioxus_config = DioxusConfig::load()?; + let crate_dir = crate::cargo::crate_root()?; let workspace_dir = crate::cargo::workspace_root()?; let target_dir = workspace_dir.join("target"); - let out_dir = crate_dir.join("public"); + + let out_dir = match dioxus_config.web.app.out_dir { + Some(ref v) => crate_dir.join(v), + None => crate_dir.join("dist"), + }; + let cargo_def = &crate_dir.join("Cargo.toml"); - let static_dir = crate_dir.join("static"); + + let static_dir = match dioxus_config.web.app.static_dir { + Some(ref v) => crate_dir.join(v), + None => crate_dir.join("static"), + }; let manifest = cargo_toml::Manifest::from_path(&cargo_def).unwrap(); @@ -96,6 +141,7 @@ impl CrateConfig { manifest, executable, release, + dioxus_config, }) } @@ -124,4 +170,4 @@ impl CrateConfig { // self.release = options.release; // self.out_dir = tempfile::Builder::new().tempdir().expect("").into_path(); // } -} \ No newline at end of file +} diff --git a/src/server/err.html b/src/server/err.html deleted file mode 100644 index 8fdbf9bae..000000000 --- a/src/server/err.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - -
-

- Sorry, but building your application failed. -

-

- Here's the error: -

- - {err} - -
- - - diff --git a/src/server/mod.rs b/src/server/mod.rs index 6b91a2e71..4d33f524e 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -13,7 +13,7 @@ use std::{ }; use tower_http::services::ServeDir; -use crate::{builder, CrateConfig}; +use crate::{builder, crate_root, CrateConfig}; struct WsRelodState { update: bool, @@ -25,42 +25,54 @@ impl WsRelodState { } } -pub async fn startup( - config: CrateConfig, - opts: &crate::cfg::ConfigOptsServe, -) -> anyhow::Result<()> { +pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { log::info!("🚀 Starting development server..."); let (tx, rx) = channel(); - let dist_path = opts.dist.clone().unwrap_or(PathBuf::from("dist")); + let dist_path = config.out_dir.clone(); // file watcher: check file change - let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap(); + let mut watcher = watcher(tx, Duration::from_secs(1)).unwrap(); watcher - .watch( - config.crate_dir.join("src").clone(), - notify::RecursiveMode::Recursive, - ) + .watch(config.crate_dir.clone(), notify::RecursiveMode::Recursive) .unwrap(); let ws_reload_state = Arc::new(Mutex::new(WsRelodState { update: false })); let watcher_conf = config.clone(); let watcher_ws_state = ws_reload_state.clone(); - let watcher_dist_path = dist_path.clone(); tokio::spawn(async move { + let allow_watch_path = watcher_conf + .dioxus_config + .web + .watcher + .watch_path + .clone() + .unwrap_or(vec![PathBuf::from("src")]); + let crate_dir = watcher_conf.crate_dir.clone(); loop { if let Ok(v) = rx.recv() { match v { - DebouncedEvent::Create(_) - | DebouncedEvent::Write(_) - | DebouncedEvent::Remove(_) - | DebouncedEvent::Rename(_, _) => { - if let Ok(_) = builder::build(&watcher_conf, watcher_dist_path.clone()) { - // change the websocket reload state to true; - // the page will auto-reload. - watcher_ws_state.lock().unwrap().change(); + DebouncedEvent::Create(e) + | DebouncedEvent::Write(e) + | DebouncedEvent::Remove(e) + | DebouncedEvent::Rename(e, _) => { + let mut reload = false; + for path in &allow_watch_path { + let temp = crate_dir.clone().join(path); + if e.starts_with(temp) { + reload = true; + break; + } + } + + if reload { + if let Ok(_) = builder::build(&watcher_conf) { + // change the websocket reload state to true; + // the page will auto-reload. + watcher_ws_state.lock().unwrap().change(); + } } } _ => {} @@ -70,7 +82,7 @@ pub async fn startup( }); let app = Router::new() - .route("/ws", get(ws_handler)) + .route("/_dioxus/ws", get(ws_handler)) .fallback( get_service(ServeDir::new(config.crate_dir.join(&dist_path))).handle_error( |error: std::io::Error| async move { diff --git a/src/server/serve.html b/src/server/serve.html deleted file mode 100644 index b5268bd68..000000000 --- a/src/server/serve.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Dioxus-CLI Dev Server - - -
- - - - - - - diff --git a/src/template/config.toml b/src/template/config.toml index 9644babc1..ea1efbd4b 100644 --- a/src/template/config.toml +++ b/src/template/config.toml @@ -1,9 +1,38 @@ -[package] -name = "{project}" -version = "0.1.0" -edition = "2021" +[application] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +# App (Project) Name +name = "{project-name}" -[dependencies] -dioxus = { version = "0.1.7", features = ["web"] } \ No newline at end of file +# Dioxus App Support Platform +# desktop, web, mobile, ssr +platforms = ["web"] + +[web.app] + +# HTML title tag content +title = "dioxus | ⛺" + +# Web `build` & `serve` dist path +out_dir = "dist" + +# resource (static) file folder +static_dir = "static" + +[web.watcher] + +watch_path = ["src"] + +# include `assets` in web platform +[web.resource] + +# CSS style file +style = [] + +# Javascript code file +script = [] + +[web.resource.dev] + +# Javascript code file +# serve: [dev-server] only +script = [] \ No newline at end of file diff --git a/src/template/default.rs b/src/template/default.rs index ac1614fc4..47b4a2c1d 100644 --- a/src/template/default.rs +++ b/src/template/default.rs @@ -8,8 +8,8 @@ fn app(cx: Scope) -> Element { cx.render(rsx! ( div { style: "text-align: center;", - h2 { "🌗🚀 Dioxus" } - p { strong { "Frontend that scales." } } + h1 { "🌗 Dioxus 🚀" } + h3 { "Frontend that scales." } p { "Dioxus is a portable, performant, and ergonomic framework for building cross-platform user interfaces in Rust." } } )) From 7343af2089ae0ff1f3da6b418d8168651a201832 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 23 Jan 2022 22:50:23 +0800 Subject: [PATCH 027/330] feat: `clean` command --- src/assets/index.html | 4 ++-- src/builder.rs | 30 ++++++++++++++++++------- src/cli/build/mod.rs | 22 +++++++++++++++++- src/cli/clean/mod.rs | 35 +++++++++++++++++++++++++++++ src/cli/mod.rs | 3 +-- src/cli/serve/mod.rs | 17 +++++++++----- src/config.rs | 48 ++++++++++++++++++++++++++++++++-------- src/main.rs | 8 ++++--- src/server/mod.rs | 11 ++++++++- src/template/config.toml | 8 +++++-- 10 files changed, 152 insertions(+), 34 deletions(-) diff --git a/src/assets/index.html b/src/assets/index.html index 12e1e5678..9934e490d 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -10,8 +10,8 @@
{script_include} diff --git a/src/builder.rs b/src/builder.rs index 381ef8b28..0ecde96cd 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -19,7 +19,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { out_dir, crate_dir, target_dir, - static_dir, + public_dir, executable, dioxus_config, .. @@ -56,7 +56,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { } // [2] Establish the output directory structure - let bindgen_outdir = out_dir.join("assets"); + let bindgen_outdir = out_dir.join("assets").join("dioxus"); // [3] Bindgen the final binary for use easy linking let mut bindgen_builder = Bindgen::new(); @@ -87,12 +87,26 @@ pub fn build(config: &CrateConfig) -> Result<()> { .out_name(&dioxus_config.application.name) .generate(&bindgen_outdir)?; - let copy_options = fs_extra::dir::CopyOptions::new(); - if static_dir.is_dir() { - match fs_extra::dir::copy(static_dir, out_dir, ©_options) { - Ok(_) => {} - Err(_e) => { - log::warn!("Error copying dir: {}", _e); + let copy_options = fs_extra::dir::CopyOptions { + overwrite: true, + skip_exist: false, + buffer_size: 64000, + copy_inside: false, + content_only: false, + depth: 0, + }; + if public_dir.is_dir() { + for entry in std::fs::read_dir(&public_dir)? { + let path = entry?.path(); + if path.is_file() { + std::fs::copy(&path, out_dir.join(path.file_name().unwrap()))?; + } else { + match fs_extra::dir::copy(&path, out_dir, ©_options) { + Ok(_) => {} + Err(_e) => { + log::warn!("Error copying dir: {}", _e); + } + } } } } diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index fc329a305..e24a99822 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,4 +1,6 @@ -use crate::cfg::ConfigOptsBuild; +use std::{io::Write, path::PathBuf}; + +use crate::{cfg::ConfigOptsBuild, gen_page}; use structopt::StructOpt; /// Build the Rust WASM app and all of its assets. @@ -18,6 +20,24 @@ impl Build { crate::builder::build(&crate_config)?; + let temp = gen_page(&crate_config.dioxus_config, false); + + let mut file = std::fs::File::create( + crate_config + .crate_dir + .join( + crate_config + .dioxus_config + .web + .app + .out_dir + .clone() + .unwrap_or(PathBuf::from("dist")), + ) + .join("index.html"), + )?; + file.write_all(temp.as_bytes())?; + Ok(()) } } diff --git a/src/cli/clean/mod.rs b/src/cli/clean/mod.rs index 1edcd053a..4ab7653d2 100644 --- a/src/cli/clean/mod.rs +++ b/src/cli/clean/mod.rs @@ -1,6 +1,41 @@ +use std::{ + fs::remove_dir_all, + path::PathBuf, + process::{Command, Stdio}, +}; + use structopt::StructOpt; /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, StructOpt)] #[structopt(name = "clean")] pub struct Clean {} + +impl Clean { + pub fn clean(self) -> anyhow::Result<()> { + let crate_config = crate::CrateConfig::new()?; + + let output = Command::new("cargo") + .arg("clean") + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .output()?; + + if !output.status.success() { + log::error!("Cargo clean failed."); + return Ok(()); + } + + let out_dir = crate_config + .dioxus_config + .web + .app + .out_dir + .unwrap_or(PathBuf::from("dist")); + if crate_config.crate_dir.join(&out_dir).is_dir() { + remove_dir_all(crate_config.crate_dir.join(&out_dir))?; + } + + Ok(()) + } +} diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 93cbfef28..6224cea32 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -37,8 +37,7 @@ pub enum Commands { /// Init a new project for Dioxus. Init(init::Init), // /// Clean output artifacts. - // Clean(clean::Clean), - + Clean(clean::Clean), // /// Trunk config controls. // Config(config::Config), } diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 7d580f7fb..19a7f28ff 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,4 +1,4 @@ -use crate::{cfg::ConfigOptsServe, gen_page, server}; +use crate::{cfg::ConfigOptsServe, gen_page, server, CrateConfig}; use std::{io::Write, path::PathBuf}; use structopt::StructOpt; @@ -18,6 +18,16 @@ impl Serve { crate::builder::build(&crate_config).expect("build failed"); + // generate dev-index page + Serve::regen_dev_page(&crate_config)?; + + // start the develop server + server::startup(crate_config.clone()).await?; + + Ok(()) + } + + pub fn regen_dev_page(crate_config: &CrateConfig) -> anyhow::Result<()> { let serve_html = gen_page(&crate_config.dioxus_config, true); let mut file = std::fs::File::create( @@ -36,11 +46,6 @@ impl Serve { )?; file.write_all(serve_html.as_bytes())?; - // start the develop server - server::startup(crate_config.clone()).await?; - Ok(()) } - - pub fn regen_page() {} } diff --git a/src/config.rs b/src/config.rs index 39a3d2038..403ad0e81 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,9 +13,8 @@ impl DioxusConfig { let crate_dir = crate::cargo::crate_root()?; if !crate_dir.join("Dioxus.toml").is_file() { - return Err(crate::error::Error::CargoError( - "Dioxus.toml not found".into(), - )); + log::warn!("Config file: `Dioxus.toml` not found."); + return Ok(Self::default()); } let mut dioxus_conf_file = File::open(crate_dir.join("Dioxus.toml"))?; @@ -34,6 +33,36 @@ impl DioxusConfig { } } +impl Default for DioxusConfig { + fn default() -> Self { + Self { + application: ApplicationConfig { + name: "dioxus".into(), + platforms: vec![String::from("web")], + }, + web: WebConfig { + app: WebAppConfing { + title: Some("dioxus | ⛺".into()), + out_dir: Some(PathBuf::from("dist")), + public_dir: Some(PathBuf::from("public")), + }, + watcher: WebWatcherConfing { + watch_path: Some(vec![PathBuf::from("src")]), + reload_html: Some(false), + }, + resource: WebResourceConfing { + dev: WebDevResourceConfing { + style: Some(vec![]), + script: Some(vec![]), + }, + style: Some(vec![]), + script: Some(vec![]), + }, + }, + } + } +} + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ApplicationConfig { pub name: String, @@ -51,12 +80,13 @@ pub struct WebConfig { pub struct WebAppConfing { pub title: Option, pub out_dir: Option, - pub static_dir: Option, + pub public_dir: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebWatcherConfing { pub watch_path: Option>, + pub reload_html: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -78,7 +108,7 @@ pub struct CrateConfig { pub crate_dir: PathBuf, pub workspace_dir: PathBuf, pub target_dir: PathBuf, - pub static_dir: PathBuf, + pub public_dir: PathBuf, pub manifest: cargo_toml::Manifest, pub executable: ExecutableType, pub dioxus_config: DioxusConfig, @@ -107,9 +137,9 @@ impl CrateConfig { let cargo_def = &crate_dir.join("Cargo.toml"); - let static_dir = match dioxus_config.web.app.static_dir { + let public_dir = match dioxus_config.web.app.public_dir { Some(ref v) => crate_dir.join(v), - None => crate_dir.join("static"), + None => crate_dir.join("public"), }; let manifest = cargo_toml::Manifest::from_path(&cargo_def).unwrap(); @@ -124,7 +154,7 @@ impl CrateConfig { (&manifest) .package .as_ref() - .and_then(|pkg| Some(pkg.name.replace("-", "_"))) + .and_then(|pkg| Some(pkg.name.clone())) .clone() }) .expect("No lib found from cargo metadata"); @@ -137,7 +167,7 @@ impl CrateConfig { crate_dir, workspace_dir, target_dir, - static_dir, + public_dir, manifest, executable, release, diff --git a/src/main.rs b/src/main.rs index 69636c6e3..70f92cf95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,9 +19,11 @@ async fn main() -> Result<()> { } } - // Commands::Clean(_) => { - // // - // } + Commands::Clean(opts) => { + if let Err(e) = opts.clean() { + log::error!("clean error: {}", e); + } + } // Commands::Config(_) => { // // diff --git a/src/server/mod.rs b/src/server/mod.rs index 4d33f524e..3151975d5 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -13,7 +13,7 @@ use std::{ }; use tower_http::services::ServeDir; -use crate::{builder, crate_root, CrateConfig}; +use crate::{builder, serve::Serve, CrateConfig}; struct WsRelodState { update: bool, @@ -71,6 +71,15 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { if let Ok(_) = builder::build(&watcher_conf) { // change the websocket reload state to true; // the page will auto-reload. + if watcher_conf + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&watcher_conf); + } watcher_ws_state.lock().unwrap().change(); } } diff --git a/src/template/config.toml b/src/template/config.toml index ea1efbd4b..44f5baabd 100644 --- a/src/template/config.toml +++ b/src/template/config.toml @@ -15,11 +15,15 @@ title = "dioxus | ⛺" # Web `build` & `serve` dist path out_dir = "dist" -# resource (static) file folder -static_dir = "static" +# resource (public) file folder +public_dir = "public" [web.watcher] +# when watcher trigger, regenerate the `index.html` +reload_html = true + +# which files or dirs will be watcher monitoring watch_path = ["src"] # include `assets` in web platform From bdcc06648b0275404b8626bcae6acf62b8af7af8 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 24 Jan 2022 05:55:40 +0800 Subject: [PATCH 028/330] feat: init use `cargo-generate ` --- Cargo.toml | 3 +- Dioxus.toml | 2 +- src/cli/build/mod.rs | 4 ++ src/cli/cfg.rs | 8 ++++ src/cli/init/mod.rs | 97 ++++++++++++++++++++++------------------ src/cli/serve/mod.rs | 5 +++ src/template/config.toml | 42 ----------------- src/template/default.rs | 16 ------- 8 files changed, 74 insertions(+), 103 deletions(-) delete mode 100644 src/template/config.toml delete mode 100644 src/template/default.rs diff --git a/Cargo.toml b/Cargo.toml index 8bb6fd3ce..68dd3ee56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-cli" -version = "0.1.1" +version = "0.1.2" authors = ["Jonathan Kelley"] edition = "2018" description = "CLI tool for developing, testing, and publishing Dioxus apps" @@ -28,6 +28,7 @@ structopt = "0.3.25" cargo_metadata = "0.14.1" tokio = { version = "1.15.0", features = ["full"] } atty = "0.2.14" +regex = "1.5.4" axum = { version = "0.4.4", features = ["ws", "headers"] } tower-http = { version = "0.2.0", features = ["fs", "trace"] } diff --git a/Dioxus.toml b/Dioxus.toml index abd2d1ee4..b4ba03f9d 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -13,7 +13,7 @@ platforms = ["web"] out_dir = "dist" # resource (static) file folder -static_dir = "static" +public_dir = "public" [web.watcher] diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index e24a99822..cbf82b339 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -18,6 +18,10 @@ impl Build { // change the relase state. crate_config.with_release(self.build.release); + if self.build.example.is_some() { + crate_config.as_example(self.build.example.unwrap()); + } + crate::builder::build(&crate_config)?; let temp = gen_page(&crate_config.dioxus_config, false); diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index ab68ce4f9..6a27c4890 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -16,6 +16,10 @@ pub struct ConfigOptsBuild { #[serde(default)] pub release: bool, + /// Build a example [default: ""] + #[structopt(long)] + pub example: Option, + /// Optional pattern for the app loader script [default: None] /// /// Patterns should include the sequences `{base}`, `{wasm}`, and `{js}` in order to @@ -62,6 +66,10 @@ pub struct ConfigOptsServe { #[structopt(parse(from_os_str))] pub target: Option, + /// Build a example [default: ""] + #[structopt(long)] + pub example: Option, + /// Build in release mode [default: false] #[structopt(long)] #[serde(default)] diff --git a/src/cli/init/mod.rs b/src/cli/init/mod.rs index 52dcf4c14..a19ee68fd 100644 --- a/src/cli/init/mod.rs +++ b/src/cli/init/mod.rs @@ -1,16 +1,18 @@ use std::{ - fs::{File, OpenOptions}, - io::Write, + fs::File, + io::{Read, Write}, path::PathBuf, process::{Command, Stdio}, }; +use regex::Regex; +use serde::Deserialize; use structopt::StructOpt; -use crate::error::{Error, Result}; +use crate::{error::Result, Error}; /// Build the Rust WASM app and all of its assets. -#[derive(Clone, Debug, StructOpt)] +#[derive(Clone, Debug, Default, Deserialize, StructOpt)] #[structopt(name = "init")] pub struct Init { /// Init project name @@ -18,69 +20,73 @@ pub struct Init { name: String, /// Template path - #[structopt(default_value = "default", long)] + #[structopt(default_value = "gh:dioxuslabs/dioxus-template", long)] template: String, + + /// Create a `lib` project, include a `hello-world` example. + #[structopt(long)] + #[serde(default)] + pub lib: bool, } impl Init { pub fn init(self) -> Result<()> { - if self.name.contains(".") { + if Self::name_vaild_check(self.name.clone()) { log::error!("❗Unsupported project name."); return Ok(()); } - log::info!("🔧 Start to init a new project '{}'.", self.name); - let project_path = PathBuf::from(&self.name); - if project_path.join("Cargo.toml").is_file() { - log::warn!("Folder '{}' is initialized.", self.name); - return Ok(()); + if project_path.join("Dioxus.toml").is_file() || project_path.join("Cargo.toml").is_file() { + return Err(Error::Other(anyhow::anyhow!( + "🧨 Folder '{}' is initialized.", + &self.name + ))); } + log::info!("🔧 Start to init a new project '{}'.", self.name); + let output = Command::new("cargo") - .arg("init") - .arg(&format!("./{}", self.name)) - .arg("--bin") + .arg("generate") + .arg("--help") .stdout(Stdio::piped()) .stderr(Stdio::piped()) .output()?; if !output.status.success() { - return Err(Error::CargoError("Cargo init failed".into())); + log::warn!("Tool is not installed: cargo-generate, try to install it."); + let install_output = Command::new("cargo") + .arg("install") + .arg("cargo-generate") + .stdout(Stdio::inherit()) + .stderr(Stdio::inherit()) + .output()?; + if !install_output.status.success() { + return Err(Error::Other(anyhow::anyhow!( + "Try to install cargo-generate failed." + ))); + } } - // get the template code - let template_str = match self.template { - _ => include_str!("../../template/default.rs"), - }; + let generate_output = Command::new("cargo") + .arg("generate") + .arg(&self.template) + .arg("--name") + .arg(&self.name) + .stdout(Stdio::piped()) + .stderr(Stdio::inherit()) + .output()?; - let main_rs_file = project_path.join("src").join("main.rs"); - if !main_rs_file.is_file() { - return Err(Error::FailedToWrite); + if !generate_output.status.success() { + return Err(Error::Other(anyhow::anyhow!("Generate project failed."))); } - let mut file = File::create(main_rs_file)?; - file.write_all(&template_str.as_bytes())?; - - let mut file = File::create(project_path.join("Dioxus.toml"))?; - let dioxus_conf = String::from(include_str!("../../template/config.toml")) - .replace("{project-name}", &self.name); - file.write_all(dioxus_conf.as_bytes())?; - - // log::info!("🎯 Project initialization completed."); - - if !Command::new("cargo") - .args(["add", "dioxus", "--features web"]) - .output()? - .status - .success() - { - let mut file = OpenOptions::new() - .append(true) - .open(project_path.join("Cargo.toml"))?; - file.write_all("dioxus = { version = \"0.1.7\", features = [\"web\"] }".as_bytes())?; - } + let mut dioxus_file = File::open(project_path.join("Dioxus.toml"))?; + let mut meta_file = String::new(); + dioxus_file.read_to_string(&mut meta_file)?; + meta_file = meta_file.replace("{{project-name}}", &self.name); + File::create(project_path.join("Dioxus.toml"))?.write_all(meta_file.as_bytes())?; println!(""); log::info!("💡 Project initialized:"); @@ -89,4 +95,9 @@ impl Init { Ok(()) } + + fn name_vaild_check(name: String) -> bool { + let r = Regex::new(r"^[a-zA-Z][a-zA-Z0-9\-_]$").unwrap(); + r.is_match(&name) + } } diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 19a7f28ff..57716ac7e 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -13,9 +13,14 @@ pub struct Serve { impl Serve { pub async fn serve(self) -> anyhow::Result<()> { let mut crate_config = crate::CrateConfig::new()?; + // change the relase state. crate_config.with_release(self.serve.release); + if self.serve.example.is_some() { + crate_config.as_example(self.serve.example.unwrap()); + } + crate::builder::build(&crate_config).expect("build failed"); // generate dev-index page diff --git a/src/template/config.toml b/src/template/config.toml deleted file mode 100644 index 44f5baabd..000000000 --- a/src/template/config.toml +++ /dev/null @@ -1,42 +0,0 @@ -[application] - -# App (Project) Name -name = "{project-name}" - -# Dioxus App Support Platform -# desktop, web, mobile, ssr -platforms = ["web"] - -[web.app] - -# HTML title tag content -title = "dioxus | ⛺" - -# Web `build` & `serve` dist path -out_dir = "dist" - -# resource (public) file folder -public_dir = "public" - -[web.watcher] - -# when watcher trigger, regenerate the `index.html` -reload_html = true - -# which files or dirs will be watcher monitoring -watch_path = ["src"] - -# include `assets` in web platform -[web.resource] - -# CSS style file -style = [] - -# Javascript code file -script = [] - -[web.resource.dev] - -# Javascript code file -# serve: [dev-server] only -script = [] \ No newline at end of file diff --git a/src/template/default.rs b/src/template/default.rs deleted file mode 100644 index 47b4a2c1d..000000000 --- a/src/template/default.rs +++ /dev/null @@ -1,16 +0,0 @@ -use dioxus::prelude::*; - -fn main() { - dioxus::web::launch(app); -} - -fn app(cx: Scope) -> Element { - cx.render(rsx! ( - div { - style: "text-align: center;", - h1 { "🌗 Dioxus 🚀" } - h3 { "Frontend that scales." } - p { "Dioxus is a portable, performant, and ergonomic framework for building cross-platform user interfaces in Rust." } - } - )) -} From 0ff4881d54f03115812ddeda48fa4687683be8c3 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 24 Jan 2022 08:55:52 +0800 Subject: [PATCH 029/330] feat: support `desktop` build --- src/cli/build/mod.rs | 63 +++++++++++++++++++++++++++++++++++++++++++- src/cli/cfg.rs | 41 +++------------------------- 2 files changed, 65 insertions(+), 39 deletions(-) diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index cbf82b339..82060b436 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,6 +1,7 @@ -use std::{io::Write, path::PathBuf}; +use std::{io::Write, path::PathBuf, process::Command, fs::copy}; use crate::{cfg::ConfigOptsBuild, gen_page}; +use std::fs::remove_dir_all; use structopt::StructOpt; /// Build the Rust WASM app and all of its assets. @@ -22,6 +23,66 @@ impl Build { crate_config.as_example(self.build.example.unwrap()); } + if self.build.platform.is_some() { + if self.build.platform.unwrap().to_uppercase() == "DESKTOP" { + log::info!("🚅 Running build command..."); + + let mut cmd = Command::new("cargo"); + cmd.current_dir(&crate_config.crate_dir) + .arg("build") + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + + if self.build.release { + cmd.arg("--release"); + } + + match &crate_config.executable { + crate::ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), + crate::ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), + crate::ExecutableType::Example(name) => cmd.arg("--example").arg(name), + }; + + let output = cmd.output()?; + + if output.status.success() { + if crate_config.out_dir.is_dir() { + + remove_dir_all(&crate_config.out_dir)?; + + let release_type = match crate_config.release { + true => "release", + false => "debug", + }; + + let mut res_path = match &crate_config.executable { + crate::ExecutableType::Binary(name) + | crate::ExecutableType::Lib(name) => crate_config + .target_dir + .join(format!("{}", release_type)) + .join(format!("{}", name)), + + crate::ExecutableType::Example(name) => crate_config + .target_dir + .join(format!("{}/examples", release_type)) + .join(format!("{}", name)), + }; + + let target_file; + if cfg!(windows) { + res_path.set_extension("exe"); + target_file = format!("{}.exe", &crate_config.dioxus_config.application.name); + } else { + target_file = crate_config.dioxus_config.application.name.clone(); + } + copy(res_path, &crate_config.out_dir.join(target_file))?; + } + } + + return Ok(()); + } + } + crate::builder::build(&crate_config)?; let temp = gen_page(&crate_config.dioxus_config, false); diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 6a27c4890..7010d62e6 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -20,44 +20,9 @@ pub struct ConfigOptsBuild { #[structopt(long)] pub example: Option, - /// Optional pattern for the app loader script [default: None] - /// - /// Patterns should include the sequences `{base}`, `{wasm}`, and `{js}` in order to - /// properly load the application. Other sequences may be included corresponding - /// to key/value pairs provided in `pattern_params`. - /// - /// These values can only be provided via config file. - #[structopt(skip)] - #[serde(default)] - pub pattern_script: Option, - - /// Optional pattern for the app preload element [default: None] - /// - /// Patterns should include the sequences `{base}`, `{wasm}`, and `{js}` in order to - /// properly preload the application. Other sequences may be included corresponding - /// to key/value pairs provided in `pattern_params`. - /// - /// These values can only be provided via config file. - #[structopt(skip)] - #[serde(default)] - pub pattern_preload: Option, - - #[structopt(skip)] - #[serde(default)] - /// Optional replacement parameters corresponding to the patterns provided in - /// `pattern_script` and `pattern_preload`. - /// - /// When a pattern is being replaced with its corresponding value from this map, if the value is - /// prefixed with the symbol `@`, then the value is expected to be a file path, and the pattern - /// will be replaced with the contents of the target file. This allows insertion of some big JSON - /// state or even HTML files as a part of the `index.html` build. - /// - /// Trunk will automatically insert the `base`, `wasm` and `js` key/values into this map. In order - //// for the app to be loaded properly, the patterns `{base}`, `{wasm}` and `{js}` should be used - /// in `pattern_script` and `pattern_preload`. - /// - /// These values can only be provided via config file. - pub pattern_params: Option>, + /// Build platform: support Web & Desktop [default: "web"] + #[structopt(long)] + pub platform: Option, } #[derive(Clone, Debug, Default, Deserialize, StructOpt)] From bb69a040456db2e2a669ba4e3d80f2d2da44415f Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 24 Jan 2022 11:29:39 +0800 Subject: [PATCH 030/330] feat: commit code --- Dioxus.toml | 4 +-- src/cli/build/mod.rs | 76 ++++++++++++++++++++++++++++---------------- src/cli/cfg.rs | 1 - src/cli/clean/mod.rs | 3 +- src/cli/serve/mod.rs | 3 +- src/config.rs | 6 ++-- 6 files changed, 55 insertions(+), 38 deletions(-) diff --git a/Dioxus.toml b/Dioxus.toml index b4ba03f9d..86f52c349 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -7,11 +7,11 @@ name = "dioxus-cli" # desktop, web, mobile, ssr platforms = ["web"] -[web.app] - # Web `build` & `serve` dist path out_dir = "dist" +[web.app] + # resource (static) file folder public_dir = "public" diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 82060b436..c1639e815 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,4 +1,9 @@ -use std::{io::Write, path::PathBuf, process::Command, fs::copy}; +use std::{ + fs::{copy, create_dir_all}, + io::Write, + path::PathBuf, + process::Command, +}; use crate::{cfg::ConfigOptsBuild, gen_page}; use std::fs::remove_dir_all; @@ -25,7 +30,7 @@ impl Build { if self.build.platform.is_some() { if self.build.platform.unwrap().to_uppercase() == "DESKTOP" { - log::info!("🚅 Running build command..."); + log::info!("🚅 Running build [Desktop] command..."); let mut cmd = Command::new("cargo"); cmd.current_dir(&crate_config.crate_dir) @@ -47,36 +52,52 @@ impl Build { if output.status.success() { if crate_config.out_dir.is_dir() { - remove_dir_all(&crate_config.out_dir)?; + } - let release_type = match crate_config.release { - true => "release", - false => "debug", - }; - - let mut res_path = match &crate_config.executable { - crate::ExecutableType::Binary(name) - | crate::ExecutableType::Lib(name) => crate_config + let release_type = match crate_config.release { + true => "release", + false => "debug", + }; + + let file_name: String; + let mut res_path = match &crate_config.executable { + crate::ExecutableType::Binary(name) | crate::ExecutableType::Lib(name) => { + file_name = name.clone(); + crate_config .target_dir .join(format!("{}", release_type)) - .join(format!("{}", name)), - - crate::ExecutableType::Example(name) => crate_config - .target_dir - .join(format!("{}/examples", release_type)) - .join(format!("{}", name)), - }; - - let target_file; - if cfg!(windows) { - res_path.set_extension("exe"); - target_file = format!("{}.exe", &crate_config.dioxus_config.application.name); - } else { - target_file = crate_config.dioxus_config.application.name.clone(); + .join(format!("{}", name)) } - copy(res_path, &crate_config.out_dir.join(target_file))?; + crate::ExecutableType::Example(name) => { + file_name = name.clone(); + crate_config + .target_dir + .join(format!("{}", release_type)) + .join("examples") + .join(format!("{}", name)) + } + }; + + let target_file; + if cfg!(windows) { + res_path.set_extension("exe"); + target_file = format!("{}.exe", &file_name); + } else { + target_file = file_name.clone(); } + create_dir_all(&crate_config.out_dir)?; + copy(res_path, &crate_config.out_dir.join(target_file))?; + + log::info!( + "🏛 Build completed: [:{}]", + &crate_config + .dioxus_config + .application + .out_dir + .unwrap_or(PathBuf::from("dist")) + .display() + ); } return Ok(()); @@ -93,8 +114,7 @@ impl Build { .join( crate_config .dioxus_config - .web - .app + .application .out_dir .clone() .unwrap_or(PathBuf::from("dist")), diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 7010d62e6..0734f362d 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -2,7 +2,6 @@ use std::path::PathBuf; use structopt::StructOpt; use serde::Deserialize; -use std::collections::HashMap; /// Config options for the build system. #[derive(Clone, Debug, Default, Deserialize, StructOpt)] diff --git a/src/cli/clean/mod.rs b/src/cli/clean/mod.rs index 4ab7653d2..7ba33b530 100644 --- a/src/cli/clean/mod.rs +++ b/src/cli/clean/mod.rs @@ -28,8 +28,7 @@ impl Clean { let out_dir = crate_config .dioxus_config - .web - .app + .application .out_dir .unwrap_or(PathBuf::from("dist")); if crate_config.crate_dir.join(&out_dir).is_dir() { diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 57716ac7e..8b002e1fb 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -41,8 +41,7 @@ impl Serve { .join( crate_config .dioxus_config - .web - .app + .application .out_dir .clone() .unwrap_or(PathBuf::from("dist")), diff --git a/src/config.rs b/src/config.rs index 403ad0e81..ad1e25ea5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -39,11 +39,11 @@ impl Default for DioxusConfig { application: ApplicationConfig { name: "dioxus".into(), platforms: vec![String::from("web")], + out_dir: Some(PathBuf::from("dist")), }, web: WebConfig { app: WebAppConfing { title: Some("dioxus | ⛺".into()), - out_dir: Some(PathBuf::from("dist")), public_dir: Some(PathBuf::from("public")), }, watcher: WebWatcherConfing { @@ -67,6 +67,7 @@ impl Default for DioxusConfig { pub struct ApplicationConfig { pub name: String, pub platforms: Vec, + pub out_dir: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -79,7 +80,6 @@ pub struct WebConfig { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebAppConfing { pub title: Option, - pub out_dir: Option, pub public_dir: Option, } @@ -130,7 +130,7 @@ impl CrateConfig { let workspace_dir = crate::cargo::workspace_root()?; let target_dir = workspace_dir.join("target"); - let out_dir = match dioxus_config.web.app.out_dir { + let out_dir = match dioxus_config.application.out_dir { Some(ref v) => crate_dir.join(v), None => crate_dir.join("dist"), }; From d6957774026620c8649e92202e312432580c771c Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 24 Jan 2022 11:55:27 +0800 Subject: [PATCH 031/330] feat: support `desktop` --- src/builder.rs | 81 +++++++++++++++++++++++++++++++++++++++++++- src/cli/build/mod.rs | 80 ++----------------------------------------- src/cli/cfg.rs | 4 +++ src/cli/serve/mod.rs | 25 +++++++++++++- 4 files changed, 110 insertions(+), 80 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 0ecde96cd..415e56480 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -3,7 +3,11 @@ use crate::{ error::{Error, Result}, DioxusConfig, }; -use std::process::Command; +use std::{ + fs::{copy, create_dir_all, remove_dir_all}, + path::PathBuf, + process::Command, +}; use wasm_bindgen_cli_support::Bindgen; pub fn build(config: &CrateConfig) -> Result<()> { @@ -116,6 +120,81 @@ pub fn build(config: &CrateConfig) -> Result<()> { Ok(()) } +pub fn build_desktop(config: &CrateConfig) -> Result<()> { + log::info!("🚅 Running build [Desktop] command..."); + + let mut cmd = Command::new("cargo"); + cmd.current_dir(&config.crate_dir) + .arg("build") + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + + if config.release { + cmd.arg("--release"); + } + + match &config.executable { + crate::ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), + crate::ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), + crate::ExecutableType::Example(name) => cmd.arg("--example").arg(name), + }; + + let output = cmd.output()?; + + if output.status.success() { + if config.out_dir.is_dir() { + remove_dir_all(&config.out_dir)?; + } + + let release_type = match config.release { + true => "release", + false => "debug", + }; + + let file_name: String; + let mut res_path = match &config.executable { + crate::ExecutableType::Binary(name) | crate::ExecutableType::Lib(name) => { + file_name = name.clone(); + config + .target_dir + .join(format!("{}", release_type)) + .join(format!("{}", name)) + } + crate::ExecutableType::Example(name) => { + file_name = name.clone(); + config + .target_dir + .join(format!("{}", release_type)) + .join("examples") + .join(format!("{}", name)) + } + }; + + let target_file; + if cfg!(windows) { + res_path.set_extension("exe"); + target_file = format!("{}.exe", &file_name); + } else { + target_file = file_name.clone(); + } + create_dir_all(&config.out_dir)?; + copy(res_path, &config.out_dir.join(target_file))?; + + log::info!( + "🚩 Build completed: [./{}]", + config + .dioxus_config + .application + .out_dir + .clone() + .unwrap_or(PathBuf::from("dist")) + .display() + ); + } + + Ok(()) +} + pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { let mut html = String::from(include_str!("./assets/index.html")); diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index c1639e815..f018165ef 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,12 +1,6 @@ -use std::{ - fs::{copy, create_dir_all}, - io::Write, - path::PathBuf, - process::Command, -}; +use std::{io::Write, path::PathBuf}; use crate::{cfg::ConfigOptsBuild, gen_page}; -use std::fs::remove_dir_all; use structopt::StructOpt; /// Build the Rust WASM app and all of its assets. @@ -30,77 +24,7 @@ impl Build { if self.build.platform.is_some() { if self.build.platform.unwrap().to_uppercase() == "DESKTOP" { - log::info!("🚅 Running build [Desktop] command..."); - - let mut cmd = Command::new("cargo"); - cmd.current_dir(&crate_config.crate_dir) - .arg("build") - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - - if self.build.release { - cmd.arg("--release"); - } - - match &crate_config.executable { - crate::ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), - crate::ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), - crate::ExecutableType::Example(name) => cmd.arg("--example").arg(name), - }; - - let output = cmd.output()?; - - if output.status.success() { - if crate_config.out_dir.is_dir() { - remove_dir_all(&crate_config.out_dir)?; - } - - let release_type = match crate_config.release { - true => "release", - false => "debug", - }; - - let file_name: String; - let mut res_path = match &crate_config.executable { - crate::ExecutableType::Binary(name) | crate::ExecutableType::Lib(name) => { - file_name = name.clone(); - crate_config - .target_dir - .join(format!("{}", release_type)) - .join(format!("{}", name)) - } - crate::ExecutableType::Example(name) => { - file_name = name.clone(); - crate_config - .target_dir - .join(format!("{}", release_type)) - .join("examples") - .join(format!("{}", name)) - } - }; - - let target_file; - if cfg!(windows) { - res_path.set_extension("exe"); - target_file = format!("{}.exe", &file_name); - } else { - target_file = file_name.clone(); - } - create_dir_all(&crate_config.out_dir)?; - copy(res_path, &crate_config.out_dir.join(target_file))?; - - log::info!( - "🏛 Build completed: [:{}]", - &crate_config - .dioxus_config - .application - .out_dir - .unwrap_or(PathBuf::from("dist")) - .display() - ); - } - - return Ok(()); + crate::builder::build_desktop(&crate_config)?; } } diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 0734f362d..454da71fe 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -38,6 +38,10 @@ pub struct ConfigOptsServe { #[structopt(long)] #[serde(default)] pub release: bool, + + /// Build platform: support Web & Desktop [default: "web"] + #[structopt(long)] + pub platform: Option, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 8b002e1fb..ef413a63e 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,5 +1,5 @@ use crate::{cfg::ConfigOptsServe, gen_page, server, CrateConfig}; -use std::{io::Write, path::PathBuf}; +use std::{io::Write, path::PathBuf, process::Command}; use structopt::StructOpt; /// Run the WASM project on dev-server @@ -21,6 +21,29 @@ impl Serve { crate_config.as_example(self.serve.example.unwrap()); } + if self.serve.platform.is_some() { + if self.serve.platform.unwrap().to_uppercase() == "DESKTOP" { + crate::builder::build_desktop(&crate_config)?; + + match &crate_config.executable { + crate::ExecutableType::Binary(name) + | crate::ExecutableType::Lib(name) + | crate::ExecutableType::Example(name) => { + let mut file = crate_config.out_dir.join(name); + if cfg!(windows) { + file.set_extension("exe"); + } + Command::new(format!( + "{}", + crate_config.out_dir.join(file).to_str().unwrap() + )) + .output()?; + } + } + return Ok(()); + } + } + crate::builder::build(&crate_config).expect("build failed"); // generate dev-index page From 4cc7752adf17e41e153bcfa490ea14964e67b863 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 24 Jan 2022 12:16:02 +0800 Subject: [PATCH 032/330] fix: change `init` to `create` --- src/cli/{init => create}/mod.rs | 10 +++++----- src/cli/mod.rs | 4 ++-- src/config.rs | 3 +-- src/main.rs | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) rename src/cli/{init => create}/mod.rs (94%) diff --git a/src/cli/init/mod.rs b/src/cli/create/mod.rs similarity index 94% rename from src/cli/init/mod.rs rename to src/cli/create/mod.rs index a19ee68fd..7cb2edbbe 100644 --- a/src/cli/init/mod.rs +++ b/src/cli/create/mod.rs @@ -13,8 +13,8 @@ use crate::{error::Result, Error}; /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Default, Deserialize, StructOpt)] -#[structopt(name = "init")] -pub struct Init { +#[structopt(name = "create")] +pub struct Create { /// Init project name #[structopt(default_value = ".")] name: String, @@ -29,8 +29,8 @@ pub struct Init { pub lib: bool, } -impl Init { - pub fn init(self) -> Result<()> { +impl Create { + pub fn create(self) -> Result<()> { if Self::name_vaild_check(self.name.clone()) { log::error!("❗Unsupported project name."); return Ok(()); @@ -45,7 +45,7 @@ impl Init { ))); } - log::info!("🔧 Start to init a new project '{}'.", self.name); + log::info!("🔧 Start to create a new project '{}'.", self.name); let output = Command::new("cargo") .arg("generate") diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 6224cea32..91d561463 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -3,7 +3,7 @@ use structopt::StructOpt; pub mod build; pub mod cfg; pub mod clean; -pub mod init; +pub mod create; pub mod serve; pub mod translate; @@ -35,7 +35,7 @@ pub enum Commands { /// Build, watch & serve the Rust WASM app and all of its assets. Serve(serve::Serve), /// Init a new project for Dioxus. - Init(init::Init), + Create(create::Create), // /// Clean output artifacts. Clean(clean::Clean), // /// Trunk config controls. diff --git a/src/config.rs b/src/config.rs index ad1e25ea5..fa52ddcbc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,8 +13,7 @@ impl DioxusConfig { let crate_dir = crate::cargo::crate_root()?; if !crate_dir.join("Dioxus.toml").is_file() { - log::warn!("Config file: `Dioxus.toml` not found."); - return Ok(Self::default()); + return Err(crate::error::Error::Unique("Config file: `Dioxus.toml` not found.".into())); } let mut dioxus_conf_file = File::open(crate_dir.join("Dioxus.toml"))?; diff --git a/src/main.rs b/src/main.rs index 70f92cf95..20536048b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,9 +34,9 @@ async fn main() -> Result<()> { } } - Commands::Init(opts) => { - if let Err(e) = opts.init() { - log::error!("init error: {}", e); + Commands::Create(opts) => { + if let Err(e) = opts.create() { + log::error!("create error: {}", e); } } } From 66b832045ad436c4577990ef138407331d38d056 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 24 Jan 2022 16:18:16 +0800 Subject: [PATCH 033/330] feat: add `config` command --- Dioxus.toml => src/assets/dioxus.toml | 18 +++++------ src/cli/config/mod.rs | 43 +++++++++++++++++++++++++++ src/cli/create/mod.rs | 5 ---- src/cli/mod.rs | 7 +++-- src/config.rs | 4 ++- src/main.rs | 6 ++++ 6 files changed, 63 insertions(+), 20 deletions(-) rename Dioxus.toml => src/assets/dioxus.toml (79%) create mode 100644 src/cli/config/mod.rs diff --git a/Dioxus.toml b/src/assets/dioxus.toml similarity index 79% rename from Dioxus.toml rename to src/assets/dioxus.toml index 86f52c349..717b070e2 100644 --- a/Dioxus.toml +++ b/src/assets/dioxus.toml @@ -1,7 +1,7 @@ [application] # App (Project) Name -name = "dioxus-cli" +name = "{{project-name}}" # Dioxus App Support Platform # desktop, web, mobile, ssr @@ -12,31 +12,27 @@ out_dir = "dist" [web.app] +# HTML title tag content +title = "dioxus | ⛺" + # resource (static) file folder public_dir = "public" [web.watcher] - watch_path = ["src"] # include `assets` in web platform [web.resource] # CSS style file -style = [ - "./my-style.css" -] +style = [] # Javascript code file -script = [ - "./app.js" -] +script = [] [web.resource.dev] # Javascript code file # serve: [dev-server] only -script = [ - "./debug.js" -] \ No newline at end of file +script = [] \ No newline at end of file diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs new file mode 100644 index 000000000..5e903dc3a --- /dev/null +++ b/src/cli/config/mod.rs @@ -0,0 +1,43 @@ +use std::{fs::File, io::Write}; + +use serde::Deserialize; +use structopt::StructOpt; + +/// Build the Rust WASM app and all of its assets. +#[derive(Clone, Debug, Deserialize, StructOpt)] +#[structopt(name = "config")] +pub enum Config { + /// Init `Dioxus.toml` for project/folder. + Init { + /// Init project name + name: String, + + /// Cover old config + #[structopt(long)] + #[serde(default)] + force: bool, + }, +} + +impl Config { + pub fn config(self) -> anyhow::Result<()> { + let crate_root = crate::cargo::crate_root()?; + match self { + Config::Init { name, force } => { + let conf_path = crate_root.join("Dioxus.toml"); + if conf_path.is_file() && force == false { + log::warn!( + "config file `Dioxus.toml` already exist, use `--force` to overwrite it." + ); + return Ok(()); + } + let mut file = File::create(conf_path)?; + let content = String::from(include_str!("../../assets/dioxus.toml")) + .replace("{{project-name}}", &name); + file.write_all(content.as_bytes())?; + log::info!("🚩 Init config file completed."); + } + } + Ok(()) + } +} diff --git a/src/cli/create/mod.rs b/src/cli/create/mod.rs index 7cb2edbbe..42364ddab 100644 --- a/src/cli/create/mod.rs +++ b/src/cli/create/mod.rs @@ -22,11 +22,6 @@ pub struct Create { /// Template path #[structopt(default_value = "gh:dioxuslabs/dioxus-template", long)] template: String, - - /// Create a `lib` project, include a `hello-world` example. - #[structopt(long)] - #[serde(default)] - pub lib: bool, } impl Create { diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 91d561463..4a72e00ac 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -3,6 +3,7 @@ use structopt::StructOpt; pub mod build; pub mod cfg; pub mod clean; +pub mod config; pub mod create; pub mod serve; pub mod translate; @@ -36,8 +37,8 @@ pub enum Commands { Serve(serve::Serve), /// Init a new project for Dioxus. Create(create::Create), - // /// Clean output artifacts. + /// Clean output artifacts. Clean(clean::Clean), - // /// Trunk config controls. - // Config(config::Config), + /// Dioxus config file controls. + Config(config::Config), } diff --git a/src/config.rs b/src/config.rs index fa52ddcbc..fb26b50bf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,7 +13,9 @@ impl DioxusConfig { let crate_dir = crate::cargo::crate_root()?; if !crate_dir.join("Dioxus.toml").is_file() { - return Err(crate::error::Error::Unique("Config file: `Dioxus.toml` not found.".into())); + return Err(crate::error::Error::Unique( + "Config file: `Dioxus.toml` not found.".into(), + )); } let mut dioxus_conf_file = File::open(crate_dir.join("Dioxus.toml"))?; diff --git a/src/main.rs b/src/main.rs index 20536048b..1ef3a08f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,6 +39,12 @@ async fn main() -> Result<()> { log::error!("create error: {}", e); } } + + Commands::Config(opts) => { + if let Err(e) = opts.config() { + log::error!("config error: {}", e); + } + } } Ok(()) From 84d1867654482640fa2cf31dd3eae10bf1bfa52d Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 25 Jan 2022 12:42:27 +0800 Subject: [PATCH 034/330] fix: use clippy fix --- src/builder.rs | 18 +++++++++--------- src/cli/build/mod.rs | 6 ++---- src/cli/config/mod.rs | 2 +- src/cli/create/mod.rs | 2 +- src/cli/serve/mod.rs | 29 ++++++++++++----------------- src/cli/translate/mod.rs | 4 ++-- src/cli/translate/to_component.rs | 2 +- src/config.rs | 15 +++++++-------- src/logging.rs | 2 +- 9 files changed, 36 insertions(+), 44 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 415e56480..c281f2b80 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -157,16 +157,16 @@ pub fn build_desktop(config: &CrateConfig) -> Result<()> { file_name = name.clone(); config .target_dir - .join(format!("{}", release_type)) - .join(format!("{}", name)) + .join(release_type.to_string()) + .join(name.to_string()) } crate::ExecutableType::Example(name) => { file_name = name.clone(); config .target_dir - .join(format!("{}", release_type)) + .join(release_type.to_string()) .join("examples") - .join(format!("{}", name)) + .join(name.to_string()) } }; @@ -175,7 +175,7 @@ pub fn build_desktop(config: &CrateConfig) -> Result<()> { res_path.set_extension("exe"); target_file = format!("{}.exe", &file_name); } else { - target_file = file_name.clone(); + target_file = file_name; } create_dir_all(&config.out_dir)?; copy(res_path, &config.out_dir.join(target_file))?; @@ -200,12 +200,12 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { let resouces = config.web.resource.clone(); - let mut style_list = resouces.style.unwrap_or(vec![]); - let mut script_list = resouces.script.unwrap_or(vec![]); + let mut style_list = resouces.style.unwrap_or_default(); + let mut script_list = resouces.script.unwrap_or_default(); if serve { - let mut dev_style = resouces.dev.style.clone().unwrap_or(vec![]); - let mut dev_script = resouces.dev.script.clone().unwrap_or(vec![]); + let mut dev_style = resouces.dev.style.clone().unwrap_or_default(); + let mut dev_script = resouces.dev.script.unwrap_or_default(); style_list.append(&mut dev_style); script_list.append(&mut dev_script); } diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index f018165ef..318f6b7f5 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -22,10 +22,8 @@ impl Build { crate_config.as_example(self.build.example.unwrap()); } - if self.build.platform.is_some() { - if self.build.platform.unwrap().to_uppercase() == "DESKTOP" { - crate::builder::build_desktop(&crate_config)?; - } + if self.build.platform.is_some() && self.build.platform.unwrap().to_uppercase() == "DESKTOP" { + crate::builder::build_desktop(&crate_config)?; } crate::builder::build(&crate_config)?; diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs index 5e903dc3a..d5291a7d6 100644 --- a/src/cli/config/mod.rs +++ b/src/cli/config/mod.rs @@ -25,7 +25,7 @@ impl Config { match self { Config::Init { name, force } => { let conf_path = crate_root.join("Dioxus.toml"); - if conf_path.is_file() && force == false { + if conf_path.is_file() && !force { log::warn!( "config file `Dioxus.toml` already exist, use `--force` to overwrite it." ); diff --git a/src/cli/create/mod.rs b/src/cli/create/mod.rs index 42364ddab..fa553c55a 100644 --- a/src/cli/create/mod.rs +++ b/src/cli/create/mod.rs @@ -83,7 +83,7 @@ impl Create { meta_file = meta_file.replace("{{project-name}}", &self.name); File::create(project_path.join("Dioxus.toml"))?.write_all(meta_file.as_bytes())?; - println!(""); + println!(); log::info!("💡 Project initialized:"); log::info!("🎯> cd ./{}", self.name); log::info!("🎯> dioxus serve"); diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index ef413a63e..04795ab13 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -21,27 +21,22 @@ impl Serve { crate_config.as_example(self.serve.example.unwrap()); } - if self.serve.platform.is_some() { - if self.serve.platform.unwrap().to_uppercase() == "DESKTOP" { - crate::builder::build_desktop(&crate_config)?; + if self.serve.platform.is_some() && self.serve.platform.unwrap().to_uppercase() == "DESKTOP" { + crate::builder::build_desktop(&crate_config)?; - match &crate_config.executable { - crate::ExecutableType::Binary(name) - | crate::ExecutableType::Lib(name) - | crate::ExecutableType::Example(name) => { - let mut file = crate_config.out_dir.join(name); - if cfg!(windows) { - file.set_extension("exe"); - } - Command::new(format!( - "{}", - crate_config.out_dir.join(file).to_str().unwrap() - )) - .output()?; + match &crate_config.executable { + crate::ExecutableType::Binary(name) + | crate::ExecutableType::Lib(name) + | crate::ExecutableType::Example(name) => { + let mut file = crate_config.out_dir.join(name); + if cfg!(windows) { + file.set_extension("exe"); } + Command::new(crate_config.out_dir.join(file).to_str().unwrap().to_string()) + .output()?; } - return Ok(()); } + return Ok(()); } crate::builder::build(&crate_config).expect("build failed"); diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index 5799cad02..a62a1b4b3 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -48,7 +48,7 @@ impl Translate { exit(0); }) }); - if let None = temp { + if temp.is_none() { if let Some(s) = source { contents = s; } else { @@ -112,7 +112,7 @@ fn render_child(f: &mut impl Write, child: &Node, il: u32) -> std::fmt::Result { } write!(f, "\",")?; } - write!(f, "\n")?; + writeln!(f)?; // write the attributes if let Some(id) = &el.id { diff --git a/src/cli/translate/to_component.rs b/src/cli/translate/to_component.rs index 972da7a25..c83777ccb 100644 --- a/src/cli/translate/to_component.rs +++ b/src/cli/translate/to_component.rs @@ -120,7 +120,7 @@ fn render_element<'a>( } write!(f, "\",")?; } - write!(f, "\n")?; + writeln!(f)?; // write the attributes if let Some(id) = &el.id { diff --git a/src/config.rs b/src/config.rs index fb26b50bf..fa7e1bd1c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,12 +23,12 @@ impl DioxusConfig { dioxus_conf_file.read_to_string(&mut meta_str)?; match toml::from_str::(&meta_str) { - Ok(v) => return Ok(v), + Ok(v) => Ok(v), Err(e) => { log::error!("{}", e); - return Err(crate::error::Error::Unique( + Err(crate::error::Error::Unique( "Dioxus.toml parse failed".into(), - )); + )) } } } @@ -147,16 +147,15 @@ impl CrateConfig { // We just assume they're using a 'main.rs' // Anyway, we've already parsed the manifest, so it should be easy to change the type - let output_filename = (&manifest) + let output_filename = manifest .lib .as_ref() .and_then(|lib| lib.name.clone()) .or_else(|| { - (&manifest) + manifest .package - .as_ref() - .and_then(|pkg| Some(pkg.name.clone())) - .clone() + .as_ref().map(|pkg| pkg.name.clone()) + }) .expect("No lib found from cargo metadata"); let executable = ExecutableType::Binary(output_filename); diff --git a/src/logging.rs b/src/logging.rs index d30eeee47..48c2a2788 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -14,7 +14,7 @@ pub fn set_up_logging() { // configure colors for the name of the level. // since almost all of them are the same as the color for the whole line, we // just clone `colors_line` and overwrite our changes - let colors_level = colors_line.clone().info(Color::Green); + let colors_level = colors_line.info(Color::Green); // here we set up our fern Dispatch fern::Dispatch::new() .format(move |out, message, record| { From 1c2cf3330ee164a9492342ab1132f8d17b15931b Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 25 Jan 2022 13:52:33 +0800 Subject: [PATCH 035/330] fix: use clippy fix --- src/builder.rs | 4 ++-- src/cargo.rs | 6 +++--- src/cli/build/mod.rs | 2 +- src/cli/clean/mod.rs | 2 +- src/cli/serve/mod.rs | 2 +- src/cli/translate/mod.rs | 2 +- src/server/mod.rs | 28 +++++++++++++--------------- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index c281f2b80..7d76f75cc 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -187,7 +187,7 @@ pub fn build_desktop(config: &CrateConfig) -> Result<()> { .application .out_dir .clone() - .unwrap_or(PathBuf::from("dist")) + .unwrap_or_else(|| PathBuf::from("dist")) .display() ); } @@ -238,7 +238,7 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { html = html.replace("{app_name}", &config.application.name); - let title = config.web.app.title.clone().unwrap_or("dioxus | ⛺".into()); + let title = config.web.app.title.clone().unwrap_or_else(|| "dioxus | ⛺".into()); html.replace("{app_title}", &title) } diff --git a/src/cargo.rs b/src/cargo.rs index 3a911a81e..c268c5a3a 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -1,6 +1,6 @@ //! Utilities for working with cargo and rust files use crate::error::{Error, Result}; -use std::{env, fs, path::PathBuf, process::Command, str}; +use std::{env, fs, path::{PathBuf, Path}, process::Command, str}; /// How many parent folders are searched for a `Cargo.toml` const MAX_ANCESTORS: u32 = 10; @@ -44,7 +44,7 @@ pub fn workspace_root() -> Result { } let stdout = str::from_utf8(&output.stdout).unwrap(); - for line in stdout.lines() { + if let Some(line) = stdout.lines().next() { let meta: serde_json::Value = serde_json::from_str(line) .map_err(|_| Error::CargoError("InvalidOutput".to_string()))?; @@ -58,7 +58,7 @@ pub fn workspace_root() -> Result { } /// Checks if the directory contains `Cargo.toml` -fn contains_manifest(path: &PathBuf) -> bool { +fn contains_manifest(path: &Path) -> bool { fs::read_dir(path) .map(|entries| { entries diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 318f6b7f5..27015420b 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -39,7 +39,7 @@ impl Build { .application .out_dir .clone() - .unwrap_or(PathBuf::from("dist")), + .unwrap_or_else(|| PathBuf::from("dist")), ) .join("index.html"), )?; diff --git a/src/cli/clean/mod.rs b/src/cli/clean/mod.rs index 7ba33b530..62593b1ee 100644 --- a/src/cli/clean/mod.rs +++ b/src/cli/clean/mod.rs @@ -30,7 +30,7 @@ impl Clean { .dioxus_config .application .out_dir - .unwrap_or(PathBuf::from("dist")); + .unwrap_or_else(|| PathBuf::from("dist")); if crate_config.crate_dir.join(&out_dir).is_dir() { remove_dir_all(crate_config.crate_dir.join(&out_dir))?; } diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 04795ab13..a84d8136d 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -62,7 +62,7 @@ impl Serve { .application .out_dir .clone() - .unwrap_or(PathBuf::from("dist")), + .unwrap_or_else(|| PathBuf::from("dist")), ) .join("index.html"), )?; diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index a62a1b4b3..81b5092ed 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -48,7 +48,7 @@ impl Translate { exit(0); }) }); - if temp.is_none() { + if let Some(..) = temp { if let Some(s) = source { contents = s; } else { diff --git a/src/server/mod.rs b/src/server/mod.rs index 3151975d5..3092a01ec 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -49,7 +49,7 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { .watcher .watch_path .clone() - .unwrap_or(vec![PathBuf::from("src")]); + .unwrap_or_else(|| vec![PathBuf::from("src")]); let crate_dir = watcher_conf.crate_dir.clone(); loop { if let Ok(v) = rx.recv() { @@ -67,21 +67,19 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { } } - if reload { - if let Ok(_) = builder::build(&watcher_conf) { - // change the websocket reload state to true; - // the page will auto-reload. - if watcher_conf - .dioxus_config - .web - .watcher - .reload_html - .unwrap_or(false) - { - let _ = Serve::regen_dev_page(&watcher_conf); - } - watcher_ws_state.lock().unwrap().change(); + if reload && builder::build(&watcher_conf).is_ok() { + // change the websocket reload state to true; + // the page will auto-reload. + if watcher_conf + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&watcher_conf); } + watcher_ws_state.lock().unwrap().change(); } } _ => {} From 25e3ee848cadcd14ff291b39436266857037a11a Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 25 Jan 2022 17:09:06 +0800 Subject: [PATCH 036/330] fix: high CPU usage --- src/server/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/mod.rs b/src/server/mod.rs index 3092a01ec..364b7c572 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -118,6 +118,7 @@ async fn ws_handler( ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { loop { + tokio::time::sleep(tokio::time::Duration::from_millis(1200)).await; if state.lock().unwrap().update { socket .send(Message::Text(String::from("reload"))) From b01b3f519f5a2a279cb60c479e7000d9819fed33 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 25 Jan 2022 17:51:36 +0800 Subject: [PATCH 037/330] fix: commit code --- src/builder.rs | 17 ++++++++++------ src/cargo.rs | 7 ++++++- src/cli/build/mod.rs | 14 +++++++++---- src/cli/cfg.rs | 8 ++++---- src/cli/serve/mod.rs | 47 ++++++++++++++++++++++++++++---------------- src/config.rs | 12 +++-------- src/main.rs | 3 --- src/server/mod.rs | 6 +++--- 8 files changed, 67 insertions(+), 47 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 7d76f75cc..583c9bc8f 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -170,13 +170,13 @@ pub fn build_desktop(config: &CrateConfig) -> Result<()> { } }; - let target_file; - if cfg!(windows) { + let target_file = if cfg!(windows) { res_path.set_extension("exe"); - target_file = format!("{}.exe", &file_name); + format!("{}.exe", &file_name) } else { - target_file = file_name; - } + file_name + }; + create_dir_all(&config.out_dir)?; copy(res_path, &config.out_dir.join(target_file))?; @@ -238,7 +238,12 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { html = html.replace("{app_name}", &config.application.name); - let title = config.web.app.title.clone().unwrap_or_else(|| "dioxus | ⛺".into()); + let title = config + .web + .app + .title + .clone() + .unwrap_or_else(|| "dioxus | ⛺".into()); html.replace("{app_title}", &title) } diff --git a/src/cargo.rs b/src/cargo.rs index c268c5a3a..67a3e48f1 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -1,6 +1,11 @@ //! Utilities for working with cargo and rust files use crate::error::{Error, Result}; -use std::{env, fs, path::{PathBuf, Path}, process::Command, str}; +use std::{ + env, fs, + path::{Path, PathBuf}, + process::Command, + str, +}; /// How many parent folders are searched for a `Cargo.toml` const MAX_ANCESTORS: u32 = 10; diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 27015420b..684cec58c 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -22,12 +22,18 @@ impl Build { crate_config.as_example(self.build.example.unwrap()); } - if self.build.platform.is_some() && self.build.platform.unwrap().to_uppercase() == "DESKTOP" { - crate::builder::build_desktop(&crate_config)?; + match self.build.platform.as_str() { + "web" => { + crate::builder::build(&crate_config)?; + } + "desktop" => { + crate::builder::build_desktop(&crate_config)?; + } + _ => { + return Err(anyhow::anyhow!("Unsoppurt platform target.")); + } } - crate::builder::build(&crate_config)?; - let temp = gen_page(&crate_config.dioxus_config, false); let mut file = std::fs::File::create( diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 454da71fe..ece00e07e 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -20,8 +20,8 @@ pub struct ConfigOptsBuild { pub example: Option, /// Build platform: support Web & Desktop [default: "web"] - #[structopt(long)] - pub platform: Option, + #[structopt(long, default_value = "web")] + pub platform: String, } #[derive(Clone, Debug, Default, Deserialize, StructOpt)] @@ -40,8 +40,8 @@ pub struct ConfigOptsServe { pub release: bool, /// Build platform: support Web & Desktop [default: "web"] - #[structopt(long)] - pub platform: Option, + #[structopt(long, default_value = "web")] + pub platform: String, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index a84d8136d..fd8f3c4f5 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -21,25 +21,38 @@ impl Serve { crate_config.as_example(self.serve.example.unwrap()); } - if self.serve.platform.is_some() && self.serve.platform.unwrap().to_uppercase() == "DESKTOP" { - crate::builder::build_desktop(&crate_config)?; - - match &crate_config.executable { - crate::ExecutableType::Binary(name) - | crate::ExecutableType::Lib(name) - | crate::ExecutableType::Example(name) => { - let mut file = crate_config.out_dir.join(name); - if cfg!(windows) { - file.set_extension("exe"); - } - Command::new(crate_config.out_dir.join(file).to_str().unwrap().to_string()) - .output()?; - } + match self.serve.platform.as_str() { + "web" => { + crate::builder::build(&crate_config)?; } - return Ok(()); - } + "desktop" => { + crate::builder::build_desktop(&crate_config)?; - crate::builder::build(&crate_config).expect("build failed"); + match &crate_config.executable { + crate::ExecutableType::Binary(name) + | crate::ExecutableType::Lib(name) + | crate::ExecutableType::Example(name) => { + let mut file = crate_config.out_dir.join(name); + if cfg!(windows) { + file.set_extension("exe"); + } + Command::new( + crate_config + .out_dir + .join(file) + .to_str() + .unwrap() + .to_string(), + ) + .output()?; + } + } + return Ok(()); + } + _ => { + return Err(anyhow::anyhow!("Unsoppurt platform target.")); + } + } // generate dev-index page Serve::regen_dev_page(&crate_config)?; diff --git a/src/config.rs b/src/config.rs index fa7e1bd1c..088955910 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,9 +13,8 @@ impl DioxusConfig { let crate_dir = crate::cargo::crate_root()?; if !crate_dir.join("Dioxus.toml").is_file() { - return Err(crate::error::Error::Unique( - "Config file: `Dioxus.toml` not found.".into(), - )); + log::warn!("Config file: `Dioxus.toml` not found; using default config."); + return Ok(DioxusConfig::default()); } let mut dioxus_conf_file = File::open(crate_dir.join("Dioxus.toml"))?; @@ -151,12 +150,7 @@ impl CrateConfig { .lib .as_ref() .and_then(|lib| lib.name.clone()) - .or_else(|| { - manifest - .package - .as_ref().map(|pkg| pkg.name.clone()) - - }) + .or_else(|| manifest.package.as_ref().map(|pkg| pkg.name.clone())) .expect("No lib found from cargo metadata"); let executable = ExecutableType::Binary(output_filename); diff --git a/src/main.rs b/src/main.rs index 1ef3a08f1..6b8c177db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,9 +25,6 @@ async fn main() -> Result<()> { } } - // Commands::Config(_) => { - // // - // } Commands::Serve(opts) => { if let Err(e) = opts.serve().await { log::error!("serve error: {}", e); diff --git a/src/server/mod.rs b/src/server/mod.rs index 364b7c572..c7c9074ed 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -58,16 +58,16 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { | DebouncedEvent::Write(e) | DebouncedEvent::Remove(e) | DebouncedEvent::Rename(e, _) => { - let mut reload = false; + let mut should_reload = false; for path in &allow_watch_path { let temp = crate_dir.clone().join(path); if e.starts_with(temp) { - reload = true; + should_reload = true; break; } } - if reload && builder::build(&watcher_conf).is_ok() { + if should_reload && builder::build(&watcher_conf).is_ok() { // change the websocket reload state to true; // the page will auto-reload. if watcher_conf From 2c0b0460c9da1f8b30e3c91cce070e669b23d908 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 25 Jan 2022 18:01:33 +0800 Subject: [PATCH 038/330] fix: error wrap --- src/config.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/config.rs b/src/config.rs index 088955910..1151445ef 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,15 +21,8 @@ impl DioxusConfig { let mut meta_str = String::new(); dioxus_conf_file.read_to_string(&mut meta_str)?; - match toml::from_str::(&meta_str) { - Ok(v) => Ok(v), - Err(e) => { - log::error!("{}", e); - Err(crate::error::Error::Unique( - "Dioxus.toml parse failed".into(), - )) - } - } + toml::from_str::(&meta_str) + .map_err(|_| crate::Error::Unique("Dioxus.toml parse failed".into())) } } From 20977a49f0e0329dcdc77ccd01f4d5bb83fcf989 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Wed, 26 Jan 2022 00:21:40 +0800 Subject: [PATCH 039/330] fix: high CPU usage --- src/assets/autoreload.js | 17 ++++------- src/server/mod.rs | 63 ++++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 43 deletions(-) diff --git a/src/assets/autoreload.js b/src/assets/autoreload.js index ff4444085..b2baa1907 100644 --- a/src/assets/autoreload.js +++ b/src/assets/autoreload.js @@ -5,21 +5,16 @@ var poll_interval = 2000; - var reload_upon_connect = () => { - window.setTimeout(() => { - var ws = new WebSocket(url); - ws.onopen = () => window.location.reload(); - ws.onclose = reload_upon_connect; - }, poll_interval); - }; - var ws = new WebSocket(url); - ws.onmessage = (ev) => { + ws.addEventListener("message", (ev) => { if (ev.data == "reload") { window.location.reload(); } - }; + }); + + ws.addEventListener("open", () => { + ws.send("init"); + }); - ws.onclose = reload_upon_connect; })(); \ No newline at end of file diff --git a/src/server/mod.rs b/src/server/mod.rs index c7c9074ed..24504498a 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -20,8 +20,8 @@ struct WsRelodState { } impl WsRelodState { - fn change(&mut self) { - self.update = !self.update; + fn change(&mut self, state: bool) { + self.update = state; } } @@ -34,40 +34,35 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { // file watcher: check file change let mut watcher = watcher(tx, Duration::from_secs(1)).unwrap(); - watcher - .watch(config.crate_dir.clone(), notify::RecursiveMode::Recursive) - .unwrap(); + let allow_watch_path = config + .dioxus_config + .web + .watcher + .watch_path + .clone() + .unwrap_or_else(|| vec![PathBuf::from("src")]); + for sub_path in allow_watch_path { + watcher + .watch( + config.crate_dir.join(sub_path), + notify::RecursiveMode::Recursive, + ) + .unwrap(); + } let ws_reload_state = Arc::new(Mutex::new(WsRelodState { update: false })); let watcher_conf = config.clone(); let watcher_ws_state = ws_reload_state.clone(); tokio::spawn(async move { - let allow_watch_path = watcher_conf - .dioxus_config - .web - .watcher - .watch_path - .clone() - .unwrap_or_else(|| vec![PathBuf::from("src")]); - let crate_dir = watcher_conf.crate_dir.clone(); loop { if let Ok(v) = rx.recv() { match v { - DebouncedEvent::Create(e) - | DebouncedEvent::Write(e) - | DebouncedEvent::Remove(e) - | DebouncedEvent::Rename(e, _) => { - let mut should_reload = false; - for path in &allow_watch_path { - let temp = crate_dir.clone().join(path); - if e.starts_with(temp) { - should_reload = true; - break; - } - } - - if should_reload && builder::build(&watcher_conf).is_ok() { + DebouncedEvent::Create(_) + | DebouncedEvent::Write(_) + | DebouncedEvent::Remove(_) + | DebouncedEvent::Rename(_, _) => { + if builder::build(&watcher_conf).is_ok() { // change the websocket reload state to true; // the page will auto-reload. if watcher_conf @@ -79,7 +74,7 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { { let _ = Serve::regen_dev_page(&watcher_conf); } - watcher_ws_state.lock().unwrap().change(); + watcher_ws_state.lock().unwrap().change(true); } } _ => {} @@ -118,13 +113,17 @@ async fn ws_handler( ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { loop { - tokio::time::sleep(tokio::time::Duration::from_millis(1200)).await; + tokio::time::sleep(tokio::time::Duration::from_millis(1000)).await; if state.lock().unwrap().update { - socket + // ignore the error + if socket .send(Message::Text(String::from("reload"))) .await - .unwrap(); - state.lock().unwrap().change(); + .is_err() + { + return; + } + state.lock().unwrap().change(false); } } }) From 78980b2dbf62278bf939ece72c67f9ab35a39807 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Wed, 26 Jan 2022 10:18:31 +0800 Subject: [PATCH 040/330] fix: use channel --- src/assets/autoreload.js | 4 ++++ src/server/mod.rs | 52 +++++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/assets/autoreload.js b/src/assets/autoreload.js index b2baa1907..89054664e 100644 --- a/src/assets/autoreload.js +++ b/src/assets/autoreload.js @@ -17,4 +17,8 @@ ws.send("init"); }); + ws.addEventListener("close", () => { + alert("Dev-Server Socket Closed."); + }); + })(); \ No newline at end of file diff --git a/src/server/mod.rs b/src/server/mod.rs index 24504498a..366ea41ab 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -9,31 +9,26 @@ use notify::{watcher, DebouncedEvent, Watcher}; use std::time::Duration; use std::{ path::PathBuf, - sync::{mpsc::channel, Arc, Mutex}, + sync::{mpsc::channel, Arc}, }; use tower_http::services::ServeDir; use crate::{builder, serve::Serve, CrateConfig}; +use tokio::sync::broadcast; struct WsRelodState { - update: bool, -} - -impl WsRelodState { - fn change(&mut self, state: bool) { - self.update = state; - } + update: broadcast::Sender, } pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { log::info!("🚀 Starting development server..."); - let (tx, rx) = channel(); + let (watcher_tx, watcher_rx) = channel(); let dist_path = config.out_dir.clone(); // file watcher: check file change - let mut watcher = watcher(tx, Duration::from_secs(1)).unwrap(); + let mut watcher = watcher(watcher_tx, Duration::from_secs(1)).unwrap(); let allow_watch_path = config .dioxus_config .web @@ -50,13 +45,14 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { .unwrap(); } - let ws_reload_state = Arc::new(Mutex::new(WsRelodState { update: false })); + let (reload_tx, _) = broadcast::channel(100); + let ws_reload_state = Arc::new(WsRelodState { update: reload_tx }); let watcher_conf = config.clone(); - let watcher_ws_state = ws_reload_state.clone(); + let watcher_ws_state = ws_reload_state.update.clone(); tokio::spawn(async move { loop { - if let Ok(v) = rx.recv() { + if let Ok(v) = watcher_rx.recv() { match v { DebouncedEvent::Create(_) | DebouncedEvent::Write(_) @@ -74,7 +70,8 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { { let _ = Serve::regen_dev_page(&watcher_conf); } - watcher_ws_state.lock().unwrap().change(true); + println!("send reload!"); + watcher_ws_state.send("reload".into()).unwrap(); } } _ => {} @@ -109,21 +106,26 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { async fn ws_handler( ws: WebSocketUpgrade, _: Option>, - Extension(state): Extension>>, + Extension(state): Extension>, ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { + let mut rx = state.update.subscribe(); loop { - tokio::time::sleep(tokio::time::Duration::from_millis(1000)).await; - if state.lock().unwrap().update { - // ignore the error - if socket - .send(Message::Text(String::from("reload"))) - .await - .is_err() - { - return; + println!("wait"); + if let Ok(v) = rx.recv().await { + println!("trigger recv: {}", v); + if v == "reload" { + // ignore the error + if socket + .send(Message::Text(String::from("reload"))) + .await + .is_err() + { + return; + } } - state.lock().unwrap().change(false); + } else { + println!("SS"); } } }) From 7aeddba4270c404a1898382acd0b89b4b33096db Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Thu, 27 Jan 2022 01:03:17 +0800 Subject: [PATCH 041/330] fix: auto-connect `ws` server --- src/assets/autoreload.js | 40 +++++++------- src/server/mod.rs | 111 ++++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 74 deletions(-) diff --git a/src/assets/autoreload.js b/src/assets/autoreload.js index 89054664e..a6bbac5da 100644 --- a/src/assets/autoreload.js +++ b/src/assets/autoreload.js @@ -1,24 +1,22 @@ (function () { - var protocol = window.location.protocol === "https:" ? "wss:" : "ws:"; - - var url = protocol + "//" + window.location.host + "/_dioxus/ws"; - - var poll_interval = 2000; + var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + var url = protocol + '//' + window.location.host + '/_dioxus/ws'; + var poll_interval = 8080; + var reload_upon_connect = () => { + window.setTimeout( + () => { + var ws = new WebSocket(url); + ws.onopen = () => window.location.reload(); + ws.onclose = reload_upon_connect; + }, + poll_interval); + }; var ws = new WebSocket(url); - - ws.addEventListener("message", (ev) => { - if (ev.data == "reload") { - window.location.reload(); - } - }); - - ws.addEventListener("open", () => { - ws.send("init"); - }); - - ws.addEventListener("close", () => { - alert("Dev-Server Socket Closed."); - }); - -})(); \ No newline at end of file + ws.onmessage = (ev) => { + if (ev.data == "reload") { + window.location.reload(); + } + }; + ws.onclose = reload_upon_connect; +})() \ No newline at end of file diff --git a/src/server/mod.rs b/src/server/mod.rs index 366ea41ab..7dd4151eb 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -36,6 +36,7 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { .watch_path .clone() .unwrap_or_else(|| vec![PathBuf::from("src")]); + for sub_path in allow_watch_path { watcher .watch( @@ -46,60 +47,63 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { } let (reload_tx, _) = broadcast::channel(100); - let ws_reload_state = Arc::new(WsRelodState { update: reload_tx }); + + let ws_reload_state = Arc::new(WsRelodState { + update: reload_tx.clone(), + }); let watcher_conf = config.clone(); - let watcher_ws_state = ws_reload_state.update.clone(); + tokio::spawn(async move { - loop { - if let Ok(v) = watcher_rx.recv() { - match v { - DebouncedEvent::Create(_) - | DebouncedEvent::Write(_) - | DebouncedEvent::Remove(_) - | DebouncedEvent::Rename(_, _) => { - if builder::build(&watcher_conf).is_ok() { - // change the websocket reload state to true; - // the page will auto-reload. - if watcher_conf - .dioxus_config - .web - .watcher - .reload_html - .unwrap_or(false) - { - let _ = Serve::regen_dev_page(&watcher_conf); - } - println!("send reload!"); - watcher_ws_state.send("reload".into()).unwrap(); + while let Ok(v) = watcher_rx.recv() { + match v { + DebouncedEvent::Create(_) + | DebouncedEvent::Write(_) + | DebouncedEvent::Remove(_) + | DebouncedEvent::Rename(_, _) => { + if builder::build(&watcher_conf).is_ok() { + // change the websocket reload state to true; + // the page will auto-reload. + if watcher_conf + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&watcher_conf); } + reload_tx.send("reload".into()).unwrap(); } - _ => {} } + _ => {} } } }); - let app = Router::new() - .route("/_dioxus/ws", get(ws_handler)) - .fallback( - get_service(ServeDir::new(config.crate_dir.join(&dist_path))).handle_error( - |error: std::io::Error| async move { - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Unhandled internal error: {}", error), - ) - }, - ), - ) - .layer(AddExtensionLayer::new(ws_reload_state.clone())); - // start serve dev-server at 0.0.0.0:8080 let port = "8080"; log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); + axum::Server::bind(&format!("0.0.0.0:{}", port).parse().unwrap()) - .serve(app.into_make_service()) + .serve( + Router::new() + .route("/_dioxus/ws", get(ws_handler)) + .fallback( + get_service(ServeDir::new(config.crate_dir.join(&dist_path))).handle_error( + |error: std::io::Error| async move { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Unhandled internal error: {}", error), + ) + }, + ), + ) + .layer(AddExtensionLayer::new(ws_reload_state)) + .into_make_service(), + ) .await?; + Ok(()) } @@ -109,23 +113,24 @@ async fn ws_handler( Extension(state): Extension>, ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { + + log::info!("New websocket conenct."); + let mut rx = state.update.subscribe(); + loop { - println!("wait"); - if let Ok(v) = rx.recv().await { - println!("trigger recv: {}", v); - if v == "reload" { - // ignore the error - if socket - .send(Message::Text(String::from("reload"))) - .await - .is_err() - { - return; - } + let v = rx.recv().await.unwrap(); + println!("trigger recv: {}", v); + if v == "reload" { + // ignore the error + if socket + .send(Message::Text(String::from("reload"))) + .await + .is_err() + { + println!("send failed"); + return; } - } else { - println!("SS"); } } }) From b6172998609812a02cc9e68786e0cd283bc0e685 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Thu, 27 Jan 2022 11:13:41 +0800 Subject: [PATCH 042/330] fix: auto-reload --- Cargo.toml | 3 +- src/assets/autoreload.js | 1 + src/server/mod.rs | 131 +++++++++++++++++++++------------------ 3 files changed, 73 insertions(+), 62 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 68dd3ee56..5f6443245 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,8 @@ toml = "0.5.8" fs_extra = "1.2.0" cargo_toml = "0.10.0" futures = "0.3.12" -notify = "4.0.17" +# notify = "4.0.17" +notify = { version = "5.0.0-pre.13", features = ["serde"] } html_parser = "0.6.2" binary-install = "0.0.2" convert_case = "0.5.0" diff --git a/src/assets/autoreload.js b/src/assets/autoreload.js index a6bbac5da..da62e5eae 100644 --- a/src/assets/autoreload.js +++ b/src/assets/autoreload.js @@ -15,6 +15,7 @@ var ws = new WebSocket(url); ws.onmessage = (ev) => { if (ev.data == "reload") { + // alert("reload!!!"); window.location.reload(); } }; diff --git a/src/server/mod.rs b/src/server/mod.rs index 7dd4151eb..45d7191d0 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -5,12 +5,9 @@ use axum::{ routing::{get, get_service}, AddExtensionLayer, Router, }; -use notify::{watcher, DebouncedEvent, Watcher}; -use std::time::Duration; -use std::{ - path::PathBuf, - sync::{mpsc::channel, Arc}, -}; +use notify::{RecommendedWatcher, Watcher}; + +use std::{path::PathBuf, sync::Arc}; use tower_http::services::ServeDir; use crate::{builder, serve::Serve, CrateConfig}; @@ -23,12 +20,33 @@ struct WsRelodState { pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { log::info!("🚀 Starting development server..."); - let (watcher_tx, watcher_rx) = channel(); - let dist_path = config.out_dir.clone(); + let (reload_tx, _) = broadcast::channel(100); + + let ws_reload_state = Arc::new(WsRelodState { + update: reload_tx.clone(), + }); + // file watcher: check file change - let mut watcher = watcher(watcher_tx, Duration::from_secs(1)).unwrap(); + let watcher_conf = config.clone(); + let mut watcher = RecommendedWatcher::new(move |_| { + if builder::build(&watcher_conf).is_ok() { + // change the websocket reload state to true; + // the page will auto-reload. + if watcher_conf + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&watcher_conf); + } + reload_tx.send("reload".into()).unwrap(); + } + }) + .unwrap(); let allow_watch_path = config .dioxus_config .web @@ -40,46 +58,38 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { for sub_path in allow_watch_path { watcher .watch( - config.crate_dir.join(sub_path), + &config.crate_dir.join(sub_path), notify::RecursiveMode::Recursive, ) .unwrap(); } - let (reload_tx, _) = broadcast::channel(100); - - let ws_reload_state = Arc::new(WsRelodState { - update: reload_tx.clone(), - }); - - let watcher_conf = config.clone(); - - tokio::spawn(async move { - while let Ok(v) = watcher_rx.recv() { - match v { - DebouncedEvent::Create(_) - | DebouncedEvent::Write(_) - | DebouncedEvent::Remove(_) - | DebouncedEvent::Rename(_, _) => { - if builder::build(&watcher_conf).is_ok() { - // change the websocket reload state to true; - // the page will auto-reload. - if watcher_conf - .dioxus_config - .web - .watcher - .reload_html - .unwrap_or(false) - { - let _ = Serve::regen_dev_page(&watcher_conf); - } - reload_tx.send("reload".into()).unwrap(); - } - } - _ => {} - } - } - }); + // tokio::spawn(async move { + // while let Ok(v) = watcher_rx.recv() { + // match v { + // DebouncedEvent::Create(_) + // | DebouncedEvent::Write(_) + // | DebouncedEvent::Remove(_) + // | DebouncedEvent::Rename(_, _) => { + // if builder::build(&watcher_conf).is_ok() { + // // change the websocket reload state to true; + // // the page will auto-reload. + // if watcher_conf + // .dioxus_config + // .web + // .watcher + // .reload_html + // .unwrap_or(false) + // { + // let _ = Serve::regen_dev_page(&watcher_conf); + // } + // reload_tx.send("reload".into()).unwrap(); + // } + // } + // _ => {} + // } + // } + // }); // start serve dev-server at 0.0.0.0:8080 let port = "8080"; @@ -113,25 +123,24 @@ async fn ws_handler( Extension(state): Extension>, ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { - - log::info!("New websocket conenct."); - let mut rx = state.update.subscribe(); - - loop { - let v = rx.recv().await.unwrap(); - println!("trigger recv: {}", v); - if v == "reload" { - // ignore the error - if socket - .send(Message::Text(String::from("reload"))) - .await - .is_err() - { - println!("send failed"); - return; + let reload_watcher = tokio::spawn(async move { + loop { + let v = rx.recv().await.unwrap(); + println!("trigger recv: {}", v); + if v == "reload" { + // ignore the error + if socket + .send(Message::Text(String::from("reload"))) + .await + .is_err() + { + break; + } } } - } + }); + + reload_watcher.await.unwrap(); }) } From b8b0303904b3f01da5942355b5c61a5ea33c325c Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Thu, 27 Jan 2022 12:09:54 +0800 Subject: [PATCH 043/330] fix: dev server `auto-reload` --- Cargo.toml | 2 +- src/server/mod.rs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5f6443245..5bbfd7ac2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,6 @@ toml = "0.5.8" fs_extra = "1.2.0" cargo_toml = "0.10.0" futures = "0.3.12" -# notify = "4.0.17" notify = { version = "5.0.0-pre.13", features = ["serde"] } html_parser = "0.6.2" binary-install = "0.0.2" @@ -30,6 +29,7 @@ cargo_metadata = "0.14.1" tokio = { version = "1.15.0", features = ["full"] } atty = "0.2.14" regex = "1.5.4" +chrono = "0.4.19" axum = { version = "0.4.4", features = ["ws", "headers"] } tower-http = { version = "0.2.0", features = ["fs", "trace"] } diff --git a/src/server/mod.rs b/src/server/mod.rs index 45d7191d0..b1684d980 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -28,10 +28,14 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { update: reload_tx.clone(), }); + let mut last_update_time = chrono::Local::now().timestamp(); + // file watcher: check file change let watcher_conf = config.clone(); - let mut watcher = RecommendedWatcher::new(move |_| { - if builder::build(&watcher_conf).is_ok() { + let mut watcher = RecommendedWatcher::new(move | _ : notify::Result| { + if chrono::Local::now().timestamp() > last_update_time + && builder::build(&watcher_conf).is_ok() + { // change the websocket reload state to true; // the page will auto-reload. if watcher_conf @@ -43,7 +47,9 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { { let _ = Serve::regen_dev_page(&watcher_conf); } + println!("watcher send reload"); reload_tx.send("reload".into()).unwrap(); + last_update_time = chrono::Local::now().timestamp(); } }) .unwrap(); @@ -127,7 +133,6 @@ async fn ws_handler( let reload_watcher = tokio::spawn(async move { loop { let v = rx.recv().await.unwrap(); - println!("trigger recv: {}", v); if v == "reload" { // ignore the error if socket From 23e09f0d9f0b3740cb9b9809e3efdd0f2652c21c Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Thu, 27 Jan 2022 14:11:18 +0800 Subject: [PATCH 044/330] fix: delete comment --- src/server/mod.rs | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index b1684d980..880f25ceb 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -32,7 +32,7 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { // file watcher: check file change let watcher_conf = config.clone(); - let mut watcher = RecommendedWatcher::new(move | _ : notify::Result| { + let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { if chrono::Local::now().timestamp() > last_update_time && builder::build(&watcher_conf).is_ok() { @@ -70,33 +70,6 @@ pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { .unwrap(); } - // tokio::spawn(async move { - // while let Ok(v) = watcher_rx.recv() { - // match v { - // DebouncedEvent::Create(_) - // | DebouncedEvent::Write(_) - // | DebouncedEvent::Remove(_) - // | DebouncedEvent::Rename(_, _) => { - // if builder::build(&watcher_conf).is_ok() { - // // change the websocket reload state to true; - // // the page will auto-reload. - // if watcher_conf - // .dioxus_config - // .web - // .watcher - // .reload_html - // .unwrap_or(false) - // { - // let _ = Serve::regen_dev_page(&watcher_conf); - // } - // reload_tx.send("reload".into()).unwrap(); - // } - // } - // _ => {} - // } - // } - // }); - // start serve dev-server at 0.0.0.0:8080 let port = "8080"; log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); From b23e69cfbbf0af2d96ab897bf45e3944f863be59 Mon Sep 17 00:00:00 2001 From: c5soft Date: Thu, 27 Jan 2022 15:54:49 +0800 Subject: [PATCH 045/330] Refactor extension, make it easy to maintain and unique to register --- extension/LICENSE.txt | 21 +++++++++++ extension/package.json | 15 ++++---- extension/src/extension.ts | 75 +++++++++++++------------------------- 3 files changed, 54 insertions(+), 57 deletions(-) create mode 100644 extension/LICENSE.txt diff --git a/extension/LICENSE.txt b/extension/LICENSE.txt new file mode 100644 index 000000000..6fd3d45f6 --- /dev/null +++ b/extension/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 DioxusLabs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/extension/package.json b/extension/package.json index 3b72cfa8c..0a3d50b67 100644 --- a/extension/package.json +++ b/extension/package.json @@ -17,19 +17,19 @@ "Other" ], "activationEvents": [ - "onCommand:extension.htmlToRsx", - "onCommand:extension.htmlToComponent" + "onCommand:extension.htmlToDioxusRsx", + "onCommand:extension.htmlToDioxusComponent" ], "main": "./out/extension", "contributes": { "commands": [ { - "command": "extension.htmlToRsx", - "title": "Convert HTML to RSX" + "command": "extension.htmlToDioxusRsx", + "title": "Dioxus: Convert HTML to RSX" }, { - "command": "extension.htmlToComponent", - "title": "Convert HTML to Dioxus Component" + "command": "extension.htmlToDioxusComponent", + "title": "Dioxus: Convert HTML to Component" } ] }, @@ -37,7 +37,8 @@ "vscode:prepublish": "npm run compile", "compile": "tsc -p ./", "lint": "eslint . --ext .ts,.tsx", - "watch": "tsc -watch -p ./" + "watch": "tsc -watch -p ./", + "package": "vsce package" }, "devDependencies": { "@types/node": "^12.12.0", diff --git a/extension/src/extension.ts b/extension/src/extension.ts index c9ab06662..5a41c7f5f 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -1,57 +1,32 @@ -'use strict'; - import * as vscode from 'vscode'; import { spawn } from "child_process"; export function activate(context: vscode.ExtensionContext) { - const htmlToPureRsx = vscode.commands.registerCommand('extension.htmlToRsx', function () { - // Get the active text editor - const editor = vscode.window.activeTextEditor; - - if (editor) { - const document = editor.document; - const selection = editor.selection; - const word = document.getText(selection); - - const child_proc = spawn("dioxus", ["translate", "--source", word]); - - let result = ''; - child_proc.stdout?.on('data', data => result += data); - - child_proc.on('close', () => { - editor.edit(editBuilder => { - if (result != '') { - editBuilder.replace(selection, result) - } - }) - }); + function registerCommand(cmd: string) { + function convert(cmd: string) { + const editor = vscode.window.activeTextEditor;// Get the active text editor + if (editor) { + const html = editor.document.getText(editor.selection); + if (html.length > 0) { + let params = ["translate"]; + if (cmd.includes("Component")) params.push("--component"); + params.push("--source"); + params.push(html); + const child_proc = spawn("dioxus", params); + let result = ''; + child_proc.stdout?.on('data', data => result += data); + child_proc.on('close', () => { + if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); + }); + } else { + vscode.window.showWarningMessage("Please select HTML fragment before invoking this command!"); + } + } } - }); + const handle = vscode.commands.registerCommand(cmd, () => convert(cmd)); + context.subscriptions.push(handle); + } - const htmlToComponent = vscode.commands.registerCommand('extension.htmlToComponent', function () { - // Get the active text editor - const editor = vscode.window.activeTextEditor; - - if (editor) { - const document = editor.document; - const selection = editor.selection; - const word = document.getText(selection); - - const child_proc = spawn("dioxus", ["translate", "--component", "--source", word]); - - let result = ''; - child_proc.stdout?.on('data', data => result += data); - - child_proc.on('close', () => { - editor.edit(editBuilder => { - if (result != '') { - editBuilder.replace(selection, result) - } - }) - }); - } - }); - - context.subscriptions.push(htmlToPureRsx); - context.subscriptions.push(htmlToComponent); + registerCommand('extension.htmlToDioxusRsx'); + registerCommand('extension.htmlToDioxusComponent'); } From 5d9a58b0faae85375b523ea3fa70ce29d58b141c Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Thu, 27 Jan 2022 23:06:09 +0800 Subject: [PATCH 046/330] fix: desktop build --- src/builder.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/builder.rs b/src/builder.rs index 583c9bc8f..257072a6a 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -141,6 +141,10 @@ pub fn build_desktop(config: &CrateConfig) -> Result<()> { let output = cmd.output()?; + if !output.status.success() { + return Err(Error::BuildFailed("Program build failed.".into())); + } + if output.status.success() { if config.out_dir.is_dir() { remove_dir_all(&config.out_dir)?; From efe956a1bfd097a2190a7db95286dafe1a2c09d9 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Thu, 27 Jan 2022 23:56:44 +0800 Subject: [PATCH 047/330] fix: display log --- src/cli/serve/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index fd8f3c4f5..8f26e0f30 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,5 +1,5 @@ use crate::{cfg::ConfigOptsServe, gen_page, server, CrateConfig}; -use std::{io::Write, path::PathBuf, process::Command}; +use std::{io::Write, path::PathBuf, process::{Command, Stdio}}; use structopt::StructOpt; /// Run the WASM project on dev-server @@ -44,6 +44,7 @@ impl Serve { .unwrap() .to_string(), ) + .stdout(Stdio::inherit()) .output()?; } } From a4ae4598fbf4aa41562efe2c0afbf37049da7ba8 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sat, 5 Feb 2022 09:11:44 +0800 Subject: [PATCH 048/330] docs: update reamde --- README.md | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 75e05b3cf..7bc1fa131 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,46 @@

📦✨ dioxus-cli

-

- Tooling to supercharge dioxus projects -

+

Tooling to supercharge dioxus projects

-![Dioxus Logo](https://dioxuslabs.com/guide/images/dioxuslogo_full.png) - - -# About - dioxus-cli (inspired by wasm-pack and webpack) is a tool to help get dioxus projects off the ground. It handles all the build, development, bundling, and publishing to make web development simple. - ## Installation ``` $ cargo install dioxus-cli ``` -Now, `dioxus` is in your path. \ No newline at end of file +Now, `dioxus` is in your path, you can use `dioxus --help` to get the help document. + +``` +dioxus 0.1.2 +Build, bundle, & ship your Dioxus app + +USAGE: + dioxus.exe [FLAGS] + +FLAGS: + -h, --help Prints help information + -v Enable verbose logging + -V, --version Prints version information + +SUBCOMMANDS: + build Build the Rust WASM app and all of its assets + clean Clean output artifacts + config Dioxus config file controls + create Init a new project for Dioxus + help Prints this message or the help of the given subcommand(s) + serve Build, watch & serve the Rust WASM app and all of its assets + translate Translate some source file into Dioxus code +``` + +## Get Started + +You can use the `dioxus crate project_name` to init a dioxus project, its will be clone from the [dioxus-template](https://github.com/DioxusLabs/dioxus-template). + +or you can assign the template path: + +``` +dioxus create hello --template gh:dioxuslabs/dioxus-template +``` \ No newline at end of file From 025efc912075348bb90fbaed1cde3e5c61c8ccf9 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sun, 6 Feb 2022 16:28:17 -0500 Subject: [PATCH 049/330] fix: translation service --- src/cli/translate/extract_svgs.rs | 1 - src/cli/translate/mod.rs | 240 ++++++++++++++++++++++++------ src/cli/translate/to_component.rs | 183 ----------------------- src/cli/translate/translate.rs | 1 - 4 files changed, 192 insertions(+), 233 deletions(-) delete mode 100644 src/cli/translate/extract_svgs.rs delete mode 100644 src/cli/translate/to_component.rs delete mode 100644 src/cli/translate/translate.rs diff --git a/src/cli/translate/extract_svgs.rs b/src/cli/translate/extract_svgs.rs deleted file mode 100644 index 8b1378917..000000000 --- a/src/cli/translate/extract_svgs.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index 81b5092ed..a717d632a 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -1,15 +1,14 @@ +use anyhow::Result; use html_parser::Dom; +use html_parser::Element; use html_parser::Node; -use std::fmt::Write; +#[allow(unused_imports)] +use std::fmt::{Display, Formatter}; use std::io::Read; use std::path::PathBuf; use std::process::exit; use structopt::StructOpt; -pub mod extract_svgs; -pub mod to_component; -pub mod translate; - /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, StructOpt)] #[structopt(name = "translate")] @@ -21,11 +20,7 @@ pub struct Translate { /// Input file #[structopt(short, long)] - pub source: Option, - - /// Input file - #[structopt(short, long, parse(from_os_str))] - pub input: Option, + pub file: Option, /// Output file, stdout if not present #[structopt(parse(from_os_str))] @@ -35,23 +30,17 @@ pub struct Translate { impl Translate { pub fn translate(self) -> anyhow::Result<()> { let Translate { - component: as_component, - input, + component, output, - source, + file, } = self; - let contents; - let temp = input.map(|f| { - std::fs::read_to_string(&f).unwrap_or_else(|e| { + let contents = match file { + Some(input) => std::fs::read_to_string(&input).unwrap_or_else(|e| { log::error!("Cloud not read input file: {}.", e); exit(0); - }) - }); - if let Some(..) = temp { - if let Some(s) = source { - contents = s; - } else { + }), + None => { if atty::is(atty::Stream::Stdin) { log::error!("No input file, source, or stdin to translate from."); exit(0); @@ -60,28 +49,21 @@ impl Translate { let mut buffer = String::new(); std::io::stdin().read_to_string(&mut buffer).unwrap(); - contents = buffer.trim().to_string(); + buffer.trim().to_string() } - } else { - contents = temp.unwrap(); - } + }; - // parse the input as html and prepare the output - let dom = Dom::parse(&contents)?; - let mut out_buf = String::new(); - - if as_component { - writeln!(out_buf, "use dioxus::prelude::*;")?; - writeln!(out_buf, "fn component(cx: Scope) -> Element {{")?; - writeln!(out_buf, " cx.render(rsx!(")?; - } - for child in &dom.children { - render_child(&mut out_buf, child, if as_component { 2 } else { 0 })?; - } - if as_component { - writeln!(out_buf, " ))")?; - writeln!(out_buf, "}}")?; - } + let out_buf = match component { + true => format!("{}", convert_html_to_component(&contents).unwrap()), + false => { + let mut buf = String::new(); + let dom = Dom::parse(&contents).unwrap(); + for child in &dom.children { + simple_render_child(&mut buf, child, 0)?; + } + buf + } + }; if let Some(output) = output { std::fs::write(&output, out_buf)?; @@ -93,7 +75,8 @@ impl Translate { } } -fn render_child(f: &mut impl Write, child: &Node, il: u32) -> std::fmt::Result { +/// render without handling svgs or anything +fn simple_render_child(f: &mut impl std::fmt::Write, child: &Node, il: u32) -> std::fmt::Result { write_tabs(f, il)?; match child { Node::Text(t) => writeln!(f, "\"{}\"", t)?, @@ -131,9 +114,8 @@ fn render_child(f: &mut impl Write, child: &Node, il: u32) -> std::fmt::Result { None => writeln!(f, "{}: \"\",", new_name)?, } } else { - match name.as_str() { - "for" | "async" | "type" | "as" => write!(f, "r#")?, - _ => {} + if matches!(name.as_str(), "for" | "async" | "type" | "as") { + write!(f, "r#")? } match value { @@ -145,7 +127,7 @@ fn render_child(f: &mut impl Write, child: &Node, il: u32) -> std::fmt::Result { // now the children for child in &el.children { - render_child(f, child, il + 1)?; + simple_render_child(f, child, il + 1)?; } // close the tag @@ -156,9 +138,171 @@ fn render_child(f: &mut impl Write, child: &Node, il: u32) -> std::fmt::Result { Ok(()) } -fn write_tabs(f: &mut impl Write, num: u32) -> std::fmt::Result { +pub fn convert_html_to_component(html: &str) -> Result { + Ok(ComponentRenderer { + dom: Dom::parse(html)?, + icon_index: 0, + }) +} + +#[allow(dead_code)] +pub struct ComponentRenderer { + dom: Dom, + icon_index: usize, +} + +impl Display for ComponentRenderer { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + writeln!( + f, + r##" +fn component(cx: Scope) -> Element {{ + cx.render(rsx!("## + )?; + let mut svg_nodes = vec![]; + + let mut svg_idx = 0; + for child in &self.dom.children { + render_child(f, child, 2, &mut svg_nodes, true, &mut svg_idx)?; + } + write!( + f, + r##" )) +}}"## + )?; + + if svg_idx == 0 { + return Ok(()); + } + + writeln!(f, "\n\nmod icons {{")?; + + let mut id = 0; + while let Some(svg) = svg_nodes.pop() { + writeln!( + f, + r##" pub(super) fn icon_{}(cx: Scope) -> Element {{ + cx.render(rsx!("##, + id + )?; + write_tabs(f, 3)?; + + render_element(f, svg, 3, &mut svg_nodes, false, &mut 0)?; + writeln!(f, "\t\t))\n\t}}\n")?; + id += 1; + } + + writeln!(f, "}}")?; + + Ok(()) + } +} + +fn render_child<'a>( + f: &mut Formatter<'_>, + child: &'a Node, + il: u32, + svg_buffer: &mut Vec<&'a Element>, + skip_svg: bool, + svg_idx: &mut usize, +) -> std::fmt::Result { + write_tabs(f, il)?; + match child { + Node::Text(t) => writeln!(f, "\"{}\"", t)?, + Node::Comment(e) => writeln!(f, "/* {} */", e)?, + Node::Element(el) => render_element(f, el, il, svg_buffer, skip_svg, svg_idx)?, + }; + Ok(()) +} + +fn render_element<'a>( + f: &mut Formatter<'_>, + el: &'a Element, + il: u32, + svg_buffer: &mut Vec<&'a Element>, + skip_svg: bool, + svg_idx: &mut usize, +) -> std::fmt::Result { + if el.name == "svg" && skip_svg { + svg_buffer.push(el); + // todo: attach the right icon ID + writeln!(f, "icons::icon_{} {{}}", svg_idx)?; + *svg_idx += 1; + return Ok(()); + } + + // open the tag + write!(f, "{} {{ ", &el.name)?; + + // todo: dioxus will eventually support classnames + // for now, just write them with a space between each + let class_iter = &mut el.classes.iter(); + if let Some(first_class) = class_iter.next() { + write!(f, "class: \"{}", first_class)?; + for next_class in class_iter { + write!(f, " {}", next_class)?; + } + write!(f, "\",")?; + } + writeln!(f)?; + + // write the attributes + if let Some(id) = &el.id { + write_tabs(f, il + 1)?; + writeln!(f, "id: \"{}\",", id)?; + } + + for (name, value) in &el.attributes { + write_tabs(f, il + 1)?; + + use convert_case::{Case, Casing}; + if name.chars().any(|ch| ch.is_ascii_uppercase() || ch == '-') { + let new_name = name.to_case(Case::Snake); + match value { + Some(val) => writeln!(f, "{}: \"{}\",", new_name, val)?, + None => writeln!(f, "{}: \"\",", new_name)?, + } + } else { + if matches!(name.as_str(), "for" | "async" | "type" | "as") { + write!(f, "r#")? + } + + match value { + Some(val) => writeln!(f, "{}: \"{}\",", name, val)?, + None => writeln!(f, "{}: \"\",", name)?, + } + } + } + + // now the children + for child in &el.children { + render_child(f, child, il + 1, svg_buffer, skip_svg, svg_idx)?; + } + + // close the tag + write_tabs(f, il)?; + writeln!(f, "}}")?; + Ok(()) +} + +fn write_tabs(f: &mut impl std::fmt::Write, num: u32) -> std::fmt::Result { for _ in 0..num { write!(f, " ")? } Ok(()) } + +#[test] +fn generates_svgs() { + use std::io::Write; + + let st = include_str!("../../../tests/svg.html"); + + let out = format!("{:}", convert_html_to_component(st).unwrap()); + dbg!(&out); + + std::fs::File::create("svg_rsx.rs") + .unwrap() + .write_all(out.as_bytes()) + .unwrap(); +} diff --git a/src/cli/translate/to_component.rs b/src/cli/translate/to_component.rs deleted file mode 100644 index c83777ccb..000000000 --- a/src/cli/translate/to_component.rs +++ /dev/null @@ -1,183 +0,0 @@ -//! Intelligently converts html to rsx with appropraite transformations and extractions. -//! -//! - [*] Creates a component -//! - [ ] Extracts svgs -//! - [ ] Attempts to extract lists - -#[allow(unused_imports)] -use std::{ - fmt::{Display, Formatter}, - io::Write, -}; - -use anyhow::Result; - -use html_parser::{Dom, Element, Node}; - -pub fn convert_html_to_component(html: &str) -> Result { - Ok(ComponentRenderer { - dom: Dom::parse(html)?, - icon_index: 0, - }) -} - -#[allow(dead_code)] -pub struct ComponentRenderer { - dom: Dom, - icon_index: usize, -} - -impl Display for ComponentRenderer { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!( - f, - r##" -fn component(cx: Scope) -> Element {{ - cx.render(rsx!("## - )?; - let mut svg_nodes = vec![]; - - let mut svg_idx = 0; - for child in &self.dom.children { - render_child(f, child, 2, &mut svg_nodes, true, &mut svg_idx)?; - } - write!( - f, - r##" )) -}}"## - )?; - - if svg_idx == 0 { - return Ok(()); - } - - writeln!(f, "\n\nmod icons {{")?; - - let mut id = 0; - while let Some(svg) = svg_nodes.pop() { - writeln!( - f, - r##" pub(super) fn icon_{}(cx: Scope) -> Element {{ - cx.render(rsx!("##, - id - )?; - write_tabs(f, 3)?; - - render_element(f, svg, 3, &mut svg_nodes, false, &mut 0)?; - writeln!(f, "\t\t))\n\t}}\n")?; - id += 1; - } - - writeln!(f, "}}")?; - - Ok(()) - } -} - -fn render_child<'a>( - f: &mut Formatter<'_>, - child: &'a Node, - il: u32, - svg_buffer: &mut Vec<&'a Element>, - skip_svg: bool, - svg_idx: &mut usize, -) -> std::fmt::Result { - write_tabs(f, il)?; - match child { - Node::Text(t) => writeln!(f, "\"{}\"", t)?, - Node::Comment(e) => writeln!(f, "/* {} */", e)?, - Node::Element(el) => render_element(f, el, il, svg_buffer, skip_svg, svg_idx)?, - }; - Ok(()) -} - -fn render_element<'a>( - f: &mut Formatter<'_>, - el: &'a Element, - il: u32, - svg_buffer: &mut Vec<&'a Element>, - skip_svg: bool, - svg_idx: &mut usize, -) -> std::fmt::Result { - if el.name == "svg" && skip_svg { - svg_buffer.push(el); - // todo: attach the right icon ID - writeln!(f, "icons::icon_{} {{}}", svg_idx)?; - *svg_idx += 1; - return Ok(()); - } - - // open the tag - write!(f, "{} {{ ", &el.name)?; - - // todo: dioxus will eventually support classnames - // for now, just write them with a space between each - let class_iter = &mut el.classes.iter(); - if let Some(first_class) = class_iter.next() { - write!(f, "class: \"{}", first_class)?; - for next_class in class_iter { - write!(f, " {}", next_class)?; - } - write!(f, "\",")?; - } - writeln!(f)?; - - // write the attributes - if let Some(id) = &el.id { - write_tabs(f, il + 1)?; - writeln!(f, "id: \"{}\",", id)?; - } - - for (name, value) in &el.attributes { - write_tabs(f, il + 1)?; - - use convert_case::{Case, Casing}; - if name.chars().any(|ch| ch.is_ascii_uppercase() || ch == '-') { - let new_name = name.to_case(Case::Snake); - match value { - Some(val) => writeln!(f, "{}: \"{}\",", new_name, val)?, - None => writeln!(f, "{}: \"\",", new_name)?, - } - } else { - match name.as_str() { - "for" | "async" | "type" | "as" => write!(f, "r#")?, - _ => {} - } - - match value { - Some(val) => writeln!(f, "{}: \"{}\",", name, val)?, - None => writeln!(f, "{}: \"\",", name)?, - } - } - } - - // now the children - for child in &el.children { - render_child(f, child, il + 1, svg_buffer, skip_svg, svg_idx)?; - } - - // close the tag - write_tabs(f, il)?; - writeln!(f, "}}")?; - Ok(()) -} - -fn write_tabs(f: &mut Formatter, num: u32) -> std::fmt::Result { - for _ in 0..num { - write!(f, " ")? - } - Ok(()) -} - -#[test] -fn generates_svgs() { - let st = include_str!("../../../tests/svg.html"); - - let out = format!("{:}", convert_html_to_component(st).unwrap()); - dbg!(&out); - - std::fs::File::create("svg_rsx.rs") - .unwrap() - .write_all(out.as_bytes()) - .unwrap(); -} diff --git a/src/cli/translate/translate.rs b/src/cli/translate/translate.rs deleted file mode 100644 index 8b1378917..000000000 --- a/src/cli/translate/translate.rs +++ /dev/null @@ -1 +0,0 @@ - From eb7388794a09eae788ad70aaabfb483e37cc19b3 Mon Sep 17 00:00:00 2001 From: Aster Date: Mon, 7 Feb 2022 05:28:18 +0800 Subject: [PATCH 050/330] Replace struct-opt with clap --- .gitignore | 1 + Cargo.toml | 26 +++++++++++++------------- README.md | 7 ++++++- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 96ef6c0b9..2e049011e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target Cargo.lock +.idea/ \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 5bbfd7ac2..0f2ad96c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-cli" -version = "0.1.2" +version = "0.1.3" authors = ["Jonathan Kelley"] edition = "2018" description = "CLI tool for developing, testing, and publishing Dioxus apps" @@ -9,31 +9,31 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -thiserror = "1.0.23" -log = "0.4.13" +thiserror = "1.0.30" +log = "0.4.14" fern = { version = "0.6.0", features = ["colored"] } wasm-bindgen-cli-support = "0.2.79" -anyhow = "1.0.38" -serde = { version = "1.0.133", features = ["derive"] } -serde_json = "1" +anyhow = "1.0.53" +serde = { version = "1.0.136", features = ["derive"] } +serde_json = "1.0.79" toml = "0.5.8" fs_extra = "1.2.0" -cargo_toml = "0.10.0" -futures = "0.3.12" +cargo_toml = "0.11.4" +futures = "0.3.21" notify = { version = "5.0.0-pre.13", features = ["serde"] } html_parser = "0.6.2" binary-install = "0.0.2" convert_case = "0.5.0" -structopt = "0.3.25" cargo_metadata = "0.14.1" -tokio = { version = "1.15.0", features = ["full"] } +tokio = { version = "1.16.1", features = ["full"] } atty = "0.2.14" regex = "1.5.4" chrono = "0.4.19" +clap = "3.0.14" -axum = { version = "0.4.4", features = ["ws", "headers"] } -tower-http = { version = "0.2.0", features = ["fs", "trace"] } -headers = "0.3" +axum = { version = "0.4.5", features = ["ws", "headers"] } +tower-http = { version = "0.2.2", features = ["fs", "trace"] } +headers = "0.3.7" # hyper = { version = "0.14.11", features = ["full"] } [[bin]] diff --git a/README.md b/README.md index 75e05b3cf..ab4cf1225 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,13 @@ dioxus-cli (inspired by wasm-pack and webpack) is a tool to help get dioxus proj ## Installation -``` +```shell +# for stable $ cargo install dioxus-cli +# for latest +$ cargo install --git https://github.com/DioxusLabs/cli +# for developing +$ cargo install --path . --debug ``` Now, `dioxus` is in your path. \ No newline at end of file From b6c6dd6532335c5acd2c2eea54300f6f6b341a64 Mon Sep 17 00:00:00 2001 From: Aster Date: Tue, 8 Feb 2022 00:51:21 +0800 Subject: [PATCH 051/330] Clean struct-opt derive --- Cargo.toml | 7 ++++--- src/cli/build/mod.rs | 8 +++----- src/cli/cfg.rs | 9 +++------ src/cli/clean/mod.rs | 10 ++-------- src/cli/config/mod.rs | 7 ++----- src/cli/create/mod.rs | 13 +------------ src/cli/mod.rs | 33 ++++++++++++++++++++++++++------- src/cli/serve/mod.rs | 6 ++---- src/cli/translate/mod.rs | 13 ++----------- tests/main.rs | 4 ++++ 10 files changed, 49 insertions(+), 61 deletions(-) create mode 100644 tests/main.rs diff --git a/Cargo.toml b/Cargo.toml index 0f2ad96c4..89943ec62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,11 +9,13 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +# cli core +clap = {version = "3.0.14", features = ["derive"]} thiserror = "1.0.30" +wasm-bindgen-cli-support = "0.2.79" +# features log = "0.4.14" fern = { version = "0.6.0", features = ["colored"] } -wasm-bindgen-cli-support = "0.2.79" -anyhow = "1.0.53" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" toml = "0.5.8" @@ -29,7 +31,6 @@ tokio = { version = "1.16.1", features = ["full"] } atty = "0.2.14" regex = "1.5.4" chrono = "0.4.19" -clap = "3.0.14" axum = { version = "0.4.5", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 684cec58c..b4d7f5fe4 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,10 +1,8 @@ -use std::{io::Write, path::PathBuf}; +use super::*; -use crate::{cfg::ConfigOptsBuild, gen_page}; -use structopt::StructOpt; /// Build the Rust WASM app and all of its assets. -#[derive(Clone, Debug, StructOpt)] +#[derive(Clone, Debug, Parser)] #[structopt(name = "build")] pub struct Build { #[structopt(flatten)] @@ -15,7 +13,7 @@ impl Build { pub fn build(self) -> anyhow::Result<()> { let mut crate_config = crate::CrateConfig::new()?; - // change the relase state. + // change the release state. crate_config.with_release(self.build.release); if self.build.example.is_some() { diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index ece00e07e..fdd627e85 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -1,10 +1,7 @@ -use std::path::PathBuf; -use structopt::StructOpt; - -use serde::Deserialize; +use super::*; /// Config options for the build system. -#[derive(Clone, Debug, Default, Deserialize, StructOpt)] +#[derive(Clone, Debug, Default, Deserialize, Parser)] pub struct ConfigOptsBuild { /// The index HTML file to drive the bundling process [default: index.html] #[structopt(parse(from_os_str))] @@ -24,7 +21,7 @@ pub struct ConfigOptsBuild { pub platform: String, } -#[derive(Clone, Debug, Default, Deserialize, StructOpt)] +#[derive(Clone, Debug, Default, Deserialize, Parser)] pub struct ConfigOptsServe { /// The index HTML file to drive the bundling process [default: index.html] #[structopt(parse(from_os_str))] diff --git a/src/cli/clean/mod.rs b/src/cli/clean/mod.rs index 62593b1ee..334f93572 100644 --- a/src/cli/clean/mod.rs +++ b/src/cli/clean/mod.rs @@ -1,13 +1,7 @@ -use std::{ - fs::remove_dir_all, - path::PathBuf, - process::{Command, Stdio}, -}; - -use structopt::StructOpt; +use super::*; /// Build the Rust WASM app and all of its assets. -#[derive(Clone, Debug, StructOpt)] +#[derive(Clone, Debug, Parser)] #[structopt(name = "clean")] pub struct Clean {} diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs index d5291a7d6..e5d7bdbe4 100644 --- a/src/cli/config/mod.rs +++ b/src/cli/config/mod.rs @@ -1,10 +1,7 @@ -use std::{fs::File, io::Write}; - -use serde::Deserialize; -use structopt::StructOpt; +use super::*; /// Build the Rust WASM app and all of its assets. -#[derive(Clone, Debug, Deserialize, StructOpt)] +#[derive(Clone, Debug, Deserialize, Parser)] #[structopt(name = "config")] pub enum Config { /// Init `Dioxus.toml` for project/folder. diff --git a/src/cli/create/mod.rs b/src/cli/create/mod.rs index fa553c55a..b92a193b7 100644 --- a/src/cli/create/mod.rs +++ b/src/cli/create/mod.rs @@ -1,15 +1,4 @@ -use std::{ - fs::File, - io::{Read, Write}, - path::PathBuf, - process::{Command, Stdio}, -}; - -use regex::Regex; -use serde::Deserialize; -use structopt::StructOpt; - -use crate::{error::Result, Error}; +use super::*; /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Default, Deserialize, StructOpt)] diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 4a72e00ac..e3bd18b3b 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -1,5 +1,3 @@ -use structopt::StructOpt; - pub mod build; pub mod cfg; pub mod clean; @@ -8,17 +6,38 @@ pub mod create; pub mod serve; pub mod translate; +use std::{io::Write, path::PathBuf}; +use crate::{cfg::ConfigOptsBuild, gen_page}; +use clap::{Parser}; +use serde::Deserialize; +use std::{ + fs::remove_dir_all, + process::{Command, Stdio}, +}; +use std::{fs::File}; +use std::{ + io::{Read}, +}; +use regex::Regex; +use crate::{error::Result, Error}; +use crate::{cfg::ConfigOptsServe, server, CrateConfig}; +use html_parser::Dom; +use html_parser::Element; +use html_parser::Node; +use std::fmt::{Display, Formatter}; +use std::process::exit; + /// Build, bundle, & ship your Dioxus app. /// /// -#[derive(StructOpt)] -#[structopt(name = "dioxus")] +#[derive(Parser, Debug)] +#[clap(name = "dioxus")] pub struct Cli { - #[structopt(subcommand)] + #[clap(subcommand)] pub action: Commands, /// Enable verbose logging. - #[structopt(short)] + #[clap(short)] pub v: bool, // // // note: dioxus is still roughly compatible with trunk @@ -27,7 +46,7 @@ pub struct Cli { // pub config: Option, } -#[derive(StructOpt)] +#[derive(Parser)] pub enum Commands { /// Build the Rust WASM app and all of its assets. Build(build::Build), diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 8f26e0f30..d7184f5f9 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,9 +1,7 @@ -use crate::{cfg::ConfigOptsServe, gen_page, server, CrateConfig}; -use std::{io::Write, path::PathBuf, process::{Command, Stdio}}; -use structopt::StructOpt; +use super::*; /// Run the WASM project on dev-server -#[derive(Clone, Debug, StructOpt)] +#[derive(Clone, Debug, Parser)] #[structopt(name = "serve")] pub struct Serve { #[structopt(flatten)] diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index a717d632a..4e23533aa 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -1,16 +1,7 @@ -use anyhow::Result; -use html_parser::Dom; -use html_parser::Element; -use html_parser::Node; -#[allow(unused_imports)] -use std::fmt::{Display, Formatter}; -use std::io::Read; -use std::path::PathBuf; -use std::process::exit; -use structopt::StructOpt; +use super::*; /// Build the Rust WASM app and all of its assets. -#[derive(Clone, Debug, StructOpt)] +#[derive(Clone, Debug, Parser)] #[structopt(name = "translate")] pub struct Translate { /// Activate debug mode diff --git a/tests/main.rs b/tests/main.rs new file mode 100644 index 000000000..f9bb6a890 --- /dev/null +++ b/tests/main.rs @@ -0,0 +1,4 @@ +#[test] +fn ready() { + println!("Compiled successfully!") +} \ No newline at end of file From ce628e1197095c778432fcb51df6d5f176a4f868 Mon Sep 17 00:00:00 2001 From: Aster Date: Wed, 9 Feb 2022 16:11:02 +0800 Subject: [PATCH 052/330] Fix compiler errors --- Cargo.toml | 2 ++ src/cli/build/mod.rs | 9 ++++----- src/cli/cfg.rs | 16 ++++++++-------- src/cli/clean/mod.rs | 4 ++-- src/cli/config/mod.rs | 9 +++++---- src/cli/create/mod.rs | 20 ++++++++------------ src/cli/mod.rs | 33 +++++++++++++++++---------------- src/cli/serve/mod.rs | 10 +++++----- src/cli/translate/mod.rs | 10 +++++----- src/error.rs | 37 +++++++++++++++++++++++++++++++++++++ src/main.rs | 4 ++-- src/server/mod.rs | 3 ++- tests/main.rs | 8 ++++---- 13 files changed, 101 insertions(+), 64 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 89943ec62..3ae7b4610 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,8 @@ tokio = { version = "1.16.1", features = ["full"] } atty = "0.2.14" regex = "1.5.4" chrono = "0.4.19" +anyhow = "1.0.53" +hyper = "0.14.17" axum = { version = "0.4.5", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index b4d7f5fe4..1c665abd3 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -1,16 +1,15 @@ use super::*; - /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Parser)] -#[structopt(name = "build")] +#[clap(name = "build")] pub struct Build { - #[structopt(flatten)] + #[clap(flatten)] pub build: ConfigOptsBuild, } impl Build { - pub fn build(self) -> anyhow::Result<()> { + pub fn build(self) -> Result<()> { let mut crate_config = crate::CrateConfig::new()?; // change the release state. @@ -28,7 +27,7 @@ impl Build { crate::builder::build_desktop(&crate_config)?; } _ => { - return Err(anyhow::anyhow!("Unsoppurt platform target.")); + return custom_error!("Unsoppurt platform target."); } } diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index fdd627e85..f1e3d0845 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -4,40 +4,40 @@ use super::*; #[derive(Clone, Debug, Default, Deserialize, Parser)] pub struct ConfigOptsBuild { /// The index HTML file to drive the bundling process [default: index.html] - #[structopt(parse(from_os_str))] + #[clap(parse(from_os_str))] pub target: Option, /// Build in release mode [default: false] - #[structopt(long)] + #[clap(long)] #[serde(default)] pub release: bool, /// Build a example [default: ""] - #[structopt(long)] + #[clap(long)] pub example: Option, /// Build platform: support Web & Desktop [default: "web"] - #[structopt(long, default_value = "web")] + #[clap(long, default_value = "web")] pub platform: String, } #[derive(Clone, Debug, Default, Deserialize, Parser)] pub struct ConfigOptsServe { /// The index HTML file to drive the bundling process [default: index.html] - #[structopt(parse(from_os_str))] + #[clap(parse(from_os_str))] pub target: Option, /// Build a example [default: ""] - #[structopt(long)] + #[clap(long)] pub example: Option, /// Build in release mode [default: false] - #[structopt(long)] + #[clap(long)] #[serde(default)] pub release: bool, /// Build platform: support Web & Desktop [default: "web"] - #[structopt(long, default_value = "web")] + #[clap(long, default_value = "web")] pub platform: String, } diff --git a/src/cli/clean/mod.rs b/src/cli/clean/mod.rs index 334f93572..74a99fec2 100644 --- a/src/cli/clean/mod.rs +++ b/src/cli/clean/mod.rs @@ -2,11 +2,11 @@ use super::*; /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Parser)] -#[structopt(name = "clean")] +#[clap(name = "clean")] pub struct Clean {} impl Clean { - pub fn clean(self) -> anyhow::Result<()> { + pub fn clean(self) -> Result<()> { let crate_config = crate::CrateConfig::new()?; let output = Command::new("cargo") diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs index e5d7bdbe4..3cbf368e0 100644 --- a/src/cli/config/mod.rs +++ b/src/cli/config/mod.rs @@ -1,8 +1,9 @@ use super::*; + /// Build the Rust WASM app and all of its assets. -#[derive(Clone, Debug, Deserialize, Parser)] -#[structopt(name = "config")] +#[derive(Clone, Debug, Deserialize, Subcommand)] +#[clap(name = "config")] pub enum Config { /// Init `Dioxus.toml` for project/folder. Init { @@ -10,14 +11,14 @@ pub enum Config { name: String, /// Cover old config - #[structopt(long)] + #[clap(long)] #[serde(default)] force: bool, }, } impl Config { - pub fn config(self) -> anyhow::Result<()> { + pub fn config(self) -> Result<()> { let crate_root = crate::cargo::crate_root()?; match self { Config::Init { name, force } => { diff --git a/src/cli/create/mod.rs b/src/cli/create/mod.rs index b92a193b7..f00bc5dd9 100644 --- a/src/cli/create/mod.rs +++ b/src/cli/create/mod.rs @@ -1,15 +1,16 @@ use super::*; +use crate::custom_error; /// Build the Rust WASM app and all of its assets. -#[derive(Clone, Debug, Default, Deserialize, StructOpt)] -#[structopt(name = "create")] +#[derive(Clone, Debug, Default, Deserialize, Parser)] +#[clap(name = "create")] pub struct Create { /// Init project name - #[structopt(default_value = ".")] + #[clap(default_value = ".")] name: String, /// Template path - #[structopt(default_value = "gh:dioxuslabs/dioxus-template", long)] + #[clap(default_value = "gh:dioxuslabs/dioxus-template", long)] template: String, } @@ -23,10 +24,7 @@ impl Create { let project_path = PathBuf::from(&self.name); if project_path.join("Dioxus.toml").is_file() || project_path.join("Cargo.toml").is_file() { - return Err(Error::Other(anyhow::anyhow!( - "🧨 Folder '{}' is initialized.", - &self.name - ))); + return custom_error!("🧨 Folder '{}' is initialized.", &self.name); } log::info!("🔧 Start to create a new project '{}'.", self.name); @@ -47,9 +45,7 @@ impl Create { .stderr(Stdio::inherit()) .output()?; if !install_output.status.success() { - return Err(Error::Other(anyhow::anyhow!( - "Try to install cargo-generate failed." - ))); + return custom_error!("Try to install cargo-generate failed."); } } @@ -63,7 +59,7 @@ impl Create { .output()?; if !generate_output.status.success() { - return Err(Error::Other(anyhow::anyhow!("Generate project failed."))); + return custom_error!("Generate project failed."); } let mut dioxus_file = File::open(project_path.join("Dioxus.toml"))?; diff --git a/src/cli/mod.rs b/src/cli/mod.rs index e3bd18b3b..8ec374933 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -6,31 +6,31 @@ pub mod create; pub mod serve; pub mod translate; -use std::{io::Write, path::PathBuf}; +use crate::custom_error; use crate::{cfg::ConfigOptsBuild, gen_page}; -use clap::{Parser}; +use crate::{cfg::ConfigOptsServe, server, CrateConfig}; +use crate::{error::Result, Error}; +use clap::Parser; +use html_parser::Dom; +use html_parser::Element; +use html_parser::Node; +use regex::Regex; use serde::Deserialize; +use std::fmt::{Display, Formatter}; +use std::fs::File; +use std::io::Read; +use std::process::exit; use std::{ fs::remove_dir_all, process::{Command, Stdio}, }; -use std::{fs::File}; -use std::{ - io::{Read}, -}; -use regex::Regex; -use crate::{error::Result, Error}; -use crate::{cfg::ConfigOptsServe, server, CrateConfig}; -use html_parser::Dom; -use html_parser::Element; -use html_parser::Node; -use std::fmt::{Display, Formatter}; -use std::process::exit; +use std::{io::Write, path::PathBuf}; +use clap::{Subcommand}; /// Build, bundle, & ship your Dioxus app. /// /// -#[derive(Parser, Debug)] +#[derive(Parser)] #[clap(name = "dioxus")] pub struct Cli { #[clap(subcommand)] @@ -42,7 +42,7 @@ pub struct Cli { // // // note: dioxus is still roughly compatible with trunk // /// Path to the Trunk config file [default: Trunk.toml] - // #[structopt(long, parse(from_os_str), env = "TRUNK_CONFIG")] + // #[clap(long, parse(from_os_str), env = "TRUNK_CONFIG")] // pub config: Option, } @@ -59,5 +59,6 @@ pub enum Commands { /// Clean output artifacts. Clean(clean::Clean), /// Dioxus config file controls. + #[clap(subcommand)] Config(config::Config), } diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index d7184f5f9..d627ace47 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -2,14 +2,14 @@ use super::*; /// Run the WASM project on dev-server #[derive(Clone, Debug, Parser)] -#[structopt(name = "serve")] +#[clap(name = "serve")] pub struct Serve { - #[structopt(flatten)] + #[clap(flatten)] pub serve: ConfigOptsServe, } impl Serve { - pub async fn serve(self) -> anyhow::Result<()> { + pub async fn serve(self) -> Result<()> { let mut crate_config = crate::CrateConfig::new()?; // change the relase state. @@ -49,7 +49,7 @@ impl Serve { return Ok(()); } _ => { - return Err(anyhow::anyhow!("Unsoppurt platform target.")); + return custom_error!("Unsoppurt platform target."); } } @@ -62,7 +62,7 @@ impl Serve { Ok(()) } - pub fn regen_dev_page(crate_config: &CrateConfig) -> anyhow::Result<()> { + pub fn regen_dev_page(crate_config: &CrateConfig) -> Result<()> { let serve_html = gen_page(&crate_config.dioxus_config, true); let mut file = std::fs::File::create( diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index 4e23533aa..55ba101cd 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -2,24 +2,24 @@ use super::*; /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Parser)] -#[structopt(name = "translate")] +#[clap(name = "translate")] pub struct Translate { /// Activate debug mode // short and long flags (-d, --debug) will be deduced from the field's name - #[structopt(short, long)] + #[clap(short, long)] pub component: bool, /// Input file - #[structopt(short, long)] + #[clap(short, long)] pub file: Option, /// Output file, stdout if not present - #[structopt(parse(from_os_str))] + #[clap(parse(from_os_str))] pub output: Option, } impl Translate { - pub fn translate(self) -> anyhow::Result<()> { + pub fn translate(self) -> Result<()> { let Translate { component, output, diff --git a/src/error.rs b/src/error.rs index 8684abf74..d40868333 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,6 +11,15 @@ pub enum Error { #[error("I/O Error: {0}")] IO(#[from] std::io::Error), + #[error("Format Error: {0}")] + FormatError(#[from] std::fmt::Error), + + #[error("Format failed: {0}")] + ParseError(String), + + #[error("Runtime Error: {0}")] + RuntimeError(String), + #[error("Failed to write error")] FailedToWrite, @@ -20,6 +29,9 @@ pub enum Error { #[error("Failed to write error")] CargoError(String), + #[error("{0}")] + CustomError(String), + #[error(transparent)] Other(#[from] anyhow::Error), } @@ -35,3 +47,28 @@ impl From for Error { Error::Unique(s) } } + +impl From for Error { + fn from(e: html_parser::Error) -> Self { + Self::ParseError(e.to_string()) + } +} + +impl From for Error { + fn from(e: hyper::Error) -> Self { + Self::RuntimeError(e.to_string()) + } +} + +#[macro_export] +macro_rules! custom_error { + ($msg:literal $(,)?) => { + Err(Error::CustomError($msg.to_string())) + }; + ($err:expr $(,)?) => { + Err(Error::from($err)) + }; + ($fmt:expr, $($arg:tt)*) => { + Err(Error::CustomError(format!($fmt, $($arg)*))) + }; +} diff --git a/src/main.rs b/src/main.rs index 6b8c177db..97d4a3bb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,9 @@ +use clap::Parser; use dioxus_cli::*; -use structopt::StructOpt; #[tokio::main] async fn main() -> Result<()> { - let args = Cli::from_args(); + let args = Cli::parse(); set_up_logging(); match args.action { diff --git a/src/server/mod.rs b/src/server/mod.rs index 880f25ceb..f312e07c2 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -10,6 +10,7 @@ use notify::{RecommendedWatcher, Watcher}; use std::{path::PathBuf, sync::Arc}; use tower_http::services::ServeDir; +use crate::Result; use crate::{builder, serve::Serve, CrateConfig}; use tokio::sync::broadcast; @@ -17,7 +18,7 @@ struct WsRelodState { update: broadcast::Sender, } -pub async fn startup(config: CrateConfig) -> anyhow::Result<()> { +pub async fn startup(config: CrateConfig) -> Result<()> { log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); diff --git a/tests/main.rs b/tests/main.rs index f9bb6a890..1849f5dc8 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -1,4 +1,4 @@ -#[test] -fn ready() { - println!("Compiled successfully!") -} \ No newline at end of file +#[test] +fn ready() { + println!("Compiled successfully!") +} From 59ebb9ec116449bcd77ab554b34a6bb8e09796b9 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Wed, 9 Feb 2022 21:11:41 +0800 Subject: [PATCH 053/330] feat: add `default_platform` config --- src/assets/dioxus.toml | 15 ++++++++------- src/cli/build/mod.rs | 10 +++++++++- src/cli/cfg.rs | 12 ++++++------ src/cli/serve/mod.rs | 16 ++++++++++++++-- src/config.rs | 4 ++-- 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 717b070e2..31e306079 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -1,23 +1,24 @@ [application] -# App (Project) Name +# dioxus project name name = "{{project-name}}" -# Dioxus App Support Platform -# desktop, web, mobile, ssr -platforms = ["web"] +# default platfrom +# you can also use `dioxus serve/build --platform XXX` to use other platform +# value: web | desktop +default_platform = "web" # Web `build` & `serve` dist path out_dir = "dist" +# resource (static) file folder +public_dir = "public" + [web.app] # HTML title tag content title = "dioxus | ⛺" -# resource (static) file folder -public_dir = "public" - [web.watcher] watch_path = ["src"] diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 684cec58c..bae291b7e 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -22,7 +22,15 @@ impl Build { crate_config.as_example(self.build.example.unwrap()); } - match self.build.platform.as_str() { + let platform = self.build.platform.unwrap_or_else(|| { + crate_config + .dioxus_config + .application + .default_platform + .clone() + }); + + match platform.as_str() { "web" => { crate::builder::build(&crate_config)?; } diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index ece00e07e..2271f0453 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -19,9 +19,9 @@ pub struct ConfigOptsBuild { #[structopt(long)] pub example: Option, - /// Build platform: support Web & Desktop [default: "web"] - #[structopt(long, default_value = "web")] - pub platform: String, + /// Build platform: support Web & Desktop [default: "default_platform"] + #[structopt(long)] + pub platform: Option, } #[derive(Clone, Debug, Default, Deserialize, StructOpt)] @@ -39,9 +39,9 @@ pub struct ConfigOptsServe { #[serde(default)] pub release: bool, - /// Build platform: support Web & Desktop [default: "web"] - #[structopt(long, default_value = "web")] - pub platform: String, + /// Build platform: support Web & Desktop [default: "default_platform"] + #[structopt(long)] + pub platform: Option, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 8f26e0f30..ff263b6b5 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,5 +1,9 @@ use crate::{cfg::ConfigOptsServe, gen_page, server, CrateConfig}; -use std::{io::Write, path::PathBuf, process::{Command, Stdio}}; +use std::{ + io::Write, + path::PathBuf, + process::{Command, Stdio}, +}; use structopt::StructOpt; /// Run the WASM project on dev-server @@ -21,7 +25,15 @@ impl Serve { crate_config.as_example(self.serve.example.unwrap()); } - match self.serve.platform.as_str() { + let platform = self.serve.platform.unwrap_or_else(|| { + crate_config + .dioxus_config + .application + .default_platform + .clone() + }); + + match platform.as_str() { "web" => { crate::builder::build(&crate_config)?; } diff --git a/src/config.rs b/src/config.rs index 1151445ef..a7f5d1fec 100644 --- a/src/config.rs +++ b/src/config.rs @@ -31,7 +31,7 @@ impl Default for DioxusConfig { Self { application: ApplicationConfig { name: "dioxus".into(), - platforms: vec![String::from("web")], + default_platform: "web".to_string(), out_dir: Some(PathBuf::from("dist")), }, web: WebConfig { @@ -59,7 +59,7 @@ impl Default for DioxusConfig { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ApplicationConfig { pub name: String, - pub platforms: Vec, + pub default_platform: String, pub out_dir: Option, } From a0356c7f36cc8862ec3f49f92d07330070e3fa3e Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Wed, 9 Feb 2022 21:25:29 +0800 Subject: [PATCH 054/330] fix: clean `out_dir` --- src/builder.rs | 6 ++++-- src/cli/build/mod.rs | 2 +- src/cli/serve/mod.rs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 257072a6a..24168a934 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -120,7 +120,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { Ok(()) } -pub fn build_desktop(config: &CrateConfig) -> Result<()> { +pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { log::info!("🚅 Running build [Desktop] command..."); let mut cmd = Command::new("cargo"); @@ -146,7 +146,9 @@ pub fn build_desktop(config: &CrateConfig) -> Result<()> { } if output.status.success() { - if config.out_dir.is_dir() { + // this code will clean the output dir. + // if using the serve, we will not clean the out_dir. + if config.out_dir.is_dir() && !is_serve { remove_dir_all(&config.out_dir)?; } diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index bae291b7e..a29ba654b 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -35,7 +35,7 @@ impl Build { crate::builder::build(&crate_config)?; } "desktop" => { - crate::builder::build_desktop(&crate_config)?; + crate::builder::build_desktop(&crate_config, false)?; } _ => { return Err(anyhow::anyhow!("Unsoppurt platform target.")); diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index ff263b6b5..fe70f7914 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -38,7 +38,7 @@ impl Serve { crate::builder::build(&crate_config)?; } "desktop" => { - crate::builder::build_desktop(&crate_config)?; + crate::builder::build_desktop(&crate_config, true)?; match &crate_config.executable { crate::ExecutableType::Binary(name) From 653ee254c036653674a984cb716d0239c4c38f27 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Wed, 9 Feb 2022 21:30:00 +0800 Subject: [PATCH 055/330] docs: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bc1fa131..31e957111 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ dioxus-cli (inspired by wasm-pack and webpack) is a tool to help get dioxus proj ## Installation ``` -$ cargo install dioxus-cli +$ cargo install --git https://github.com/DioxusLabs/cli ``` Now, `dioxus` is in your path, you can use `dioxus --help` to get the help document. From 9d8b95dfc43023da050943300df86ba2612c72a6 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Wed, 9 Feb 2022 21:59:26 +0800 Subject: [PATCH 056/330] feat: add `public_dir` for other platform --- src/builder.rs | 31 ++++++++++++++++++++++++++++++- src/config.rs | 6 +++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 24168a934..1458d52ba 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -91,6 +91,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { .out_name(&dioxus_config.application.name) .generate(&bindgen_outdir)?; + // this code will copy all public file to the output dir let copy_options = fs_extra::dir::CopyOptions { overwrite: true, skip_exist: false, @@ -183,9 +184,37 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { file_name }; - create_dir_all(&config.out_dir)?; + if !config.out_dir.is_dir() { + create_dir_all(&config.out_dir)?; + } copy(res_path, &config.out_dir.join(target_file))?; + // this code will copy all public file to the output dir + if config.public_dir.is_dir() { + let copy_options = fs_extra::dir::CopyOptions { + overwrite: true, + skip_exist: false, + buffer_size: 64000, + copy_inside: false, + content_only: false, + depth: 0, + }; + + for entry in std::fs::read_dir(&config.public_dir)? { + let path = entry?.path(); + if path.is_file() { + std::fs::copy(&path, &config.out_dir.join(path.file_name().unwrap()))?; + } else { + match fs_extra::dir::copy(&path, &config.out_dir, ©_options) { + Ok(_) => {} + Err(e) => { + log::warn!("Error copying dir: {}", e); + } + } + } + } + } + log::info!( "🚩 Build completed: [./{}]", config diff --git a/src/config.rs b/src/config.rs index a7f5d1fec..5949310dd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -33,11 +33,11 @@ impl Default for DioxusConfig { name: "dioxus".into(), default_platform: "web".to_string(), out_dir: Some(PathBuf::from("dist")), + public_dir: Some(PathBuf::from("public")), }, web: WebConfig { app: WebAppConfing { title: Some("dioxus | ⛺".into()), - public_dir: Some(PathBuf::from("public")), }, watcher: WebWatcherConfing { watch_path: Some(vec![PathBuf::from("src")]), @@ -61,6 +61,7 @@ pub struct ApplicationConfig { pub name: String, pub default_platform: String, pub out_dir: Option, + pub public_dir: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -73,7 +74,6 @@ pub struct WebConfig { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebAppConfing { pub title: Option, - pub public_dir: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -130,7 +130,7 @@ impl CrateConfig { let cargo_def = &crate_dir.join("Cargo.toml"); - let public_dir = match dioxus_config.web.app.public_dir { + let public_dir = match dioxus_config.application.public_dir { Some(ref v) => crate_dir.join(v), None => crate_dir.join("public"), }; From 62712219406ef95d83060bf637c0fa831bcc30d8 Mon Sep 17 00:00:00 2001 From: Aster Date: Thu, 10 Feb 2022 04:02:09 +0800 Subject: [PATCH 057/330] Fix format and clippy --- rustfmt.toml | 8 ++++++++ src/builder.rs | 12 +++++------- src/cli/config/mod.rs | 1 - src/cli/mod.rs | 32 +++++++++++++------------------- src/server/mod.rs | 3 +-- 5 files changed, 27 insertions(+), 29 deletions(-) create mode 100644 rustfmt.toml diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 000000000..9071fb4b5 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,8 @@ +version = "Two" +edition = "2018" + +imports_granularity = "Crate" +#use_small_heuristics = "Max" +#control_brace_style = "ClosingNextLine" +normalize_comments = true +format_code_in_doc_comments = true \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index 257072a6a..f3090f85d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -11,13 +11,11 @@ use std::{ use wasm_bindgen_cli_support::Bindgen; pub fn build(config: &CrateConfig) -> Result<()> { - /* - [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) - [2] Generate the appropriate build folders - [3] Wasm-bindgen the .wasm fiile, and move it into the {builddir}/modules/xxxx/xxxx_bg.wasm - [4] Wasm-opt the .wasm file with whatever optimizations need to be done - [5] Link up the html page to the wasm module - */ + // [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) + // [2] Generate the appropriate build folders + // [3] Wasm-bindgen the .wasm fiile, and move it into the {builddir}/modules/xxxx/xxxx_bg.wasm + // [4] Wasm-opt the .wasm file with whatever optimizations need to be done + // [5] Link up the html page to the wasm module let CrateConfig { out_dir, diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs index 3cbf368e0..6d672b7a5 100644 --- a/src/cli/config/mod.rs +++ b/src/cli/config/mod.rs @@ -1,6 +1,5 @@ use super::*; - /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Deserialize, Subcommand)] #[clap(name = "config")] diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 8ec374933..1b5ba0be7 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -6,30 +6,25 @@ pub mod create; pub mod serve; pub mod translate; -use crate::custom_error; -use crate::{cfg::ConfigOptsBuild, gen_page}; -use crate::{cfg::ConfigOptsServe, server, CrateConfig}; -use crate::{error::Result, Error}; -use clap::Parser; -use html_parser::Dom; -use html_parser::Element; -use html_parser::Node; +use crate::{ + cfg::{ConfigOptsBuild, ConfigOptsServe}, + custom_error, + error::Result, + gen_page, server, CrateConfig, Error, +}; +use clap::{Parser, Subcommand}; +use html_parser::{Dom, Element, Node}; use regex::Regex; use serde::Deserialize; -use std::fmt::{Display, Formatter}; -use std::fs::File; -use std::io::Read; -use std::process::exit; use std::{ - fs::remove_dir_all, - process::{Command, Stdio}, + fmt::{Display, Formatter}, + fs::{remove_dir_all, File}, + io::{Read, Write}, + path::PathBuf, + process::{exit, Command, Stdio}, }; -use std::{io::Write, path::PathBuf}; -use clap::{Subcommand}; /// Build, bundle, & ship your Dioxus app. -/// -/// #[derive(Parser)] #[clap(name = "dioxus")] pub struct Cli { @@ -39,7 +34,6 @@ pub struct Cli { /// Enable verbose logging. #[clap(short)] pub v: bool, - // // // note: dioxus is still roughly compatible with trunk // /// Path to the Trunk config file [default: Trunk.toml] // #[clap(long, parse(from_os_str), env = "TRUNK_CONFIG")] diff --git a/src/server/mod.rs b/src/server/mod.rs index f312e07c2..38e37d60b 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -10,8 +10,7 @@ use notify::{RecommendedWatcher, Watcher}; use std::{path::PathBuf, sync::Arc}; use tower_http::services::ServeDir; -use crate::Result; -use crate::{builder, serve::Serve, CrateConfig}; +use crate::{builder, serve::Serve, CrateConfig, Result}; use tokio::sync::broadcast; struct WsRelodState { From 936fefbbf8da475d4b1a915c1d040161b9daee3c Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Fri, 11 Feb 2022 16:54:35 +0800 Subject: [PATCH 058/330] feat: commit code --- src/builder.rs | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 1458d52ba..c1e9fc0a7 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -5,6 +5,7 @@ use crate::{ }; use std::{ fs::{copy, create_dir_all, remove_dir_all}, + panic, path::PathBuf, process::Command, }; @@ -62,9 +63,6 @@ pub fn build(config: &CrateConfig) -> Result<()> { // [2] Establish the output directory structure let bindgen_outdir = out_dir.join("assets").join("dioxus"); - // [3] Bindgen the final binary for use easy linking - let mut bindgen_builder = Bindgen::new(); - let release_type = match config.release { true => "release", false => "debug", @@ -80,16 +78,25 @@ pub fn build(config: &CrateConfig) -> Result<()> { .join(format!("{}.wasm", name)), }; - bindgen_builder - .input_path(input_path) - .web(true)? - .debug(true) - .demangle(true) - .keep_debug(true) - .remove_name_section(false) - .remove_producers_section(false) - .out_name(&dioxus_config.application.name) - .generate(&bindgen_outdir)?; + let bindgen_result = panic::catch_unwind(move || { + // [3] Bindgen the final binary for use easy linking + let mut bindgen_builder = Bindgen::new(); + + bindgen_builder + .input_path(input_path) + .web(true).unwrap() + .debug(true) + .demangle(true) + .keep_debug(true) + .remove_name_section(false) + .remove_producers_section(false) + .out_name(&dioxus_config.application.name) + .generate(&bindgen_outdir).unwrap(); + }); + if bindgen_result.is_err() { + panic!("Bindgen build failed"); + } + // this code will copy all public file to the output dir let copy_options = fs_extra::dir::CopyOptions { From c3ba5c287decc50d82748ee502de3bc863be04e8 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Thu, 17 Feb 2022 19:28:54 +0800 Subject: [PATCH 059/330] feat: change public to `asset_dir` --- src/assets/dioxus.toml | 2 +- src/builder.rs | 10 +++++----- src/config.rs | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 31e306079..d3f160242 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -12,7 +12,7 @@ default_platform = "web" out_dir = "dist" # resource (static) file folder -public_dir = "public" +asset_dir = "public" [web.app] diff --git a/src/builder.rs b/src/builder.rs index efc5a915a..afd551dd3 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -22,7 +22,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { out_dir, crate_dir, target_dir, - public_dir, + asset_dir, executable, dioxus_config, .. @@ -105,8 +105,8 @@ pub fn build(config: &CrateConfig) -> Result<()> { content_only: false, depth: 0, }; - if public_dir.is_dir() { - for entry in std::fs::read_dir(&public_dir)? { + if asset_dir.is_dir() { + for entry in std::fs::read_dir(&asset_dir)? { let path = entry?.path(); if path.is_file() { std::fs::copy(&path, out_dir.join(path.file_name().unwrap()))?; @@ -195,7 +195,7 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { copy(res_path, &config.out_dir.join(target_file))?; // this code will copy all public file to the output dir - if config.public_dir.is_dir() { + if config.asset_dir.is_dir() { let copy_options = fs_extra::dir::CopyOptions { overwrite: true, skip_exist: false, @@ -205,7 +205,7 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { depth: 0, }; - for entry in std::fs::read_dir(&config.public_dir)? { + for entry in std::fs::read_dir(&config.asset_dir)? { let path = entry?.path(); if path.is_file() { std::fs::copy(&path, &config.out_dir.join(path.file_name().unwrap()))?; diff --git a/src/config.rs b/src/config.rs index 5949310dd..ba0427191 100644 --- a/src/config.rs +++ b/src/config.rs @@ -33,7 +33,7 @@ impl Default for DioxusConfig { name: "dioxus".into(), default_platform: "web".to_string(), out_dir: Some(PathBuf::from("dist")), - public_dir: Some(PathBuf::from("public")), + asset_dir: Some(PathBuf::from("public")), }, web: WebConfig { app: WebAppConfing { @@ -61,7 +61,7 @@ pub struct ApplicationConfig { pub name: String, pub default_platform: String, pub out_dir: Option, - pub public_dir: Option, + pub asset_dir: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -101,7 +101,7 @@ pub struct CrateConfig { pub crate_dir: PathBuf, pub workspace_dir: PathBuf, pub target_dir: PathBuf, - pub public_dir: PathBuf, + pub asset_dir: PathBuf, pub manifest: cargo_toml::Manifest, pub executable: ExecutableType, pub dioxus_config: DioxusConfig, @@ -130,7 +130,7 @@ impl CrateConfig { let cargo_def = &crate_dir.join("Cargo.toml"); - let public_dir = match dioxus_config.application.public_dir { + let asset_dir = match dioxus_config.application.asset_dir { Some(ref v) => crate_dir.join(v), None => crate_dir.join("public"), }; @@ -154,7 +154,7 @@ impl CrateConfig { crate_dir, workspace_dir, target_dir, - public_dir, + asset_dir, manifest, executable, release, From e7acc4d88de55792606014c28c9c235bdb860f41 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Thu, 17 Feb 2022 19:32:56 +0800 Subject: [PATCH 060/330] feat: add `log info` --- src/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index afd551dd3..708e1ce69 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -92,7 +92,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { .generate(&bindgen_outdir).unwrap(); }); if bindgen_result.is_err() { - panic!("Bindgen build failed"); + log::error!("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate."); } From 8a0abec82865daf78c5783d897c4d8375c0fbb6c Mon Sep 17 00:00:00 2001 From: YuKun Liu Date: Fri, 18 Feb 2022 09:50:26 +0800 Subject: [PATCH 061/330] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 33d1d4932..a939dfcaf 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ dioxus 0.1.2 Build, bundle, & ship your Dioxus app USAGE: - dioxus.exe [FLAGS] + dioxus [FLAGS] FLAGS: -h, --help Prints help information @@ -42,10 +42,10 @@ SUBCOMMANDS: ## Get Started -You can use the `dioxus crate project_name` to init a dioxus project, its will be clone from the [dioxus-template](https://github.com/DioxusLabs/dioxus-template). +You can use the `dioxus create project_name` to init a dioxus project, its will be clone from the [dioxus-template](https://github.com/DioxusLabs/dioxus-template). or you can assign the template path: ``` dioxus create hello --template gh:dioxuslabs/dioxus-template -``` \ No newline at end of file +``` From d462e032925f3a455eb0808274df69207f057fd5 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Fri, 18 Feb 2022 15:40:16 -0500 Subject: [PATCH 062/330] fix: indenting --- src/cli/translate/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index a717d632a..3e1f1057c 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -23,7 +23,7 @@ pub struct Translate { pub file: Option, /// Output file, stdout if not present - #[structopt(parse(from_os_str))] + #[structopt(short, long)] pub output: Option, } @@ -176,6 +176,7 @@ fn component(cx: Scope) -> Element {{ } writeln!(f, "\n\nmod icons {{")?; + writeln!(f, "\tuse super::*;")?; let mut id = 0; while let Some(svg) = svg_nodes.pop() { @@ -188,7 +189,8 @@ fn component(cx: Scope) -> Element {{ write_tabs(f, 3)?; render_element(f, svg, 3, &mut svg_nodes, false, &mut 0)?; - writeln!(f, "\t\t))\n\t}}\n")?; + + writeln!(f, "\t\t))\n\t}}")?; id += 1; } From 91a8ce31690d54b8df896254e58206da2816b0cd Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Thu, 10 Mar 2022 11:29:27 +0800 Subject: [PATCH 063/330] feat: config init `platform` arg --- src/assets/autoreload.js | 4 +++- src/assets/dioxus.toml | 2 +- src/cli/config/mod.rs | 13 +++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/assets/autoreload.js b/src/assets/autoreload.js index da62e5eae..fffb3e26c 100644 --- a/src/assets/autoreload.js +++ b/src/assets/autoreload.js @@ -1,3 +1,6 @@ +// Dioxus-CLI +// https://github.com/DioxusLabs/cli + (function () { var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; var url = protocol + '//' + window.location.host + '/_dioxus/ws'; @@ -15,7 +18,6 @@ var ws = new WebSocket(url); ws.onmessage = (ev) => { if (ev.data == "reload") { - // alert("reload!!!"); window.location.reload(); } }; diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index d3f160242..af9cc886b 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -6,7 +6,7 @@ name = "{{project-name}}" # default platfrom # you can also use `dioxus serve/build --platform XXX` to use other platform # value: web | desktop -default_platform = "web" +default_platform = "{{default-platform}}" # Web `build` & `serve` dist path out_dir = "dist" diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs index 6d672b7a5..2a1f28fda 100644 --- a/src/cli/config/mod.rs +++ b/src/cli/config/mod.rs @@ -13,6 +13,10 @@ pub enum Config { #[clap(long)] #[serde(default)] force: bool, + + /// Project default platform + #[clap(long, default_value = "web")] + platform: String, }, } @@ -20,7 +24,11 @@ impl Config { pub fn config(self) -> Result<()> { let crate_root = crate::cargo::crate_root()?; match self { - Config::Init { name, force } => { + Config::Init { + name, + force, + platform, + } => { let conf_path = crate_root.join("Dioxus.toml"); if conf_path.is_file() && !force { log::warn!( @@ -30,7 +38,8 @@ impl Config { } let mut file = File::create(conf_path)?; let content = String::from(include_str!("../../assets/dioxus.toml")) - .replace("{{project-name}}", &name); + .replace("{{project-name}}", &name) + .replace("{{default-platform}}", &platform); file.write_all(content.as_bytes())?; log::info!("🚩 Init config file completed."); } From 5fb1b3e20bb5f8282c735bcf7160dfdbcaf695d9 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sat, 12 Mar 2022 13:00:07 +0800 Subject: [PATCH 064/330] feat: commit code --- Cargo.toml | 7 ++++- src/assets/dioxus.toml | 4 ++- src/cli/mod.rs | 1 + src/cli/tools.rs | 69 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 src/cli/tools.rs diff --git a/Cargo.toml b/Cargo.toml index 3ae7b4610..6a7a2c9d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,12 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + # cli core clap = {version = "3.0.14", features = ["derive"]} thiserror = "1.0.30" wasm-bindgen-cli-support = "0.2.79" + # features log = "0.4.14" fern = { version = "0.6.0", features = ["colored"] } @@ -37,7 +39,10 @@ hyper = "0.14.17" axum = { version = "0.4.5", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } headers = "0.3.7" -# hyper = { version = "0.14.11", features = ["full"] } + +# tools download +dirs = "4.0.0" +reqwest = { version = "0.11", features = ["json"] } [[bin]] path = "src/main.rs" diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index af9cc886b..b897a39a7 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -36,4 +36,6 @@ script = [] # Javascript code file # serve: [dev-server] only -script = [] \ No newline at end of file +script = [] + +[web.tools] diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 1b5ba0be7..9f31c60ae 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -5,6 +5,7 @@ pub mod config; pub mod create; pub mod serve; pub mod translate; +pub mod tools; use crate::{ cfg::{ConfigOptsBuild, ConfigOptsServe}, diff --git a/src/cli/tools.rs b/src/cli/tools.rs new file mode 100644 index 000000000..aa320275e --- /dev/null +++ b/src/cli/tools.rs @@ -0,0 +1,69 @@ +use std::path::PathBuf; + +pub enum Tool { + WasmOpt, +} + +pub fn app_path() { + let data_local = dirs::data_local_dir().unwrap(); + +} + +impl Tool { + pub fn name(&self) -> &str { + match self { + Self::WasmOpt => "wasm-opt", + } + } + + pub fn bin_path(&self) -> &str { + if cfg!(target_os = "windows") { + match self { + Self::WasmOpt => "bin/wasm-opt.exe", + } + } else { + match self { + Self::WasmOpt => "bin/wasm-opt", + } + } + } + + pub fn target_platform(&self) -> &str { + match self { + Self::WasmOpt => { + if cfg!(target_os = "windows") { + "windows" + } else if cfg!(target_os = "macos") { + "macos" + } else if cfg!(target_os = "linux") { + "linux" + } else { + panic!("unsupported platformm"); + } + } + } + } + + pub fn download_url(&self) -> String { + match self { + Self::WasmOpt => { + format!( + "https://github.com/WebAssembly/binaryen/releases/download/version_105/binaryen-version_105-x86_64-{target}.tar.gz", + target = self.target_platform() + ) + } + } + } + + pub async fn download_package(&self) { + + let download_dir = dirs::download_dir().unwrap(); + let download_url = self.download_url(); + + let resp = reqwest::get(download_url).await.unwrap(); + + resp. + + } + +} From 25ff6c5937b8907a734d05b6936f5f20e8113b5b Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sat, 12 Mar 2022 23:48:05 +0800 Subject: [PATCH 065/330] feat: commit code --- Cargo.toml | 2 +- src/cli/tools.rs | 41 +++++++++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6a7a2c9d0..0b96d72a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ headers = "0.3.7" # tools download dirs = "4.0.0" -reqwest = { version = "0.11", features = ["json"] } +reqwest = { version = "0.11", features = ["rustls-tls", "stream", "trust-dns"] } [[bin]] path = "src/main.rs" diff --git a/src/cli/tools.rs b/src/cli/tools.rs index aa320275e..a042e7565 100644 --- a/src/cli/tools.rs +++ b/src/cli/tools.rs @@ -1,12 +1,29 @@ -use std::path::PathBuf; +use std::{fs::create_dir_all, path::PathBuf}; + +use anyhow::Context; +use futures::StreamExt; +use tokio::io::AsyncWriteExt; pub enum Tool { WasmOpt, } -pub fn app_path() { +pub fn app_path() -> PathBuf { let data_local = dirs::data_local_dir().unwrap(); - + let dioxus_dir = data_local.join("dioxus"); + if !dioxus_dir.is_dir() { + create_dir_all(&dioxus_dir).unwrap(); + } + dioxus_dir +} + +pub fn temp_path() -> PathBuf { + let app_path = app_path(); + let temp_path = app_path.join("temp"); + if !temp_path.is_dir() { + create_dir_all(&temp_path).unwrap(); + } + temp_path } impl Tool { @@ -55,15 +72,23 @@ impl Tool { } } - pub async fn download_package(&self) { - - let download_dir = dirs::download_dir().unwrap(); + pub async fn download_package(&self) -> anyhow::Result { + let temp_dir = temp_path(); let download_url = self.download_url(); + let temp_out = temp_dir.join(format!("{}-tool.tmp", self.name())); + let mut file = tokio::fs::File::create(&temp_out) + .await + .context("failed creating temporary output file")?; + let resp = reqwest::get(download_url).await.unwrap(); - resp. + let mut res_bytes = resp.bytes_stream(); + while let Some(chunk_res) = res_bytes.next().await { + let chunk = chunk_res.context("error reading chunk from download")?; + let _ = file.write(chunk.as_ref()).await; + } + Ok(temp_out) } - } From eea01f7f8c94c00d6c8ae4cbe6bde29e184552a6 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 13 Mar 2022 13:19:54 +0800 Subject: [PATCH 066/330] feat: commit code --- Cargo.toml | 2 ++ src/cli/mod.rs | 4 ++++ src/cli/tool/mod.rs | 40 ++++++++++++++++++++++++++++++++++++++++ src/cli/tools.rs | 45 +++++++++++++++++++++++++++++++++++++++++---- src/main.rs | 6 ++++++ 5 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 src/cli/tool/mod.rs diff --git a/Cargo.toml b/Cargo.toml index 0b96d72a2..8beca8f7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,8 @@ headers = "0.3.7" # tools download dirs = "4.0.0" reqwest = { version = "0.11", features = ["rustls-tls", "stream", "trust-dns"] } +flate2 = "1.0.22" +tar = "0.4.38" [[bin]] path = "src/main.rs" diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 9f31c60ae..6e653507d 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -6,6 +6,7 @@ pub mod create; pub mod serve; pub mod translate; pub mod tools; +pub mod tool; use crate::{ cfg::{ConfigOptsBuild, ConfigOptsServe}, @@ -56,4 +57,7 @@ pub enum Commands { /// Dioxus config file controls. #[clap(subcommand)] Config(config::Config), + /// Install & Manage tools for Dioxus-cli. + #[clap(subcommand)] + Tool(tool::Tool), } diff --git a/src/cli/tool/mod.rs b/src/cli/tool/mod.rs new file mode 100644 index 000000000..3f3a86bfc --- /dev/null +++ b/src/cli/tool/mod.rs @@ -0,0 +1,40 @@ +use super::*; + +/// Build the Rust WASM app and all of its assets. +#[derive(Clone, Debug, Deserialize, Subcommand)] +#[clap(name = "tool")] +pub enum Tool { + /// Return all dioxus-cli support tools. + List {}, + Add { + name: String + } +} + +impl Tool { + pub async fn tool(self) -> Result<()> { + match self { + Tool::List {} => { + for item in tools::tool_list() { + if tools::Tool::from_str(item).unwrap().is_installed() { + println!("{item} [installed]"); + } else { + println!("{item}"); + } + } + } + Tool::Add { name } => { + let tool_list = tools::tool_list(); + + if !tool_list.contains(&name.as_str()) { + log::error!("Tool {name} not found."); + return Ok(()); + } + let target_tool = tools::Tool::from_str(&name).unwrap(); + println!("{:?}", target_tool.download_package().await); + } + } + + Ok(()) + } +} diff --git a/src/cli/tools.rs b/src/cli/tools.rs index a042e7565..1eb68e773 100644 --- a/src/cli/tools.rs +++ b/src/cli/tools.rs @@ -8,6 +8,10 @@ pub enum Tool { WasmOpt, } +pub fn tool_list() -> Vec<&'static str> { + vec!["wasm-opt"] +} + pub fn app_path() -> PathBuf { let data_local = dirs::data_local_dir().unwrap(); let dioxus_dir = data_local.join("dioxus"); @@ -26,7 +30,24 @@ pub fn temp_path() -> PathBuf { temp_path } +pub fn tools_path(tool: &Tool) -> PathBuf { + let app_path = app_path(); + let temp_path = app_path.join("tools"); + if !temp_path.is_dir() { + create_dir_all(&temp_path).unwrap(); + } + temp_path.join(tool.name()) +} + +#[allow(clippy::should_implement_trait)] impl Tool { + pub fn from_str(name: &str) -> Option { + match name { + "wasm-opt" => Some(Self::WasmOpt), + _ => None, + } + } + pub fn name(&self) -> &str { match self { Self::WasmOpt => "wasm-opt", @@ -72,11 +93,23 @@ impl Tool { } } - pub async fn download_package(&self) -> anyhow::Result { - let temp_dir = temp_path(); - let download_url = self.download_url(); + pub fn extension(&self) -> &str { + match self { + Self::WasmOpt => "tar.gz", + } + } - let temp_out = temp_dir.join(format!("{}-tool.tmp", self.name())); + pub fn is_installed(&self) -> bool { + tools_path(self).is_dir() + } + + pub fn temp_out_path(&self) -> PathBuf { + temp_path().join(format!("{}-tool.tmp", self.name())) + } + + pub async fn download_package(&self) -> anyhow::Result { + let download_url = self.download_url(); + let temp_out = self.temp_out_path(); let mut file = tokio::fs::File::create(&temp_out) .await .context("failed creating temporary output file")?; @@ -91,4 +124,8 @@ impl Tool { Ok(temp_out) } + + pub async fn install_package() -> anyhow::Result<()> { + Ok(()) + } } diff --git a/src/main.rs b/src/main.rs index 97d4a3bb4..099ff74c0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,6 +42,12 @@ async fn main() -> Result<()> { log::error!("config error: {}", e); } } + + Commands::Tool(opts) => { + if let Err(e) = opts.tool().await { + log::error!("tool error: {}", e); + } + } } Ok(()) From 140d7ad7ed1b724b19806ea8999bde84b904646d Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 14 Mar 2022 19:11:12 +0800 Subject: [PATCH 067/330] feat: commit code --- Dioxus.toml | 45 +++++++++++++++++++++++++++++++ src/assets/dioxus.toml | 6 ++++- src/cli/config/mod.rs | 5 ++++ src/cli/tool/mod.rs | 26 +++++++++++++++++- src/cli/tools.rs | 61 ++++++++++++++++++++++++++++-------------- src/config.rs | 4 ++- 6 files changed, 124 insertions(+), 23 deletions(-) create mode 100644 Dioxus.toml diff --git a/Dioxus.toml b/Dioxus.toml new file mode 100644 index 000000000..ab85abe86 --- /dev/null +++ b/Dioxus.toml @@ -0,0 +1,45 @@ +[application] + +# dioxus project name +name = "{{project-name}}" + +# default platfrom +# you can also use `dioxus serve/build --platform XXX` to use other platform +# value: web | desktop +default_platform = "{{default-platform}}" + +# Web `build` & `serve` dist path +out_dir = "dist" + +# resource (static) file folder +asset_dir = "public" + +[web.app] + +# HTML title tag content +title = "dioxus | ⛺" + +[web.watcher] + +watch_path = ["src"] + +# include `assets` in web platform +[web.resource] + +# CSS style file +style = [] + +# Javascript code file +script = [] + +[web.resource.dev] + +# Javascript code file +# serve: [dev-server] only +script = [] + +[application.tools] + +# use binaryen.wasm-opt for output Wasm file +# binaryen just will trigger in `web` platform +binaryen = { wasm_opt = [".PROJECT_OUT"] } \ No newline at end of file diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index b897a39a7..ab85abe86 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -38,4 +38,8 @@ script = [] # serve: [dev-server] only script = [] -[web.tools] +[application.tools] + +# use binaryen.wasm-opt for output Wasm file +# binaryen just will trigger in `web` platform +binaryen = { wasm_opt = [".PROJECT_OUT"] } \ No newline at end of file diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs index 2a1f28fda..6422ede27 100644 --- a/src/cli/config/mod.rs +++ b/src/cli/config/mod.rs @@ -18,6 +18,8 @@ pub enum Config { #[clap(long, default_value = "web")] platform: String, }, + /// Format Print Dioxus-Config. + FormatPrint {} } impl Config { @@ -43,6 +45,9 @@ impl Config { file.write_all(content.as_bytes())?; log::info!("🚩 Init config file completed."); } + Config::FormatPrint {} => { + println!("{:#?}", crate::CrateConfig::new()?.dioxus_config); + } } Ok(()) } diff --git a/src/cli/tool/mod.rs b/src/cli/tool/mod.rs index 3f3a86bfc..1b8768497 100644 --- a/src/cli/tool/mod.rs +++ b/src/cli/tool/mod.rs @@ -6,6 +6,9 @@ use super::*; pub enum Tool { /// Return all dioxus-cli support tools. List {}, + /// Get default app install path. + AppPath {}, + /// Install a new tool. Add { name: String } @@ -23,6 +26,9 @@ impl Tool { } } } + Tool::AppPath {} => { + println!("{}", tools::tools_path().to_str().unwrap()); + } Tool::Add { name } => { let tool_list = tools::tool_list(); @@ -31,7 +37,25 @@ impl Tool { return Ok(()); } let target_tool = tools::Tool::from_str(&name).unwrap(); - println!("{:?}", target_tool.download_package().await); + + if target_tool.is_installed() { + log::warn!("Tool {name} is installed."); + return Ok(()); + } + + log::info!("Start to download tool package..."); + if let Err(e) = target_tool.download_package().await { + log::error!("Tool download failed: {e}"); + return Ok(()); + } + + log::info!("Start to install tool package..."); + if let Err(e) = target_tool.install_package().await { + log::error!("Tool install failed: {e}"); + return Ok(()); + } + + log::info!("Tool {name} install successfully!"); } } diff --git a/src/cli/tools.rs b/src/cli/tools.rs index 1eb68e773..257c7f856 100644 --- a/src/cli/tools.rs +++ b/src/cli/tools.rs @@ -1,15 +1,21 @@ -use std::{fs::create_dir_all, path::PathBuf}; +use std::{ + fs::{create_dir_all, File}, + path::PathBuf, +}; use anyhow::Context; +use flate2::read::GzDecoder; use futures::StreamExt; +use tar::Archive; use tokio::io::AsyncWriteExt; +#[derive(Debug, PartialEq, Eq)] pub enum Tool { - WasmOpt, + Binaryen, } pub fn tool_list() -> Vec<&'static str> { - vec!["wasm-opt"] + vec!["binaryen"] } pub fn app_path() -> PathBuf { @@ -30,45 +36,39 @@ pub fn temp_path() -> PathBuf { temp_path } -pub fn tools_path(tool: &Tool) -> PathBuf { +pub fn tools_path() -> PathBuf { let app_path = app_path(); let temp_path = app_path.join("tools"); if !temp_path.is_dir() { create_dir_all(&temp_path).unwrap(); } - temp_path.join(tool.name()) + temp_path } #[allow(clippy::should_implement_trait)] impl Tool { pub fn from_str(name: &str) -> Option { match name { - "wasm-opt" => Some(Self::WasmOpt), + "binaryen" => Some(Self::Binaryen), _ => None, } } pub fn name(&self) -> &str { match self { - Self::WasmOpt => "wasm-opt", + Self::Binaryen => "binaryen", } } pub fn bin_path(&self) -> &str { - if cfg!(target_os = "windows") { - match self { - Self::WasmOpt => "bin/wasm-opt.exe", - } - } else { - match self { - Self::WasmOpt => "bin/wasm-opt", - } + match self { + Self::Binaryen => "bin", } } pub fn target_platform(&self) -> &str { match self { - Self::WasmOpt => { + Self::Binaryen => { if cfg!(target_os = "windows") { "windows" } else if cfg!(target_os = "macos") { @@ -84,7 +84,7 @@ impl Tool { pub fn download_url(&self) -> String { match self { - Self::WasmOpt => { + Self::Binaryen => { format!( "https://github.com/WebAssembly/binaryen/releases/download/version_105/binaryen-version_105-x86_64-{target}.tar.gz", target = self.target_platform() @@ -95,12 +95,12 @@ impl Tool { pub fn extension(&self) -> &str { match self { - Self::WasmOpt => "tar.gz", + Self::Binaryen => "tar.gz", } } pub fn is_installed(&self) -> bool { - tools_path(self).is_dir() + tools_path().join(self.name()).is_dir() } pub fn temp_out_path(&self) -> PathBuf { @@ -125,7 +125,28 @@ impl Tool { Ok(temp_out) } - pub async fn install_package() -> anyhow::Result<()> { + pub async fn install_package(&self) -> anyhow::Result<()> { + let temp_path = self.temp_out_path(); + let tool_path = tools_path(); + + let dir_name = if self == &Tool::Binaryen { + "binaryen-version_105" + } else { + "" + }; + + if self.extension() == "tar.gz" { + let tar_gz = File::open(temp_path)?; + let tar = GzDecoder::new(tar_gz); + let mut archive = Archive::new(tar); + archive.unpack(&tool_path)?; + // println!("{:?} -> {:?}", tool_path.join(dir_name), tool_path.join(self.name())); + std::fs::rename( + tool_path.join(dir_name), + tool_path.join(self.name()), + )?; + } + Ok(()) } } diff --git a/src/config.rs b/src/config.rs index ba0427191..f7897f5f8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,6 @@ use crate::error::Result; use serde::{Deserialize, Serialize}; -use std::{fs::File, io::Read, path::PathBuf}; +use std::{fs::File, io::Read, path::PathBuf, collections::HashMap}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DioxusConfig { @@ -34,6 +34,7 @@ impl Default for DioxusConfig { default_platform: "web".to_string(), out_dir: Some(PathBuf::from("dist")), asset_dir: Some(PathBuf::from("public")), + tools: None, }, web: WebConfig { app: WebAppConfing { @@ -62,6 +63,7 @@ pub struct ApplicationConfig { pub default_platform: String, pub out_dir: Option, pub asset_dir: Option, + pub tools: Option> } #[derive(Debug, Clone, Serialize, Deserialize)] From 2e83822d415e8d29503defb56eec5cccb0231ed3 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Mon, 14 Mar 2022 22:39:15 +0800 Subject: [PATCH 068/330] feat: commit code --- Dioxus.toml | 4 ++-- src/cli/mod.rs | 1 - src/cli/tool/mod.rs | 2 ++ src/lib.rs | 2 ++ src/{cli => }/tools.rs | 11 +++++++++++ 5 files changed, 17 insertions(+), 3 deletions(-) rename src/{cli => }/tools.rs (92%) diff --git a/Dioxus.toml b/Dioxus.toml index ab85abe86..2db611914 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -1,12 +1,12 @@ [application] # dioxus project name -name = "{{project-name}}" +name = "dioxus-cli" # default platfrom # you can also use `dioxus serve/build --platform XXX` to use other platform # value: web | desktop -default_platform = "{{default-platform}}" +default_platform = "desktop" # Web `build` & `serve` dist path out_dir = "dist" diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 6e653507d..2c91c94dd 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -5,7 +5,6 @@ pub mod config; pub mod create; pub mod serve; pub mod translate; -pub mod tools; pub mod tool; use crate::{ diff --git a/src/cli/tool/mod.rs b/src/cli/tool/mod.rs index 1b8768497..51e41e384 100644 --- a/src/cli/tool/mod.rs +++ b/src/cli/tool/mod.rs @@ -1,3 +1,5 @@ +use crate::tools; + use super::*; /// Build the Rust WASM app and all of its assets. diff --git a/src/lib.rs b/src/lib.rs index 395cbc8dc..8cd4b1f2d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,7 @@ pub mod builder; pub mod server; +pub mod tools; + pub use builder::*; pub mod cargo; diff --git a/src/cli/tools.rs b/src/tools.rs similarity index 92% rename from src/cli/tools.rs rename to src/tools.rs index 257c7f856..b5c9d658a 100644 --- a/src/cli/tools.rs +++ b/src/tools.rs @@ -47,6 +47,8 @@ pub fn tools_path() -> PathBuf { #[allow(clippy::should_implement_trait)] impl Tool { + + /// from str to tool enum pub fn from_str(name: &str) -> Option { match name { "binaryen" => Some(Self::Binaryen), @@ -54,18 +56,21 @@ impl Tool { } } + /// get current tool name str pub fn name(&self) -> &str { match self { Self::Binaryen => "binaryen", } } + /// get tool bin dir path pub fn bin_path(&self) -> &str { match self { Self::Binaryen => "bin", } } + /// get target platform pub fn target_platform(&self) -> &str { match self { Self::Binaryen => { @@ -82,6 +87,7 @@ impl Tool { } } + /// get tool package download url pub fn download_url(&self) -> String { match self { Self::Binaryen => { @@ -93,20 +99,24 @@ impl Tool { } } + /// get package extension name pub fn extension(&self) -> &str { match self { Self::Binaryen => "tar.gz", } } + /// check tool state pub fn is_installed(&self) -> bool { tools_path().join(self.name()).is_dir() } + /// get download temp path pub fn temp_out_path(&self) -> PathBuf { temp_path().join(format!("{}-tool.tmp", self.name())) } + /// start to download package pub async fn download_package(&self) -> anyhow::Result { let download_url = self.download_url(); let temp_out = self.temp_out_path(); @@ -125,6 +135,7 @@ impl Tool { Ok(temp_out) } + /// start to install package pub async fn install_package(&self) -> anyhow::Result<()> { let temp_path = self.temp_out_path(); let tool_path = tools_path(); From 3514e341124bd9f0b9f91ad6604c071cd9296685 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 15 Mar 2022 00:22:41 +0800 Subject: [PATCH 069/330] feat: commit code --- Dioxus.toml | 2 +- src/builder.rs | 27 +++++++++++++++++++++++++-- src/cli/build/mod.rs | 1 + src/tools.rs | 34 +++++++++++++++++++++++++++++----- 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/Dioxus.toml b/Dioxus.toml index 2db611914..c3e0dd8a0 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -42,4 +42,4 @@ script = [] # use binaryen.wasm-opt for output Wasm file # binaryen just will trigger in `web` platform -binaryen = { wasm_opt = [".PROJECT_OUT"] } \ No newline at end of file +binaryen = { wasm_opt = true } \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index 708e1ce69..870e737f0 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -82,19 +82,42 @@ pub fn build(config: &CrateConfig) -> Result<()> { bindgen_builder .input_path(input_path) - .web(true).unwrap() + .web(true) + .unwrap() .debug(true) .demangle(true) .keep_debug(true) .remove_name_section(false) .remove_producers_section(false) .out_name(&dioxus_config.application.name) - .generate(&bindgen_outdir).unwrap(); + .generate(&bindgen_outdir) + .unwrap(); }); if bindgen_result.is_err() { log::error!("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate."); } + // check binaryen:wasm-opt tool + let dioxus_tools = dioxus_config.application.tools.clone().unwrap_or_default(); + if dioxus_tools.contains_key("binaryen") { + let info = dioxus_tools.get("binaryen").unwrap(); + let binaryen = crate::tools::Tool::Binaryen; + if let Some(sub) = info.as_table() { + println!("sub: {sub:?}"); + if sub.contains_key("wasm_opt") + && sub.get("wasm_opt").unwrap().as_bool().unwrap_or(false) + { + let target_file = out_dir + .join("assets") + .join("dioxus") + .join(format!("{}_bg.wasm", dioxus_config.application.name)); + println!("tf: {target_file:?}"); + if target_file.is_file() { + binaryen.call("wasm-opt", vec![target_file.to_str().unwrap(), "--print"])?; + } + } + } + } // this code will copy all public file to the output dir let copy_options = fs_extra::dir::CopyOptions { diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 4c043091f..3b4d343af 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -12,6 +12,7 @@ impl Build { pub fn build(self) -> Result<()> { let mut crate_config = crate::CrateConfig::new()?; + // change the release state. crate_config.with_release(self.build.release); diff --git a/src/tools.rs b/src/tools.rs index b5c9d658a..b84cd5579 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -1,6 +1,7 @@ use std::{ fs::{create_dir_all, File}, path::PathBuf, + process::Command, }; use anyhow::Context; @@ -47,7 +48,6 @@ pub fn tools_path() -> PathBuf { #[allow(clippy::should_implement_trait)] impl Tool { - /// from str to tool enum pub fn from_str(name: &str) -> Option { match name { @@ -152,12 +152,36 @@ impl Tool { let mut archive = Archive::new(tar); archive.unpack(&tool_path)?; // println!("{:?} -> {:?}", tool_path.join(dir_name), tool_path.join(self.name())); - std::fs::rename( - tool_path.join(dir_name), - tool_path.join(self.name()), - )?; + std::fs::rename(tool_path.join(dir_name), tool_path.join(self.name()))?; } Ok(()) } + + pub fn call(&self, command: &str, args: Vec<&str>) -> anyhow::Result<()> { + let bin_path = tools_path().join(self.name()).join(self.bin_path()); + + let command_file = match self { + Tool::Binaryen => { + if cfg!(target_os = "windows") { + format!("{}.exe", command) + } else { + command.to_string() + } + } + }; + + if !bin_path.join(command_file).is_file() { + return Err(anyhow::anyhow!("Command file not found.")); + } + + let mut command = Command::new(bin_path.to_str().unwrap()); + + command + .args(&args[..]) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + + Ok(()) + } } From 62a2292c16e54fe46c1438d7629ed67831eb5018 Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 15 Mar 2022 17:32:42 +0800 Subject: [PATCH 070/330] feat: commit code --- src/builder.rs | 18 +++++++++++++++--- src/tools.rs | 14 +++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 870e737f0..ac9f72b13 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -95,6 +95,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { }); if bindgen_result.is_err() { log::error!("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate."); + return Ok(()); } // check binaryen:wasm-opt tool @@ -102,8 +103,13 @@ pub fn build(config: &CrateConfig) -> Result<()> { if dioxus_tools.contains_key("binaryen") { let info = dioxus_tools.get("binaryen").unwrap(); let binaryen = crate::tools::Tool::Binaryen; + + if !binaryen.is_installed() { + log::error!("Binaryen tool not found, you can use `dioxus tool add binaryen` to install it."); + return Ok(()); + } + if let Some(sub) = info.as_table() { - println!("sub: {sub:?}"); if sub.contains_key("wasm_opt") && sub.get("wasm_opt").unwrap().as_bool().unwrap_or(false) { @@ -111,9 +117,15 @@ pub fn build(config: &CrateConfig) -> Result<()> { .join("assets") .join("dioxus") .join(format!("{}_bg.wasm", dioxus_config.application.name)); - println!("tf: {target_file:?}"); if target_file.is_file() { - binaryen.call("wasm-opt", vec![target_file.to_str().unwrap(), "--print"])?; + binaryen.call( + "wasm-opt", + vec![ + target_file.to_str().unwrap(), + "-o", + target_file.to_str().unwrap(), + ], + )?; } } } diff --git a/src/tools.rs b/src/tools.rs index b84cd5579..937063be0 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -158,7 +158,7 @@ impl Tool { Ok(()) } - pub fn call(&self, command: &str, args: Vec<&str>) -> anyhow::Result<()> { + pub fn call(&self, command: &str, args: Vec<&str>) -> anyhow::Result> { let bin_path = tools_path().join(self.name()).join(self.bin_path()); let command_file = match self { @@ -171,17 +171,17 @@ impl Tool { } }; - if !bin_path.join(command_file).is_file() { + if !bin_path.join(&command_file).is_file() { return Err(anyhow::anyhow!("Command file not found.")); } - let mut command = Command::new(bin_path.to_str().unwrap()); + let mut command = Command::new(bin_path.join(&command_file).to_str().unwrap()); - command + let output = command .args(&args[..]) .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - - Ok(()) + .stderr(std::process::Stdio::inherit()) + .output()?; + Ok(output.stdout) } } From 8b380f2617f3845db6d7006790312290c85cf19c Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Tue, 15 Mar 2022 18:28:19 +0800 Subject: [PATCH 071/330] feat: commit code --- src/builder.rs | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index ac9f72b13..d58af6f43 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -105,29 +105,30 @@ pub fn build(config: &CrateConfig) -> Result<()> { let binaryen = crate::tools::Tool::Binaryen; if !binaryen.is_installed() { - log::error!("Binaryen tool not found, you can use `dioxus tool add binaryen` to install it."); - return Ok(()); - } - - if let Some(sub) = info.as_table() { - if sub.contains_key("wasm_opt") - && sub.get("wasm_opt").unwrap().as_bool().unwrap_or(false) - { - let target_file = out_dir - .join("assets") - .join("dioxus") - .join(format!("{}_bg.wasm", dioxus_config.application.name)); - if target_file.is_file() { - binaryen.call( - "wasm-opt", - vec![ - target_file.to_str().unwrap(), - "-o", - target_file.to_str().unwrap(), - ], - )?; + if let Some(sub) = info.as_table() { + if sub.contains_key("wasm_opt") + && sub.get("wasm_opt").unwrap().as_bool().unwrap_or(false) + { + let target_file = out_dir + .join("assets") + .join("dioxus") + .join(format!("{}_bg.wasm", dioxus_config.application.name)); + if target_file.is_file() { + binaryen.call( + "wasm-opt", + vec![ + target_file.to_str().unwrap(), + "-o", + target_file.to_str().unwrap(), + ], + )?; + } } } + } else { + log::warn!( + "Binaryen tool not found, you can use `dioxus tool add binaryen` to install it." + ); } } From 6b0d57abe5c70ebd8cc7cdcc9f14fea5c8b738dd Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 20 Mar 2022 18:39:28 +0800 Subject: [PATCH 072/330] feat: commit code --- Cargo.toml | 2 +- src/server/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8beca8f7d..246e90517 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-cli" -version = "0.1.3" +version = "0.1.4" authors = ["Jonathan Kelley"] edition = "2018" description = "CLI tool for developing, testing, and publishing Dioxus apps" diff --git a/src/server/mod.rs b/src/server/mod.rs index 38e37d60b..7d63f3eb6 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -33,6 +33,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { // file watcher: check file change let watcher_conf = config.clone(); let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { + log::info!("Start to rebuild project..."); if chrono::Local::now().timestamp() > last_update_time && builder::build(&watcher_conf).is_ok() { @@ -47,8 +48,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { { let _ = Serve::regen_dev_page(&watcher_conf); } - println!("watcher send reload"); - reload_tx.send("reload".into()).unwrap(); + let _ = reload_tx.send("reload".into()); last_update_time = chrono::Local::now().timestamp(); } }) From e5dfe84eb1f8c821fa875744ed7ec541de8013ad Mon Sep 17 00:00:00 2001 From: mrxiaozhuox Date: Sun, 20 Mar 2022 19:31:30 +0800 Subject: [PATCH 073/330] feat: add `custom html` support --- src/assets/index.html | 2 -- src/builder.rs | 17 +++++++++++++++-- src/cli/config/mod.rs | 13 +++++++++++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/assets/index.html b/src/assets/index.html index 9934e490d..925df0227 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -4,11 +4,9 @@ {style_include} -
- {script_include} From 4867cb5cf30f06635142837cf790480b37aa5fdc Mon Sep 17 00:00:00 2001 From: YuKun Liu Date: Sat, 2 Apr 2022 23:51:52 +0800 Subject: [PATCH 089/330] Update config.rs --- src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 3fc63637c..e664edbfc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -65,7 +65,7 @@ pub struct ApplicationConfig { pub default_platform: String, pub out_dir: Option, pub asset_dir: Option, - pub tools: Option> + pub tools: Option>, pub sub_package: Option, } From 280480de6bd7c9d95910be0932edb31b984827f3 Mon Sep 17 00:00:00 2001 From: Ben Birch Date: Thu, 7 Apr 2022 15:22:46 +1000 Subject: [PATCH 090/330] - set index on 404 to true (highly desired for SPA) - add support for web.base_path in dioxus.toml to allow multi level routes --- src/assets/index.html | 45 +++++++++++++++++++++++-------------------- src/builder.rs | 12 +++++++++--- src/config.rs | 4 +++- 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/src/assets/index.html b/src/assets/index.html index bff411bee..f907aa281 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -1,23 +1,26 @@ - - {app_title} - - - - {style_include} - - -
- - - {script_include} - - + + {app_title} + + + + {style_include} + + + + +
+ + + {script_include} + + + \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index 708e1ce69..bacfcd664 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -82,20 +82,21 @@ pub fn build(config: &CrateConfig) -> Result<()> { bindgen_builder .input_path(input_path) - .web(true).unwrap() + .web(true) + .unwrap() .debug(true) .demangle(true) .keep_debug(true) .remove_name_section(false) .remove_producers_section(false) .out_name(&dioxus_config.application.name) - .generate(&bindgen_outdir).unwrap(); + .generate(&bindgen_outdir) + .unwrap(); }); if bindgen_result.is_err() { log::error!("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate."); } - // this code will copy all public file to the output dir let copy_options = fs_extra::dir::CopyOptions { overwrite: true, @@ -278,6 +279,11 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { html = html.replace("{app_name}", &config.application.name); + html = match &config.web.app.base_path { + Some(path) => html.replace("{base_path}", path), + None => html.replace("{base_path}", "."), + }; + let title = config .web .app diff --git a/src/config.rs b/src/config.rs index fbf6f4b9d..9e8b47f7a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -39,11 +39,12 @@ impl Default for DioxusConfig { web: WebConfig { app: WebAppConfing { title: Some("dioxus | ⛺".into()), + base_path: None, }, watcher: WebWatcherConfing { watch_path: Some(vec![PathBuf::from("src")]), reload_html: Some(false), - index_on_404: Some(false), + index_on_404: Some(true), }, resource: WebResourceConfing { dev: WebDevResourceConfing { @@ -77,6 +78,7 @@ pub struct WebConfig { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebAppConfing { pub title: Option, + pub base_path: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] From 714c6dd46ff383abfa749e6c3d9d82bbbfd6bdb5 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sun, 17 Apr 2022 11:24:17 +0800 Subject: [PATCH 091/330] Upgrade `axum` version --- Cargo.toml | 2 +- src/builder.rs | 8 ++++---- src/cli/serve/mod.rs | 15 ++++----------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5f5ded9be..21e2dad7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ chrono = "0.4.19" anyhow = "1.0.53" hyper = "0.14.17" -axum = { version = "0.4.5", features = ["ws", "headers"] } +axum = { version = "0.5.1", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } headers = "0.3.7" # tools download diff --git a/src/builder.rs b/src/builder.rs index aaaa0278a..09a410458 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -206,16 +206,16 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { file_name = name.clone(); config .target_dir - .join(release_type.to_string()) - .join(name.to_string()) + .join(release_type) + .join(name) } crate::ExecutableType::Example(name) => { file_name = name.clone(); config .target_dir - .join(release_type.to_string()) + .join(release_type) .join("examples") - .join(name.to_string()) + .join(name) } }; diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 21d29cd93..85bd92c74 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -1,9 +1,9 @@ +use super::*; use std::{ io::Write, path::PathBuf, process::{Command, Stdio}, }; -use super::*; /// Run the WASM project on dev-server #[derive(Clone, Debug, Parser)] @@ -47,16 +47,9 @@ impl Serve { if cfg!(windows) { file.set_extension("exe"); } - Command::new( - crate_config - .out_dir - .join(file) - .to_str() - .unwrap() - .to_string(), - ) - .stdout(Stdio::inherit()) - .output()?; + Command::new(crate_config.out_dir.join(file).to_str().unwrap()) + .stdout(Stdio::inherit()) + .output()?; } } return Ok(()); From 001410f1196f2ea6fe35084b5d489f48d104ca83 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sun, 17 Apr 2022 11:25:53 +0800 Subject: [PATCH 092/330] Format code --- src/builder.rs | 7 ++----- src/cli/build/mod.rs | 1 - src/cli/config/mod.rs | 2 +- src/cli/mod.rs | 2 +- src/cli/tool/mod.rs | 6 ++---- src/config.rs | 2 +- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 09a410458..f7f68e2bc 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -132,7 +132,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { ); } } - + // this code will copy all public file to the output dir let copy_options = fs_extra::dir::CopyOptions { overwrite: true, @@ -204,10 +204,7 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { let mut res_path = match &config.executable { crate::ExecutableType::Binary(name) | crate::ExecutableType::Lib(name) => { file_name = name.clone(); - config - .target_dir - .join(release_type) - .join(name) + config.target_dir.join(release_type).join(name) } crate::ExecutableType::Example(name) => { file_name = name.clone(); diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 3b4d343af..4c043091f 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -12,7 +12,6 @@ impl Build { pub fn build(self) -> Result<()> { let mut crate_config = crate::CrateConfig::new()?; - // change the release state. crate_config.with_release(self.build.release); diff --git a/src/cli/config/mod.rs b/src/cli/config/mod.rs index fb1e046fb..5f9fa20d0 100644 --- a/src/cli/config/mod.rs +++ b/src/cli/config/mod.rs @@ -21,7 +21,7 @@ pub enum Config { /// Format print Dioxus config. FormatPrint {}, /// Create a custom html file. - CustomHtml {} + CustomHtml {}, } impl Config { diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 2c91c94dd..d639d28a7 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -4,8 +4,8 @@ pub mod clean; pub mod config; pub mod create; pub mod serve; -pub mod translate; pub mod tool; +pub mod translate; use crate::{ cfg::{ConfigOptsBuild, ConfigOptsServe}, diff --git a/src/cli/tool/mod.rs b/src/cli/tool/mod.rs index 51e41e384..d5c4581aa 100644 --- a/src/cli/tool/mod.rs +++ b/src/cli/tool/mod.rs @@ -11,9 +11,7 @@ pub enum Tool { /// Get default app install path. AppPath {}, /// Install a new tool. - Add { - name: String - } + Add { name: String }, } impl Tool { @@ -33,7 +31,7 @@ impl Tool { } Tool::Add { name } => { let tool_list = tools::tool_list(); - + if !tool_list.contains(&name.as_str()) { log::error!("Tool {name} not found."); return Ok(()); diff --git a/src/config.rs b/src/config.rs index 0cdd0bd8b..783c72ccd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,6 @@ use crate::error::Result; use serde::{Deserialize, Serialize}; -use std::{fs::File, io::Read, path::PathBuf, collections::HashMap}; +use std::{collections::HashMap, fs::File, io::Read, path::PathBuf}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DioxusConfig { From 569b294ab9fe98960f89c9eb4e75158f7db4b8cb Mon Sep 17 00:00:00 2001 From: Michael Mroz Date: Sun, 17 Apr 2022 01:13:48 -0700 Subject: [PATCH 093/330] Opt into standards mode --- src/assets/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/assets/index.html b/src/assets/index.html index f57acbd34..87d447816 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -1,3 +1,4 @@ + {app_title} From f203b5f99d7bed69f638073ac86fd911b14f2c19 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sun, 24 Apr 2022 10:44:06 +0800 Subject: [PATCH 094/330] Move `docs` to cli repo --- .github/workflows/docs.yml | 32 ++++++++ docs/.gitignore | 1 + docs/book.toml | 6 ++ docs/src/SUMMARY.md | 11 +++ docs/src/cmd/README.md | 26 +++++++ docs/src/cmd/build.md | 47 ++++++++++++ docs/src/cmd/clean.md | 18 +++++ docs/src/cmd/serve.md | 49 +++++++++++++ docs/src/cmd/translate.md | 57 ++++++++++++++ docs/src/configure.md | 147 +++++++++++++++++++++++++++++++++++++ docs/src/creating.md | 38 ++++++++++ docs/src/installation.md | 24 ++++++ docs/src/introduction.md | 21 ++++++ 13 files changed, 477 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/.gitignore create mode 100644 docs/book.toml create mode 100644 docs/src/SUMMARY.md create mode 100644 docs/src/cmd/README.md create mode 100644 docs/src/cmd/build.md create mode 100644 docs/src/cmd/clean.md create mode 100644 docs/src/cmd/serve.md create mode 100644 docs/src/cmd/translate.md create mode 100644 docs/src/configure.md create mode 100644 docs/src/creating.md create mode 100644 docs/src/installation.md create mode 100644 docs/src/introduction.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..2638b8a18 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +name: github pages + +on: + push: + paths: + - docs/** + - .github/workflows/docs.yml + branches: + - master + +jobs: + build-deploy: + runs-on: ubuntu-latest + environment: docs + steps: + - uses: actions/checkout@v2 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: "0.4.10" + + - name: Build + run: cd docs && md build -d ../build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.2.3 + with: + branch: gh-pages # The branch the action should deploy to. + folder: build # The folder the action should deploy. + clean: false + token: ${{ secrets.DEPLOY_KEY }} # let's pretend I don't need it for now diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..7585238ef --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +book diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 000000000..c5c216fe4 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["YuKun Liu"] +language = "en" +multilingual = false +src = "src" +title = "Dioxus Cli" diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md new file mode 100644 index 000000000..ed7bcbfaf --- /dev/null +++ b/docs/src/SUMMARY.md @@ -0,0 +1,11 @@ +# Summary + +- [Introduction](./introduction.md) +- [Installation](./installation.md) +- [Create a Project](./creating.md) +- [Configure Project](./configure.md) +- [Commands](./cmd/README.md) + - [Build](./cmd/build.md) + - [Serve](./cmd/serve.md) + - [Clean](./cmd/clean.md) + - [Translate](./cmd/translate.md) \ No newline at end of file diff --git a/docs/src/cmd/README.md b/docs/src/cmd/README.md new file mode 100644 index 000000000..c642b475f --- /dev/null +++ b/docs/src/cmd/README.md @@ -0,0 +1,26 @@ +# Commands + +In this chapter we will introduce all `dioxus-cli` commands. + +> you can also use `dioxus --help` to get cli help info. + +``` +dioxus +Build, bundle, & ship your Dioxus app + +USAGE: + dioxus [OPTIONS] + +OPTIONS: + -h, --help Print help information + -v Enable verbose logging + +SUBCOMMANDS: + build Build the Rust WASM app and all of its assets + clean Clean output artifacts + config Dioxus config file controls + create Init a new project for Dioxus + help Print this message or the help of the given subcommand(s) + serve Build, watch & serve the Rust WASM app and all of its assets + translate Translate some source file into Dioxus code +``` \ No newline at end of file diff --git a/docs/src/cmd/build.md b/docs/src/cmd/build.md new file mode 100644 index 000000000..e81973f2d --- /dev/null +++ b/docs/src/cmd/build.md @@ -0,0 +1,47 @@ +# Build + +The `dioxus build` command can help you `pack & build` a dioxus project. + +``` +dioxus-build +Build the Rust WASM app and all of its assets + +USAGE: + dioxus build [OPTIONS] + +OPTIONS: + --example [default: ""] + --platform [default: "default_platform"] + --release [default: false] +``` + +You can use this command to build project to `out_dir` : + +``` +dioxus build --release +``` + +## Target platform + +Use option `platform` choose build target platform: + +``` +# for desktop project +dioxus build --platform desktop +``` + +`platform` only supports `desktop` & `web`. + +``` +# for web project +dioxus build --platform web +``` + +## Build Example + +You can use `--example {name}` to build a example code. + +``` +# build `example/test` code +dioxus build --exmaple test +``` \ No newline at end of file diff --git a/docs/src/cmd/clean.md b/docs/src/cmd/clean.md new file mode 100644 index 000000000..2f889c1a8 --- /dev/null +++ b/docs/src/cmd/clean.md @@ -0,0 +1,18 @@ +# Clean + +`dioxus clean` will call `target clean` and remove `out_dir` directory. + +``` +dioxus-clean +Clean output artifacts + +USAGE: + dioxus clean +``` + +you can use this command to clean all build cache and the `out_dir` content. + +``` +dioxus clean +``` + diff --git a/docs/src/cmd/serve.md b/docs/src/cmd/serve.md new file mode 100644 index 000000000..e5c10a902 --- /dev/null +++ b/docs/src/cmd/serve.md @@ -0,0 +1,49 @@ +# Serve + +The `dioxus serve` can start a dev server (include hot-reload tool) to run the project. + +``` +dioxus-serve +Build, watch & serve the Rust WASM app and all of its assets + +USAGE: + dioxus serve [OPTIONS] + +OPTIONS: + --example [default: ""] + --platform [default: "default_platform"] + --release [default: false] +``` + +You can use this command to build project and start a `dev server` : + +``` +dioxus serve +``` + +## Target platform + +Use option `platform` choose build target platform: + +``` +# for desktop project +dioxus serve --platform desktop +``` + +`platform` only supports `desktop` & `web`. + +`dev-server` only for `web` project. + +``` +# for web project +dioxus serve --platform web +``` + +## Serve Example + +You can use `--example {name}` to start a example code. + +``` +# build `example/test` code +dioxus serve --exmaple test +``` \ No newline at end of file diff --git a/docs/src/cmd/translate.md b/docs/src/cmd/translate.md new file mode 100644 index 000000000..415a88fba --- /dev/null +++ b/docs/src/cmd/translate.md @@ -0,0 +1,57 @@ +# Translate + +`dioxus translate` can translate some source file into Dioxus code. + +``` +dioxus-translate +Translate some source file into Dioxus code + +USAGE: + dioxus translate [OPTIONS] [OUTPUT] + +ARGS: + Output file, stdout if not present + +OPTIONS: + -c, --component Activate debug mode + -f, --file Input file +``` + +## Translate HTML to stdout + +``` +dioxus transtale --file ./index.html +``` + +## Output in a file + +``` +dioxus translate --component --file ./index.html component.rsx +``` + +set `component` flag will wrap `dioxus rsx` code in a component function. + +## Example + +```html +
+

Hello World

+ Link +
+``` + +Translate HTML to Dioxus component code. + +```rust +fn component(cx: Scope) -> Element { + cx.render(rsx! { + div { + h1 { "Hello World" }, + a { + href: "https://dioxuslabs.com/", + "Link" + } + } + }) +} +``` \ No newline at end of file diff --git a/docs/src/configure.md b/docs/src/configure.md new file mode 100644 index 000000000..f274ce70d --- /dev/null +++ b/docs/src/configure.md @@ -0,0 +1,147 @@ +# Configure Project + +This chapter will introduce `Dioxus.toml` and anatomy the config file. + +## Structure + +We use `toml` to define some info for `dioxus` project. + +### Application + +1. ***name*** - project name & title +2. ***default_platform*** - which platform target for this project. + ``` + # current support: web, desktop + # default: web + default_platform = "web" + ``` + change this to `desktop`, the `dioxus build & serve` will default build desktop app. +3. ***out_dir*** - which directory to put the output file; use `dioxus build & service`, the output will put at this directory, and the `assets` will be also copy to here. + ``` + out_dir = "dist" + ``` +4. ***asset_dir*** - which direcotry to put your `static, assets` file, cli will automatic copy all file to `out_dir`, so you can put some resource file in there, like `CSS, JS, Image` file. + ``` + asset_dir = "public" + ``` + +### Web.App + +Web platform application config: + +1. ***title*** - this value will display on the web page title. like `` tag. + ``` + # HTML title tag content + title = "dioxus app | ⛺" + ``` + +### Web.Watcher + +Web platform `dev-server` watcher config: + +1. ***reload_html*** - a boolean value; when watcher trigger, regenerate `index.html` file. + ``` + # when watcher trigger, regenerate the `index.html` + reload_html = true + ``` +2. ***watch_path*** - which files & directories will be watcher monitoring. + ``` + watch_path = ["src", "public"] + ``` + +### Web.Resource + +Include some `CSS Javascript` resources into html file. + +1. ***style*** - include some style(CSS) file into html. + ``` + style = [ + # include from public_dir. + "./assets/style.css", + # or some asset from online cdn. + "https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.css" + ] + ``` +2. ***script*** - include some script(JS) file into html. + ``` + style = [ + # include from public_dir. + "./assets/index.js", + # or some asset from online cdn. + "https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.js" + ] + ``` + +### Web.Resource.Dev + +Only include resources at `Dev` mode. + +1. ***style*** - include some style(CSS) file into html. + ``` + style = [ + # include from public_dir. + "./assets/style.css", + # or some asset from online cdn. + "https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.css" + ] + ``` +2. ***script*** - include some script(JS) file into html. + ``` + style = [ + # include from public_dir. + "./assets/index.js", + # or some asset from online cdn. + "https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.js" + ] + ``` + +## Config example + +```toml +[application] + +# App (Project) Name +name = "{{project-name}}" + +# Dioxus App Default Platform +# desktop, web, mobile, ssr +default_platform = "web" + +# `build` & `serve` dist path +out_dir = "dist" + +# resource (public) file folder +asset_dir = "public" + +[web.app] + +# HTML title tag content +title = "dioxus | ⛺" + +[web.watcher] + +# when watcher trigger, regenerate the `index.html` +reload_html = true + +# which files or dirs will be watcher monitoring +watch_path = ["src", "public"] + +# include `assets` in web platform +[web.resource] + +# CSS style file +style = [] + +# Javascript code file +script = [] + +[web.resource.dev] + +# serve: [dev-server] only + +# CSS style file +style = [] + +# Javascript code file +script = [] +``` \ No newline at end of file diff --git a/docs/src/creating.md b/docs/src/creating.md new file mode 100644 index 000000000..fa725a4f7 --- /dev/null +++ b/docs/src/creating.md @@ -0,0 +1,38 @@ +# Create a Project + +Once you have the Dioxus CLI tool installed, you can use it to create dioxus project. + +## Initializing a default project + +The `dioxus create` command will create a new directory containing a project template. +``` +dioxus create hello-dioxus +``` + +It will clone a default template from github template: [DioxusLabs/dioxus-template](https://github.com/DioxusLabs/dioxus-template) + +> This default template is use for `web` platform application. + +then you can change the current directory in to the project: + +``` +cd hello-dioxus +``` + +> Make sure `wasm32 target` is installed before running the Web project. + +now we can create a `dev server` to display the project: + +``` +dioxus serve +``` + +by default, the dioxus dev server will running at: [`http://127.0.0.1:8080/`](http://127.0.0.1:8080/) + +## Initalizing from other repository + +you can assign which repository you want to create: + +``` +dioxus init hello-dioxus --template=gh:dioxuslabs/dioxus-template +``` \ No newline at end of file diff --git a/docs/src/installation.md b/docs/src/installation.md new file mode 100644 index 000000000..7151de1ff --- /dev/null +++ b/docs/src/installation.md @@ -0,0 +1,24 @@ +# Installation + +There are multiple ways to install the Dioxus CLI tool. Choose any one of the methods below that best suit your needs. + +## Install from latest master version + +We suggest you use `github master` version to install it now. + +We have not yet released the latest version to `crates.io` + +``` +cargo install --git https://github.com/Dioxuslabs/cli +``` + +This will automatically download `Dioxus-CLI` source from github master branch, +and install it in Cargo's global binary directory (`~/.cargo/bin/` by default). + +## Install from `crates.io` version + +``` +cargo install dioxus-cli +``` + +Make sure to add the Cargo bin directory to your `PATH`. \ No newline at end of file diff --git a/docs/src/introduction.md b/docs/src/introduction.md new file mode 100644 index 000000000..2f857a2a5 --- /dev/null +++ b/docs/src/introduction.md @@ -0,0 +1,21 @@ +# Introduction + +📦✨ **Dioxus-Cli** is a tool to help get dioxus projects off the ground. + +![dioxus-logo](https://dioxuslabs.com/guide/images/dioxuslogo_full.png) + +It includes `dev server`, `hot reload` and some `quick command` to help you use dioxus. + +## Features + +- [x] `html` to `rsx` conversion tool +- [x] hot reload for `web` platform +- [x] create dioxus project from `git` repo +- [x] build & pack dioxus project +- [ ] autoformat dioxus `rsx` code + +## Contributors + +Contributors to this guide: + +- [mrxiaozhuox](https://github.com/mrxiaozhuox) \ No newline at end of file From 79df0d0f742f98c7d54a5463e62a19a3ef0b36c8 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sun, 24 Apr 2022 10:47:04 +0800 Subject: [PATCH 095/330] Fixed workflows --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2638b8a18..c6ae8be13 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,7 +21,7 @@ jobs: mdbook-version: "0.4.10" - name: Build - run: cd docs && md build -d ../build + run: cd docs && mdbook build -d ../build - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4.2.3 From 1f1de4d82219125df7ff4654b76c7ef3d7d3ba1b Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:03:46 +0800 Subject: [PATCH 096/330] Fixed docs.yml --- .github/workflows/docs.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c6ae8be13..5643e6194 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,31 +2,29 @@ name: github pages on: push: - paths: - - docs/** - - .github/workflows/docs.yml branches: - - master + - main + pull_request: jobs: - build-deploy: - runs-on: ubuntu-latest - environment: docs + deploy: + runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} steps: - uses: actions/checkout@v2 - name: Setup mdBook uses: peaceiris/actions-mdbook@v1 with: - mdbook-version: "0.4.10" + mdbook-version: '0.4.10' + # mdbook-version: 'latest' - - name: Build - run: cd docs && mdbook build -d ../build + - run: cd docs && mdbook build - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.2.3 + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} with: - branch: gh-pages # The branch the action should deploy to. - folder: build # The folder the action should deploy. - clean: false - token: ${{ secrets.DEPLOY_KEY }} # let's pretend I don't need it for now + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/book \ No newline at end of file From 5f7daedc5d0a9515fce711804e1eaf94204cf6df Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:22:02 +0800 Subject: [PATCH 097/330] Update docs.yml --- .github/workflows/docs.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5643e6194..2ed974a47 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,9 +22,12 @@ jobs: - run: cd docs && mdbook build - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/main' }} + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.2.3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/book \ No newline at end of file + branch: gh-pages # The branch the action should deploy to. + folder: docs/book # The folder the action should deploy. + target-folder: docs/nightly/cli + repository-name: dioxuslabs/docsite + clean: false + token: ${{ secrets.DEPLOY_KEY }} # let's pretend I don't need it for now \ No newline at end of file From 04535749e9668b04a37d192fedc258ba6d9168ef Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sat, 23 Apr 2022 23:28:53 -0400 Subject: [PATCH 098/330] chore: clean up some latent items --- TODO.md | 11 ----------- out.rsx | 23 ----------------------- test.html | 5 ----- 3 files changed, 39 deletions(-) delete mode 100644 TODO.md delete mode 100644 out.rsx delete mode 100644 test.html diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 6fd51d591..000000000 --- a/TODO.md +++ /dev/null @@ -1,11 +0,0 @@ - -asd -- [ ] use a TUI for the dev server aspect of things -- [ ] allow any index.html -- [ ] use wasmopt for production builds -- [ ] pass arguments through to `cargo` -- [ ] figure out a bundling strategy -- [ ] an external configuration - - -should we just use trunk? diff --git a/out.rsx b/out.rsx deleted file mode 100644 index b30b76f9e..000000000 --- a/out.rsx +++ /dev/null @@ -1,23 +0,0 @@ - -use dioxus::prelude::*; -fn component(cx: Scope) -> Element { - cx.render(rsx!( - div { - h1 { - "hello" - } - } - )) -} - -use dioxus::prelude::*; -fn component(cx: Scope) -> Element { - cx.render(rsx!( - div { - h1 { - "hello" - } - } - )) -} - diff --git a/test.html b/test.html deleted file mode 100644 index 33ca3dd1f..000000000 --- a/test.html +++ /dev/null @@ -1,5 +0,0 @@ -
-

- hello -

-
From 3269b2b5aaaa95c55599bc311cc46ade38ca4630 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sat, 23 Apr 2022 23:55:18 -0400 Subject: [PATCH 099/330] feat: add more options to translation --- extension/package.json | 4 +-- extension/src/extension.ts | 5 ++- src/cli/translate/mod.rs | 22 +++++++++--- tests/test.html | 72 +++++++++++++++++++++++--------------- 4 files changed, 68 insertions(+), 35 deletions(-) diff --git a/extension/package.json b/extension/package.json index 0a3d50b67..c492f97e2 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,7 +1,7 @@ { "name": "dioxusstudio", - "displayName": "dioxusStudio", - "description": "Toolkit for IDE support in Dioxus apps", + "displayName": "Dioxus", + "description": "Useful tools for working with Dioxus", "version": "0.0.1", "publisher": "jkelleyrtp", "private": true, diff --git a/extension/src/extension.ts b/extension/src/extension.ts index 5a41c7f5f..4322c48e1 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -2,6 +2,7 @@ import * as vscode from 'vscode'; import { spawn } from "child_process"; export function activate(context: vscode.ExtensionContext) { + function registerCommand(cmd: string) { function convert(cmd: string) { const editor = vscode.window.activeTextEditor;// Get the active text editor @@ -10,7 +11,7 @@ export function activate(context: vscode.ExtensionContext) { if (html.length > 0) { let params = ["translate"]; if (cmd.includes("Component")) params.push("--component"); - params.push("--source"); + params.push("--raw"); params.push(html); const child_proc = spawn("dioxus", params); let result = ''; @@ -23,6 +24,8 @@ export function activate(context: vscode.ExtensionContext) { } } } + + const handle = vscode.commands.registerCommand(cmd, () => convert(cmd)); context.subscriptions.push(handle); } diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index e239ce318..3440ee6b1 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -13,6 +13,10 @@ pub struct Translate { #[clap(short, long)] pub file: Option, + /// Input file + #[clap(short, long)] + pub raw: Option, + /// Output file, stdout if not present #[clap(parse(from_os_str))] pub output: Option, @@ -24,14 +28,20 @@ impl Translate { component, output, file, + raw, } = self; - let contents = match file { - Some(input) => std::fs::read_to_string(&input).unwrap_or_else(|e| { + let contents = match (file, raw) { + (Some(input), None) => std::fs::read_to_string(&input).unwrap_or_else(|e| { log::error!("Cloud not read input file: {}.", e); exit(0); }), - None => { + (None, Some(raw)) => raw, + (Some(_), Some(_)) => { + log::error!("Only one of --file or --raw can be specified."); + exit(0); + } + (None, None) => { if atty::is(atty::Stream::Stdin) { log::error!("No input file, source, or stdin to translate from."); exit(0); @@ -67,7 +77,11 @@ impl Translate { } /// render without handling svgs or anything -fn simple_render_child(f: &mut impl std::fmt::Write, child: &Node, il: u32) -> std::fmt::Result { +pub fn simple_render_child( + f: &mut impl std::fmt::Write, + child: &Node, + il: u32, +) -> std::fmt::Result { write_tabs(f, il)?; match child { Node::Text(t) => writeln!(f, "\"{}\"", t)?, diff --git a/tests/test.html b/tests/test.html index 4936ae36a..05ccd7b18 100644 --- a/tests/test.html +++ b/tests/test.html @@ -1,32 +1,48 @@
-
-
-
-
- content -
-

Buy YouTube Videos

-

- Williamsburg occupy sustainable snackwave gochujang. Pinterest cornhole brunch, slow-carb neutra - irony. -

- -
-
-
- content -
-

The Catalyzer

-

- Williamsburg occupy sustainable snackwave gochujang. Pinterest - cornhole brunch, slow-carb neutra irony. -

- -
+
+
+
+
+ content
+

+ Buy YouTube Videos +

+

+ Williamsburg occupy sustainable snackwave gochujang. Pinterest + cornhole brunch, slow-carb neutra irony. +

+ +
+
+
+ content +
+

+ The Catalyzer +

+

+ Williamsburg occupy sustainable snackwave gochujang. Pinterest + cornhole brunch, slow-carb neutra irony. +

+ +
+
From 84f0245f6c5fe18412b799e9019327fb73788083 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sun, 24 Apr 2022 03:24:41 -0400 Subject: [PATCH 100/330] feat: basic autofmt --- Cargo.toml | 3 ++ extension/DEV.md | 10 +++++ extension/README.md | 10 ----- extension/package.json | 14 ++++-- extension/src/extension.ts | 86 ++++++++++++++++++++++++++----------- extension/static/icon.png | Bin 0 -> 20768 bytes src/cli/autoformat/mod.rs | 25 +++++++++++ src/cli/mod.rs | 11 +++++ src/main.rs | 6 +++ 9 files changed, 127 insertions(+), 38 deletions(-) create mode 100644 extension/DEV.md create mode 100644 extension/static/icon.png create mode 100644 src/cli/autoformat/mod.rs diff --git a/Cargo.toml b/Cargo.toml index 21e2dad7e..b8f0e271b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,9 @@ flate2 = "1.0.22" tar = "0.4.38" tower = "0.4.12" +dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } +dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } + [[bin]] path = "src/main.rs" name = "dioxus" diff --git a/extension/DEV.md b/extension/DEV.md new file mode 100644 index 000000000..54d0c396a --- /dev/null +++ b/extension/DEV.md @@ -0,0 +1,10 @@ + +## packaging + +``` +$ cd myExtension +$ vsce package +# myExtension.vsix generated +$ vsce publish +# .myExtension published to VS Code Marketplace +``` diff --git a/extension/README.md b/extension/README.md index bf9459fe9..fe67f1587 100644 --- a/extension/README.md +++ b/extension/README.md @@ -12,13 +12,3 @@ Converts a selection of html to valid rsx. ### Convert HTML to Dioxus Component Converts a selection of html to a valid Dioxus component with all SVGs factored out into their own module. - -## packaging - -``` -$ cd myExtension -$ vsce package -# myExtension.vsix generated -$ vsce publish -# .myExtension published to VS Code Marketplace -``` diff --git a/extension/package.json b/extension/package.json index c492f97e2..ca73c0ea8 100644 --- a/extension/package.json +++ b/extension/package.json @@ -1,14 +1,15 @@ { - "name": "dioxusstudio", + "name": "dioxus", "displayName": "Dioxus", "description": "Useful tools for working with Dioxus", "version": "0.0.1", - "publisher": "jkelleyrtp", + "publisher": "DioxusLabs", "private": true, "license": "MIT", + "icon": "static/icon.png", "repository": { "type": "git", - "url": "https://github.com/Microsoft/vscode-extension-samples" + "url": "https://github.com/DioxusLabs/cli" }, "engines": { "vscode": "^1.32.0" @@ -18,7 +19,8 @@ ], "activationEvents": [ "onCommand:extension.htmlToDioxusRsx", - "onCommand:extension.htmlToDioxusComponent" + "onCommand:extension.htmlToDioxusComponent", + "onCommand:extension.formatRsx" ], "main": "./out/extension", "contributes": { @@ -30,6 +32,10 @@ { "command": "extension.htmlToDioxusComponent", "title": "Dioxus: Convert HTML to Component" + }, + { + "command": "extension.formatRsx", + "title": "Dioxus: Format RSX" } ] }, diff --git a/extension/src/extension.ts b/extension/src/extension.ts index 4322c48e1..fd8e2906b 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -3,33 +3,71 @@ import { spawn } from "child_process"; export function activate(context: vscode.ExtensionContext) { - function registerCommand(cmd: string) { - function convert(cmd: string) { - const editor = vscode.window.activeTextEditor;// Get the active text editor - if (editor) { - const html = editor.document.getText(editor.selection); - if (html.length > 0) { - let params = ["translate"]; - if (cmd.includes("Component")) params.push("--component"); - params.push("--raw"); - params.push(html); - const child_proc = spawn("dioxus", params); - let result = ''; - child_proc.stdout?.on('data', data => result += data); - child_proc.on('close', () => { - if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); - }); - } else { - vscode.window.showWarningMessage("Please select HTML fragment before invoking this command!"); - } - } + + function translate(component: boolean) { + const editor = vscode.window.activeTextEditor;// Get the active text editor + if (!editor) return; + + const html = editor.document.getText(editor.selection); + if (html.length == 0) { + vscode.window.showWarningMessage("Please select HTML fragment before invoking this command!"); + return; } + let params = ["translate"]; + if (component) params.push("--component"); + params.push("--raw"); + params.push(html); - const handle = vscode.commands.registerCommand(cmd, () => convert(cmd)); - context.subscriptions.push(handle); + const child_proc = spawn("dioxus", params); + + let result = ''; + child_proc.stdout?.on('data', data => result += data); + + child_proc.on('close', () => { + if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); + }); + + child_proc.on('error', (err) => { + vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); + }); } - registerCommand('extension.htmlToDioxusRsx'); - registerCommand('extension.htmlToDioxusComponent'); + function autoformat() { + const editor = vscode.window.activeTextEditor;// Get the active text editor + if (!editor) return; + + const unformatted = editor.document.getText(editor.selection); + if (unformatted.length == 0) { + vscode.window.showWarningMessage("Please select rsx invoking this command!"); + return; + } + + const params = ["fmt", "--raw", unformatted]; + + const child_proc = spawn("dioxus", params); + + let result = ''; + child_proc.stdout?.on('data', data => result += data); + + child_proc.on('close', () => { + if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); + }); + + child_proc.on('error', (err) => { + vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); + }); + } + + + + + const handles = + [ + vscode.commands.registerCommand('extension.htmlToDioxusRsx', () => translate(false)), + vscode.commands.registerCommand('extension.htmlToDioxusComponent', () => translate(true)), + vscode.commands.registerCommand('extension.formatRsx', () => autoformat()) + ]; + + context.subscriptions.push(...handles); } diff --git a/extension/static/icon.png b/extension/static/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..42c355c2647b0b68cf18c12d292db134ac8750d2 GIT binary patch literal 20768 zcmX6^V|ZR&vkn{EP8!>`ZQG4)H@0oFu^Zb?V>N1Q`|S5Sxvo6<_3Z4m)~uPiF_B6N zk_fQ4upl5H2+~qwD!|{d|9+vr0iQKmwRs>QN=MRS!fKv5=YCMW_`}^_9zUKgT~E6w zljyOuFT0JiQL_Tsz{qxIeMkz)QiQ;OPqJMUky|iE7qL57Y;FE8y&N=ooQ zFK;~my7JJ^-n{sRFn^Oy>f^>5MK1bEG{;F%LFMCo7j22(xk~3cLM0jc)(1-LzuE4@ znv|4e|9Rdti%G!c2r@lAT|{JMWi>W2F|aor&C9~ddIf&HP^;hRjbj=`H(6Cg6@xs$ zJ~TXhQ_tXB?7yB?uJzHT<{y3gXjC{U530sA(h&xS8Pc3uaq!mchpznL6vMKqBi zF{FUL!mIV2IZAf+meUy4nf8*du6I`tzp?!smzm7u)YO)SFPBTsailK+r@f(ofSYK; zDc-FQLS`y@`ff4-fu8;ds+gW|G#L$zWnOc0bI5WZcu|z$;b9eR?X~WZgr6wF*nT3j zxhl9+3=E(72M1=}9iz~6G?v5<-FB^tgWMpNNDde-7t(c%m-&w5|O3D?U zR>Kf}Ol2@{9h0caw2M)dhd9Edpjm!>qfBV8MhSe(h9t4FyZbl&W~AoGIXaAG_)gk% zM2R**4u)98Z#p2{M@^{m1Nt(f^qX8R&%^m5|A^L53bpD%OiT>VuOmvB?}_d70+FNXa(`il zOZ8fZ&t~&fCiTg6 zER~FUv%>8UC4`7n`@HNDW54#bo}CEOh0iheMQ7NYLt*dwN6=CDWldF8m6DA51sXI& zO1IAwArNm{4HmP6<^>j9z@a5|b#)zHTwItoLnS9CtFElCzh1W5ZJgH3?B@i;g$vd* zP12M8q-RGf6?`)+nbCts2AkmG!nVvo6W8=ZauVOK|LP$Ufq@v}#^>8x>(r}_2I=CO z!&acIuC6R600J_eje}#`@(%@QdodT3AmcP9WB8mD2JbHZbX5@d8B)PG)=!#$|K^}b zAb$V;{jj#SX1D|Vf5{)C^jh_Q;~vgd1d;D0kkjn#oYybhuW&4KoW33}HonSRT9&Ri zr>3TmHrCf?_)dF}MF`0p<=!7y$Mo9KW6%=nwM(Y`Qmg7&d3iqX5Z$+2SfNdg_-@xW zE*_UtQc`T21cty&)*X|xvvqBk%jg?4k4iq*C=5`o}9=XK%D`rt>jJr!yWlVg#IK@fPz==~2Ic9CTKj-AAutSs-sc_$#V zb&}?Y!wNFq^9u@osT8{~_B@-|El@ms@9Wgm0%L$;EkEh`yzurrvnf<+`mOG=d|eWcZ7pb!{^?eVY#_a z9A%+*KTa<%InG6^iOXQfHffs#->ZtE{no{p_w&SpAzka;eb(db9W%33f;T~8?GvUAolM%W?YXp1ZGeqgoHq}Y3o}2 zgaK7Hb(lU5hAC1)F1LFDuPzfsSoch0H2i#OZEbyuS@-ew_RmO5Tefuf7ZDMO-Ln4@ zEN;c1)sSQDsbr|wNG{U74^^1AdxeGE+uyH2;+l@I0(0WY?fzlcO@qc5qg}Drd|`n0 zJvRkbV+wxVtT-h~v6@uucz-nhi}q)ohpQ_#qAhS1^l+GTT8Swsf3SHN?=ykKbw*81 zo!n-(;XZb}Syc4h6x_g(xshBVf-(%*+a`a-5fm<#R6t-GV`*3c&14I4!E|{Us7U(3 zIuTfUXf)Id7egu#nXDEw9d;Y7{3Rc{NhSX2^~?SU&8)d&FA_)AqvjCYV6gYKusHG*ks_w0wJ9InuXM1qWa7V?D-;dWg+N(`2g^byh$avF zcY`m0_pKGVd~uE7fA5ebl%r67@`(5MXTB3x#S6m#8wnxmf?e~@88>cJ(KC2p-(>L0 zU2=3FG%3Eix_T5v6O>^6_ZZ}=U%x1EKM1`?RFcd?46w1$^92W#uo1%t=dlil72r&= z%CFx(1b#g(|1`u}ppQ$$Mq`ocvh`Q<^ZTe)E*B?&!(tfP?)JgLZHe3>6#$K+f(da# zT-q}2U;1qV zhG@+)eS3F@p#G;J1PH~TATT)4xPp12dX6tAp*^uxQA{%4;2|@*cLx0q*At_AuL{$V z7@T3_HL=$gXD*jJdd!mIc}*9PoL^<(y!de$m~$v+5Vtp@MA@e|Fxb`~@TlMwYjH&H z`g{0rs;D8sq)VwUD4xI(OM-i{6$+_iWn2*A&YDfqMtLtkSGkA32Owj3*UTq?iHN&cutdSiIugOD>0HHK3cvjscr>`r4Owp&tKb@$=LRb}O zVZTZ;Kp7f5=w_7vd4=q-fdp&~)VHR6N^s_yf2robW0CicawMN~EQ9tW(siMOekA8X zb<29qsrz_~;GcFyT??Jmxx+(%Ra8}Z^Yij{R(`pO*zbisVgKBM#vzJ7dQULE@|;;( z4}y6u642~i2}8h}(w3(oDfQ(MGE*)6JroGC^ii*;E7;V0cmMD(+y#%i2;qGFSJ*&H ztG&Cn*1lHRr&v=sdLoe?r%C>UnY%wMl>iy#+M5W;J&%3a+{d^(M%%=Tl zs3HAx@NzkIK~EjK+nuy>pAmecyN31Z$T{VGi%_8LI{DP^22fSPi0 z?r^m|@fp}ENua5r@z^>-0{`Pn@taAW5GpF_BMat>h-Cu3*4i?bTZv?r925CGB6TbG zWCkcqX2#GA7@0yg<=zbaQdbI$$lYbjpSptjdZvGCwD6E%yE%0%uep$Dy+qeO^(~{M z&Ez5;CM^_BQ5ZOp-%st(!ATF`s>W?2O)0-u+D2W={M85(nV*^Oc4<0n(Pvn33EtW7 zmz+Wy>+yT*SXfwa7l(}(dm1!BU3Pznyw;&z@c^A@pkh}hb72~EjK*sa8Jpf&D9#ug z(5LhmKJ+$$4~n1~aI{2|xv&jyE1bE{2nh*s@7yB1!=(dWZl1|*y;<{n0LJ*c*y>R^ zgJ7R}!!JjZ8Aq#MJ4q!FV@WO1UQ)lSZqnWgo!I z)mzRNwb(3IbJu?6S;NEp&{Iwk1aE&jHuRcXi88iJhpS@yrluZJx=AM(JR(@W7D(He zbdz4jFlfp)Fg7!zkxr-WyaV8hp#zw4Aqg>7Wai2$Yj1{ub25pQrORJ_aSxl8mjr}D z>N+~!C%O*Z7%1Wu`ud6JB?@^6x;n1R#3{WvYgTU(#w=(V*}!U?-=iRls$t zJ-NITpg}-h3@%YVQmx5`6) z4y>p1HC3+#D32^<1A{nzpGWK;ob!26)e};>&OaQvqrlXJSN=VuH4>AUecU`f|1puO z*Xs1R3R^tUvs$ig(D<@E1w8^)omIvsq#I5Vi<&hbI*Xi>Q|qyBd(#d6^N}H;qqDC0 zc(vnzA6(l{LV7naN!)Z?CNnznaJ{kuLJ{O^Vqy|K{exBB9m@tA6#~q!w8>0o$Nr3f ziF?zyhA;j4a0=ac;nV>Gv8l?C-C?`Sm_8zgNHFhwyZbF*dc9>l(QCdmLRLOZrr4At zYsXugj^{^Ig3Ao|k>W8+e)i{aOh^g9*`w{B&wKhTzee zZ}>-WtnE!oj(qV!9d&zb6u)m~GKM_%Z#tXzXg2>VDzontYIHHYgT6&;cPz(KJK>YnfY|fA7~KuRJ0MC@Tf86>{z5ET_3-puwaLoI-|%K=n9Z zy;(v#cAomq%Ib2S#csoJ^2IxfqAI!kk{>>WE{va|y%twNTwNQ#&EK_&9GuHXO1gj1 zPcS?_n(#egtJ5QZ2>?+9iJcLb=qo3r&$2F*&GKT*n+NefD;g_k^@bE^lgb z(E%`_t41S9(9qBjD-gJ88H9b@&J3@x#Nz1~DK0_(j`Gp9>82AhGha>u!J)!J9{BJ@ z2M|%?1_lNINU?r-^3_=%>Bzh6=2c%a8l4$=v+V6NBc`ONT?B4XLbhv~P8(D}RXU*5 z7Vz~MFfvNyljeW1xj(&(t+N(CTIAqX`=~1`8$G-R@rQ);?VS;)QCdPt=XAdD)z9&V z|NCl#>DSWoGUn2Q35;l*(7XTFznq+$(|`Z|HSG4XGE@61arMvIWZlf(I`QZl4e-c{ zJ<%p{4KIa`Kbv{v&vl0o5jGas1Z;sHWDuMZCxmPYQ%Qav)%|3x1Ib!7<~R&)`6HAO z_0Pi)O1W#Ga^4n++x2+PP|@T`5jPAyI+QqDT}{nQyY=h>lgPdO?Ow-N`R`=rI5rxi zE;$$8BXZtch_K9zP(P;wrb@2*W;j*gsG9P4#lwYW|8IyTA-K8=t;54ZMovynq?`rj zZ_EeKVxsQuk7)mVz@heO{Ph<>#VT)O)2TiMDv@uYos`az_?3P}itU*8IFXi=m>C~8 zMg93>CV+u|LDUPSsNb@rc6xSt`uaG2`Zhk2K$eh7tGP_4+j_1&C?V2MH7J3iP% zz(JL%?5Pz(V;#5b{4>-`8iNQWNlo8#dm&mRH9K;gAba?I=DNLVPMC3h4qbU-v4Aim zktK#g#IN8#%5gE^T=+9*bUw;DZMP?0g^HB+jWujUp`tO!>qbE@KcB`ODJp}(m+e?8 zs|_0mZiZ=kV4En#N$u-V!0|`zddtQ|CywbAk_o3GcUTT4Eq-@*x1#e5WAxaFu&dvn z83Up`2iM)+TNZIE6IMmT*xY(*#0u2G?tSMQ2}wpoFYtdbZTBVaxzf_osYzrHpwJ*n zA}zDz(t9z?%5;JP0))A_xtk}hCKD;tl1nCn8t9mqMa|9VKria}TaS!e3szoz_)&@r zE0HPXw8LCmT|Il_f}ysqE+5&6xu_vct&RvOirKIiHzW}>O^(5qaQ$=rWv%>pyJ1_Y z1<#u(nNqRG3cwYk{M%Z6328DdFswi};?$_oacfv(M%2Y`ou(18GAS}}bp~NlxK@$H zt6kr+%oMH%c)5umP19>_4u*0^>A9Q^+i2Mwb{zsNHHj1!CvoH_`EPs^{YOjZM#8%sM;HJ z!0YJOauv`)HEpM(1UKC$NE==H^Cu;aNbqxc|KzE1;P+9UuC*LKGz}=ZqqfBO66a}S z_G1G)&YWmgwq_5=>}PI2*!f2sbQqkH%$Fx>nCk>{35?hv?^V|#i_hb^AWoYz6T@zu ze6Hm^tx2gV_(7jZqttmwe(W^jKl#EiO!Es|BLC-Ide$FP5z>-1x3|u=YmJ91|Co}J7!?gI-??*3l!9sk zb}&eY1K{kumaDai#H&*VJ_{8u)$Q!N7MH4+fRxhoK%%U2ep#b7_Xw*EE2)sk4*z{qZN%{D`9z`-4wnB-O@y-6`#rr3H&> z)&iXvw6gT#t*%bs(EIV|vsfk{{RchwTS;jt_xi@h*9qT?dKt#SPgi;}={a>=8fR|1E zs4EY%Es#uQWhXt7lal0e_t;+c3xjKpBUzMNN-hXOc6S?XW8yu6ShzFNIg+;4o2?cx zxVgE*PFxf)Fc}Se*MN3Ho|M=v9W`nIF90Mn`)C7JcvZUKC#}Kx>$shfzqqF$-UZRR zy$tool2Ht48dC{E=!deh^1R<}DAwmEfXDs&D)fCCQnx|;f7gM3v69Fl$Gp5!lev${ zNx(u9VrPfSdMv>R(x*zMDb7*oy13j$pPZaL?fBkJ@BLg})-W?SC+N|6PW|xjbw@Og zNfaUm5m$~NlO9+t|5%D^ShEdLsUpB+0gFO1jj`_a={CT1#-IBXcsWQmJg-y#E-Xs5 z`^v>S`@)w*A&>BnqxBn9Fajc5&l_X=lPy}WhJBFCS`#zuC4vlcNJl0cY6M4rRA9fCy8%wJF?MOaldz zqQ=Si9FleX7mpHZ|IPbl{kHJ_cf(y4P6 zm8GTSaUQS7B_x2QMk{hr5PLv`l1dC!hb$jVwjb^gt8b$Lmcb~!6*%gsmeKJuf< zjZobu{%kQ5axGkN*<(NWk?^Oq5_H4;QjxIuRkaw7Aa*jMi0DWQ_K^yA0+R;}EJKe< zdvkP`affX2?(RC3`YF`aiSV=`Asprub8V(5^>C4R^rfKdal&ueE9B97@&o|9vjft` z14@WjdYC8^PRM@ksRmO~Ul~Z0c@Sj(FKF<+_>mtbU0cQ#^HJ=ptWC@({gTEWTm^H1 zSY9+GEO@7e-k5}817 zXNpc+G`i^BD!NW|p0~CnQ$vq;!U4K$`}6gz?uxsxA0Bjw3!I;e>+Ah4;2NONKPIL) zrL#B3olt3x6ogv+{;GAY58bHt%~03YSPtdm@%EEJCdm|J)ax03y{>$fcXqx#<=h#7 zd;)q)Srv_ql~tg2OR3LQHx^KoNpEg$hW2liq>~PS3*;0p`1#BbKWciKN{7u5QotfA2whV1+gI0PtP4N(HpAR$0g z+26E(8jX#Ob%|ZCG|GqW$xDwqqQDSB@NUiGK6E0aNgSKM)O6gA17BUk`-#i4kSH~8 z21qVY&Mq!kegG$}p}j%Z03_O&w6wG(3=E90S~713YJAAhjMrns-LWaO@f&!*8qcwx zW8x}skt)qKzL2TCU9#~AC{SW~X<1o1ynx)ojmKeY$-nIcPY!Q`NgGmCMRPR}3OC!f zX3HN&2fIQ)#K`9Ux3qQJ$dBIzp7|< zdLz=yM5QuFDx%Qf9^g4yWn^Rs1(tiTFfsRTCmDMyi;DJm?&6e?i;Dif5)s?&u7Rk# zrM6~n76Kvx&7Tb#?5cn_7h)q@JQzUP^Bw&Bc>D6L{vevbP74!Z<-(790N|npz)Qu# zedR*XpW{-Zf()1E625!*F%#pfqUKAmV=pPH$VS?9K?EDn*SP1-H?PhF;;HQG+{ZxeL z;7ZS9OI@u&w|4-WAE5#^iimfBp5Mcg=EuuyfPZc85v>RG}DLP+)=o$qF;DADI5~GSYJb zrlKznc|y16r9oQgdw5KBSfmgWg}AoeC$P^O8*&JFI)>>0(;vR{OA~4BzK}8qr6oAz z8qk(M&4G(Civx3xy5u6-QVE}KD;RM}42L0KCN51b6<7S+8~HoUJRw-!bLIZQuilnmO0?*zC_o`$_cT@$vC# z5cpztNiYerKp{=d?cAIky_I|^^pOydNt{8FUZOTl4v|8h>{6HmP!qz!D(h;5@#1?#|ucegR4W%5DRo+zM{i8xLZMRBIm>YYy@x@pA3IGZy}p z{UV1BjmWy9u--BvU~q&~JLI~b8a#fzSADJ|+Ql52yPNx@AR}{~$zng-1h(RdaIly_ z16x_dn=30TOAkxWvHuqW0z&$mZx30qX>(=c5`j?kZ1f$g3d9*XBmn`!(y$mOgQcp6 zwsVk{zlO)};LL?sWqo~qZBZ4Kg-HSe0uj>|&zn8om1^y~pNS&~!U5FCVfRfMMg#Hw zFiP18Uf)=tt;L2SLpn4+BRa}I6`zZg3AGvMU1tv`)4zJve`#o^?GRpKH$W5_&*t%O z0lRDmpr^1CC$TLNN81ZH;#m??dzDR;UUJpxgsRSdv^drzwED$E(b5%%6U?2>O}!qI z;V2VvwXdY?$wz!Abo3=R5Tx_!&OjS+Ay?7y~!uHug1EO&0U)6wEkb7X(c z#h_vxztZX3;lE$pX;VKdwjqUg3G`!TCXNI0qlN!2oZ*;Zi}jKnVLauwTwi)61UEGd zn*RfrtyO0K9Hk2plq9RpDGQ z%qHdu$UHne&j5+hD-Ug~LF*Wvzx$>h3u3B_QCk!eDN@8C-Jd^si%bdCZAG87%>Qw} zxYE+rW}&682`TyM=0R*e^&H5H;;N@c9Xv&Kn)lAW&RLCes~&RpFR>%+y!Z30m!Yz* zP7rwsA>%9T7~Q@Fa)BZoOl9d3lnHQv=kBZXr*AfB)^anM`&%UT7{~HoHKYgILmi zFE&mgk#AS*yA&)#FRtn5P8(#R#34@gMNmqC-NQ!3=Lh(J=UC+L;jW5`W6EEeb)RoA zu1;FUDMCS(R#ufXfb?W-WAoOf+?k;e@>f-p2tO%CoEmW#x z6UR&(C$CSCh`Z7+bVw;B?u4f$2jk6Y516wOawo^a8w{^*Hi|-rBZ>3wCwD4=wo*Da zfFhIJvVY12_P@$M79s{!3cInXsqH^}WFjv=%~tH*%|LXm?199fAS;$PSQdUF(U8On zI~CJZ7_VA=_6XfN%Az8VoV*V%n7T$iuJl#RvaL}jDv_HnmMI{=V zA%b;ChI9`d>K}G1Tg4!{-PlSms(23_)U=WdbW|Zb1-Xu+^m@t?iH}CMpcLZb-C>LQ z7Q60k!CG9MCvxclNFXl+02*9)tDmdt+;7{Ia1@ z;lL_829Xxr9>I{9IL-5_QHw1r=Uw|&Fn1&WErcn#LptSU`?Ec<$@Q*NbTK2cnXMc0F z)(5Y9_z*QPm}E(|v{CRdhbyZ-pWHAU6-r4r(;YH`AcXv4wEB< zouAgmAV@qU9Mk!N0c#_%c;U8zU#g+XU^pOePgf3FfPIOjbIV@EL$2;thv<6mJ(u0` zChB$KukkH3DJo%=-5{%cEvQPWGnrgoRHNZLC?YpvLURpOhkTxD7&y`we9wrtEQ8#} zaG6}D^Vuj-fF90Ls3eyJ3>j?K%fD=drXSNRF;Eu9mE62K)oxk#bP%*+VMm!Is=>V+~YOm$H&h^RE%eUU+F0XLZGJKWRh5LCr7mLrrJ zUu%zcyFgDxwF;DcUkQ16`M)8A1JHvJG17u4W)>E_O^uBj7wauH#%5jLKw&6SnotT> zPlQrOJyHT0)NUf3bG?exBu*aMzVA;sh+>}OqTpy$CoP9ozXBrldCx;OG#epmrB5@5 zw-$mQ1Y&rx4Ztu?0yJLN#{qxlZlp5K0rvdD!X6F~f9gqO)QQY^k}SaxT=hE_(e(x{ z%1?0-B`|75W87CJX1*62j`c?5Ek;5qI8u(Uzx4T6{rA5_3vP(H3d64kUxz)AMgC+v z^t=Qq?{NvlToR8)o-CF#ZubU!>DssPK4{Hi^!!#6f5pKncrWjTY*S?_!&=3M4gygR zDae4(lF#9~`3Ja+1e~k=@I&L~2@bd#0B3^YEdSGH9SUl0;r9au z#h}u3v=PPOp?p5*C51k={`DxX_F5TCw@Db$2hv`#w+{6Vl*Gz1Zeok+tOv=q4SpGX z%Ad+49}x8bb?^ZMj2v))29}4O*xwOzgOmC$Sjq(6vA9^AU5jvxh%CfHA;KdlZT(KJ zD*P_n_LiLB0{#N|;ewx^->{;tj>wIa8x&Y1WkgR;57BG}^FC=4wsT0x53p5iVoFNW zf13zS6?0#*Jd{TZ&Dqfi?TLIEe0|uaqAN^TbiMOs+KrV)G4q63B z)>)thpKV&REo0Rv={tmg1*O>Zq};QZ0X5YqY9~aH3iaU!-G$vmK;XLm<K5x80vliBxh|Gp#I>qTA^k}{Vtutd> zNt(!oBKDmb(Zi13edpEfxsw;k!jsKK8-?aaw%tSs44MJp#E53#eWa3Ot{Ub61!6Jz z`T3dC#@bp#t3eALJ#=L!XphzbrBb+fy&VTUl)ylf)m=XT$2ZnZB*Q|(4Sg^nHB~)1 zH`nhUppzmJPG(3ru}NrGqxEqEZ2W$IFcd;$FoXw!U9|g5Ry4EbHi(F?x3v-)G$qPR z$Vk+967mF+z&&gGnN29}DxJwZG{A)qrz}`ZOisr8_!eWEH^kuqoUPXDNqN2i0W`$- z+fzVtfexgv15v&7fmd;El+w2@ZBXeWaglDHMHBB29KDjf)2$;&J-E=CTVLnl0GtIa zEiG`Q#*8&n*fNb`7D)`g^H*)753ml%2E1+TZ0GWN z)Ee6jDr^1sR8W_rnQ0d;d_0efb@tf`eK`dgVsZ+j*RKy4?P!KMIBH!CxD$`S<)tg* zS%MW|r_TGXJ``g>I>;eBay9zsa_-{pM$Sa+gl;QMiN>AVJ*c=K16KI~pd|;uSMo?n3?(J$<58p{Kv%rN+Rg+%642xW>cX`uK^_e#OV3ivCtA@0QB&{ihiA$ z?2WB9=*S3o^8WtyObqIfDoo1wYwi3Mz6>?M@4%63f zI*UF1@hkTmzat7=L}s%Qj&qMEq?tXML93D47`gEwo!{)i>MrYPYoqLRJ4`}XffBwzE3os0CVxNL20k!NORDwdX)BmFDJS;k&6 z5f7wRElUCJnJKyH)OK&IECh!_Xw6_+QfwvC7pS`=>O1P8jh+ z(_F))=-?n*ro?hBiLzcs)=xn>2C#_lMJNy67pOldhjyC;I1$@1RIxB)w@#0bGkE-7 z?{k5}F6Ndf?mI?g0ijUH;VSFt@oy=j3af@u<_059SX@y4e6tWk$x*{(DJke}r%E0+I&x$zlCwy+geijY%N>w_-$LQA6!7bV zi?PX(Y0b>c$dE-o*S5CwZQWxyu*k!~(XImEVaSt%K;^}TEHiRRWEe#EYt-<)_u48x z7Oz5UNb$+e>)h`f54gIxN|9lb(EsQVAWT3<N9iIKl* z4Hu*s!XyX=?LRY8P%0pzWG?N575b${lAWg5u=JJW^T(xBE+Vdg!(`1P)J?W*g;~j^ z$CPmz3hf)_BjZxpt3@Xu_YcUsjqKNC?kCW2BU%WZT%A^=>-?2!Tf4FKVm70J+vVH) z6n=0ZMwYU(vGK77EKS9i5}3dm(SS9+d%ithOvao-oaQy_wdbVk`Jt(#(S^aTvBg?) zc{(ONs%sWJHiY+A_Ph=j{OD|5B>TCisCr8>Sp}UI^-UGc&eKnaB+2X!wi6cs4i=@Q zrQHD4%Hz0oj1r{`#@x4NkLLm|AC8Vc6 zAps4E4p9k_ghv8XN?IBPIVI(n#b_MCHdF_DCl~2X$2Z|Y zu-nMWI75jEV_>-?0kwb{w2mI;vWVt}g_-OF=N?apGKXe{BksgvV0VVmh)6y%^xwrv z$;+GR=6!6$<`gqg9#>ODWc;c7=iBRz3kx_x5f+SZFuhJZt# zo*uW7iMEl?qzc@03onD1P8+&&ku4nLm={I{>@GVC|CEKihwdz%#aSJ$p7%C>Q`;Y>Ew@d zOe`-y9K=UzE(;foj^9M?n1|UZYGi9>d^&06=~4gCQ}9-7>Z+=;xPhd7CGNCj9E&n( zGM&L({2YuVpmq4*ojescKXl%Fcx3uM{S<_Z5u?N323pY{H|DMKzB4tpX*uDqgxj_2EwRp z++mDjr}zCBxedK!mzG<)U=y>SB}|LHZ6mkCX@BGiut3{)M8JE*j1e46(AK>#pVjsH zr#p2J;^b7-lb02}?^+}%aUmL^ViT-d7g{GTE`>+=*#A6bNq3+wb>zbD=E$}ijw9fO zkHrJ}xGcJBXTYJA3C!!5#-xIwnu%Or#Su=)OAA?bNq{&fpx_m>L1-l$49Q+>IYLgs zDZG4qhE!Kq$ApE2an>+$@iFhYC*ZLD(7S)Xn-!df&jBZCE|RnK8`*k*BU8-!7D}Z= z&d{s^9>@|F1!W&z*E6ypQ@iCeUnKseZ)n&%dFl-SdV$WZ&s4zp&qGQMmI|86{M_&K zP^-F zu_zE(N^C(>|C?Ek7XwRL9^;?p!U}%Y76$OeQ1=n#uc@oKmlMhU)i^1Sd*mO}S#BHQ zfZ@QJ&F{alr7TqymD-B{1ca)hQ%tXsxw49OH$#3hYb-iUQqbLI=wve&x{S}}A^Xwp z(%%IkU>vypDj^ZKHErA8OpJ^U!v7=8tstCjY;4Y+KYL~SQNgpCtrg`(cM&`yjLIy9 zxI#rRTzvuD{_z4Ml*|i%{)Z&?&*pEJuhY91LY_2#pYClBhTjKCSK2=kj_@5?o^~%k zpb9O|iQ~~Gz)S|jWs6#&`)tv_Qd5H<$8Uub>j9=>Q*qx3y+7&V~z$@%$)K&-pX z11KQAk}h!aZ~*XZugK@}u$PyX4s#tU&2@YcrQ@mYB`Kwik$hkK-H^^qg6j;Jg|Ee+Kp!8Yd}nn<~nVixNhqk z81&57E1$(bgY48*iKgm?P6YE7?;>;Id(YD#*P19;vk>CyQjL@}=t{^2bJWhv%;e7k zUHedpI1UO#Qflgh5O6B^ccfe@Kj_7F+pgxeq=e|sl3A6E;Y;8vy1t;G&$npQYI*d< zP{S8b&S@DKdJYcL4Fz1k@2}Pyi&`iu&h7zgTS^3;fLb_yHQGqezIt`S&TefT(l5%) z(4Tu9)*#(pNxU!hn=9C2ZflFbtfAp%@MeFMGG|OH3^vTK;_x28;B|(*pPeHN=RCG2 z+8OVCqzUJ76}8mN>Z{^9n%#kyiUNNK(5Qn;aHEF+@In9#BlPwFb4`8Ns$54^z|>q- zm7Fp8LVNjMKAIWe}sHv@uW9Q_|j+1V8S#E;`KB+SP!^PuJVq8^THK2gQ6@0>Mnu%~;R1^Oo`u&A;qP;WiY+vgi7@ zRvYAF%lXLfVG-cr+VqGR_-*GlKNZF6YYUeYL=fN1re$IVpWs;Jx8m4M?mYQ$bX#q` zya3^7&^wW!6@tZlA|)p(D(Y%rDy*Lj#hvqC7*UW&=yz)3sdp!(T0CTov5L1v((4rs zxIn&EsbV57rTvF}8(yS7yrP3ZA#OH>OJ4C4DrYgO_c%Qri`wNAE;QZRB&&VoC{~FEA!};*(JO(9^h7~*^ zA$2Er?+FyrvdBU5LkKyO2ugIcJ%VQ++4M`FA53zwQhE$4NkD?M@b>WuH|HNR{vE6b zbO6x+F;Ev}^ed>a0+%+G$&TW-?mZ4V5~G@PcUd*p(G%%%@DeHjA`;ToLUo(PIV*es5g(OOlD;1ws- zU<=C%^%Fqhg~riVDI>?Be~*T69oXSaxozH=*<4vkXOLc~r^Du{c25AX8^y)u@1~-* zwl=`PqszP>CBt-fqA85}t(J5!==__DPs0bVVPIzmYL2r0C$#9;NFyM+|0j;AvU`&9 zZ~(as6Q9fRuQBUe1Tm~ggS7^8S}9p3MG~AO2t*7uSHK2|@4_0X7Tb5sH2?8dnEr$D zWX5%XI-3y2Rgg1UMV69~_(n}d^=t$nDvL}4(aM-{B!Rd;p%xNH7Q@gPd;I_c0ACq- zFp*RibNfe{Oe%&C&?=s0fajVMX*(hgDP7NbylvZaKejwpmzr!snUE;F#f5^{|EHZ; z@+_4Zl@XvJPOW)@v~2%WO8iB4i-V4VadDWVSo!N0D-siq3AWCA5ajLctp?C$A6-U3 z_ZvMYj9`+bPm9eX2!@F2f=*kn3uzuT7JO@asll3mzm4vP*JN@zJZspvNC#|ZXI%p2 zAU;o*TPy$?<_3%($=`K<8=>f82zsZ2%qS`@+XzFB(MVS8~kxnSsyO`-QLR=gx z|Lgpl1yKM0+S}T`9~{J7{xQ`WBMuD>l~PpfB{05$BXJZ#(hQ`3UVadfdXmxjCL9~8 zLhOVguegX0s{qz@LDSwCTwA5ho502j=u!k24Dj z4P|UbEamerWd|>h#dp>s9Ke?h%_FE28P{?Zohu1raCFVwA4xgs>;a?^@L;|iVPT;1 zzyUi|m(jwiP+#^7OOeeTHd92=!Mb#D(T2t#J39_v8%*Q@>#dx84EAy3H@q9Ga7}DI!&yZHAgboQ0mF-+Wk#Vg*N^oACJaIDRcIw~IVjo(G%WiY zmNbgd{r4C($8j#<5cgidQg85=1z^YP7>A$-#kK z1B*^_#HA+2v7O}p&KH%f@ej5`M=r-{_La@&1zE;5U~p{Y8AT|GtQMF=)AWrgXt5!> z;E7=_`oNQPrx?HnFHKRh6JI%lN9EsQl=Spdyx6?n2|BV481j%#k^*?$yUNPS6<2q6 z1;ndh2CEnGf#30+e4cfK;c%)11BWBF(MvOb$%v<7+AzsY&40ncs>k03!dLq0>gbH* z0z(z+GoLYsrtwbjR=i`OSO(8~fMM3fOH5(wZ*&xGUc^g)9~=$o_qajV_AEUxZHVp5 zuj$$O*Se#JsdLQEI1Z<26)1uwtZ1PcRhTn>WM2k;P={F@Br3Uf0|baza$bicf8W(p z=2&A7p4=_Kk&p=}8=}h$EN0r(z&Oyr(@ww_>LRua*g?RqGeicBb%bj4DYKrLirMj6 zCmg*)56DR7i7XNc?%vP9^%qy8KDqn9T1zMWy0HWW%GS-z<&W3xzFhD$Ct-gdyj9J# zd-kw9@l>&s{_Dyk0MD`oa1jE_#1t=WWhcaz#na(1>V_($hKyi~f>?3F^L&w&QVZ-o ze@bJ7k_%`UrMO;JJpK)+tEv`_)kJ|PUXgFcT%FwCcQRMF6?*Enqk6MMkOrfsrOj@2 zJ6oQ`X@gZpU9&I*!M#GRMa{X6=-AsOjwy1PlssOqH`w9lB65U^49zuW>W2}|7r7Sm z!$Su{;kP3AIVSej2FntHRS`ReGC#5YUB%E)aPsPjk!S5gP#bvpg{`d*_FwKYRE-Qh zu6_E%5KCvmON>`hG~LIJp&3_d!%YYb%}|>O=y=%d<;XKIW+Kd-)QGHTIo`MD{u4uU z-%Xm<2!ZJ&ffG|M9BgNZBD)m;TBiBhO}w)vXmPMxb5uMGre3$OiK!p?as@%Rs)bIO zHAA7lH%~yS!$wfa-nmez6-6Ki{c={>ZIglq{HF~$E&>-N2!F{;#-^b~#?ApB))*Z* z$rqLO$n({^)N_^Y{{_bmIPtPcoQPC6oHMk%`HIMKrShYdEkPCQkdikBf?1JJ?f;7K z+vRw+sU6jBzhzZi8r-S1|9v?p6%OI?XnuS~M#h&1aTuozL(UH3cDuh}=yOH%R5uw5 z&V+s3BvFb$Buz8PR1(aK2-nsv=-IhRuvdDzoQUIjc6RnFt*x!c)!%`Na-J-RS|W@Y z-a9KR3(d{Vml`jS94eFWKusH-np`+=83h1E4vOy;<>A3YO{T}x)zy6?EiLWmot>RS zijN&q1hRbja%|te{mYR$eHx4_2hx|H2MBLmYMI7IB7mRR(faz|g?qayE1>Gp*VQIi zZf@@TO-)UgpGdz?r$BFX@8;%al$Dh|QCV4ez0o<^PWnP?4<4Stkt`2PAe0c?R-A_4 z*EXZiWT?Hpy(J44ESR%?{d(insWFNn#bRY;Wqq!*v$G)br8BX;+v4Jpw&+Zem>I@7 zn~$8qfk0C&+CKgeDin>Tga#`d8jI!idY?EcgE`IccszGYlGGg;KSRJJ09Lxw0q1Z*O6rZqUANEGd>R|a4D(YpSy7yEo&UEK-xI<}#W&u+KhZhi#8 zhuvQ6b@xVb z7@z3GtVEl>tr)|;Z{NNlQ|oX@5J*8mK}knPM{)RXhl{)ba3p3Ral#~#puv*EqFf|n zX!ytTP*p|bDKX;ON=r+(eDu*r`%l79ViMD*Pu~oq4EUO;PJlPtdqJX3m`8C=N}}$& zVgf?Q>=Wzpsl$-4gGiF}jsCy!P*4;lNSZSjDv=;@1&o-#NLi)ud0l8-{hsChY&Khb zNlD3_oO3rJBtR(*5JFVWxk?D(TuSY2h1&}y-RxoorEFBIt0xXQ{FrZf@*W2#wWh z%&M;X!waq5B7R*V99FSngsVugQA|lR-)($8Urt(%>i@cx8h~MlGXz(|-o2v^0vN5VR|G1r%)Q^@`v#Vx=l%nt-lgaiVqZW0%YI zmBH@n$w15#h@vQ^#vZ78Qqi>e%fL;NBlL&2qY>Vwn9R}>y9gEu;+)_=-Cl5Ftk?)a zrHZKDH7CWoAZluA>fFKa?BFBj2_!Q!bDmkqs75lW^Or;|NcC0j(hY@!-pk>PP##`} zwOzfz)Ia7&ixLxrU{bt2STvLv8gKXR-TUPkGiJp6tB835X=rGeXxKoQi2cZ1dM+%| zVjTt7_Dw-|_LzS!F@z)3@KLv0geNnL+{O~qlk?3;j)P2t*%u9-x2meijg5_YC#~Cq zgqS9fapT6JrKM$-VIv0|g(W~zO4Re+vuCHis+ss-4X41UV?}7}R?nc-ub^3h>GKO- zK*%5opqQ5s7c9CHInA{D*zNY1XR~5j&C5AYGbdt#`1~;-ToGHk(JIBDCu`7H0!`5G zuBr_3&yhlUTwGko4}S22zcw~DRsrY*;MW&Am3urMo{*5hgOf*Gp{1n-Mse0Jzx=Y% zIF6h6j^*4%ix!EDFX899TrQ-fq=bGF7xH?&M3N+8v)P2N4IxBkj3rP?3-<5d|HThK z{BW|-^|gNN?CnK%y184sc(U5_CKO9k67XrS$Iu=UOtKgAnyi>6kcNf^%X~3$*||E? zYmyUApUyf<)mL8wrMn~85Scb{_UzezyzjpI?ikbooMOE5&O0Z3jk2<`-Gq?8z^If2 z=h)@;;Jh^R>Qo__L;LTX)I`v_HW9!UaU3B7zTa3tOtV;Lo_S`Wc`Ju4Hy>OzPw2zL z!f1W_Di5>MMp~GS8#k^QoL&!Y?BBnC7tCxU1gLcTqt0_&9xsbSjg;!al65g(M`-zi+%@*qZFBT31*7*#>Pg2GI6nmm?n@(lO~z7SRAlr=L%;! zQ+}8ek^GEs4)0L}ax~J@)AtTWe}@YS3kywZ3=-7)lxXwufiZ$YhjF;BCWCl9o{Y23 zIxD8!a~>J^muq+;>3v}$5EvF zJJ78#bScrh>SR0Y5p~rOCgXH>cMt3$d>Rqc1mf{{63p5-A&~5LaEoA2F5(3#RFB)z z`)b>^ZKKXvVfgpI|E-#pOVH#w!DdAR!r>&kn~E8HK3~d-^z~#Trq#S|w>#CWO>#Pg z50)fq4jPjQ^FzNM z&%L$Z8Dr&MZ)8XS4=Qk5mFUWSaKe#DCByjJ&@*+r-5HuV64eDy17ey$yk4*A4q{74 z)=hzw!qR($5~x1!VQrQX{CJ}vhFs*V5%hvQI6_!TNX1INiiTN0)2tu=#7#?h);0HJH$zc6*f7wKT}oSc?@}l>C0bd3a|GAf^c< zEiJ9Xtj*WaCbIr93o%`P2NHapU8B3iARttDtHGIPZ468KuStVOm(xqmL|9>cZzCAAjT}+3vaB#Qis+!buo3*N zxeacniXRlx-(O2Fq$6<&ObOtF&K`hE5i(*Z2rerttKrm+;@A+=1hQ$|+INYo@KYZiYj$J5 z*AIm%kvk3Na5|lpTefTooZ3+w8)BM3ii(O%5}IibSV7A>|3cfde?)-0br);Spa#{s zj4*hs_M+mZuOp!JMOEiw6xQHDbqE8)-Bqo4zpGc2&{lCIELW8X0t9%q*@wIK)<92? zWUNTZ$;nxJS_X0qh-nQ%R#w)#d-v{DLj61{?N9J~^)nBlbIWE-yz5@b*<(OiK)jT$ z)vK}h*LOg1b&2Eqt9V0o&X+7%QhCok_q=4*2kjWElFwnq{tcm6*bFolL$ZjcAL!n) zZ2kJI?rqlZ&@*1MX3f-J{pwd=j&ym~`_sbwSh4jGZZ1m2{lx`{qh66fJm9tAH;oOb#=An7)CJwCQO*{r%=|=qdr9AbSWp4aEVHs$`0-*DB%eu zW!#pO!l}NgTYd;3eDUJNOHcP0V-ZuPOmU{BrXDbRc9croMkuF5=7~0$Pf3X5lj5D+ zX(OCcS-cag=boILT$PuXXPwz$6a%BUxVTu7q>j*oJ^YY`4p;w63E_GmEj|1J(Z5>} z$fQY=u0Gx4i)H+ONlHpOASY_{M9#nj9@P5Jz<>yAP+UOb19!MHF)@9zv9Zw}X#Wix z;P3D60*VmyNFo)3^fNI*B2r&pA9HW)D8K-2Zf=dxL`_lH!@?hgEiEnU2HIc44j395 zR=_d{B^d>zS3p4Eih_ayai`6Va3Cou3BoHV%^WZ+C@46ei;IhGp#3%MfR>gPgSxtU z5v7?#Qd07~n3x#rK>KGX0X{xHW@TmN-IQhyDJiLG1MQb#4;&mE0(p3NUf|0hD18;A zrkSXy=z0?q6On=T!%zfra&nBy%F2~YOiaIsY3{<*fSP8EjEq0zPfPOG~RyKtSLzfsFD` zSXlUol9E!PqM{f^i-?FAJ$(33>GS8$oT8$lFBBCO@7}s~ zYqOY`*ujezFa95BcMdloD=W*$!NFl+YHI3t;=~Ev7cXAOvazv!Q&3R2_5c6>+rq-a zv-j=W_i~`!ISNL>D4-!2Z4-`yQGf@GW{^=Z3h)3x00030|8KSiT6boUTmS$707*qo IM6N<$f;9DK`~Uy| literal 0 HcmV?d00001 diff --git a/src/cli/autoformat/mod.rs b/src/cli/autoformat/mod.rs new file mode 100644 index 000000000..26ab86345 --- /dev/null +++ b/src/cli/autoformat/mod.rs @@ -0,0 +1,25 @@ +use super::*; + +/// Build the Rust WASM app and all of its assets. +#[derive(Clone, Debug, Parser)] +pub struct Autoformat { + /// Input file + #[clap(short, long)] + pub raw: Option, +} + +impl Autoformat { + pub fn autoformat(self) -> Result<()> { + if let Some(raw) = self.raw { + if let Some(inner) = dioxus_autofmt::fmt_block(&raw) { + println!("{}", inner); + } else { + // exit process with error + eprintln!("error formatting codeblock"); + exit(1); + } + } + + Ok(()) + } +} diff --git a/src/cli/mod.rs b/src/cli/mod.rs index d639d28a7..92e05eaa9 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -1,3 +1,4 @@ +pub mod autoformat; pub mod build; pub mod cfg; pub mod clean; @@ -45,17 +46,27 @@ pub struct Cli { pub enum Commands { /// Build the Rust WASM app and all of its assets. Build(build::Build), + /// Translate some source file into Dioxus code. Translate(translate::Translate), + /// Build, watch & serve the Rust WASM app and all of its assets. Serve(serve::Serve), + /// Init a new project for Dioxus. Create(create::Create), + /// Clean output artifacts. Clean(clean::Clean), + + /// Format some rsx + #[clap(name = "fmt")] + Autoformat(autoformat::Autoformat), + /// Dioxus config file controls. #[clap(subcommand)] Config(config::Config), + /// Install & Manage tools for Dioxus-cli. #[clap(subcommand)] Tool(tool::Tool), diff --git a/src/main.rs b/src/main.rs index 099ff74c0..72558741e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,6 +48,12 @@ async fn main() -> Result<()> { log::error!("tool error: {}", e); } } + + Commands::Autoformat(opts) => { + if let Err(e) = opts.autoformat() { + log::error!("format error: {}", e); + } + } } Ok(()) From 201dcc144d363571865ace40d85336b3c792d474 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 26 Apr 2022 18:45:27 -0400 Subject: [PATCH 101/330] feat: fix bug with applying multiple edits in sequence --- Cargo.toml | 6 ++- extension/package.json | 7 +++- extension/src/extension.ts | 85 ++++++++++++++++++++++++++++++++------ src/cli/autoformat/mod.rs | 38 ++++++++++++++++- 4 files changed, 120 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b8f0e271b..9f85a89c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,8 +46,10 @@ flate2 = "1.0.22" tar = "0.4.38" tower = "0.4.12" -dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } -dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } +dioxus-rsx = { path = "../../dioxus/packages/rsx" } +dioxus-autofmt = { path = "../../dioxus/packages/autofmt" } +# dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } +# dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } [[bin]] path = "src/main.rs" diff --git a/extension/package.json b/extension/package.json index ca73c0ea8..f884637c8 100644 --- a/extension/package.json +++ b/extension/package.json @@ -20,7 +20,8 @@ "activationEvents": [ "onCommand:extension.htmlToDioxusRsx", "onCommand:extension.htmlToDioxusComponent", - "onCommand:extension.formatRsx" + "onCommand:extension.formatRsx", + "onCommand:extension.formatRsxDocument" ], "main": "./out/extension", "contributes": { @@ -36,6 +37,10 @@ { "command": "extension.formatRsx", "title": "Dioxus: Format RSX" + }, + { + "command": "extension.formatRsxDocument", + "title": "Dioxus: Format RSX Document" } ] }, diff --git a/extension/src/extension.ts b/extension/src/extension.ts index fd8e2906b..46ce2aa89 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -33,7 +33,7 @@ export function activate(context: vscode.ExtensionContext) { }); } - function autoformat() { + function autoformat_selection() { const editor = vscode.window.activeTextEditor;// Get the active text editor if (!editor) return; @@ -43,11 +43,10 @@ export function activate(context: vscode.ExtensionContext) { return; } - const params = ["fmt", "--raw", unformatted]; - - const child_proc = spawn("dioxus", params); - + let args = ["fmt", "--raw", unformatted.toString()]; + const child_proc = spawn("dioxus", args); let result = ''; + child_proc.stdout?.on('data', data => result += data); child_proc.on('close', () => { @@ -60,14 +59,76 @@ export function activate(context: vscode.ExtensionContext) { } + function autoformat_document(document: vscode.TextDocument) { + // check the settings to make sure format on save is configured + // const formatOnSave: string | undefined = vscode.workspace.getConfiguration('rust').get('formatOnSave'); + if (document.languageId === "rust" && document.uri.scheme === "file") { + const editor = vscode.window.activeTextEditor;// Get the active text editor + if (editor) { + const text = editor.document.getText(); - const handles = - [ - vscode.commands.registerCommand('extension.htmlToDioxusRsx', () => translate(false)), - vscode.commands.registerCommand('extension.htmlToDioxusComponent', () => translate(true)), - vscode.commands.registerCommand('extension.formatRsx', () => autoformat()) - ]; + console.error(text); - context.subscriptions.push(...handles); + const child_proc = spawn("dioxus", ["fmt", "-f", text]); + + let result = ''; + + child_proc.stdout?.on('data', data => result += data); + + type RsxEdit = { + formatted: string, + start: number, + end: number + } + + child_proc.on('close', () => { + // if (result.length > 0) { + // editor.edit(editBuilder => editBuilder.insert(new vscode.Position(0, 0), result)); + // } else { + // console.error("No result"); + // } + if (result.length > 0) { + let decoded: RsxEdit[] = JSON.parse(result); + + console.log("Decoded edits: ", decoded); + + editor.edit(editBuilder => { + + for (let edit of decoded) { + console.log("Handling Edit: ", edit); + + let start = document.positionAt(edit.start - 1); + let end = document.positionAt(edit.end + 1); + const range = new vscode.Range(start, end); + + editBuilder.replace(range, `{ ${edit.formatted} }`); + // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { + // }); + // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { + // console.log("Edit applied: ", could_be_applied); + // }); + } + }) + } + }); + + child_proc.on('error', (err) => { + vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); + }); + } + } + } + + context.subscriptions.push( + vscode.commands.registerCommand('extension.htmlToDioxusRsx', () => translate(false)), + vscode.commands.registerCommand('extension.htmlToDioxusComponent', () => translate(true)), + vscode.commands.registerCommand('extension.formatRsx', () => autoformat_selection()), + vscode.commands.registerCommand('extension.formatRsxDocument', () => { + const editor = vscode.window.activeTextEditor;// Get the active text editor + if (!editor) return; + autoformat_document(editor.document); + }), + vscode.workspace.onDidSaveTextDocument(autoformat_document) + ); } diff --git a/src/cli/autoformat/mod.rs b/src/cli/autoformat/mod.rs index 26ab86345..3008411db 100644 --- a/src/cli/autoformat/mod.rs +++ b/src/cli/autoformat/mod.rs @@ -3,9 +3,13 @@ use super::*; /// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Parser)] pub struct Autoformat { - /// Input file + /// Input rsx (selection) #[clap(short, long)] pub raw: Option, + + /// Input file + #[clap(short, long)] + pub file: Option, } impl Autoformat { @@ -20,6 +24,38 @@ impl Autoformat { } } + if let Some(file) = self.file { + let edits = dioxus_autofmt::get_format_blocks(&file); + let as_json = serde_json::to_string(&edits).unwrap(); + println!("{}", as_json); + } + Ok(()) } } + +#[test] +fn spawn_properly() { + let out = Command::new("dioxus") + .args([ + "fmt", + "-f", + r#" +// + +rsx! { + + div {} +} + +// +// +// + + "#, + ]) + .output() + .expect("failed to execute process"); + + dbg!(out); +} From 4a54934c8ef34d98861223bcf5be244fa3922027 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 28 Apr 2022 23:59:20 -0400 Subject: [PATCH 102/330] fix: extension should respect blocks --- extension/src/extension.ts | 49 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/extension/src/extension.ts b/extension/src/extension.ts index 46ce2aa89..44d5b8f16 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -64,9 +64,10 @@ export function activate(context: vscode.ExtensionContext) { // const formatOnSave: string | undefined = vscode.workspace.getConfiguration('rust').get('formatOnSave'); if (document.languageId === "rust" && document.uri.scheme === "file") { - const editor = vscode.window.activeTextEditor;// Get the active text editor - if (editor) { - const text = editor.document.getText(); + const active_editor = vscode.window.activeTextEditor;// Get the active text editor + + if (active_editor?.document.fileName === document.fileName) { + const text = document.getText(); console.error(text); @@ -83,33 +84,37 @@ export function activate(context: vscode.ExtensionContext) { } child_proc.on('close', () => { - // if (result.length > 0) { - // editor.edit(editBuilder => editBuilder.insert(new vscode.Position(0, 0), result)); - // } else { - // console.error("No result"); - // } + if (result.length > 0) { let decoded: RsxEdit[] = JSON.parse(result); console.log("Decoded edits: ", decoded); - editor.edit(editBuilder => { + // Get the active text editor + const cur_editor = vscode.window.activeTextEditor; - for (let edit of decoded) { - console.log("Handling Edit: ", edit); - let start = document.positionAt(edit.start - 1); - let end = document.positionAt(edit.end + 1); - const range = new vscode.Range(start, end); + // even if we build an empty edit stream, it tries to save the editor + // this makes sure the editor is actually saved + if (decoded.length > 0 && cur_editor == active_editor) { + active_editor.edit(editBuilder => { - editBuilder.replace(range, `{ ${edit.formatted} }`); - // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { - // }); - // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { - // console.log("Edit applied: ", could_be_applied); - // }); - } - }) + for (let edit of decoded) { + console.log("Handling Edit: ", edit); + + let start = document.positionAt(edit.start - 1); + let end = document.positionAt(edit.end + 1); + const range = new vscode.Range(start, end); + + editBuilder.replace(range, `{ ${edit.formatted} }`); + // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { + // }); + // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { + // console.log("Edit applied: ", could_be_applied); + // }); + } + }) + } } }); From 2c9f5f1957941dd7875f0b01742809f9ec0823f1 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Fri, 29 Apr 2022 12:59:15 +0800 Subject: [PATCH 103/330] Fixed `dioxus.toml` --- src/assets/dioxus.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index ab85abe86..b43d0d6df 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -42,4 +42,4 @@ script = [] # use binaryen.wasm-opt for output Wasm file # binaryen just will trigger in `web` platform -binaryen = { wasm_opt = [".PROJECT_OUT"] } \ No newline at end of file +binaryen = { wasm_opt = true } \ No newline at end of file From 5d013ecf824b1e62b8741e7e4565af8bf3262f97 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 7 May 2022 11:54:00 +0800 Subject: [PATCH 104/330] Try to add `Sass` support --- src/assets/dioxus.toml | 5 ++++- src/tools.rs | 32 +++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index b43d0d6df..0c57542b8 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -42,4 +42,7 @@ script = [] # use binaryen.wasm-opt for output Wasm file # binaryen just will trigger in `web` platform -binaryen = { wasm_opt = true } \ No newline at end of file +binaryen = { wasm_opt = true } + +# use sass auto will auto check sass file and build it. +sass = { auto = true } \ No newline at end of file diff --git a/src/tools.rs b/src/tools.rs index 937063be0..db4d82268 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -13,10 +13,11 @@ use tokio::io::AsyncWriteExt; #[derive(Debug, PartialEq, Eq)] pub enum Tool { Binaryen, + Sass, } pub fn tool_list() -> Vec<&'static str> { - vec!["binaryen"] + vec!["binaryen", "sass"] } pub fn app_path() -> PathBuf { @@ -60,6 +61,7 @@ impl Tool { pub fn name(&self) -> &str { match self { Self::Binaryen => "binaryen", + Self::Sass => "sass", } } @@ -67,6 +69,7 @@ impl Tool { pub fn bin_path(&self) -> &str { match self { Self::Binaryen => "bin", + Self::Sass => ".", } } @@ -84,6 +87,17 @@ impl Tool { panic!("unsupported platformm"); } } + Self::Sass => { + if cfg!(target_os = "windows") { + "windows" + } else if cfg!(target_os = "macos") { + "macos" + } else if cfg!(target_os = "linux") { + "linux" + } else { + panic!("unsupported platformm"); + } + } } } @@ -96,6 +110,12 @@ impl Tool { target = self.target_platform() ) } + Self::Sass => { + format!( + "https://github.com/sass/dart-sass/releases/download/1.51.0/dart-sass-1.51.0-{target}-x64.tar.gz", + target = self.target_platform() + ) + } } } @@ -103,6 +123,13 @@ impl Tool { pub fn extension(&self) -> &str { match self { Self::Binaryen => "tar.gz", + Self::Sass => { + if cfg!(target_os = "windows") { + "zip" + } else { + "tar.ge" + } + }, } } @@ -169,6 +196,9 @@ impl Tool { command.to_string() } } + Tool::Sass => { + command.to_string() + } }; if !bin_path.join(&command_file).is_file() { From c48345b86e556c0535d4ead6134921c68d4c121c Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 7 May 2022 16:25:23 +0800 Subject: [PATCH 105/330] Add `zip` support --- Cargo.toml | 2 ++ src/tools.rs | 46 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 21e2dad7e..d2bda881f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,11 +39,13 @@ hyper = "0.14.17" axum = { version = "0.5.1", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } headers = "0.3.7" + # tools download dirs = "4.0.0" reqwest = { version = "0.11", features = ["rustls-tls", "stream", "trust-dns"] } flate2 = "1.0.22" tar = "0.4.38" +zip = "0.6.2" tower = "0.4.12" [[bin]] diff --git a/src/tools.rs b/src/tools.rs index db4d82268..b37d10cd2 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -1,6 +1,6 @@ use std::{ fs::{create_dir_all, File}, - path::PathBuf, + path::{Path, PathBuf}, process::Command, }; @@ -112,8 +112,9 @@ impl Tool { } Self::Sass => { format!( - "https://github.com/sass/dart-sass/releases/download/1.51.0/dart-sass-1.51.0-{target}-x64.tar.gz", - target = self.target_platform() + "https://github.com/sass/dart-sass/releases/download/1.51.0/dart-sass-1.51.0-{target}-x64.{extension}", + target = self.target_platform(), + extension = self.extension() ) } } @@ -129,7 +130,7 @@ impl Tool { } else { "tar.ge" } - }, + } } } @@ -169,6 +170,8 @@ impl Tool { let dir_name = if self == &Tool::Binaryen { "binaryen-version_105" + } else if self == &Tool::Sass { + "sass-version-1_51" } else { "" }; @@ -180,6 +183,8 @@ impl Tool { archive.unpack(&tool_path)?; // println!("{:?} -> {:?}", tool_path.join(dir_name), tool_path.join(self.name())); std::fs::rename(tool_path.join(dir_name), tool_path.join(self.name()))?; + } else if self.extension() == "zip" { + // decompress the `zip` file } Ok(()) @@ -196,9 +201,7 @@ impl Tool { command.to_string() } } - Tool::Sass => { - command.to_string() - } + Tool::Sass => command.to_string(), }; if !bin_path.join(&command_file).is_file() { @@ -215,3 +218,32 @@ impl Tool { Ok(output.stdout) } } + +fn extract_zip(file: &Path, target: &Path) -> anyhow::Result<()> { + let zip_file = std::fs::File::open(&file)?; + let mut zip = zip::ZipArchive::new(zip_file)?; + + if !target.exists() { + let _ = std::fs::create_dir_all(target)?; + } + + for i in 0..zip.len() { + let mut file = zip.by_index(i)?; + if file.is_dir() { + // dir + let target = target.join(Path::new(&file.name().replace('\\', ""))); + let _ = std::fs::create_dir_all(target)?; + } else { + // file + let file_path = target.join(Path::new(file.name())); + let mut target_file = if !file_path.exists() { + std::fs::File::create(file_path)? + } else { + std::fs::File::open(file_path)? + }; + let _num = std::io::copy(&mut file, &mut target_file)?; + } + } + + Ok(()) +} From ea723f64cd362d4139d0766fc5a74b95166e2ca0 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 7 May 2022 19:11:12 +0800 Subject: [PATCH 106/330] Support `sass` install --- src/cli/tool/mod.rs | 4 ++-- src/tools.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cli/tool/mod.rs b/src/cli/tool/mod.rs index d5c4581aa..f13c1620e 100644 --- a/src/cli/tool/mod.rs +++ b/src/cli/tool/mod.rs @@ -20,9 +20,9 @@ impl Tool { Tool::List {} => { for item in tools::tool_list() { if tools::Tool::from_str(item).unwrap().is_installed() { - println!("{item} [installed]"); + println!("- {item} [installed]"); } else { - println!("{item}"); + println!("- {item}"); } } } diff --git a/src/tools.rs b/src/tools.rs index b37d10cd2..9f96ce0b9 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -53,6 +53,7 @@ impl Tool { pub fn from_str(name: &str) -> Option { match name { "binaryen" => Some(Self::Binaryen), + "sass" => Some(Self::Sass), _ => None, } } @@ -128,7 +129,7 @@ impl Tool { if cfg!(target_os = "windows") { "zip" } else { - "tar.ge" + "tar.gz" } } } @@ -159,7 +160,7 @@ impl Tool { let chunk = chunk_res.context("error reading chunk from download")?; let _ = file.write(chunk.as_ref()).await; } - + // log::info!("temp file path: {:?}", temp_out); Ok(temp_out) } @@ -170,10 +171,8 @@ impl Tool { let dir_name = if self == &Tool::Binaryen { "binaryen-version_105" - } else if self == &Tool::Sass { - "sass-version-1_51" } else { - "" + "dart-sass" }; if self.extension() == "tar.gz" { @@ -181,10 +180,11 @@ impl Tool { let tar = GzDecoder::new(tar_gz); let mut archive = Archive::new(tar); archive.unpack(&tool_path)?; - // println!("{:?} -> {:?}", tool_path.join(dir_name), tool_path.join(self.name())); std::fs::rename(tool_path.join(dir_name), tool_path.join(self.name()))?; } else if self.extension() == "zip" { // decompress the `zip` file + extract_zip(&temp_path, &tool_path)?; + std::fs::rename(tool_path.join(dir_name), tool_path.join(self.name()))?; } Ok(()) From f7f1d90520bf9712172175ad6ccbec41803172f2 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sun, 8 May 2022 00:56:22 +0800 Subject: [PATCH 107/330] Add `sass` support --- src/assets/dioxus.toml | 14 +++++++++++++- src/cli/tool/mod.rs | 7 +++++-- src/tools.rs | 8 +++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 0c57542b8..8f160b293 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -45,4 +45,16 @@ script = [] binaryen = { wasm_opt = true } # use sass auto will auto check sass file and build it. -sass = { auto = true } \ No newline at end of file +[application.tools.sass] + +version = "1.51.0" + +# if auto = true, we will check style array, and translate all sass file to css. +auto = true + +# or you can specify some sass file -> css file +files = [ + # some sass file path + # this file will translate to `/css/test.css` + "/css/test.sass" +] \ No newline at end of file diff --git a/src/cli/tool/mod.rs b/src/cli/tool/mod.rs index f13c1620e..45c866c40 100644 --- a/src/cli/tool/mod.rs +++ b/src/cli/tool/mod.rs @@ -27,7 +27,11 @@ impl Tool { } } Tool::AppPath {} => { - println!("{}", tools::tools_path().to_str().unwrap()); + if let Some(v) = tools::tools_path().to_str() { + println!("{}", v); + } else { + log::error!("Tools path get failed."); + } } Tool::Add { name } => { let tool_list = tools::tool_list(); @@ -58,7 +62,6 @@ impl Tool { log::info!("Tool {name} install successfully!"); } } - Ok(()) } } diff --git a/src/tools.rs b/src/tools.rs index 9f96ce0b9..ae4e58b79 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -201,7 +201,13 @@ impl Tool { command.to_string() } } - Tool::Sass => command.to_string(), + Tool::Sass => { + if cfg!(target_os = "windows") { + format!("{}.bat", command) + } else { + command.to_string() + } + }, }; if !bin_path.join(&command_file).is_file() { From 768a0426d8519073259f9e642bc0b44f75110f52 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Tue, 10 May 2022 10:31:02 +0800 Subject: [PATCH 108/330] Add `sass` support --- Cargo.toml | 2 ++ src/assets/dioxus.toml | 4 +--- src/builder.rs | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d2bda881f..c869267b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,8 @@ axum = { version = "0.5.1", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } headers = "0.3.7" +walkdir = "2" + # tools download dirs = "4.0.0" reqwest = { version = "0.11", features = ["rustls-tls", "stream", "trust-dns"] } diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 8f160b293..3e82e0c93 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -47,8 +47,6 @@ binaryen = { wasm_opt = true } # use sass auto will auto check sass file and build it. [application.tools.sass] -version = "1.51.0" - # if auto = true, we will check style array, and translate all sass file to css. auto = true @@ -56,5 +54,5 @@ auto = true files = [ # some sass file path # this file will translate to `/css/test.css` - "/css/test.sass" + "/css/test.scss" ] \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index f7f68e2bc..7c3a7e9fb 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1,6 +1,7 @@ use crate::{ config::{CrateConfig, ExecutableType}, error::{Error, Result}, + tools::Tool, DioxusConfig, }; use std::{ @@ -29,6 +30,10 @@ pub fn build(config: &CrateConfig) -> Result<()> { .. } = config; + + // start to build the assets + build_assets(config)?; + let t_start = std::time::Instant::now(); // [1] Build the .wasm module @@ -339,6 +344,49 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { html.replace("{app_title}", &title) } +// this function will build some assets file +// like sass tool resources +fn build_assets(config: &CrateConfig) -> Result<()> { + let dioxus_config = &config.dioxus_config; + let dioxus_tools = dioxus_config.application.tools.clone().unwrap_or_default(); + + // check sass tool state + let sass = Tool::Sass; + if sass.is_installed() && dioxus_tools.contains_key("sass") { + let sass_conf = dioxus_tools.get("sass").unwrap(); + if let Some(tab) = sass_conf.as_table() { + if tab.contains_key("auto") && tab.get("auto").unwrap().as_bool().unwrap_or(false) { + // if the sass open auto, we need auto-check the assets dir. + let asset_dir = config.asset_dir.clone(); + if asset_dir.is_dir() { + for entry in walkdir::WalkDir::new(asset_dir) + .into_iter() + .filter_map(|e| e.ok()) + { + let temp = entry.path(); + if temp.is_file() { + let suffix = temp.file_name().unwrap().to_str().unwrap(); + let suffix = suffix.split('.').collect::>(); + let suffix: &str = suffix.last().unwrap(); + if suffix == "scss" { + // if file suffix is `scss` we need transform it. + let temp_stem = temp.file_stem().unwrap().to_str().unwrap(); + let target_path = + temp.parent().unwrap().join(format!("{}.css", temp_stem)); + sass.call( + "sass", + vec![temp.to_str().unwrap(), target_path.to_str().unwrap()], + )?; + } + } + } + } + } + } + } + Ok(()) +} + // use binary_install::{Cache, Download}; // /// Attempts to find `wasm-opt` in `PATH` locally, or failing that downloads a From 8b06fe60596371118e47ef71a72627044c17672a Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Tue, 10 May 2022 13:46:53 +0800 Subject: [PATCH 109/330] Fixed sass tool --- src/assets/dioxus.toml | 4 ++-- src/builder.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 3e82e0c93..105251aa1 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -47,10 +47,10 @@ binaryen = { wasm_opt = true } # use sass auto will auto check sass file and build it. [application.tools.sass] -# if auto = true, we will check style array, and translate all sass file to css. +# auto will check the assets dirs, and auto to transform all scss file to css file. auto = true -# or you can specify some sass file -> css file +# you can specify some scss file -> css file files = [ # some sass file path # this file will translate to `/css/test.css` diff --git a/src/builder.rs b/src/builder.rs index 7c3a7e9fb..0e0cf7e9a 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -30,7 +30,6 @@ pub fn build(config: &CrateConfig) -> Result<()> { .. } = config; - // start to build the assets build_assets(config)?; @@ -359,20 +358,21 @@ fn build_assets(config: &CrateConfig) -> Result<()> { // if the sass open auto, we need auto-check the assets dir. let asset_dir = config.asset_dir.clone(); if asset_dir.is_dir() { - for entry in walkdir::WalkDir::new(asset_dir) + for entry in walkdir::WalkDir::new(&asset_dir) .into_iter() .filter_map(|e| e.ok()) { let temp = entry.path(); if temp.is_file() { - let suffix = temp.file_name().unwrap().to_str().unwrap(); - let suffix = suffix.split('.').collect::>(); - let suffix: &str = suffix.last().unwrap(); + let suffix = temp.extension().unwrap().to_str().unwrap(); if suffix == "scss" { // if file suffix is `scss` we need transform it. - let temp_stem = temp.file_stem().unwrap().to_str().unwrap(); - let target_path = - temp.parent().unwrap().join(format!("{}.css", temp_stem)); + let out_file = + format!("{}.css", temp.file_stem().unwrap().to_str().unwrap()); + let target_path = config + .out_dir + .join(temp.strip_prefix(&asset_dir).unwrap().parent().unwrap()) + .join(out_file); sass.call( "sass", vec![temp.to_str().unwrap(), target_path.to_str().unwrap()], From b5ecd09185062724415e9bf7b6b10d7e2c6860e8 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Tue, 10 May 2022 19:22:19 +0800 Subject: [PATCH 110/330] Add `files` list option --- src/assets/dioxus.toml | 2 +- src/builder.rs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 105251aa1..5f5032e2a 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -50,7 +50,7 @@ binaryen = { wasm_opt = true } # auto will check the assets dirs, and auto to transform all scss file to css file. auto = true -# you can specify some scss file -> css file +# or you can specify some scss file -> css file files = [ # some sass file path # this file will translate to `/css/test.css` diff --git a/src/builder.rs b/src/builder.rs index 0e0cf7e9a..fb0c8088d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -381,6 +381,28 @@ fn build_assets(config: &CrateConfig) -> Result<()> { } } } + } else if tab.contains_key("files") && tab.get("files").unwrap().is_array() { + // check files list. + let list = tab.get("files").unwrap().as_array().unwrap(); + for i in list { + if i.is_str() { + let path = i.as_str().unwrap(); + let path = PathBuf::from(path); + let path = config.asset_dir.join(path); + if path.is_file() { + sass.call( + "sass", + vec![ + path.to_str().unwrap(), + path.parent().unwrap().join(format!( + "{}.css", + path.file_stem().unwrap().to_str().unwrap() + )).to_str().unwrap(), + ], + )?; + } + } + } } } } From 551d2477ffcd84d13cfc4c5d15e1c8033a23a160 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Tue, 10 May 2022 22:32:47 +0800 Subject: [PATCH 111/330] Add `source_map` option --- src/assets/dioxus.toml | 4 +++- src/builder.rs | 30 +++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 5f5032e2a..b481193a8 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -55,4 +55,6 @@ files = [ # some sass file path # this file will translate to `/css/test.css` "/css/test.scss" -] \ No newline at end of file +] + +source_map = true \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index fb0c8088d..825a9eebf 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -354,6 +354,17 @@ fn build_assets(config: &CrateConfig) -> Result<()> { if sass.is_installed() && dioxus_tools.contains_key("sass") { let sass_conf = dioxus_tools.get("sass").unwrap(); if let Some(tab) = sass_conf.as_table() { + let source_map = tab.contains_key("source_map"); + let source_map = if source_map && tab.get("source_map").unwrap().is_bool() { + if tab.get("source_map").unwrap().as_bool().unwrap_or_default() { + "--source-map" + } else { + "--no-source-map" + } + } else { + "--no-source-map" + }; + if tab.contains_key("auto") && tab.get("auto").unwrap().as_bool().unwrap_or(false) { // if the sass open auto, we need auto-check the assets dir. let asset_dir = config.asset_dir.clone(); @@ -375,7 +386,11 @@ fn build_assets(config: &CrateConfig) -> Result<()> { .join(out_file); sass.call( "sass", - vec![temp.to_str().unwrap(), target_path.to_str().unwrap()], + vec![ + temp.to_str().unwrap(), + target_path.to_str().unwrap(), + source_map, + ], )?; } } @@ -394,10 +409,15 @@ fn build_assets(config: &CrateConfig) -> Result<()> { "sass", vec![ path.to_str().unwrap(), - path.parent().unwrap().join(format!( - "{}.css", - path.file_stem().unwrap().to_str().unwrap() - )).to_str().unwrap(), + path.parent() + .unwrap() + .join(format!( + "{}.css", + path.file_stem().unwrap().to_str().unwrap() + )) + .to_str() + .unwrap(), + source_map, ], )?; } From 9ddaa773d9ffa8d6274a2731dfdac00223f6b74d Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Tue, 10 May 2022 22:58:48 +0800 Subject: [PATCH 112/330] Remove `auto` option --- src/builder.rs | 111 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 38 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 825a9eebf..75c83990d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -362,48 +362,54 @@ fn build_assets(config: &CrateConfig) -> Result<()> { "--no-source-map" } } else { - "--no-source-map" + "--source-map" }; - if tab.contains_key("auto") && tab.get("auto").unwrap().as_bool().unwrap_or(false) { - // if the sass open auto, we need auto-check the assets dir. - let asset_dir = config.asset_dir.clone(); - if asset_dir.is_dir() { - for entry in walkdir::WalkDir::new(&asset_dir) - .into_iter() - .filter_map(|e| e.ok()) - { - let temp = entry.path(); - if temp.is_file() { - let suffix = temp.extension().unwrap().to_str().unwrap(); - if suffix == "scss" { - // if file suffix is `scss` we need transform it. - let out_file = - format!("{}.css", temp.file_stem().unwrap().to_str().unwrap()); - let target_path = config - .out_dir - .join(temp.strip_prefix(&asset_dir).unwrap().parent().unwrap()) - .join(out_file); - sass.call( - "sass", - vec![ - temp.to_str().unwrap(), - target_path.to_str().unwrap(), - source_map, - ], - )?; + if tab.contains_key("files") { + if tab.get("files").unwrap().is_str() { + let file = tab.get("files").unwrap().as_str().unwrap().trim(); + + if file == "*" { + // if the sass open auto, we need auto-check the assets dir. + let asset_dir = config.asset_dir.clone(); + if asset_dir.is_dir() { + for entry in walkdir::WalkDir::new(&asset_dir) + .into_iter() + .filter_map(|e| e.ok()) + { + let temp = entry.path(); + if temp.is_file() { + let suffix = temp.extension().unwrap().to_str().unwrap(); + if suffix == "scss" { + // if file suffix is `scss` we need transform it. + let out_file = format!( + "{}.css", + temp.file_stem().unwrap().to_str().unwrap() + ); + let target_path = config + .out_dir + .join( + temp.strip_prefix(&asset_dir) + .unwrap() + .parent() + .unwrap(), + ) + .join(out_file); + sass.call( + "sass", + vec![ + temp.to_str().unwrap(), + target_path.to_str().unwrap(), + source_map, + ], + )?; + } + } } } - } - } - } else if tab.contains_key("files") && tab.get("files").unwrap().is_array() { - // check files list. - let list = tab.get("files").unwrap().as_array().unwrap(); - for i in list { - if i.is_str() { - let path = i.as_str().unwrap(); - let path = PathBuf::from(path); - let path = config.asset_dir.join(path); + } else { + // just transform one file. + let path = config.asset_dir.join(file); if path.is_file() { sass.call( "sass", @@ -422,10 +428,39 @@ fn build_assets(config: &CrateConfig) -> Result<()> { )?; } } + } else if tab.get("files").unwrap().is_array() { + // check files list. + let list = tab.get("files").unwrap().as_array().unwrap(); + for i in list { + if i.is_str() { + let path = i.as_str().unwrap(); + let path = PathBuf::from(path); + let path = config.asset_dir.join(path); + if path.is_file() { + sass.call( + "sass", + vec![ + path.to_str().unwrap(), + path.parent() + .unwrap() + .join(format!( + "{}.css", + path.file_stem().unwrap().to_str().unwrap() + )) + .to_str() + .unwrap(), + source_map, + ], + )?; + } + } + } } } } } + // SASS END + Ok(()) } From ecb846dd24d34c0827bfa3503048bf97a8389fda Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Tue, 10 May 2022 23:00:39 +0800 Subject: [PATCH 113/330] Rename `files` to `input` --- src/assets/dioxus.toml | 12 ++++++------ src/builder.rs | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index b481193a8..a5e849bfb 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -48,13 +48,13 @@ binaryen = { wasm_opt = true } [application.tools.sass] # auto will check the assets dirs, and auto to transform all scss file to css file. -auto = true +input = "*" # or you can specify some scss file -> css file -files = [ - # some sass file path - # this file will translate to `/css/test.css` - "/css/test.scss" -] +# input = [ +# # some sass file path +# # this file will translate to `/css/test.css` +# "/css/test.scss" +# ] source_map = true \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index 75c83990d..f9f0bd9bd 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -365,9 +365,9 @@ fn build_assets(config: &CrateConfig) -> Result<()> { "--source-map" }; - if tab.contains_key("files") { - if tab.get("files").unwrap().is_str() { - let file = tab.get("files").unwrap().as_str().unwrap().trim(); + if tab.contains_key("input") { + if tab.get("input").unwrap().is_str() { + let file = tab.get("input").unwrap().as_str().unwrap().trim(); if file == "*" { // if the sass open auto, we need auto-check the assets dir. @@ -428,9 +428,9 @@ fn build_assets(config: &CrateConfig) -> Result<()> { )?; } } - } else if tab.get("files").unwrap().is_array() { + } else if tab.get("input").unwrap().is_array() { // check files list. - let list = tab.get("files").unwrap().as_array().unwrap(); + let list = tab.get("input").unwrap().as_array().unwrap(); for i in list { if i.is_str() { let path = i.as_str().unwrap(); From bf49d526d773cc87449ac343659609c52890f0ac Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 11 May 2022 00:27:37 +0800 Subject: [PATCH 114/330] Fixed some problem --- src/builder.rs | 13 ++++++++++++- src/tools.rs | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index f9f0bd9bd..77f0838f0 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -409,7 +409,13 @@ fn build_assets(config: &CrateConfig) -> Result<()> { } } else { // just transform one file. - let path = config.asset_dir.join(file); + let path = if &file[0..] == "/" { + &file[1..file.len() - 1] + } else { + file + }; + let path = PathBuf::from(path); + let path = config.asset_dir.join(path); if path.is_file() { sass.call( "sass", @@ -434,6 +440,11 @@ fn build_assets(config: &CrateConfig) -> Result<()> { for i in list { if i.is_str() { let path = i.as_str().unwrap(); + let path = if &path[0..] == "/" { + &path[1..path.len() - 1] + } else { + path + }; let path = PathBuf::from(path); let path = config.asset_dir.join(path); if path.is_file() { diff --git a/src/tools.rs b/src/tools.rs index ae4e58b79..2952a9614 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -207,7 +207,7 @@ impl Tool { } else { command.to_string() } - }, + } }; if !bin_path.join(&command_file).is_file() { @@ -232,7 +232,7 @@ fn extract_zip(file: &Path, target: &Path) -> anyhow::Result<()> { if !target.exists() { let _ = std::fs::create_dir_all(target)?; } - + for i in 0..zip.len() { let mut file = zip.by_index(i)?; if file.is_dir() { @@ -252,4 +252,4 @@ fn extract_zip(file: &Path, target: &Path) -> anyhow::Result<()> { } Ok(()) -} +} \ No newline at end of file From c6aa4e332df58c223416fafc62e729574ff8c564 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 11 May 2022 10:01:02 +0800 Subject: [PATCH 115/330] Ignore `scss` file in out_dir --- src/builder.rs | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 77f0838f0..25d087191 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -31,7 +31,7 @@ pub fn build(config: &CrateConfig) -> Result<()> { } = config; // start to build the assets - build_assets(config)?; + let ignore_files = build_assets(config)?; let t_start = std::time::Instant::now(); @@ -158,6 +158,13 @@ pub fn build(config: &CrateConfig) -> Result<()> { log::warn!("Error copying dir: {}", _e); } } + for ignore in &ignore_files { + let ignore = ignore.strip_prefix(&config.asset_dir).unwrap(); + let ignore = config.out_dir.join(ignore); + if ignore.is_file() { + std::fs::remove_file(ignore)?; + } + } } } } @@ -345,7 +352,11 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { // this function will build some assets file // like sass tool resources -fn build_assets(config: &CrateConfig) -> Result<()> { +// this function will return a array which file don't need copy to out_dir. +fn build_assets(config: &CrateConfig) -> Result> { + + let mut result = vec![]; + let dioxus_config = &config.dioxus_config; let dioxus_tools = dioxus_config.application.tools.clone().unwrap_or_default(); @@ -395,14 +406,17 @@ fn build_assets(config: &CrateConfig) -> Result<()> { .unwrap(), ) .join(out_file); - sass.call( + let res = sass.call( "sass", vec![ temp.to_str().unwrap(), target_path.to_str().unwrap(), source_map, ], - )?; + ); + if res.is_ok() { + result.push(temp.to_path_buf()); + } } } } @@ -417,7 +431,7 @@ fn build_assets(config: &CrateConfig) -> Result<()> { let path = PathBuf::from(path); let path = config.asset_dir.join(path); if path.is_file() { - sass.call( + let res = sass.call( "sass", vec![ path.to_str().unwrap(), @@ -431,7 +445,10 @@ fn build_assets(config: &CrateConfig) -> Result<()> { .unwrap(), source_map, ], - )?; + ); + if res.is_ok() { + result.push(path); + } } } } else if tab.get("input").unwrap().is_array() { @@ -448,7 +465,7 @@ fn build_assets(config: &CrateConfig) -> Result<()> { let path = PathBuf::from(path); let path = config.asset_dir.join(path); if path.is_file() { - sass.call( + let res = sass.call( "sass", vec![ path.to_str().unwrap(), @@ -462,7 +479,10 @@ fn build_assets(config: &CrateConfig) -> Result<()> { .unwrap(), source_map, ], - )?; + ); + if res.is_ok() { + result.push(path); + } } } } @@ -472,7 +492,7 @@ fn build_assets(config: &CrateConfig) -> Result<()> { } // SASS END - Ok(()) + Ok(result) } // use binary_install::{Cache, Download}; From dccd82091a0b499527cd435fccf1a088262235e1 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 11 May 2022 11:12:23 +0800 Subject: [PATCH 116/330] Fixed `input` option error --- src/builder.rs | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 25d087191..e1ed0a8f1 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -354,7 +354,6 @@ pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { // like sass tool resources // this function will return a array which file don't need copy to out_dir. fn build_assets(config: &CrateConfig) -> Result> { - let mut result = vec![]; let dioxus_config = &config.dioxus_config; @@ -430,19 +429,23 @@ fn build_assets(config: &CrateConfig) -> Result> { }; let path = PathBuf::from(path); let path = config.asset_dir.join(path); + let out_file = + format!("{}.css", path.file_stem().unwrap().to_str().unwrap()); + let target_path = config + .out_dir + .join( + path.strip_prefix(&config.asset_dir) + .unwrap() + .parent() + .unwrap(), + ) + .join(out_file); if path.is_file() { let res = sass.call( "sass", vec![ path.to_str().unwrap(), - path.parent() - .unwrap() - .join(format!( - "{}.css", - path.file_stem().unwrap().to_str().unwrap() - )) - .to_str() - .unwrap(), + target_path.to_str().unwrap(), source_map, ], ); @@ -464,19 +467,23 @@ fn build_assets(config: &CrateConfig) -> Result> { }; let path = PathBuf::from(path); let path = config.asset_dir.join(path); + let out_file = + format!("{}.css", path.file_stem().unwrap().to_str().unwrap()); + let target_path = config + .out_dir + .join( + path.strip_prefix(&config.asset_dir) + .unwrap() + .parent() + .unwrap(), + ) + .join(out_file); if path.is_file() { let res = sass.call( "sass", vec![ path.to_str().unwrap(), - path.parent() - .unwrap() - .join(format!( - "{}.css", - path.file_stem().unwrap().to_str().unwrap() - )) - .to_str() - .unwrap(), + target_path.to_str().unwrap(), source_map, ], ); From 065da8db6589a1c745392b3973bae127ebecb183 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 11 May 2022 11:14:49 +0800 Subject: [PATCH 117/330] Add `sass` desktop build support --- src/builder.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/builder.rs b/src/builder.rs index e1ed0a8f1..ae6e83605 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -177,6 +177,8 @@ pub fn build(config: &CrateConfig) -> Result<()> { pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { log::info!("🚅 Running build [Desktop] command..."); + let ignore_files = build_assets(config)?; + let mut cmd = Command::new("cargo"); cmd.current_dir(&config.crate_dir) .arg("build") @@ -261,6 +263,13 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { log::warn!("Error copying dir: {}", e); } } + for ignore in &ignore_files { + let ignore = ignore.strip_prefix(&config.asset_dir).unwrap(); + let ignore = config.out_dir.join(ignore); + if ignore.is_file() { + std::fs::remove_file(ignore)?; + } + } } } } From 60bb0d9eb9f6a6e10267df85840914afa04d460b Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 11 May 2022 11:15:33 +0800 Subject: [PATCH 118/330] Format code --- src/cli/tool/mod.rs | 2 +- src/tools.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/tool/mod.rs b/src/cli/tool/mod.rs index 45c866c40..fde94b29a 100644 --- a/src/cli/tool/mod.rs +++ b/src/cli/tool/mod.rs @@ -27,7 +27,7 @@ impl Tool { } } Tool::AppPath {} => { - if let Some(v) = tools::tools_path().to_str() { + if let Some(v) = tools::tools_path().to_str() { println!("{}", v); } else { log::error!("Tools path get failed."); diff --git a/src/tools.rs b/src/tools.rs index 2952a9614..2ab358d6b 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -252,4 +252,4 @@ fn extract_zip(file: &Path, target: &Path) -> anyhow::Result<()> { } Ok(()) -} \ No newline at end of file +} From cb650bad8a726c50eacdf8d29669532a5fb75c42 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 11 May 2022 11:47:49 +0800 Subject: [PATCH 119/330] Fixed some problem --- src/builder.rs | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index ae6e83605..8f3823a65 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -431,24 +431,19 @@ fn build_assets(config: &CrateConfig) -> Result> { } } else { // just transform one file. - let path = if &file[0..] == "/" { - &file[1..file.len() - 1] + let relative_path = if &file[0..1] == "/" { + &file[1..file.len()] } else { file }; - let path = PathBuf::from(path); - let path = config.asset_dir.join(path); + let path = config.asset_dir.join(relative_path); let out_file = format!("{}.css", path.file_stem().unwrap().to_str().unwrap()); let target_path = config .out_dir - .join( - path.strip_prefix(&config.asset_dir) - .unwrap() - .parent() - .unwrap(), - ) + .join(PathBuf::from(relative_path).parent().unwrap()) .join(out_file); + println!("{:?} -- {:?}", target_path, path); if path.is_file() { let res = sass.call( "sass", @@ -460,6 +455,8 @@ fn build_assets(config: &CrateConfig) -> Result> { ); if res.is_ok() { result.push(path); + } else { + log::error!("{:?}", res); } } } @@ -469,23 +466,17 @@ fn build_assets(config: &CrateConfig) -> Result> { for i in list { if i.is_str() { let path = i.as_str().unwrap(); - let path = if &path[0..] == "/" { - &path[1..path.len() - 1] + let relative_path = if &path[0..1] == "/" { + &path[1..path.len()] } else { path }; - let path = PathBuf::from(path); - let path = config.asset_dir.join(path); + let path = config.asset_dir.join(relative_path); let out_file = format!("{}.css", path.file_stem().unwrap().to_str().unwrap()); let target_path = config .out_dir - .join( - path.strip_prefix(&config.asset_dir) - .unwrap() - .parent() - .unwrap(), - ) + .join(PathBuf::from(relative_path).parent().unwrap()) .join(out_file); if path.is_file() { let res = sass.call( From 7f829c4553eaf45eda2e9c7964ba28cac63723cb Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 11 May 2022 11:50:01 +0800 Subject: [PATCH 120/330] Format code --- src/builder.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index 8f3823a65..e0d3ac285 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -443,7 +443,6 @@ fn build_assets(config: &CrateConfig) -> Result> { .out_dir .join(PathBuf::from(relative_path).parent().unwrap()) .join(out_file); - println!("{:?} -- {:?}", target_path, path); if path.is_file() { let res = sass.call( "sass", From cc56dd19ddbdaf9578ee6f56df7a354bbd2d3bc6 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Thu, 12 May 2022 00:11:51 +0800 Subject: [PATCH 121/330] Add `sass` file extension --- src/builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index e0d3ac285..cdb431933 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -399,8 +399,8 @@ fn build_assets(config: &CrateConfig) -> Result> { let temp = entry.path(); if temp.is_file() { let suffix = temp.extension().unwrap().to_str().unwrap(); - if suffix == "scss" { - // if file suffix is `scss` we need transform it. + if suffix == "scss" || suffix == "sass" { + // if file suffix is `scss` / `sass` we need transform it. let out_file = format!( "{}.css", temp.file_stem().unwrap().to_str().unwrap() From 87e6ed0a3d13dfb023c185a249ceee3a7a22d9e8 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Thu, 12 May 2022 22:49:27 +0800 Subject: [PATCH 122/330] Fixed builder problem --- src/builder.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index cdb431933..4f6824780 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -398,7 +398,9 @@ fn build_assets(config: &CrateConfig) -> Result> { { let temp = entry.path(); if temp.is_file() { - let suffix = temp.extension().unwrap().to_str().unwrap(); + let suffix = temp.extension(); + if suffix.is_none() { continue; } + let suffix = suffix.unwrap().to_str().unwrap(); if suffix == "scss" || suffix == "sass" { // if file suffix is `scss` / `sass` we need transform it. let out_file = format!( From 51639af48230bb8a4bb7b50105c1bcd270ac0774 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Mon, 6 Jun 2022 00:16:15 +0800 Subject: [PATCH 123/330] feat: add `profile` flag --- src/builder.rs | 5 +++++ src/cli/build/mod.rs | 4 ++++ src/cli/cfg.rs | 8 ++++++++ src/cli/serve/mod.rs | 4 ++++ src/config.rs | 9 +++++++++ 5 files changed, 30 insertions(+) diff --git a/src/builder.rs b/src/builder.rs index 4f6824780..31bb96f46 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -49,6 +49,11 @@ pub fn build(config: &CrateConfig) -> Result<()> { cmd.arg("--release"); } + if config.custom_profile.is_some() { + let custom_profile = config.custom_profile.as_ref().unwrap(); + cmd.arg(format!("--profile {}", custom_profile)); + } + match executable { ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 4c043091f..7f8c7b420 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -19,6 +19,10 @@ impl Build { crate_config.as_example(self.build.example.unwrap()); } + if self.build.profile.is_some() { + crate_config.set_profile(self.build.profile.unwrap()); + } + let platform = self.build.platform.unwrap_or_else(|| { crate_config .dioxus_config diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index f5ee45b87..11a1603c7 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -16,6 +16,10 @@ pub struct ConfigOptsBuild { #[clap(long)] pub example: Option, + /// Build with custom profile + #[clap(long)] + pub profile: Option, + /// Build platform: support Web & Desktop [default: "default_platform"] #[clap(long)] pub platform: Option, @@ -36,6 +40,10 @@ pub struct ConfigOptsServe { #[serde(default)] pub release: bool, + /// Build with custom profile + #[clap(long)] + pub profile: Option, + /// Build platform: support Web & Desktop [default: "default_platform"] #[clap(long)] pub platform: Option, diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 85bd92c74..1b79284b7 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -24,6 +24,10 @@ impl Serve { crate_config.as_example(self.serve.example.unwrap()); } + if self.serve.profile.is_some() { + crate_config.set_profile(self.serve.profile.unwrap()); + } + let platform = self.serve.platform.unwrap_or_else(|| { crate_config .dioxus_config diff --git a/src/config.rs b/src/config.rs index 783c72ccd..9679fadaa 100644 --- a/src/config.rs +++ b/src/config.rs @@ -114,6 +114,7 @@ pub struct CrateConfig { pub executable: ExecutableType, pub dioxus_config: DioxusConfig, pub release: bool, + pub custom_profile: Option, } #[derive(Debug, Clone)] @@ -163,6 +164,8 @@ impl CrateConfig { let release = false; + let custom_profile = None; + Ok(Self { out_dir, crate_dir, @@ -173,6 +176,7 @@ impl CrateConfig { executable, release, dioxus_config, + custom_profile, }) } @@ -186,6 +190,11 @@ impl CrateConfig { self } + pub fn set_profile(&mut self, profile: String) -> &mut Self { + self.custom_profile = Some(profile); + self + } + // pub fn with_build_options(&mut self, options: &BuildOptions) { // if let Some(name) = &options.example { // self.as_example(name.clone()); From 6aa609144d4b8dde995749ad2de4aaa8d69f16f4 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Mon, 6 Jun 2022 08:46:16 +0800 Subject: [PATCH 124/330] feat: add `profile` flag --- src/builder.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index 31bb96f46..57738b1bc 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -51,7 +51,8 @@ pub fn build(config: &CrateConfig) -> Result<()> { if config.custom_profile.is_some() { let custom_profile = config.custom_profile.as_ref().unwrap(); - cmd.arg(format!("--profile {}", custom_profile)); + cmd.arg("--profile"); + cmd.arg(custom_profile); } match executable { @@ -194,6 +195,12 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { cmd.arg("--release"); } + if config.custom_profile.is_some() { + let custom_profile = config.custom_profile.as_ref().unwrap(); + cmd.arg("--profile"); + cmd.arg(custom_profile); + } + match &config.executable { crate::ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), crate::ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), From d20e7ab50815014e67871ec2227413a085762690 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Mon, 6 Jun 2022 18:18:22 +0800 Subject: [PATCH 125/330] feat: add `features` flag --- src/builder.rs | 12 ++++++++++++ src/cli/cfg.rs | 8 ++++++++ src/config.rs | 9 ++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index 57738b1bc..46d4c15f5 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -55,6 +55,12 @@ pub fn build(config: &CrateConfig) -> Result<()> { cmd.arg(custom_profile); } + if config.features.is_some() { + let features_str = config.features.as_ref().unwrap().join(" "); + cmd.arg("--features"); + cmd.arg(features_str); + } + match executable { ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), @@ -201,6 +207,12 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { cmd.arg(custom_profile); } + if config.features.is_some() { + let features_str = config.features.as_ref().unwrap().join(" "); + cmd.arg("--features"); + cmd.arg(features_str); + } + match &config.executable { crate::ExecutableType::Binary(name) => cmd.arg("--bin").arg(name), crate::ExecutableType::Lib(name) => cmd.arg("--lib").arg(name), diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 11a1603c7..b8305e3a8 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -23,6 +23,10 @@ pub struct ConfigOptsBuild { /// Build platform: support Web & Desktop [default: "default_platform"] #[clap(long)] pub platform: Option, + + /// Space separated list of features to activate + #[clap(long)] + pub features: Option>, } #[derive(Clone, Debug, Default, Deserialize, Parser)] @@ -47,6 +51,10 @@ pub struct ConfigOptsServe { /// Build platform: support Web & Desktop [default: "default_platform"] #[clap(long)] pub platform: Option, + + /// Space separated list of features to activate + #[clap(long)] + pub features: Option>, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/src/config.rs b/src/config.rs index 9679fadaa..6804ae6cd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -115,6 +115,7 @@ pub struct CrateConfig { pub dioxus_config: DioxusConfig, pub release: bool, pub custom_profile: Option, + pub features: Option>, } #[derive(Debug, Clone)] @@ -163,8 +164,8 @@ impl CrateConfig { let executable = ExecutableType::Binary(output_filename); let release = false; - let custom_profile = None; + let features = None; Ok(Self { out_dir, @@ -177,6 +178,7 @@ impl CrateConfig { release, dioxus_config, custom_profile, + features }) } @@ -195,6 +197,11 @@ impl CrateConfig { self } + pub fn set_features(&mut self, features: Vec) -> &mut Self { + self.features = Some(features); + self + } + // pub fn with_build_options(&mut self, options: &BuildOptions) { // if let Some(name) = &options.example { // self.as_example(name.clone()); From 421d2ed2980d4e4d542f1b7b28c31e9ca279a563 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Mon, 6 Jun 2022 21:48:14 +0800 Subject: [PATCH 126/330] feat: add `verbose` flag --- src/builder.rs | 6 ++++++ src/cli/build/mod.rs | 1 + src/cli/cfg.rs | 10 ++++++++++ src/cli/serve/mod.rs | 1 + src/config.rs | 10 +++++++++- 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index 46d4c15f5..02add84ad 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -48,6 +48,9 @@ pub fn build(config: &CrateConfig) -> Result<()> { if config.release { cmd.arg("--release"); } + if config.verbose { + cmd.arg("--verbose"); + } if config.custom_profile.is_some() { let custom_profile = config.custom_profile.as_ref().unwrap(); @@ -200,6 +203,9 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { if config.release { cmd.arg("--release"); } + if config.verbose { + cmd.arg("--verbose"); + } if config.custom_profile.is_some() { let custom_profile = config.custom_profile.as_ref().unwrap(); diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 7f8c7b420..661f17a5a 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -14,6 +14,7 @@ impl Build { // change the release state. crate_config.with_release(self.build.release); + crate_config.with_verbose(self.build.verbose); if self.build.example.is_some() { crate_config.as_example(self.build.example.unwrap()); diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index b8305e3a8..26409c370 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -12,6 +12,11 @@ pub struct ConfigOptsBuild { #[serde(default)] pub release: bool, + // Use verbose output [default: false] + #[clap(long)] + #[serde(default)] + pub verbose: bool, + /// Build a example [default: ""] #[clap(long)] pub example: Option, @@ -44,6 +49,11 @@ pub struct ConfigOptsServe { #[serde(default)] pub release: bool, + // Use verbose output [default: false] + #[clap(long)] + #[serde(default)] + pub verbose: bool, + /// Build with custom profile #[clap(long)] pub profile: Option, diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 1b79284b7..d25aa5bad 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -19,6 +19,7 @@ impl Serve { // change the relase state. crate_config.with_release(self.serve.release); + crate_config.with_verbose(self.serve.verbose); if self.serve.example.is_some() { crate_config.as_example(self.serve.example.unwrap()); diff --git a/src/config.rs b/src/config.rs index 6804ae6cd..6e855002b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -114,6 +114,7 @@ pub struct CrateConfig { pub executable: ExecutableType, pub dioxus_config: DioxusConfig, pub release: bool, + pub verbose: bool, pub custom_profile: Option, pub features: Option>, } @@ -164,6 +165,7 @@ impl CrateConfig { let executable = ExecutableType::Binary(output_filename); let release = false; + let verbose = false; let custom_profile = None; let features = None; @@ -178,7 +180,8 @@ impl CrateConfig { release, dioxus_config, custom_profile, - features + features, + verbose, }) } @@ -192,6 +195,11 @@ impl CrateConfig { self } + pub fn with_verbose(&mut self, verbose: bool) -> &mut Self { + self.verbose = verbose; + self + } + pub fn set_profile(&mut self, profile: String) -> &mut Self { self.custom_profile = Some(profile); self From 49b3ef83d33932bb8ee0e15f128f737994ef902a Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 9 Jun 2022 09:37:26 -0500 Subject: [PATCH 127/330] create websocket to update rsx and report errors back --- Cargo.toml | 5 + src/hot_reload/mod.rs | 614 ++++++++++++++++++++++++++++++++++++++++++ src/lib.rs | 3 + src/server/mod.rs | 174 ++++++++++-- 4 files changed, 770 insertions(+), 26 deletions(-) create mode 100644 src/hot_reload/mod.rs diff --git a/Cargo.toml b/Cargo.toml index 21e2dad7e..4acd41463 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,11 @@ flate2 = "1.0.22" tar = "0.4.38" tower = "0.4.12" +# hot reload +syn = "1.0" +dioxus-rsx-interpreter = { path = "../dioxus/packages/rsx_interpreter" } +proc-macro2 = { version = "1.0", features = ["span-locations"] } + [[bin]] path = "src/main.rs" name = "dioxus" diff --git a/src/hot_reload/mod.rs b/src/hot_reload/mod.rs new file mode 100644 index 000000000..d70cda29e --- /dev/null +++ b/src/hot_reload/mod.rs @@ -0,0 +1,614 @@ +use dioxus_rsx::{BodyNode, CallBody}; +use proc_macro2::TokenStream; +use syn::{File, Macro}; + +pub enum DiffResult { + CodeChanged, + RsxChanged(Vec<(Macro, TokenStream)>), +} + +pub fn find_rsx(new: &File, old: &File) -> DiffResult { + let mut rsx_calls = Vec::new(); + if new.items.len() != old.items.len() { + return DiffResult::CodeChanged; + } + for (new, old) in new.items.iter().zip(old.items.iter()) { + if find_rsx_item(new, old, &mut rsx_calls) { + return DiffResult::CodeChanged; + } + } + DiffResult::RsxChanged(rsx_calls) +} + +fn find_rsx_item( + new: &syn::Item, + old: &syn::Item, + rsx_calls: &mut Vec<(Macro, TokenStream)>, +) -> bool { + match (new, old) { + (syn::Item::Const(new_item), syn::Item::Const(old_item)) => { + find_rsx_expr(&new_item.expr, &old_item.expr, rsx_calls) + || new_item.attrs != old_item.attrs + || new_item.vis != old_item.vis + || new_item.const_token != old_item.const_token + || new_item.ident != old_item.ident + || new_item.colon_token != old_item.colon_token + || new_item.ty != old_item.ty + || new_item.eq_token != old_item.eq_token + || new_item.semi_token != old_item.semi_token + } + (syn::Item::Enum(new_item), syn::Item::Enum(old_item)) => { + if new_item.variants.len() != old_item.variants.len() { + return true; + } + for (new_varient, old_varient) in new_item.variants.iter().zip(old_item.variants.iter()) + { + match (&new_varient.discriminant, &old_varient.discriminant) { + (Some((new_eq, new_expr)), Some((old_eq, old_expr))) => { + if find_rsx_expr(new_expr, old_expr, rsx_calls) || new_eq != old_eq { + return true; + } + } + (None, None) => (), + _ => return true, + } + if new_varient.attrs != old_varient.attrs + || new_varient.ident != old_varient.ident + || new_varient.fields != old_varient.fields + { + return true; + } + } + new_item.attrs != old_item.attrs + || new_item.vis != old_item.vis + || new_item.enum_token != old_item.enum_token + || new_item.ident != old_item.ident + || new_item.generics != old_item.generics + || new_item.brace_token != old_item.brace_token + } + (syn::Item::ExternCrate(new_item), syn::Item::ExternCrate(old_item)) => { + old_item != new_item + } + (syn::Item::Fn(new_item), syn::Item::Fn(old_item)) => { + find_rsx_block(&new_item.block, &old_item.block, rsx_calls) + || new_item.attrs != old_item.attrs + || new_item.vis != old_item.vis + || new_item.sig != old_item.sig + } + (syn::Item::ForeignMod(new_item), syn::Item::ForeignMod(old_item)) => old_item != new_item, + (syn::Item::Impl(new_item), syn::Item::Impl(old_item)) => { + if new_item.items.len() != old_item.items.len() { + return true; + } + for (new_item, old_item) in new_item.items.iter().zip(old_item.items.iter()) { + if match (new_item, old_item) { + (syn::ImplItem::Const(new_item), syn::ImplItem::Const(old_item)) => { + find_rsx_expr(&new_item.expr, &old_item.expr, rsx_calls) + } + (syn::ImplItem::Method(new_item), syn::ImplItem::Method(old_item)) => { + find_rsx_block(&new_item.block, &old_item.block, rsx_calls) + } + (syn::ImplItem::Type(new_item), syn::ImplItem::Type(old_item)) => { + old_item != new_item + } + (syn::ImplItem::Macro(new_item), syn::ImplItem::Macro(old_item)) => { + old_item != new_item + } + _ => true, + } { + return true; + } + } + new_item.attrs != old_item.attrs + || new_item.defaultness != old_item.defaultness + || new_item.unsafety != old_item.unsafety + || new_item.impl_token != old_item.impl_token + || new_item.generics != old_item.generics + || new_item.trait_ != old_item.trait_ + || new_item.self_ty != old_item.self_ty + || new_item.brace_token != old_item.brace_token + } + (syn::Item::Macro(new_item), syn::Item::Macro(old_item)) => old_item != new_item, + (syn::Item::Macro2(new_item), syn::Item::Macro2(old_item)) => old_item != new_item, + (syn::Item::Mod(new_item), syn::Item::Mod(old_item)) => { + match (&new_item.content, &old_item.content) { + (Some((_, new_items)), Some((_, old_items))) => { + if new_items.len() != old_items.len() { + return true; + } + for (new_item, old_item) in new_items.iter().zip(old_items.iter()) { + if find_rsx_item(new_item, old_item, rsx_calls) { + return true; + } + } + new_item.attrs != old_item.attrs + || new_item.vis != old_item.vis + || new_item.mod_token != old_item.mod_token + || new_item.ident != old_item.ident + || new_item.semi != old_item.semi + } + (None, None) => { + new_item.attrs != old_item.attrs + || new_item.vis != old_item.vis + || new_item.mod_token != old_item.mod_token + || new_item.ident != old_item.ident + || new_item.semi != old_item.semi + } + _ => true, + } + } + (syn::Item::Static(new_item), syn::Item::Static(old_item)) => { + find_rsx_expr(&new_item.expr, &old_item.expr, rsx_calls) + || new_item.attrs != old_item.attrs + || new_item.vis != old_item.vis + || new_item.static_token != old_item.static_token + || new_item.mutability != old_item.mutability + || new_item.ident != old_item.ident + || new_item.colon_token != old_item.colon_token + || new_item.ty != old_item.ty + || new_item.eq_token != old_item.eq_token + || new_item.semi_token != old_item.semi_token + } + (syn::Item::Struct(new_item), syn::Item::Struct(old_item)) => old_item != new_item, + (syn::Item::Trait(new_item), syn::Item::Trait(old_item)) => { + find_rsx_trait(new_item, old_item, rsx_calls) + } + (syn::Item::TraitAlias(new_item), syn::Item::TraitAlias(old_item)) => old_item != new_item, + (syn::Item::Type(new_item), syn::Item::Type(old_item)) => old_item != new_item, + (syn::Item::Union(new_item), syn::Item::Union(old_item)) => old_item != new_item, + (syn::Item::Use(new_item), syn::Item::Use(old_item)) => old_item != new_item, + (syn::Item::Verbatim(_), syn::Item::Verbatim(_)) => false, + _ => return true, + } +} + +fn find_rsx_trait( + new_item: &syn::ItemTrait, + old_item: &syn::ItemTrait, + rsx_calls: &mut Vec<(Macro, TokenStream)>, +) -> bool { + if new_item.items.len() != old_item.items.len() { + return true; + } + for (new_item, old_item) in new_item.items.iter().zip(old_item.items.iter()) { + if match (new_item, old_item) { + (syn::TraitItem::Const(new_item), syn::TraitItem::Const(old_item)) => { + if let (Some((_, new_expr)), Some((_, old_expr))) = + (&new_item.default, &old_item.default) + { + find_rsx_expr(new_expr, old_expr, rsx_calls) + } else { + true + } + } + (syn::TraitItem::Method(new_item), syn::TraitItem::Method(old_item)) => { + if let (Some(new_block), Some(old_block)) = (&new_item.default, &old_item.default) { + find_rsx_block(new_block, old_block, rsx_calls) + } else { + true + } + } + (syn::TraitItem::Type(new_item), syn::TraitItem::Type(old_item)) => { + old_item != new_item + } + (syn::TraitItem::Macro(new_item), syn::TraitItem::Macro(old_item)) => { + old_item != new_item + } + _ => true, + } { + return true; + } + } + new_item.attrs != old_item.attrs + || new_item.vis != old_item.vis + || new_item.unsafety != old_item.unsafety + || new_item.auto_token != old_item.auto_token + || new_item.ident != old_item.ident + || new_item.generics != old_item.generics + || new_item.colon_token != old_item.colon_token + || new_item.supertraits != old_item.supertraits + || new_item.brace_token != old_item.brace_token +} + +fn find_rsx_block( + new_block: &syn::Block, + old_block: &syn::Block, + rsx_calls: &mut Vec<(Macro, TokenStream)>, +) -> bool { + if new_block.stmts.len() != old_block.stmts.len() { + return true; + } + for (new_stmt, old_stmt) in new_block.stmts.iter().zip(old_block.stmts.iter()) { + if find_rsx_stmt(new_stmt, old_stmt, rsx_calls) { + return true; + } + } + new_block.brace_token != old_block.brace_token +} + +fn find_rsx_stmt( + new_stmt: &syn::Stmt, + old_stmt: &syn::Stmt, + rsx_calls: &mut Vec<(Macro, TokenStream)>, +) -> bool { + match (new_stmt, old_stmt) { + (syn::Stmt::Local(new_local), syn::Stmt::Local(old_local)) => { + (match (&new_local.init, &old_local.init) { + (Some((new_eq, new_expr)), Some((old_eq, old_expr))) => { + find_rsx_expr(new_expr, old_expr, rsx_calls) || new_eq != old_eq + } + (None, None) => false, + _ => true, + } || new_local.attrs != old_local.attrs + || new_local.let_token != old_local.let_token + || new_local.pat != old_local.pat + || new_local.semi_token != old_local.semi_token) + } + (syn::Stmt::Item(new_item), syn::Stmt::Item(old_item)) => { + find_rsx_item(new_item, old_item, rsx_calls) + } + (syn::Stmt::Expr(new_expr), syn::Stmt::Expr(old_expr)) => { + find_rsx_expr(new_expr, old_expr, rsx_calls) + } + (syn::Stmt::Semi(new_expr, new_semi), syn::Stmt::Semi(old_expr, old_semi)) => { + find_rsx_expr(new_expr, old_expr, rsx_calls) || new_semi != old_semi + } + _ => true, + } +} + +fn find_rsx_expr( + new_expr: &syn::Expr, + old_expr: &syn::Expr, + rsx_calls: &mut Vec<(Macro, TokenStream)>, +) -> bool { + match (new_expr, old_expr) { + (syn::Expr::Array(new_expr), syn::Expr::Array(old_expr)) => { + if new_expr.elems.len() != old_expr.elems.len() { + return true; + } + for (new_el, old_el) in new_expr.elems.iter().zip(old_expr.elems.iter()) { + if find_rsx_expr(new_el, old_el, rsx_calls) { + return true; + } + } + new_expr.attrs != old_expr.attrs || new_expr.bracket_token != old_expr.bracket_token + } + (syn::Expr::Assign(new_expr), syn::Expr::Assign(old_expr)) => { + find_rsx_expr(&new_expr.left, &old_expr.left, rsx_calls) + || find_rsx_expr(&new_expr.right, &old_expr.right, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.eq_token != old_expr.eq_token + } + (syn::Expr::AssignOp(new_expr), syn::Expr::AssignOp(old_expr)) => { + find_rsx_expr(&new_expr.left, &old_expr.left, rsx_calls) + || find_rsx_expr(&new_expr.right, &old_expr.right, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.op != old_expr.op + } + (syn::Expr::Async(new_expr), syn::Expr::Async(old_expr)) => { + find_rsx_block(&new_expr.block, &old_expr.block, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.async_token != old_expr.async_token + || new_expr.capture != old_expr.capture + } + (syn::Expr::Await(new_expr), syn::Expr::Await(old_expr)) => { + find_rsx_expr(&new_expr.base, &old_expr.base, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.dot_token != old_expr.dot_token + || new_expr.await_token != old_expr.await_token + } + (syn::Expr::Binary(new_expr), syn::Expr::Binary(old_expr)) => { + find_rsx_expr(&new_expr.left, &old_expr.left, rsx_calls) + || find_rsx_expr(&new_expr.right, &old_expr.right, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.op != old_expr.op + } + (syn::Expr::Block(new_expr), syn::Expr::Block(old_expr)) => { + find_rsx_block(&new_expr.block, &old_expr.block, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.label != old_expr.label + } + (syn::Expr::Box(new_expr), syn::Expr::Box(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.box_token != old_expr.box_token + } + (syn::Expr::Break(new_expr), syn::Expr::Break(old_expr)) => { + match (&new_expr.expr, &old_expr.expr) { + (Some(new_inner), Some(old_inner)) => { + find_rsx_expr(new_inner, old_inner, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.break_token != old_expr.break_token + || new_expr.label != old_expr.label + } + (None, None) => { + new_expr.attrs != old_expr.attrs + || new_expr.break_token != old_expr.break_token + || new_expr.label != old_expr.label + } + _ => true, + } + } + (syn::Expr::Call(new_expr), syn::Expr::Call(old_expr)) => { + find_rsx_expr(&new_expr.func, &old_expr.func, rsx_calls); + if new_expr.args.len() != old_expr.args.len() { + return true; + } + for (new_arg, old_arg) in new_expr.args.iter().zip(old_expr.args.iter()) { + if find_rsx_expr(new_arg, old_arg, rsx_calls) { + return true; + } + } + new_expr.attrs != old_expr.attrs || new_expr.paren_token != old_expr.paren_token + } + (syn::Expr::Cast(new_expr), syn::Expr::Cast(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.as_token != old_expr.as_token + || new_expr.ty != old_expr.ty + } + (syn::Expr::Closure(new_expr), syn::Expr::Closure(old_expr)) => { + find_rsx_expr(&new_expr.body, &old_expr.body, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.movability != old_expr.movability + || new_expr.asyncness != old_expr.asyncness + || new_expr.capture != old_expr.capture + || new_expr.or1_token != old_expr.or1_token + || new_expr.inputs != old_expr.inputs + || new_expr.or2_token != old_expr.or2_token + || new_expr.output != old_expr.output + } + (syn::Expr::Continue(new_expr), syn::Expr::Continue(old_expr)) => old_expr != new_expr, + (syn::Expr::Field(new_expr), syn::Expr::Field(old_expr)) => { + find_rsx_expr(&new_expr.base, &old_expr.base, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.dot_token != old_expr.dot_token + || new_expr.member != old_expr.member + } + (syn::Expr::ForLoop(new_expr), syn::Expr::ForLoop(old_expr)) => { + find_rsx_block(&new_expr.body, &old_expr.body, rsx_calls) + || find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.label != old_expr.label + || new_expr.for_token != old_expr.for_token + || new_expr.pat != old_expr.pat + || new_expr.in_token != old_expr.in_token + } + (syn::Expr::Group(new_expr), syn::Expr::Group(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + } + (syn::Expr::If(new_expr), syn::Expr::If(old_expr)) => { + if find_rsx_expr(&new_expr.cond, &old_expr.cond, rsx_calls) + || find_rsx_block(&new_expr.then_branch, &old_expr.then_branch, rsx_calls) + { + return true; + } + match (&new_expr.else_branch, &old_expr.else_branch) { + (Some((new_tok, new_else)), Some((old_tok, old_else))) => { + find_rsx_expr(new_else, old_else, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.if_token != old_expr.if_token + || new_expr.cond != old_expr.cond + || new_tok != old_tok + } + (None, None) => { + new_expr.attrs != old_expr.attrs + || new_expr.if_token != old_expr.if_token + || new_expr.cond != old_expr.cond + } + _ => true, + } + } + (syn::Expr::Index(new_expr), syn::Expr::Index(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || find_rsx_expr(&new_expr.index, &old_expr.index, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.bracket_token != old_expr.bracket_token + } + (syn::Expr::Let(new_expr), syn::Expr::Let(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.let_token != old_expr.let_token + || new_expr.pat != old_expr.pat + || new_expr.eq_token != old_expr.eq_token + } + (syn::Expr::Lit(new_expr), syn::Expr::Lit(old_expr)) => old_expr != new_expr, + (syn::Expr::Loop(new_expr), syn::Expr::Loop(old_expr)) => { + find_rsx_block(&new_expr.body, &old_expr.body, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.label != old_expr.label + || new_expr.loop_token != old_expr.loop_token + } + (syn::Expr::Macro(new_expr), syn::Expr::Macro(old_expr)) => { + let new_mac = &new_expr.mac; + let old_mac = &old_expr.mac; + if new_mac.path.get_ident().map(|ident| ident.to_string()) == Some("rsx".to_string()) + && old_mac.path.get_ident().map(|ident| ident.to_string()) + == Some("rsx".to_string()) + { + rsx_calls.push((old_mac.clone(), new_mac.tokens.clone())); + false + } else { + new_expr != old_expr + } + } + (syn::Expr::Match(new_expr), syn::Expr::Match(old_expr)) => { + if find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) { + return true; + } + for (new_arm, old_arm) in new_expr.arms.iter().zip(old_expr.arms.iter()) { + match (&new_arm.guard, &old_arm.guard) { + (Some((new_tok, new_expr)), Some((old_tok, old_expr))) => { + if find_rsx_expr(new_expr, old_expr, rsx_calls) || new_tok != old_tok { + return true; + } + } + (None, None) => (), + _ => return true, + } + if find_rsx_expr(&new_arm.body, &old_arm.body, rsx_calls) + || new_arm.attrs != old_arm.attrs + || new_arm.pat != old_arm.pat + || new_arm.fat_arrow_token != old_arm.fat_arrow_token + || new_arm.comma != old_arm.comma + { + return true; + } + } + new_expr.attrs != old_expr.attrs + || new_expr.match_token != old_expr.match_token + || new_expr.brace_token != old_expr.brace_token + } + (syn::Expr::MethodCall(new_expr), syn::Expr::MethodCall(old_expr)) => { + if find_rsx_expr(&new_expr.receiver, &old_expr.receiver, rsx_calls) { + return true; + } + for (new_arg, old_arg) in new_expr.args.iter().zip(old_expr.args.iter()) { + if find_rsx_expr(new_arg, old_arg, rsx_calls) { + return true; + } + } + new_expr.attrs != old_expr.attrs + || new_expr.dot_token != old_expr.dot_token + || new_expr.method != old_expr.method + || new_expr.turbofish != old_expr.turbofish + || new_expr.paren_token != old_expr.paren_token + } + (syn::Expr::Paren(new_expr), syn::Expr::Paren(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.paren_token != old_expr.paren_token + } + (syn::Expr::Path(new_expr), syn::Expr::Path(old_expr)) => old_expr != new_expr, + (syn::Expr::Range(new_expr), syn::Expr::Range(old_expr)) => { + match (&new_expr.from, &old_expr.from) { + (Some(new_expr), Some(old_expr)) => { + if find_rsx_expr(new_expr, old_expr, rsx_calls) { + return true; + } + } + (None, None) => (), + _ => return true, + } + match (&new_expr.to, &old_expr.to) { + (Some(new_inner), Some(old_inner)) => { + find_rsx_expr(new_inner, old_inner, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.limits != old_expr.limits + } + (None, None) => { + new_expr.attrs != old_expr.attrs || new_expr.limits != old_expr.limits + } + _ => true, + } + } + (syn::Expr::Reference(new_expr), syn::Expr::Reference(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.and_token != old_expr.and_token + || new_expr.mutability != old_expr.mutability + } + (syn::Expr::Repeat(new_expr), syn::Expr::Repeat(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || find_rsx_expr(&new_expr.len, &old_expr.len, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.bracket_token != old_expr.bracket_token + || new_expr.semi_token != old_expr.semi_token + } + (syn::Expr::Return(new_expr), syn::Expr::Return(old_expr)) => { + match (&new_expr.expr, &old_expr.expr) { + (Some(new_inner), Some(old_inner)) => { + find_rsx_expr(new_inner, old_inner, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.return_token != old_expr.return_token + } + (None, None) => { + new_expr.attrs != old_expr.attrs + || new_expr.return_token != old_expr.return_token + } + _ => true, + } + } + (syn::Expr::Struct(new_expr), syn::Expr::Struct(old_expr)) => { + match (&new_expr.rest, &old_expr.rest) { + (Some(new_expr), Some(old_expr)) => { + if find_rsx_expr(new_expr, old_expr, rsx_calls) { + return true; + } + } + (None, None) => (), + _ => return true, + } + for (new_field, old_field) in new_expr.fields.iter().zip(old_expr.fields.iter()) { + if find_rsx_expr(&new_field.expr, &old_field.expr, rsx_calls) + || new_field.attrs != old_field.attrs + || new_field.member != old_field.member + || new_field.colon_token != old_field.colon_token + { + return true; + } + } + new_expr.attrs != old_expr.attrs + || new_expr.path != old_expr.path + || new_expr.brace_token != old_expr.brace_token + || new_expr.dot2_token != old_expr.dot2_token + } + (syn::Expr::Try(new_expr), syn::Expr::Try(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.question_token != old_expr.question_token + } + (syn::Expr::TryBlock(new_expr), syn::Expr::TryBlock(old_expr)) => { + find_rsx_block(&new_expr.block, &old_expr.block, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.try_token != old_expr.try_token + } + (syn::Expr::Tuple(new_expr), syn::Expr::Tuple(old_expr)) => { + for (new_el, old_el) in new_expr.elems.iter().zip(old_expr.elems.iter()) { + if find_rsx_expr(new_el, old_el, rsx_calls) { + return true; + } + } + new_expr.attrs != old_expr.attrs || new_expr.paren_token != old_expr.paren_token + } + (syn::Expr::Type(new_expr), syn::Expr::Type(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.colon_token != old_expr.colon_token + || new_expr.ty != old_expr.ty + } + (syn::Expr::Unary(new_expr), syn::Expr::Unary(old_expr)) => { + find_rsx_expr(&new_expr.expr, &old_expr.expr, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.op != old_expr.op + } + (syn::Expr::Unsafe(new_expr), syn::Expr::Unsafe(old_expr)) => { + find_rsx_block(&new_expr.block, &old_expr.block, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.unsafe_token != old_expr.unsafe_token + } + (syn::Expr::While(new_expr), syn::Expr::While(old_expr)) => { + find_rsx_expr(&new_expr.cond, &old_expr.cond, rsx_calls) + || find_rsx_block(&new_expr.body, &old_expr.body, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.label != old_expr.label + || new_expr.while_token != old_expr.while_token + } + (syn::Expr::Yield(new_expr), syn::Expr::Yield(old_expr)) => { + match (&new_expr.expr, &old_expr.expr) { + (Some(new_inner), Some(old_inner)) => { + find_rsx_expr(new_inner, old_inner, rsx_calls) + || new_expr.attrs != old_expr.attrs + || new_expr.yield_token != old_expr.yield_token + } + (None, None) => { + new_expr.attrs != old_expr.attrs || new_expr.yield_token != old_expr.yield_token + } + _ => true, + } + } + (syn::Expr::Verbatim(_), syn::Expr::Verbatim(_)) => false, + _ => true, + } +} diff --git a/src/lib.rs b/src/lib.rs index 8cd4b1f2d..722b03a06 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,3 +18,6 @@ pub use error::*; pub mod logging; pub use logging::*; + +pub mod hot_reload; +pub use hot_reload::*; diff --git a/src/server/mod.rs b/src/server/mod.rs index 1df13ca6a..230136e54 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,18 +7,28 @@ use axum::{ Router, }; use notify::{RecommendedWatcher, Watcher}; +use std::{fs::File, io::Read}; +use syn::__private::ToTokens; use std::{path::PathBuf, sync::Arc}; use tower::ServiceBuilder; use tower_http::services::fs::{ServeDir, ServeFileSystemResponseBody}; -use crate::{builder, serve::Serve, CrateConfig, Result}; +use crate::{builder, find_rsx, serve::Serve, CrateConfig, Result}; use tokio::sync::broadcast; -struct WsRelodState { +use std::collections::HashMap; + +use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; + +struct WsReloadState { update: broadcast::Sender, } +struct HotReloadState { + messages: broadcast::Sender, +} + pub async fn startup(config: CrateConfig) -> Result<()> { log::info!("🚀 Starting development server..."); @@ -26,35 +36,20 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let (reload_tx, _) = broadcast::channel(100); - let ws_reload_state = Arc::new(WsRelodState { + let ws_reload_state = Arc::new(WsReloadState { update: reload_tx.clone(), }); + let hot_reload_tx = broadcast::channel(100).0; + let hot_reload_state = Arc::new(HotReloadState { + messages: hot_reload_tx.clone(), + }); + let mut last_update_time = chrono::Local::now().timestamp(); // file watcher: check file change let watcher_conf = config.clone(); - let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { - if chrono::Local::now().timestamp() > last_update_time { - log::info!("Start to rebuild project..."); - if builder::build(&watcher_conf).is_ok() { - // change the websocket reload state to true; - // the page will auto-reload. - if watcher_conf - .dioxus_config - .web - .watcher - .reload_html - .unwrap_or(false) - { - let _ = Serve::regen_dev_page(&watcher_conf); - } - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); - } - } - }) - .unwrap(); + let mut old_files_parsed: HashMap = HashMap::new(); let allow_watch_path = config .dioxus_config .web @@ -63,6 +58,92 @@ pub async fn startup(config: CrateConfig) -> Result<()> { .clone() .unwrap_or_else(|| vec![PathBuf::from("src")]); + let crate_dir = config.crate_dir.clone(); + + let mut watcher = RecommendedWatcher::new(move |evt: notify::Result| { + if let Ok(evt) = evt { + if let notify::EventKind::Modify(_) = evt.kind { + for path in evt.paths { + log::info!("File changed: {}", path.display()); + let mut file = File::open(path.clone()).unwrap(); + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + if src.is_empty() { + continue; + } + if let Ok(syntax) = syn::parse_file(&src) { + if let Some(old_str) = old_files_parsed.get(path.to_str().unwrap()) { + if let Ok(old) = syn::parse_file(&old_str) { + match find_rsx(&syntax, &old) { + crate::DiffResult::CodeChanged => { + log::info!("reload required"); + if chrono::Local::now().timestamp() > last_update_time { + log::info!("Start to rebuild project..."); + if builder::build(&watcher_conf).is_ok() { + // change the websocket reload state to true; + // the page will auto-reload. + if watcher_conf + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&watcher_conf); + } + let _ = reload_tx.send("reload".into()); + old_files_parsed.insert( + path.to_str().unwrap().to_string(), + src, + ); + last_update_time = chrono::Local::now().timestamp(); + } + } + } + crate::DiffResult::RsxChanged(changed) => { + for (old, new) in changed.into_iter() { + if let Some(hr) = old + .to_token_stream() + .into_iter() + .map(|tree| { + let location = tree.span(); + let start = location.start(); + CodeLocation { + file: path + .strip_prefix(&crate_dir) + .unwrap() + .display() + .to_string(), + line: start.line as u32, + column: start.column as u32 + 1, + } + }) + .min_by(|cl1, cl2| { + cl1.line + .cmp(&cl2.line) + .then(cl1.column.cmp(&cl2.column)) + }) + { + let rsx = new.to_string(); + let _ = hot_reload_tx.send(SetRsxMessage { + location: hr, + new_text: rsx, + }); + } + } + } + } + } + } else { + old_files_parsed.insert(path.to_str().unwrap().to_string(), src); + } + } + } + } + } + }) + .unwrap(); + for sub_path in allow_watch_path { watcher .watch( @@ -115,6 +196,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let router = Router::new() .route("/_dioxus/ws", get(ws_handler)) + .route("/_dioxus/hot_reload", get(hot_reload_handler)) .fallback( get_service(file_service).handle_error(|error: std::io::Error| async move { ( @@ -125,7 +207,12 @@ pub async fn startup(config: CrateConfig) -> Result<()> { ); axum::Server::bind(&format!("0.0.0.0:{}", port).parse().unwrap()) - .serve(router.layer(Extension(ws_reload_state)).into_make_service()) + .serve( + router + .layer(Extension(ws_reload_state)) + .layer(Extension(hot_reload_state)) + .into_make_service(), + ) .await?; Ok(()) @@ -134,7 +221,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { async fn ws_handler( ws: WebSocketUpgrade, _: Option>, - Extension(state): Extension>, + Extension(state): Extension>, ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { let mut rx = state.update.subscribe(); @@ -157,3 +244,38 @@ async fn ws_handler( reload_watcher.await.unwrap(); }) } + +async fn hot_reload_handler( + ws: WebSocketUpgrade, + _: Option>, + Extension(state): Extension>, +) -> impl IntoResponse { + ws.on_upgrade(|mut socket| async move { + println!("🔥 Hot Reload WebSocket is connected."); + let mut rx = state.messages.subscribe(); + loop { + let read_set_rsx = rx.recv(); + let read_err = socket.recv(); + tokio::select! { + err = read_err => { + if let Some(Ok(Message::Text(err))) = err { + let error: RecompileReason = serde_json::from_str(&err).unwrap(); + log::error!("{:?}", error); + }; + }, + set_rsx = read_set_rsx => { + if let Ok(rsx) = set_rsx{ + if socket + .send(Message::Text(serde_json::to_string(&rsx).unwrap())) + .await + .is_err() + { + break; + }; + // println!("{:?}", rsx); + } + } + }; + } + }) +} From 3ccd65b582b8320b24c8921829b777084a6d2e1e Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 9 Jun 2022 10:35:18 -0500 Subject: [PATCH 128/330] remove unused import --- src/hot_reload/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hot_reload/mod.rs b/src/hot_reload/mod.rs index d70cda29e..3aced9567 100644 --- a/src/hot_reload/mod.rs +++ b/src/hot_reload/mod.rs @@ -1,4 +1,3 @@ -use dioxus_rsx::{BodyNode, CallBody}; use proc_macro2::TokenStream; use syn::{File, Macro}; From 61e9f56816495ad18c367cc72038409e60382ddc Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 9 Jun 2022 11:37:48 -0500 Subject: [PATCH 129/330] automaticly reload when rsx requires it --- src/server/mod.rs | 59 +++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 230136e54..c4ab60385 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,7 +7,7 @@ use axum::{ Router, }; use notify::{RecommendedWatcher, Watcher}; -use std::{fs::File, io::Read}; +use std::{fs::File, io::Read, sync::Mutex}; use syn::__private::ToTokens; use std::{path::PathBuf, sync::Arc}; @@ -23,10 +23,13 @@ use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage struct WsReloadState { update: broadcast::Sender, + last_file_rebuild: Arc>>, + watcher_config: CrateConfig, } struct HotReloadState { messages: broadcast::Sender, + update: broadcast::Sender, } pub async fn startup(config: CrateConfig) -> Result<()> { @@ -36,20 +39,23 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let (reload_tx, _) = broadcast::channel(100); + let last_file_rebuild = Arc::new(Mutex::new(HashMap::new())); + let ws_reload_state = Arc::new(WsReloadState { update: reload_tx.clone(), + last_file_rebuild: last_file_rebuild.clone(), + watcher_config: config.clone(), }); let hot_reload_tx = broadcast::channel(100).0; let hot_reload_state = Arc::new(HotReloadState { messages: hot_reload_tx.clone(), + update: reload_tx.clone(), }); let mut last_update_time = chrono::Local::now().timestamp(); // file watcher: check file change - let watcher_conf = config.clone(); - let mut old_files_parsed: HashMap = HashMap::new(); let allow_watch_path = config .dioxus_config .web @@ -64,7 +70,6 @@ pub async fn startup(config: CrateConfig) -> Result<()> { if let Ok(evt) = evt { if let notify::EventKind::Modify(_) = evt.kind { for path in evt.paths { - log::info!("File changed: {}", path.display()); let mut file = File::open(path.clone()).unwrap(); let mut src = String::new(); file.read_to_string(&mut src).expect("Unable to read file"); @@ -72,35 +77,19 @@ pub async fn startup(config: CrateConfig) -> Result<()> { continue; } if let Ok(syntax) = syn::parse_file(&src) { - if let Some(old_str) = old_files_parsed.get(path.to_str().unwrap()) { + let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); + if let Some(old_str) = last_file_rebuild.get(path.to_str().unwrap()) { if let Ok(old) = syn::parse_file(&old_str) { match find_rsx(&syntax, &old) { crate::DiffResult::CodeChanged => { log::info!("reload required"); if chrono::Local::now().timestamp() > last_update_time { - log::info!("Start to rebuild project..."); - if builder::build(&watcher_conf).is_ok() { - // change the websocket reload state to true; - // the page will auto-reload. - if watcher_conf - .dioxus_config - .web - .watcher - .reload_html - .unwrap_or(false) - { - let _ = Serve::regen_dev_page(&watcher_conf); - } - let _ = reload_tx.send("reload".into()); - old_files_parsed.insert( - path.to_str().unwrap().to_string(), - src, - ); - last_update_time = chrono::Local::now().timestamp(); - } + let _ = reload_tx.send("reload".into()); + last_update_time = chrono::Local::now().timestamp(); } } crate::DiffResult::RsxChanged(changed) => { + log::info!("reloading rsx"); for (old, new) in changed.into_iter() { if let Some(hr) = old .to_token_stream() @@ -135,7 +124,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { } } } else { - old_files_parsed.insert(path.to_str().unwrap().to_string(), src); + last_file_rebuild.insert(path.to_str().unwrap().to_string(), src); } } } @@ -229,6 +218,22 @@ async fn ws_handler( loop { let v = rx.recv().await.unwrap(); if v == "reload" { + log::info!("Start to rebuild project..."); + if builder::build(&state.watcher_config).is_ok() { + // change the websocket reload state to true; + // the page will auto-reload. + if state + .watcher_config + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&state.watcher_config); + } + *state.last_file_rebuild.lock().unwrap() = HashMap::new(); + } // ignore the error if socket .send(Message::Text(String::from("reload"))) @@ -261,6 +266,7 @@ async fn hot_reload_handler( if let Some(Ok(Message::Text(err))) = err { let error: RecompileReason = serde_json::from_str(&err).unwrap(); log::error!("{:?}", error); + state.update.send("reload".to_string()).unwrap(); }; }, set_rsx = read_set_rsx => { @@ -272,7 +278,6 @@ async fn hot_reload_handler( { break; }; - // println!("{:?}", rsx); } } }; From f19958d766c5584c89df6d617170e87f275591bd Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 9 Jun 2022 11:58:09 -0500 Subject: [PATCH 130/330] move into feature --- Cargo.toml | 10 +-- src/lib.rs | 2 +- src/server/mod.rs | 159 +++++++++++++++++++++++++++------------------- 3 files changed, 100 insertions(+), 71 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4acd41463..770fd7b1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,10 +46,12 @@ flate2 = "1.0.22" tar = "0.4.38" tower = "0.4.12" -# hot reload -syn = "1.0" -dioxus-rsx-interpreter = { path = "../dioxus/packages/rsx_interpreter" } -proc-macro2 = { version = "1.0", features = ["span-locations"] } +syn = { version = "1.0", optional = true } +dioxus-rsx-interpreter = { path = "../dioxus/packages/rsx_interpreter", optional = true } +proc-macro2 = { version = "1.0", features = ["span-locations"], optional = true } + +[features] +hot_reload = ["dioxus-rsx-interpreter", "proc-macro2", "syn"] [[bin]] path = "src/main.rs" diff --git a/src/lib.rs b/src/lib.rs index 722b03a06..683b7251a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,5 +19,5 @@ pub use error::*; pub mod logging; pub use logging::*; +#[cfg(feature = "hot_reload")] pub mod hot_reload; -pub use hot_reload::*; diff --git a/src/server/mod.rs b/src/server/mod.rs index c4ab60385..18d50fc57 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,26 +7,34 @@ use axum::{ Router, }; use notify::{RecommendedWatcher, Watcher}; -use std::{fs::File, io::Read, sync::Mutex}; -use syn::__private::ToTokens; +use std::{fs::File, io::Read}; use std::{path::PathBuf, sync::Arc}; use tower::ServiceBuilder; use tower_http::services::fs::{ServeDir, ServeFileSystemResponseBody}; -use crate::{builder, find_rsx, serve::Serve, CrateConfig, Result}; +use crate::{builder, serve::Serve, CrateConfig, Result}; use tokio::sync::broadcast; -use std::collections::HashMap; - -use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; +#[cfg(feature = "hot_reload")] +mod hot_reload_improts { + pub use crate::hot_reload::{find_rsx, DiffResult}; + pub use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; + pub use std::collections::HashMap; + pub use std::sync::Mutex; + pub use syn::__private::ToTokens; +} +#[cfg(feature = "hot_reload")] +use hot_reload_improts::*; struct WsReloadState { update: broadcast::Sender, + #[cfg(feature = "hot_reload")] last_file_rebuild: Arc>>, watcher_config: CrateConfig, } +#[cfg(feature = "hot_reload")] struct HotReloadState { messages: broadcast::Sender, update: broadcast::Sender, @@ -39,19 +47,24 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let (reload_tx, _) = broadcast::channel(100); + #[cfg(feature = "hot_reload")] let last_file_rebuild = Arc::new(Mutex::new(HashMap::new())); - - let ws_reload_state = Arc::new(WsReloadState { - update: reload_tx.clone(), - last_file_rebuild: last_file_rebuild.clone(), - watcher_config: config.clone(), - }); - + #[cfg(feature = "hot_reload")] let hot_reload_tx = broadcast::channel(100).0; + #[cfg(feature = "hot_reload")] let hot_reload_state = Arc::new(HotReloadState { messages: hot_reload_tx.clone(), update: reload_tx.clone(), }); + #[cfg(feature = "hot_reload")] + let crate_dir = config.crate_dir.clone(); + + let ws_reload_state = Arc::new(WsReloadState { + update: reload_tx.clone(), + #[cfg(feature = "hot_reload")] + last_file_rebuild: last_file_rebuild.clone(), + watcher_config: config.clone(), + }); let mut last_update_time = chrono::Local::now().timestamp(); @@ -64,8 +77,6 @@ pub async fn startup(config: CrateConfig) -> Result<()> { .clone() .unwrap_or_else(|| vec![PathBuf::from("src")]); - let crate_dir = config.crate_dir.clone(); - let mut watcher = RecommendedWatcher::new(move |evt: notify::Result| { if let Ok(evt) = evt { if let notify::EventKind::Modify(_) = evt.kind { @@ -76,55 +87,66 @@ pub async fn startup(config: CrateConfig) -> Result<()> { if src.is_empty() { continue; } - if let Ok(syntax) = syn::parse_file(&src) { - let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); - if let Some(old_str) = last_file_rebuild.get(path.to_str().unwrap()) { - if let Ok(old) = syn::parse_file(&old_str) { - match find_rsx(&syntax, &old) { - crate::DiffResult::CodeChanged => { - log::info!("reload required"); - if chrono::Local::now().timestamp() > last_update_time { - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); + #[cfg(feature = "hot_reload")] + { + if let Ok(syntax) = syn::parse_file(&src) { + let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); + if let Some(old_str) = last_file_rebuild.get(path.to_str().unwrap()) { + if let Ok(old) = syn::parse_file(&old_str) { + match find_rsx(&syntax, &old) { + DiffResult::CodeChanged => { + log::info!("reload required"); + if chrono::Local::now().timestamp() > last_update_time { + let _ = reload_tx.send("reload".into()); + last_update_time = chrono::Local::now().timestamp(); + } } - } - crate::DiffResult::RsxChanged(changed) => { - log::info!("reloading rsx"); - for (old, new) in changed.into_iter() { - if let Some(hr) = old - .to_token_stream() - .into_iter() - .map(|tree| { - let location = tree.span(); - let start = location.start(); - CodeLocation { - file: path - .strip_prefix(&crate_dir) - .unwrap() - .display() - .to_string(), - line: start.line as u32, - column: start.column as u32 + 1, - } - }) - .min_by(|cl1, cl2| { - cl1.line - .cmp(&cl2.line) - .then(cl1.column.cmp(&cl2.column)) - }) - { - let rsx = new.to_string(); - let _ = hot_reload_tx.send(SetRsxMessage { - location: hr, - new_text: rsx, - }); + DiffResult::RsxChanged(changed) => { + log::info!("reloading rsx"); + for (old, new) in changed.into_iter() { + if let Some(hr) = old + .to_token_stream() + .into_iter() + .map(|tree| { + let location = tree.span(); + let start = location.start(); + CodeLocation { + file: path + .strip_prefix(&crate_dir) + .unwrap() + .display() + .to_string(), + line: start.line as u32, + column: start.column as u32 + 1, + } + }) + .min_by(|cl1, cl2| { + cl1.line + .cmp(&cl2.line) + .then(cl1.column.cmp(&cl2.column)) + }) + { + let rsx = new.to_string(); + let _ = hot_reload_tx.send(SetRsxMessage { + location: hr, + new_text: rsx, + }); + } } } } } + } else { + last_file_rebuild.insert(path.to_str().unwrap().to_string(), src); } - } else { - last_file_rebuild.insert(path.to_str().unwrap().to_string(), src); + } + } + #[cfg(not(feature = "hot_reload"))] + { + log::info!("reload required"); + if chrono::Local::now().timestamp() > last_update_time { + let _ = reload_tx.send("reload".into()); + last_update_time = chrono::Local::now().timestamp(); } } } @@ -185,7 +207,6 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let router = Router::new() .route("/_dioxus/ws", get(ws_handler)) - .route("/_dioxus/hot_reload", get(hot_reload_handler)) .fallback( get_service(file_service).handle_error(|error: std::io::Error| async move { ( @@ -194,14 +215,16 @@ pub async fn startup(config: CrateConfig) -> Result<()> { ) }), ); + #[cfg(feature = "hot_reload")] + let router = router.route("/_dioxus/hot_reload", get(hot_reload_handler)); + + let router = router.layer(Extension(ws_reload_state)); + + #[cfg(feature = "hot_reload")] + let router = router.layer(Extension(hot_reload_state)); axum::Server::bind(&format!("0.0.0.0:{}", port).parse().unwrap()) - .serve( - router - .layer(Extension(ws_reload_state)) - .layer(Extension(hot_reload_state)) - .into_make_service(), - ) + .serve(router.into_make_service()) .await?; Ok(()) @@ -232,7 +255,10 @@ async fn ws_handler( { let _ = Serve::regen_dev_page(&state.watcher_config); } - *state.last_file_rebuild.lock().unwrap() = HashMap::new(); + #[cfg(feature = "hot_reload")] + { + *state.last_file_rebuild.lock().unwrap() = HashMap::new(); + } } // ignore the error if socket @@ -250,6 +276,7 @@ async fn ws_handler( }) } +#[cfg(feature = "hot_reload")] async fn hot_reload_handler( ws: WebSocketUpgrade, _: Option>, From f06920a37ec12fafbff53d766c14b89fd8b21c8a Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 9 Jun 2022 12:38:59 -0500 Subject: [PATCH 131/330] search directory .rs files to diff automaticly --- src/server/mod.rs | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 18d50fc57..8670debb1 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,7 +7,10 @@ use axum::{ Router, }; use notify::{RecommendedWatcher, Watcher}; -use std::{fs::File, io::Read}; +use std::{ + fs::{self, File}, + io::{self, Read}, +}; use std::{path::PathBuf, sync::Arc}; use tower::ServiceBuilder; @@ -50,6 +53,8 @@ pub async fn startup(config: CrateConfig) -> Result<()> { #[cfg(feature = "hot_reload")] let last_file_rebuild = Arc::new(Mutex::new(HashMap::new())); #[cfg(feature = "hot_reload")] + find_rs_files(&config.crate_dir, &mut *last_file_rebuild.lock().unwrap()).unwrap(); + #[cfg(feature = "hot_reload")] let hot_reload_tx = broadcast::channel(100).0; #[cfg(feature = "hot_reload")] let hot_reload_state = Arc::new(HotReloadState { @@ -215,6 +220,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { ) }), ); + #[cfg(feature = "hot_reload")] let router = router.route("/_dioxus/hot_reload", get(hot_reload_handler)); @@ -257,7 +263,9 @@ async fn ws_handler( } #[cfg(feature = "hot_reload")] { - *state.last_file_rebuild.lock().unwrap() = HashMap::new(); + let mut write = state.last_file_rebuild.lock().unwrap(); + *write = HashMap::new(); + find_rs_files(&state.watcher_config.crate_dir, &mut *write).unwrap(); } } // ignore the error @@ -311,3 +319,23 @@ async fn hot_reload_handler( } }) } + +#[cfg(feature = "hot_reload")] +fn find_rs_files(root: &PathBuf, files: &mut HashMap) -> io::Result<()> { + for entry in fs::read_dir(root)? { + if let Ok(entry) = entry { + let path = entry.path(); + if path.is_dir() { + find_rs_files(&path, files)?; + } else { + if path.extension().map(|s| s.to_str()).flatten() == Some("rs") { + let mut file = File::open(path.clone()).unwrap(); + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + files.insert(path.display().to_string(), src); + } + } + } + } + Ok(()) +} From aa9f5a1a425c0e07e234ac8e594d041b53fb79f4 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 9 Jun 2022 12:44:07 -0500 Subject: [PATCH 132/330] clean up imports --- src/server/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 8670debb1..9c0c86fd6 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,10 +7,7 @@ use axum::{ Router, }; use notify::{RecommendedWatcher, Watcher}; -use std::{ - fs::{self, File}, - io::{self, Read}, -}; +use std::{fs::File, io::Read}; use std::{path::PathBuf, sync::Arc}; use tower::ServiceBuilder; @@ -25,6 +22,7 @@ mod hot_reload_improts { pub use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; pub use std::collections::HashMap; pub use std::sync::Mutex; + pub use std::{fs, io}; pub use syn::__private::ToTokens; } #[cfg(feature = "hot_reload")] From 1d29f66cfc40cbd33065a193cbc013694cfebf0f Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 9 Jun 2022 13:00:28 -0500 Subject: [PATCH 133/330] use log::info instead of print --- src/server/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 9c0c86fd6..95026d768 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -289,7 +289,7 @@ async fn hot_reload_handler( Extension(state): Extension>, ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { - println!("🔥 Hot Reload WebSocket is connected."); + log::info!("🔥 Hot Reload WebSocket connected"); let mut rx = state.messages.subscribe(); loop { let read_set_rsx = rx.recv(); From 0c4028ad5270281e0893dd8e919fdebb3407b44c Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 10 Jun 2022 19:18:02 -0500 Subject: [PATCH 134/330] close websocket on disconnect --- src/server/mod.rs | 54 ++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 95026d768..3506112f2 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -291,30 +291,40 @@ async fn hot_reload_handler( ws.on_upgrade(|mut socket| async move { log::info!("🔥 Hot Reload WebSocket connected"); let mut rx = state.messages.subscribe(); - loop { - let read_set_rsx = rx.recv(); - let read_err = socket.recv(); - tokio::select! { - err = read_err => { - if let Some(Ok(Message::Text(err))) = err { - let error: RecompileReason = serde_json::from_str(&err).unwrap(); - log::error!("{:?}", error); - state.update.send("reload".to_string()).unwrap(); - }; - }, - set_rsx = read_set_rsx => { - if let Ok(rsx) = set_rsx{ - if socket - .send(Message::Text(serde_json::to_string(&rsx).unwrap())) - .await - .is_err() - { + let hot_reload_handle = tokio::spawn(async move { + loop { + let read_set_rsx = rx.recv(); + let read_err = socket.recv(); + tokio::select! { + err = read_err => { + if let Some(Ok(err)) = err { + if let Message::Text(err) = err { + let error: RecompileReason = serde_json::from_str(&err).unwrap(); + log::error!("{:?}", error); + if state.update.send("reload".to_string()).is_err() { + break; + } + } + } else { break; - }; + } + }, + set_rsx = read_set_rsx => { + if let Ok(rsx) = set_rsx { + if socket + .send(Message::Text(serde_json::to_string(&rsx).unwrap())) + .await + .is_err() + { + break; + }; + } } - } - }; - } + }; + } + }); + + hot_reload_handle.await.unwrap(); }) } From d1c619e5dc9409eb358dfaf141458a5b38edc02b Mon Sep 17 00:00:00 2001 From: xTeKc <81730792+xTeKc@users.noreply.github.com> Date: Sun, 12 Jun 2022 03:31:13 -0400 Subject: [PATCH 135/330] update edition --- rustfmt.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index 9071fb4b5..39b98f125 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,8 +1,8 @@ version = "Two" -edition = "2018" +edition = "2021" imports_granularity = "Crate" #use_small_heuristics = "Max" #control_brace_style = "ClosingNextLine" normalize_comments = true -format_code_in_doc_comments = true \ No newline at end of file +format_code_in_doc_comments = true From f287e757611ac2a84a8622bcf9b4a3d3cf60294b Mon Sep 17 00:00:00 2001 From: xTeKc <81730792+xTeKc@users.noreply.github.com> Date: Sun, 12 Jun 2022 03:31:35 -0400 Subject: [PATCH 136/330] update edition --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c869267b1..24493e787 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "dioxus-cli" version = "0.1.4" authors = ["Jonathan Kelley"] -edition = "2018" +edition = "2021" description = "CLI tool for developing, testing, and publishing Dioxus apps" license = "MIT/Apache-2.0" From bfab711010dd4f508930c3ce6af8f39c65c6c025 Mon Sep 17 00:00:00 2001 From: xTeKc <81730792+xTeKc@users.noreply.github.com> Date: Sun, 12 Jun 2022 03:35:25 -0400 Subject: [PATCH 137/330] force closure to take ownership --- src/server/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 1df13ca6a..ada3e10c7 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -79,7 +79,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let file_service_config = config.clone(); let file_service = ServiceBuilder::new() .and_then( - |response: Response| async move { + move |response: Response| async move { let response = if file_service_config .dioxus_config .web From b3db5469c36b143d024b6b828cebcef261740510 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 13 Jun 2022 15:33:49 -0500 Subject: [PATCH 138/330] ignore files that have not been changed recently when checking for changes initially --- src/hot_reload/mod.rs | 4 +- src/server/mod.rs | 206 +++++++++++++++++++++++++++++------------- 2 files changed, 145 insertions(+), 65 deletions(-) diff --git a/src/hot_reload/mod.rs b/src/hot_reload/mod.rs index 3aced9567..8297fedb9 100644 --- a/src/hot_reload/mod.rs +++ b/src/hot_reload/mod.rs @@ -426,7 +426,9 @@ fn find_rsx_expr( && old_mac.path.get_ident().map(|ident| ident.to_string()) == Some("rsx".to_string()) { - rsx_calls.push((old_mac.clone(), new_mac.tokens.clone())); + if old_mac != new_mac { + rsx_calls.push((old_mac.clone(), new_mac.tokens.clone())); + } false } else { new_expr != old_expr diff --git a/src/server/mod.rs b/src/server/mod.rs index 3506112f2..a0bdf24b0 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,7 +7,6 @@ use axum::{ Router, }; use notify::{RecommendedWatcher, Watcher}; -use std::{fs::File, io::Read}; use std::{path::PathBuf, sync::Arc}; use tower::ServiceBuilder; @@ -20,9 +19,12 @@ use tokio::sync::broadcast; mod hot_reload_improts { pub use crate::hot_reload::{find_rsx, DiffResult}; pub use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; + pub use proc_macro2::TokenStream; pub use std::collections::HashMap; pub use std::sync::Mutex; - pub use std::{fs, io}; + pub use std::time::SystemTime; + pub use std::{fs, io, path::Path}; + pub use std::{fs::File, io::Read}; pub use syn::__private::ToTokens; } #[cfg(feature = "hot_reload")] @@ -31,7 +33,7 @@ use hot_reload_improts::*; struct WsReloadState { update: broadcast::Sender, #[cfg(feature = "hot_reload")] - last_file_rebuild: Arc>>, + last_file_rebuild: Arc>, watcher_config: CrateConfig, } @@ -39,6 +41,47 @@ struct WsReloadState { struct HotReloadState { messages: broadcast::Sender, update: broadcast::Sender, + last_file_rebuild: Arc>, + watcher_config: CrateConfig, +} + +#[cfg(feature = "hot_reload")] +struct FileMap { + map: HashMap, + last_updated_time: std::time::SystemTime, +} + +#[cfg(feature = "hot_reload")] +impl FileMap { + fn new(path: PathBuf) -> Self { + fn find_rs_files(root: PathBuf) -> io::Result> { + let mut files = HashMap::new(); + if root.is_dir() { + let mut handles = Vec::new(); + for entry in fs::read_dir(root)? { + if let Ok(entry) = entry { + let path = entry.path(); + handles.push(std::thread::spawn(move || find_rs_files(path))); + } + } + for handle in handles { + files.extend(handle.join().unwrap()?); + } + } else { + if root.extension().map(|s| s.to_str()).flatten() == Some("rs") { + let mut file = File::open(root.clone()).unwrap(); + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + files.insert(root, src); + } + } + Ok(files) + } + Self { + last_updated_time: SystemTime::now(), + map: find_rs_files(path).unwrap(), + } + } } pub async fn startup(config: CrateConfig) -> Result<()> { @@ -49,15 +92,15 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let (reload_tx, _) = broadcast::channel(100); #[cfg(feature = "hot_reload")] - let last_file_rebuild = Arc::new(Mutex::new(HashMap::new())); - #[cfg(feature = "hot_reload")] - find_rs_files(&config.crate_dir, &mut *last_file_rebuild.lock().unwrap()).unwrap(); + let last_file_rebuild = Arc::new(Mutex::new(FileMap::new(config.crate_dir.clone()))); #[cfg(feature = "hot_reload")] let hot_reload_tx = broadcast::channel(100).0; #[cfg(feature = "hot_reload")] let hot_reload_state = Arc::new(HotReloadState { messages: hot_reload_tx.clone(), update: reload_tx.clone(), + last_file_rebuild: last_file_rebuild.clone(), + watcher_config: config.clone(), }); #[cfg(feature = "hot_reload")] let crate_dir = config.crate_dir.clone(); @@ -83,18 +126,21 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let mut watcher = RecommendedWatcher::new(move |evt: notify::Result| { if let Ok(evt) = evt { if let notify::EventKind::Modify(_) = evt.kind { - for path in evt.paths { - let mut file = File::open(path.clone()).unwrap(); - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - if src.is_empty() { - continue; - } - #[cfg(feature = "hot_reload")] - { + #[cfg(feature = "hot_reload")] + { + for path in evt.paths { + let mut file = File::open(path.clone()).unwrap(); + if path.extension().map(|p| p.to_str()).flatten() != Some("rs") { + continue; + } + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + if src.is_empty() { + continue; + } if let Ok(syntax) = syn::parse_file(&src) { let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); - if let Some(old_str) = last_file_rebuild.get(path.to_str().unwrap()) { + if let Some(old_str) = last_file_rebuild.map.get(&path) { if let Ok(old) = syn::parse_file(&old_str) { match find_rsx(&syntax, &old) { DiffResult::CodeChanged => { @@ -107,28 +153,13 @@ pub async fn startup(config: CrateConfig) -> Result<()> { DiffResult::RsxChanged(changed) => { log::info!("reloading rsx"); for (old, new) in changed.into_iter() { - if let Some(hr) = old - .to_token_stream() - .into_iter() - .map(|tree| { - let location = tree.span(); - let start = location.start(); - CodeLocation { - file: path - .strip_prefix(&crate_dir) - .unwrap() - .display() - .to_string(), - line: start.line as u32, - column: start.column as u32 + 1, - } - }) - .min_by(|cl1, cl2| { - cl1.line - .cmp(&cl2.line) - .then(cl1.column.cmp(&cl2.column)) - }) - { + if let Some(hr) = get_min_location( + &path + .strip_prefix(&crate_dir) + .unwrap() + .to_path_buf(), + old.to_token_stream(), + ) { let rsx = new.to_string(); let _ = hot_reload_tx.send(SetRsxMessage { location: hr, @@ -140,17 +171,17 @@ pub async fn startup(config: CrateConfig) -> Result<()> { } } } else { - last_file_rebuild.insert(path.to_str().unwrap().to_string(), src); + *last_file_rebuild = FileMap::new(crate_dir.clone()); } } } - #[cfg(not(feature = "hot_reload"))] - { - log::info!("reload required"); - if chrono::Local::now().timestamp() > last_update_time { - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); - } + } + #[cfg(not(feature = "hot_reload"))] + { + log::info!("reload required"); + if chrono::Local::now().timestamp() > last_update_time { + let _ = reload_tx.send("reload".into()); + last_update_time = chrono::Local::now().timestamp(); } } } @@ -262,8 +293,7 @@ async fn ws_handler( #[cfg(feature = "hot_reload")] { let mut write = state.last_file_rebuild.lock().unwrap(); - *write = HashMap::new(); - find_rs_files(&state.watcher_config.crate_dir, &mut *write).unwrap(); + *write = FileMap::new(state.watcher_config.crate_dir.clone()); } } // ignore the error @@ -290,6 +320,59 @@ async fn hot_reload_handler( ) -> impl IntoResponse { ws.on_upgrade(|mut socket| async move { log::info!("🔥 Hot Reload WebSocket connected"); + { + log::info!("Searching files for changes since last run..."); + // update any files that changed before the websocket connected. + let mut messages = Vec::new(); + + { + let handle = state.last_file_rebuild.lock().unwrap(); + let update_time = handle.last_updated_time.clone(); + for (k, v) in handle.map.iter() { + let mut file = File::open(k).unwrap(); + if let Ok(md) = file.metadata() { + if let Ok(time) = md.modified() { + if time < update_time { + continue; + } + } + } + let mut new = String::new(); + file.read_to_string(&mut new).expect("Unable to read file"); + if let Ok(new) = syn::parse_file(&new) { + if let Ok(old) = syn::parse_file(&v) { + if let DiffResult::RsxChanged(changed) = find_rsx(&new, &old) { + for (old, new) in changed.into_iter() { + if let Some(hr) = get_min_location( + k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), + old.to_token_stream(), + ) { + let rsx = new.to_string(); + let msg = SetRsxMessage { + location: hr, + new_text: rsx, + }; + messages.push(msg); + } + } + } + } + } + } + } + + for msg in &messages { + if socket + .send(Message::Text(serde_json::to_string(msg).unwrap())) + .await + .is_err() + { + return; + } + } + log::info!("Updated page"); + } + let mut rx = state.messages.subscribe(); let hot_reload_handle = tokio::spawn(async move { loop { @@ -329,21 +412,16 @@ async fn hot_reload_handler( } #[cfg(feature = "hot_reload")] -fn find_rs_files(root: &PathBuf, files: &mut HashMap) -> io::Result<()> { - for entry in fs::read_dir(root)? { - if let Ok(entry) = entry { - let path = entry.path(); - if path.is_dir() { - find_rs_files(&path, files)?; - } else { - if path.extension().map(|s| s.to_str()).flatten() == Some("rs") { - let mut file = File::open(path.clone()).unwrap(); - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - files.insert(path.display().to_string(), src); - } +fn get_min_location(path: &Path, ts: TokenStream) -> Option { + ts.into_iter() + .map(|tree| { + let location = tree.span(); + let start = location.start(); + CodeLocation { + file: path.display().to_string(), + line: start.line as u32, + column: start.column as u32 + 1, } - } - } - Ok(()) + }) + .min_by(|cl1, cl2| cl1.line.cmp(&cl2.line).then(cl1.column.cmp(&cl2.column))) } From 712d258496415f839b389da8163d5634a36e15f1 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 14 Jun 2022 07:31:37 -0500 Subject: [PATCH 139/330] clean up config statements --- src/hot_reload/mod.rs | 4 +- src/server/hot_reload.rs | 174 ++++++++++++++++++ src/server/mod.rs | 383 +++++++++++++++------------------------ 3 files changed, 321 insertions(+), 240 deletions(-) create mode 100644 src/server/hot_reload.rs diff --git a/src/hot_reload/mod.rs b/src/hot_reload/mod.rs index 8297fedb9..3aced9567 100644 --- a/src/hot_reload/mod.rs +++ b/src/hot_reload/mod.rs @@ -426,9 +426,7 @@ fn find_rsx_expr( && old_mac.path.get_ident().map(|ident| ident.to_string()) == Some("rsx".to_string()) { - if old_mac != new_mac { - rsx_calls.push((old_mac.clone(), new_mac.tokens.clone())); - } + rsx_calls.push((old_mac.clone(), new_mac.tokens.clone())); false } else { new_expr != old_expr diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs new file mode 100644 index 000000000..661d249e6 --- /dev/null +++ b/src/server/hot_reload.rs @@ -0,0 +1,174 @@ +use axum::{ + extract::{ws::Message, Extension, TypedHeader, WebSocketUpgrade}, + response::IntoResponse, +}; + +use std::{path::PathBuf, sync::Arc}; + +pub use crate::hot_reload::{find_rsx, DiffResult}; +use crate::CrateConfig; +pub use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; +pub use proc_macro2::TokenStream; +pub use std::collections::HashMap; +pub use std::sync::Mutex; +pub use std::time::SystemTime; +pub use std::{fs, io, path::Path}; +pub use std::{fs::File, io::Read}; +pub use syn::__private::ToTokens; +use tokio::sync::broadcast; + +pub struct HotReloadState { + pub messages: broadcast::Sender, + pub update: broadcast::Sender, + pub last_file_rebuild: Arc>, + pub watcher_config: CrateConfig, +} + +pub struct FileMap { + pub map: HashMap, + pub last_updated_time: std::time::SystemTime, +} + +impl FileMap { + pub fn new(path: PathBuf) -> Self { + fn find_rs_files(root: PathBuf) -> io::Result> { + let mut files = HashMap::new(); + if root.is_dir() { + let mut handles = Vec::new(); + for entry in fs::read_dir(root)? { + if let Ok(entry) = entry { + let path = entry.path(); + handles.push(std::thread::spawn(move || find_rs_files(path))); + } + } + for handle in handles { + files.extend(handle.join().unwrap()?); + } + } else { + if root.extension().map(|s| s.to_str()).flatten() == Some("rs") { + let mut file = File::open(root.clone()).unwrap(); + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + files.insert(root, src); + } + } + Ok(files) + } + Self { + last_updated_time: SystemTime::now(), + map: find_rs_files(path).unwrap(), + } + } +} + +pub async fn hot_reload_handler( + ws: WebSocketUpgrade, + _: Option>, + Extension(state): Extension>, +) -> impl IntoResponse { + ws.on_upgrade(|mut socket| async move { + log::info!("🔥 Hot Reload WebSocket connected"); + { + log::info!("Searching files for changes since last run..."); + // update any files that changed before the websocket connected. + let mut messages = Vec::new(); + + { + let handle = state.last_file_rebuild.lock().unwrap(); + let update_time = handle.last_updated_time.clone(); + for (k, v) in handle.map.iter() { + let mut file = File::open(k).unwrap(); + if let Ok(md) = file.metadata() { + if let Ok(time) = md.modified() { + if time < update_time { + continue; + } + } + } + let mut new = String::new(); + file.read_to_string(&mut new).expect("Unable to read file"); + if let Ok(new) = syn::parse_file(&new) { + if let Ok(old) = syn::parse_file(&v) { + if let DiffResult::RsxChanged(changed) = find_rsx(&new, &old) { + for (old, new) in changed.into_iter() { + if let Some(hr) = get_min_location( + k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), + old.to_token_stream(), + ) { + let rsx = new.to_string(); + let msg = SetRsxMessage { + location: hr, + new_text: rsx, + }; + messages.push(msg); + } + } + } + } + } + } + } + + for msg in &messages { + if socket + .send(Message::Text(serde_json::to_string(msg).unwrap())) + .await + .is_err() + { + return; + } + } + log::info!("Updated page"); + } + + let mut rx = state.messages.subscribe(); + let hot_reload_handle = tokio::spawn(async move { + loop { + let read_set_rsx = rx.recv(); + let read_err = socket.recv(); + tokio::select! { + err = read_err => { + if let Some(Ok(err)) = err { + if let Message::Text(err) = err { + let error: RecompileReason = serde_json::from_str(&err).unwrap(); + log::error!("{:?}", error); + if state.update.send("reload".to_string()).is_err() { + break; + } + } + } else { + break; + } + }, + set_rsx = read_set_rsx => { + if let Ok(rsx) = set_rsx { + if socket + .send(Message::Text(serde_json::to_string(&rsx).unwrap())) + .await + .is_err() + { + break; + }; + } + } + }; + } + }); + + hot_reload_handle.await.unwrap(); + }) +} + +pub fn get_min_location(path: &Path, ts: TokenStream) -> Option { + ts.into_iter() + .map(|tree| { + let location = tree.span(); + let start = location.start(); + CodeLocation { + file: path.display().to_string(), + line: start.line as u32, + column: start.column as u32 + 1, + } + }) + .min_by(|cl1, cl2| cl1.line.cmp(&cl2.line).then(cl1.column.cmp(&cl2.column))) +} diff --git a/src/server/mod.rs b/src/server/mod.rs index a0bdf24b0..262dbf17d 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -16,19 +16,9 @@ use crate::{builder, serve::Serve, CrateConfig, Result}; use tokio::sync::broadcast; #[cfg(feature = "hot_reload")] -mod hot_reload_improts { - pub use crate::hot_reload::{find_rsx, DiffResult}; - pub use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; - pub use proc_macro2::TokenStream; - pub use std::collections::HashMap; - pub use std::sync::Mutex; - pub use std::time::SystemTime; - pub use std::{fs, io, path::Path}; - pub use std::{fs::File, io::Read}; - pub use syn::__private::ToTokens; -} +mod hot_reload; #[cfg(feature = "hot_reload")] -use hot_reload_improts::*; +use hot_reload::*; struct WsReloadState { update: broadcast::Sender, @@ -38,76 +28,24 @@ struct WsReloadState { } #[cfg(feature = "hot_reload")] -struct HotReloadState { - messages: broadcast::Sender, - update: broadcast::Sender, - last_file_rebuild: Arc>, - watcher_config: CrateConfig, -} - -#[cfg(feature = "hot_reload")] -struct FileMap { - map: HashMap, - last_updated_time: std::time::SystemTime, -} - -#[cfg(feature = "hot_reload")] -impl FileMap { - fn new(path: PathBuf) -> Self { - fn find_rs_files(root: PathBuf) -> io::Result> { - let mut files = HashMap::new(); - if root.is_dir() { - let mut handles = Vec::new(); - for entry in fs::read_dir(root)? { - if let Ok(entry) = entry { - let path = entry.path(); - handles.push(std::thread::spawn(move || find_rs_files(path))); - } - } - for handle in handles { - files.extend(handle.join().unwrap()?); - } - } else { - if root.extension().map(|s| s.to_str()).flatten() == Some("rs") { - let mut file = File::open(root.clone()).unwrap(); - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - files.insert(root, src); - } - } - Ok(files) - } - Self { - last_updated_time: SystemTime::now(), - map: find_rs_files(path).unwrap(), - } - } -} - pub async fn startup(config: CrateConfig) -> Result<()> { log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); - let (reload_tx, _) = broadcast::channel(100); - - #[cfg(feature = "hot_reload")] let last_file_rebuild = Arc::new(Mutex::new(FileMap::new(config.crate_dir.clone()))); - #[cfg(feature = "hot_reload")] let hot_reload_tx = broadcast::channel(100).0; - #[cfg(feature = "hot_reload")] let hot_reload_state = Arc::new(HotReloadState { messages: hot_reload_tx.clone(), update: reload_tx.clone(), last_file_rebuild: last_file_rebuild.clone(), watcher_config: config.clone(), }); - #[cfg(feature = "hot_reload")] - let crate_dir = config.crate_dir.clone(); + let crate_dir = config.crate_dir.clone(); let ws_reload_state = Arc::new(WsReloadState { update: reload_tx.clone(), - #[cfg(feature = "hot_reload")] + last_file_rebuild: last_file_rebuild.clone(), watcher_config: config.clone(), }); @@ -125,63 +63,49 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let mut watcher = RecommendedWatcher::new(move |evt: notify::Result| { if let Ok(evt) = evt { - if let notify::EventKind::Modify(_) = evt.kind { - #[cfg(feature = "hot_reload")] - { - for path in evt.paths { - let mut file = File::open(path.clone()).unwrap(); - if path.extension().map(|p| p.to_str()).flatten() != Some("rs") { - continue; - } - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - if src.is_empty() { - continue; - } - if let Ok(syntax) = syn::parse_file(&src) { - let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); - if let Some(old_str) = last_file_rebuild.map.get(&path) { - if let Ok(old) = syn::parse_file(&old_str) { - match find_rsx(&syntax, &old) { - DiffResult::CodeChanged => { - log::info!("reload required"); - if chrono::Local::now().timestamp() > last_update_time { - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); - } - } - DiffResult::RsxChanged(changed) => { - log::info!("reloading rsx"); - for (old, new) in changed.into_iter() { - if let Some(hr) = get_min_location( - &path - .strip_prefix(&crate_dir) - .unwrap() - .to_path_buf(), - old.to_token_stream(), - ) { - let rsx = new.to_string(); - let _ = hot_reload_tx.send(SetRsxMessage { - location: hr, - new_text: rsx, - }); - } - } + for path in evt.paths { + let mut file = File::open(path.clone()).unwrap(); + if path.extension().map(|p| p.to_str()).flatten() != Some("rs") { + continue; + } + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + if src.is_empty() { + continue; + } + // find changes to the rsx in the file + if let Ok(syntax) = syn::parse_file(&src) { + let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); + if let Some(old_str) = last_file_rebuild.map.get(&path) { + if let Ok(old) = syn::parse_file(&old_str) { + match find_rsx(&syntax, &old) { + DiffResult::CodeChanged => { + log::info!("reload required"); + if chrono::Local::now().timestamp() > last_update_time { + let _ = reload_tx.send("reload".into()); + last_update_time = chrono::Local::now().timestamp(); + } + } + DiffResult::RsxChanged(changed) => { + log::info!("reloading rsx"); + for (old, new) in changed.into_iter() { + if let Some(hr) = get_min_location( + &path.strip_prefix(&crate_dir).unwrap().to_path_buf(), + old.to_token_stream(), + ) { + let rsx = new.to_string(); + let _ = hot_reload_tx.send(SetRsxMessage { + location: hr, + new_text: rsx, + }); } } } - } else { - *last_file_rebuild = FileMap::new(crate_dir.clone()); } } - } - } - #[cfg(not(feature = "hot_reload"))] - { - log::info!("reload required"); - if chrono::Local::now().timestamp() > last_update_time { - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); + } else { + // if this is a new file, rebuild the project + *last_file_rebuild = FileMap::new(crate_dir.clone()); } } } @@ -250,13 +174,112 @@ pub async fn startup(config: CrateConfig) -> Result<()> { }), ); - #[cfg(feature = "hot_reload")] - let router = router.route("/_dioxus/hot_reload", get(hot_reload_handler)); + let router = router + .route("/_dioxus/hot_reload", get(hot_reload_handler)) + .layer(Extension(ws_reload_state)) + .layer(Extension(hot_reload_state)); - let router = router.layer(Extension(ws_reload_state)); + axum::Server::bind(&format!("0.0.0.0:{}", port).parse().unwrap()) + .serve(router.into_make_service()) + .await?; - #[cfg(feature = "hot_reload")] - let router = router.layer(Extension(hot_reload_state)); + Ok(()) +} + +#[cfg(not(feature = "hot_reload"))] +pub async fn startup(config: CrateConfig) -> Result<()> { + log::info!("🚀 Starting development server..."); + + let dist_path = config.out_dir.clone(); + + let (reload_tx, _) = broadcast::channel(100); + + let ws_reload_state = Arc::new(WsReloadState { + update: reload_tx.clone(), + watcher_config: config.clone(), + }); + + let mut last_update_time = chrono::Local::now().timestamp(); + + // file watcher: check file change + let allow_watch_path = config + .dioxus_config + .web + .watcher + .watch_path + .clone() + .unwrap_or_else(|| vec![PathBuf::from("src")]); + + let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { + log::info!("reload required"); + if chrono::Local::now().timestamp() > last_update_time { + let _ = reload_tx.send("reload".into()); + last_update_time = chrono::Local::now().timestamp(); + } + }) + .unwrap(); + + for sub_path in allow_watch_path { + watcher + .watch( + &config.crate_dir.join(sub_path), + notify::RecursiveMode::Recursive, + ) + .unwrap(); + } + + // start serve dev-server at 0.0.0.0:8080 + let port = "8080"; + log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); + + let file_service_config = config.clone(); + let file_service = ServiceBuilder::new() + .and_then( + |response: Response| async move { + let response = if file_service_config + .dioxus_config + .web + .watcher + .index_on_404 + .unwrap_or(false) + && response.status() == StatusCode::NOT_FOUND + { + let body = Full::from( + // TODO: Cache/memoize this. + std::fs::read_to_string( + file_service_config + .crate_dir + .join(file_service_config.out_dir) + .join("index.html"), + ) + .ok() + .unwrap(), + ) + .map_err(|err| match err {}) + .boxed(); + Response::builder() + .status(StatusCode::OK) + .body(body) + .unwrap() + } else { + response.map(|body| body.boxed()) + }; + Ok(response) + }, + ) + .service(ServeDir::new((&config.crate_dir).join(&dist_path))); + + let router = Router::new() + .route("/_dioxus/ws", get(ws_handler)) + .fallback( + get_service(file_service).handle_error(|error: std::io::Error| async move { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Unhandled internal error: {}", error), + ) + }), + ) + .layer(Extension(ws_reload_state)); axum::Server::bind(&format!("0.0.0.0:{}", port).parse().unwrap()) .serve(router.into_make_service()) @@ -311,117 +334,3 @@ async fn ws_handler( reload_watcher.await.unwrap(); }) } - -#[cfg(feature = "hot_reload")] -async fn hot_reload_handler( - ws: WebSocketUpgrade, - _: Option>, - Extension(state): Extension>, -) -> impl IntoResponse { - ws.on_upgrade(|mut socket| async move { - log::info!("🔥 Hot Reload WebSocket connected"); - { - log::info!("Searching files for changes since last run..."); - // update any files that changed before the websocket connected. - let mut messages = Vec::new(); - - { - let handle = state.last_file_rebuild.lock().unwrap(); - let update_time = handle.last_updated_time.clone(); - for (k, v) in handle.map.iter() { - let mut file = File::open(k).unwrap(); - if let Ok(md) = file.metadata() { - if let Ok(time) = md.modified() { - if time < update_time { - continue; - } - } - } - let mut new = String::new(); - file.read_to_string(&mut new).expect("Unable to read file"); - if let Ok(new) = syn::parse_file(&new) { - if let Ok(old) = syn::parse_file(&v) { - if let DiffResult::RsxChanged(changed) = find_rsx(&new, &old) { - for (old, new) in changed.into_iter() { - if let Some(hr) = get_min_location( - k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), - old.to_token_stream(), - ) { - let rsx = new.to_string(); - let msg = SetRsxMessage { - location: hr, - new_text: rsx, - }; - messages.push(msg); - } - } - } - } - } - } - } - - for msg in &messages { - if socket - .send(Message::Text(serde_json::to_string(msg).unwrap())) - .await - .is_err() - { - return; - } - } - log::info!("Updated page"); - } - - let mut rx = state.messages.subscribe(); - let hot_reload_handle = tokio::spawn(async move { - loop { - let read_set_rsx = rx.recv(); - let read_err = socket.recv(); - tokio::select! { - err = read_err => { - if let Some(Ok(err)) = err { - if let Message::Text(err) = err { - let error: RecompileReason = serde_json::from_str(&err).unwrap(); - log::error!("{:?}", error); - if state.update.send("reload".to_string()).is_err() { - break; - } - } - } else { - break; - } - }, - set_rsx = read_set_rsx => { - if let Ok(rsx) = set_rsx { - if socket - .send(Message::Text(serde_json::to_string(&rsx).unwrap())) - .await - .is_err() - { - break; - }; - } - } - }; - } - }); - - hot_reload_handle.await.unwrap(); - }) -} - -#[cfg(feature = "hot_reload")] -fn get_min_location(path: &Path, ts: TokenStream) -> Option { - ts.into_iter() - .map(|tree| { - let location = tree.span(); - let start = location.start(); - CodeLocation { - file: path.display().to_string(), - line: start.line as u32, - column: start.column as u32 + 1, - } - }) - .min_by(|cl1, cl2| cl1.line.cmp(&cl2.line).then(cl1.column.cmp(&cl2.column))) -} From fb7ea5915b303fe79682a299bbb6bdc3907e2e82 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 14 Jun 2022 09:47:16 -0500 Subject: [PATCH 140/330] use cli flag instead of feature flag --- Cargo.toml | 8 +++----- src/cli/cfg.rs | 5 +++++ src/cli/serve/mod.rs | 4 +++- src/config.rs | 8 ++++++++ src/lib.rs | 1 - src/server/mod.rs | 26 +++++++++++++++----------- 6 files changed, 34 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 770fd7b1d..7f1223520 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,12 +46,10 @@ flate2 = "1.0.22" tar = "0.4.38" tower = "0.4.12" -syn = { version = "1.0", optional = true } -dioxus-rsx-interpreter = { path = "../dioxus/packages/rsx_interpreter", optional = true } -proc-macro2 = { version = "1.0", features = ["span-locations"], optional = true } +syn = { version = "1.0" } +dioxus-rsx-interpreter = { path = "../dioxus/packages/rsx_interpreter" } +proc-macro2 = { version = "1.0", features = ["span-locations"] } -[features] -hot_reload = ["dioxus-rsx-interpreter", "proc-macro2", "syn"] [[bin]] path = "src/main.rs" diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index f5ee45b87..3f284cbbf 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -39,6 +39,11 @@ pub struct ConfigOptsServe { /// Build platform: support Web & Desktop [default: "default_platform"] #[clap(long)] pub platform: Option, + + /// Build with hot reloading rsx [default: false] + #[clap(long)] + #[serde(default)] + pub hot_reload: bool, } /// Ensure the given value for `--public-url` is formatted correctly. diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 85bd92c74..391e646d4 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -18,7 +18,9 @@ impl Serve { let mut crate_config = crate::CrateConfig::new()?; // change the relase state. - crate_config.with_release(self.serve.release); + crate_config + .with_release(self.serve.release) + .with_hot_reload(self.serve.hot_reload); if self.serve.example.is_some() { crate_config.as_example(self.serve.example.unwrap()); diff --git a/src/config.rs b/src/config.rs index 783c72ccd..aa2a03440 100644 --- a/src/config.rs +++ b/src/config.rs @@ -114,6 +114,7 @@ pub struct CrateConfig { pub executable: ExecutableType, pub dioxus_config: DioxusConfig, pub release: bool, + pub hot_reload: bool, } #[derive(Debug, Clone)] @@ -162,6 +163,7 @@ impl CrateConfig { let executable = ExecutableType::Binary(output_filename); let release = false; + let hot_reload = false; Ok(Self { out_dir, @@ -173,6 +175,7 @@ impl CrateConfig { executable, release, dioxus_config, + hot_reload, }) } @@ -186,6 +189,11 @@ impl CrateConfig { self } + pub fn with_hot_reload(&mut self, hot_reload: bool) -> &mut Self { + self.hot_reload = hot_reload; + self + } + // pub fn with_build_options(&mut self, options: &BuildOptions) { // if let Some(name) = &options.example { // self.as_example(name.clone()); diff --git a/src/lib.rs b/src/lib.rs index 683b7251a..6d009c18c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,5 +19,4 @@ pub use error::*; pub mod logging; pub use logging::*; -#[cfg(feature = "hot_reload")] pub mod hot_reload; diff --git a/src/server/mod.rs b/src/server/mod.rs index 262dbf17d..8a98fd9d9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -15,20 +15,24 @@ use tower_http::services::fs::{ServeDir, ServeFileSystemResponseBody}; use crate::{builder, serve::Serve, CrateConfig, Result}; use tokio::sync::broadcast; -#[cfg(feature = "hot_reload")] mod hot_reload; -#[cfg(feature = "hot_reload")] use hot_reload::*; struct WsReloadState { update: broadcast::Sender, - #[cfg(feature = "hot_reload")] - last_file_rebuild: Arc>, + last_file_rebuild: Option>>, watcher_config: CrateConfig, } -#[cfg(feature = "hot_reload")] pub async fn startup(config: CrateConfig) -> Result<()> { + if config.hot_reload { + startup_hot_reload(config).await + } else { + startup_default(config).await + } +} + +pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); @@ -46,7 +50,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let ws_reload_state = Arc::new(WsReloadState { update: reload_tx.clone(), - last_file_rebuild: last_file_rebuild.clone(), + last_file_rebuild: Some(last_file_rebuild.clone()), watcher_config: config.clone(), }); @@ -186,8 +190,7 @@ pub async fn startup(config: CrateConfig) -> Result<()> { Ok(()) } -#[cfg(not(feature = "hot_reload"))] -pub async fn startup(config: CrateConfig) -> Result<()> { +pub async fn startup_default(config: CrateConfig) -> Result<()> { log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); @@ -196,6 +199,8 @@ pub async fn startup(config: CrateConfig) -> Result<()> { let ws_reload_state = Arc::new(WsReloadState { update: reload_tx.clone(), + + last_file_rebuild: None, watcher_config: config.clone(), }); @@ -313,9 +318,8 @@ async fn ws_handler( { let _ = Serve::regen_dev_page(&state.watcher_config); } - #[cfg(feature = "hot_reload")] - { - let mut write = state.last_file_rebuild.lock().unwrap(); + if let Some(file_map) = &state.last_file_rebuild { + let mut write = file_map.lock().unwrap(); *write = FileMap::new(state.watcher_config.crate_dir.clone()); } } From b0f987aa106994e95af8e75765ce12321684821b Mon Sep 17 00:00:00 2001 From: Demonthos <66571940+Demonthos@users.noreply.github.com> Date: Wed, 15 Jun 2022 12:55:25 -0500 Subject: [PATCH 141/330] accept all interperter errors --- src/server/hot_reload.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index 661d249e6..a9f51abe7 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -7,7 +7,7 @@ use std::{path::PathBuf, sync::Arc}; pub use crate::hot_reload::{find_rsx, DiffResult}; use crate::CrateConfig; -pub use dioxus_rsx_interpreter::{error::RecompileReason, CodeLocation, SetRsxMessage}; +pub use dioxus_rsx_interpreter::{error::Error, CodeLocation, SetRsxMessage}; pub use proc_macro2::TokenStream; pub use std::collections::HashMap; pub use std::sync::Mutex; @@ -130,7 +130,7 @@ pub async fn hot_reload_handler( err = read_err => { if let Some(Ok(err)) = err { if let Message::Text(err) = err { - let error: RecompileReason = serde_json::from_str(&err).unwrap(); + let error: Error = serde_json::from_str(&err).unwrap(); log::error!("{:?}", error); if state.update.send("reload".to_string()).is_err() { break; From 8ff50df3a5dc14b90b15fd84122a12436326144a Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Wed, 15 Jun 2022 13:29:35 -0500 Subject: [PATCH 142/330] preserve whitespace in rsx --- src/server/hot_reload.rs | 37 ++++++++++++++++--------------------- src/server/mod.rs | 29 ++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index a9f51abe7..f79a7a50e 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -15,6 +15,7 @@ pub use std::time::SystemTime; pub use std::{fs, io, path::Path}; pub use std::{fs::File, io::Read}; pub use syn::__private::ToTokens; +use syn::spanned::Spanned; use tokio::sync::broadcast; pub struct HotReloadState { @@ -91,17 +92,16 @@ pub async fn hot_reload_handler( if let Ok(old) = syn::parse_file(&v) { if let DiffResult::RsxChanged(changed) = find_rsx(&new, &old) { for (old, new) in changed.into_iter() { - if let Some(hr) = get_min_location( + let hr = get_location( k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), old.to_token_stream(), - ) { - let rsx = new.to_string(); - let msg = SetRsxMessage { - location: hr, - new_text: rsx, - }; - messages.push(msg); - } + ); + let rsx = new.to_string(); + let msg = SetRsxMessage { + location: hr, + new_text: rsx, + }; + messages.push(msg); } } } @@ -159,16 +159,11 @@ pub async fn hot_reload_handler( }) } -pub fn get_min_location(path: &Path, ts: TokenStream) -> Option { - ts.into_iter() - .map(|tree| { - let location = tree.span(); - let start = location.start(); - CodeLocation { - file: path.display().to_string(), - line: start.line as u32, - column: start.column as u32 + 1, - } - }) - .min_by(|cl1, cl2| cl1.line.cmp(&cl2.line).then(cl1.column.cmp(&cl2.column))) +pub fn get_location(path: &Path, ts: TokenStream) -> CodeLocation { + let span = ts.span().start(); + CodeLocation { + file: path.display().to_string(), + line: span.line as u32, + column: span.column as u32 + 1, + } } diff --git a/src/server/mod.rs b/src/server/mod.rs index 8a98fd9d9..3397beac6 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,6 +7,7 @@ use axum::{ Router, }; use notify::{RecommendedWatcher, Watcher}; +use syn::spanned::Spanned; use std::{path::PathBuf, sync::Arc}; use tower::ServiceBuilder; @@ -93,16 +94,30 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { DiffResult::RsxChanged(changed) => { log::info!("reloading rsx"); for (old, new) in changed.into_iter() { - if let Some(hr) = get_min_location( + let hr = get_location( &path.strip_prefix(&crate_dir).unwrap().to_path_buf(), old.to_token_stream(), - ) { - let rsx = new.to_string(); - let _ = hot_reload_tx.send(SetRsxMessage { - location: hr, - new_text: rsx, - }); + ); + // get the original source code to preserve whitespace + let span = new.span(); + let start = span.start(); + let end = span.end(); + let mut lines: Vec<_> = src + .lines() + .skip(start.line - 1) + .take(end.line - start.line + 1) + .collect(); + if let Some(first) = lines.first_mut() { + *first = first.split_at(start.column).1; } + if let Some(last) = lines.last_mut() { + *last = last.split_at(end.column).0; + } + let rsx = lines.join("\n"); + let _ = hot_reload_tx.send(SetRsxMessage { + location: hr, + new_text: rsx, + }); } } } From edc31dfc031025a6a7893da39fe3278fa053d2c7 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Wed, 15 Jun 2022 13:58:24 -0500 Subject: [PATCH 143/330] better error messages --- src/server/hot_reload.rs | 45 +++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index f79a7a50e..2011b8958 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -86,22 +86,36 @@ pub async fn hot_reload_handler( } } } - let mut new = String::new(); - file.read_to_string(&mut new).expect("Unable to read file"); - if let Ok(new) = syn::parse_file(&new) { - if let Ok(old) = syn::parse_file(&v) { - if let DiffResult::RsxChanged(changed) = find_rsx(&new, &old) { + let mut new_str = String::new(); + file.read_to_string(&mut new_str).expect("Unable to read file"); + if let Ok(new_file) = syn::parse_file(&new_str) { + if let Ok(old_file) = syn::parse_file(&v) { + if let DiffResult::RsxChanged(changed) = find_rsx(&new_file, &old_file) { for (old, new) in changed.into_iter() { let hr = get_location( k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), old.to_token_stream(), ); - let rsx = new.to_string(); - let msg = SetRsxMessage { + // get the original source code to preserve whitespace + let span = new.span(); + let start = span.start(); + let end = span.end(); + let mut lines: Vec<_> = new_str + .lines() + .skip(start.line - 1) + .take(end.line - start.line + 1) + .collect(); + if let Some(first) = lines.first_mut() { + *first = first.split_at(start.column).1; + } + if let Some(last) = lines.last_mut() { + *last = last.split_at(end.column).0; + } + let rsx = lines.join("\n"); + messages.push(SetRsxMessage { location: hr, new_text: rsx, - }; - messages.push(msg); + }); } } } @@ -131,9 +145,16 @@ pub async fn hot_reload_handler( if let Some(Ok(err)) = err { if let Message::Text(err) = err { let error: Error = serde_json::from_str(&err).unwrap(); - log::error!("{:?}", error); - if state.update.send("reload".to_string()).is_err() { - break; + match error{ + Error::ParseError(parse_error) => { + log::error!("parse error:\n--> at {}:{}:{}\n\t{:?}", parse_error.location.file, parse_error.location.line, parse_error.location.column, parse_error.message); + }, + Error::RecompileRequiredError(reason) => { + log::info!("{:?}", reason); + if state.update.send("reload".to_string()).is_err() { + break; + } + } } } } else { From 8e33b8e02711cc4108f4d05d2cf95d647ad697d7 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 16 Jun 2022 09:11:02 -0500 Subject: [PATCH 144/330] improve speed when reloading the site --- src/server/hot_reload.rs | 91 +++++++++++++++++++++-------- src/server/mod.rs | 120 +++++++++++++++++++++------------------ 2 files changed, 132 insertions(+), 79 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index 2011b8958..14f9ffbc6 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -2,12 +2,13 @@ use axum::{ extract::{ws::Message, Extension, TypedHeader, WebSocketUpgrade}, response::IntoResponse, }; +use dioxus_rsx_interpreter::SetRsxMessage; use std::{path::PathBuf, sync::Arc}; pub use crate::hot_reload::{find_rsx, DiffResult}; use crate::CrateConfig; -pub use dioxus_rsx_interpreter::{error::Error, CodeLocation, SetRsxMessage}; +pub use dioxus_rsx_interpreter::{error::Error, CodeLocation, SetManyRsxMessage}; pub use proc_macro2::TokenStream; pub use std::collections::HashMap; pub use std::sync::Mutex; @@ -19,7 +20,7 @@ use syn::spanned::Spanned; use tokio::sync::broadcast; pub struct HotReloadState { - pub messages: broadcast::Sender, + pub messages: broadcast::Sender, pub update: broadcast::Sender, pub last_file_rebuild: Arc>, pub watcher_config: CrateConfig, @@ -32,32 +33,76 @@ pub struct FileMap { impl FileMap { pub fn new(path: PathBuf) -> Self { + log::info!("Searching files for changes since last compile..."); fn find_rs_files(root: PathBuf) -> io::Result> { let mut files = HashMap::new(); if root.is_dir() { - let mut handles = Vec::new(); for entry in fs::read_dir(root)? { if let Ok(entry) = entry { let path = entry.path(); - handles.push(std::thread::spawn(move || find_rs_files(path))); + files.extend(find_rs_files(path)?); } } - for handle in handles { - files.extend(handle.join().unwrap()?); - } } else { if root.extension().map(|s| s.to_str()).flatten() == Some("rs") { - let mut file = File::open(root.clone()).unwrap(); - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - files.insert(root, src); + if let Ok(mut file) = File::open(root.clone()) { + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + files.insert(root, src); + } } } Ok(files) } - Self { - last_updated_time: SystemTime::now(), + + let last_updated_time = SystemTime::now(); + let result = Self { + last_updated_time, map: find_rs_files(path).unwrap(), + }; + log::info!("Files updated"); + result + } + + pub fn update(&mut self, path: PathBuf) { + log::info!("Updating files that changed since last compile..."); + self.last_updated_time = SystemTime::now(); + self.update_inner(path); + log::info!("Files updated"); + } + + fn update_inner(&mut self, path: PathBuf) { + if path.is_dir() { + if let Ok(files) = fs::read_dir(path) { + for entry in files { + if let Ok(entry) = entry { + if let Ok(md) = entry.metadata() { + if let Ok(time) = md.modified() { + if time < self.last_updated_time { + return; + } + } + } + let path = entry.path(); + self.update(path); + } + } + } + } else { + if path.extension().map(|s| s.to_str()).flatten() == Some("rs") { + if let Ok(mut file) = File::open(path.clone()) { + if let Ok(md) = file.metadata() { + if let Ok(time) = md.modified() { + if time < self.last_updated_time { + return; + } + } + } + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + self.map.insert(path, src); + } + } } } } @@ -70,7 +115,6 @@ pub async fn hot_reload_handler( ws.on_upgrade(|mut socket| async move { log::info!("🔥 Hot Reload WebSocket connected"); { - log::info!("Searching files for changes since last run..."); // update any files that changed before the websocket connected. let mut messages = Vec::new(); @@ -123,16 +167,14 @@ pub async fn hot_reload_handler( } } - for msg in &messages { - if socket - .send(Message::Text(serde_json::to_string(msg).unwrap())) - .await - .is_err() - { - return; - } + let msg = SetManyRsxMessage(messages); + if socket + .send(Message::Text(serde_json::to_string(&msg).unwrap())) + .await + .is_err() + { + return; } - log::info!("Updated page"); } let mut rx = state.messages.subscribe(); @@ -149,8 +191,7 @@ pub async fn hot_reload_handler( Error::ParseError(parse_error) => { log::error!("parse error:\n--> at {}:{}:{}\n\t{:?}", parse_error.location.file, parse_error.location.line, parse_error.location.column, parse_error.message); }, - Error::RecompileRequiredError(reason) => { - log::info!("{:?}", reason); + Error::RecompileRequiredError(_) => { if state.update.send("reload".to_string()).is_err() { break; } diff --git a/src/server/mod.rs b/src/server/mod.rs index 3397beac6..19791fd79 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -6,6 +6,7 @@ use axum::{ routing::{get, get_service}, Router, }; +use dioxus_rsx_interpreter::SetRsxMessage; use notify::{RecommendedWatcher, Watcher}; use syn::spanned::Spanned; @@ -67,67 +68,75 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { .unwrap_or_else(|| vec![PathBuf::from("src")]); let mut watcher = RecommendedWatcher::new(move |evt: notify::Result| { - if let Ok(evt) = evt { - for path in evt.paths { - let mut file = File::open(path.clone()).unwrap(); - if path.extension().map(|p| p.to_str()).flatten() != Some("rs") { - continue; - } - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - if src.is_empty() { - continue; - } - // find changes to the rsx in the file - if let Ok(syntax) = syn::parse_file(&src) { - let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); - if let Some(old_str) = last_file_rebuild.map.get(&path) { - if let Ok(old) = syn::parse_file(&old_str) { - match find_rsx(&syntax, &old) { - DiffResult::CodeChanged => { - log::info!("reload required"); - if chrono::Local::now().timestamp() > last_update_time { - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); + if chrono::Local::now().timestamp() > last_update_time { + if let Ok(evt) = evt { + let mut messages = Vec::new(); + for path in evt.paths { + let mut file = File::open(path.clone()).unwrap(); + if path.extension().map(|p| p.to_str()).flatten() != Some("rs") { + continue; + } + let mut src = String::new(); + file.read_to_string(&mut src).expect("Unable to read file"); + if src.is_empty() { + continue; + } + // find changes to the rsx in the file + if let Ok(syntax) = syn::parse_file(&src) { + let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); + if let Some(old_str) = last_file_rebuild.map.get(&path) { + if let Ok(old) = syn::parse_file(&old_str) { + match find_rsx(&syntax, &old) { + DiffResult::CodeChanged => { + log::info!("reload required"); + let _ = reload_tx.send("reload time".into()); + break; } - } - DiffResult::RsxChanged(changed) => { - log::info!("reloading rsx"); - for (old, new) in changed.into_iter() { - let hr = get_location( - &path.strip_prefix(&crate_dir).unwrap().to_path_buf(), - old.to_token_stream(), - ); - // get the original source code to preserve whitespace - let span = new.span(); - let start = span.start(); - let end = span.end(); - let mut lines: Vec<_> = src - .lines() - .skip(start.line - 1) - .take(end.line - start.line + 1) - .collect(); - if let Some(first) = lines.first_mut() { - *first = first.split_at(start.column).1; + DiffResult::RsxChanged(changed) => { + log::info!("reloading rsx"); + for (old, new) in changed.into_iter() { + let hr = get_location( + &path + .strip_prefix(&crate_dir) + .unwrap() + .to_path_buf(), + old.to_token_stream(), + ); + // get the original source code to preserve whitespace + let span = new.span(); + let start = span.start(); + let end = span.end(); + let mut lines: Vec<_> = src + .lines() + .skip(start.line - 1) + .take(end.line - start.line + 1) + .collect(); + if let Some(first) = lines.first_mut() { + *first = first.split_at(start.column).1; + } + if let Some(last) = lines.last_mut() { + *last = last.split_at(end.column).0; + } + let rsx = lines.join("\n"); + messages.push(SetRsxMessage { + location: hr, + new_text: rsx, + }); } - if let Some(last) = lines.last_mut() { - *last = last.split_at(end.column).0; - } - let rsx = lines.join("\n"); - let _ = hot_reload_tx.send(SetRsxMessage { - location: hr, - new_text: rsx, - }); } } } + } else { + // if this is a new file, rebuild the project + *last_file_rebuild = FileMap::new(crate_dir.clone()); } - } else { - // if this is a new file, rebuild the project - *last_file_rebuild = FileMap::new(crate_dir.clone()); } } + if !messages.is_empty() { + let _ = hot_reload_tx.send(SetManyRsxMessage(messages)); + } } + last_update_time = chrono::Local::now().timestamp(); } }) .unwrap(); @@ -313,7 +322,7 @@ async fn ws_handler( _: Option>, Extension(state): Extension>, ) -> impl IntoResponse { - ws.on_upgrade(|mut socket| async move { + ws.max_send_queue(1).on_upgrade(|mut socket| async move { let mut rx = state.update.subscribe(); let reload_watcher = tokio::spawn(async move { loop { @@ -335,7 +344,7 @@ async fn ws_handler( } if let Some(file_map) = &state.last_file_rebuild { let mut write = file_map.lock().unwrap(); - *write = FileMap::new(state.watcher_config.crate_dir.clone()); + write.update(state.watcher_config.crate_dir.clone()); } } // ignore the error @@ -346,6 +355,9 @@ async fn ws_handler( { break; } + + // flush the errors after recompling + rx = rx.resubscribe(); } } }); From 22e40c6bc1f35f0a3c9a6ec9d225f7c4fe029fff Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 16 Jun 2022 10:21:28 -0500 Subject: [PATCH 145/330] removed debugging messages --- src/server/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 19791fd79..bf9299022 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -89,7 +89,7 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { match find_rsx(&syntax, &old) { DiffResult::CodeChanged => { log::info!("reload required"); - let _ = reload_tx.send("reload time".into()); + let _ = reload_tx.send("reload".into()); break; } DiffResult::RsxChanged(changed) => { From a79046f36a39a20cc4e43f8e3d83df46e23b4fa5 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 16 Jun 2022 13:13:06 -0500 Subject: [PATCH 146/330] use build manager instead of rebuilding in the ws handler --- src/server/hot_reload.rs | 53 +++--------------- src/server/mod.rs | 115 ++++++++++++++++++++++----------------- 2 files changed, 72 insertions(+), 96 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index 14f9ffbc6..6a2a58ba0 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -6,6 +6,7 @@ use dioxus_rsx_interpreter::SetRsxMessage; use std::{path::PathBuf, sync::Arc}; +use super::BuildManager; pub use crate::hot_reload::{find_rsx, DiffResult}; use crate::CrateConfig; pub use dioxus_rsx_interpreter::{error::Error, CodeLocation, SetManyRsxMessage}; @@ -21,7 +22,7 @@ use tokio::sync::broadcast; pub struct HotReloadState { pub messages: broadcast::Sender, - pub update: broadcast::Sender, + pub build_manager: Arc, pub last_file_rebuild: Arc>, pub watcher_config: CrateConfig, } @@ -63,48 +64,6 @@ impl FileMap { log::info!("Files updated"); result } - - pub fn update(&mut self, path: PathBuf) { - log::info!("Updating files that changed since last compile..."); - self.last_updated_time = SystemTime::now(); - self.update_inner(path); - log::info!("Files updated"); - } - - fn update_inner(&mut self, path: PathBuf) { - if path.is_dir() { - if let Ok(files) = fs::read_dir(path) { - for entry in files { - if let Ok(entry) = entry { - if let Ok(md) = entry.metadata() { - if let Ok(time) = md.modified() { - if time < self.last_updated_time { - return; - } - } - } - let path = entry.path(); - self.update(path); - } - } - } - } else { - if path.extension().map(|s| s.to_str()).flatten() == Some("rs") { - if let Ok(mut file) = File::open(path.clone()) { - if let Ok(md) = file.metadata() { - if let Ok(time) = md.modified() { - if time < self.last_updated_time { - return; - } - } - } - let mut src = String::new(); - file.read_to_string(&mut src).expect("Unable to read file"); - self.map.insert(path, src); - } - } - } - } } pub async fn hot_reload_handler( @@ -115,10 +74,11 @@ pub async fn hot_reload_handler( ws.on_upgrade(|mut socket| async move { log::info!("🔥 Hot Reload WebSocket connected"); { - // update any files that changed before the websocket connected. + // update any rsx calls that changed before the websocket connected. let mut messages = Vec::new(); { + println!("Finding updates since last reload..."); let handle = state.last_file_rebuild.lock().unwrap(); let update_time = handle.last_updated_time.clone(); for (k, v) in handle.map.iter() { @@ -165,6 +125,7 @@ pub async fn hot_reload_handler( } } } + println!("finished"); } let msg = SetManyRsxMessage(messages); @@ -192,8 +153,8 @@ pub async fn hot_reload_handler( log::error!("parse error:\n--> at {}:{}:{}\n\t{:?}", parse_error.location.file, parse_error.location.line, parse_error.location.column, parse_error.message); }, Error::RecompileRequiredError(_) => { - if state.update.send("reload".to_string()).is_err() { - break; + if let Err(err) = state.build_manager.build(){ + log::error!("{}", err); } } } diff --git a/src/server/mod.rs b/src/server/mod.rs index bf9299022..5742c86ee 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -20,18 +20,43 @@ use tokio::sync::broadcast; mod hot_reload; use hot_reload::*; +pub struct BuildManager { + config: CrateConfig, + reload_tx: broadcast::Sender<()>, +} + +impl BuildManager { + fn build(&self) -> Result<()> { + log::info!("Start to rebuild project..."); + builder::build(&self.config)?; + // change the websocket reload state to true; + // the page will auto-reload. + if self + .config + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&self.config); + } + let _ = self.reload_tx.send(()); + Ok(()) + } +} + struct WsReloadState { - update: broadcast::Sender, - last_file_rebuild: Option>>, - watcher_config: CrateConfig, + update: broadcast::Sender<()>, } pub async fn startup(config: CrateConfig) -> Result<()> { if config.hot_reload { - startup_hot_reload(config).await + startup_hot_reload(config).await? } else { - startup_default(config).await + startup_default(config).await? } + Ok(()) } pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { @@ -40,10 +65,14 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { let dist_path = config.out_dir.clone(); let (reload_tx, _) = broadcast::channel(100); let last_file_rebuild = Arc::new(Mutex::new(FileMap::new(config.crate_dir.clone()))); + let build_manager = Arc::new(BuildManager { + config: config.clone(), + reload_tx: reload_tx.clone(), + }); let hot_reload_tx = broadcast::channel(100).0; let hot_reload_state = Arc::new(HotReloadState { messages: hot_reload_tx.clone(), - update: reload_tx.clone(), + build_manager: build_manager.clone(), last_file_rebuild: last_file_rebuild.clone(), watcher_config: config.clone(), }); @@ -51,9 +80,6 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { let crate_dir = config.crate_dir.clone(); let ws_reload_state = Arc::new(WsReloadState { update: reload_tx.clone(), - - last_file_rebuild: Some(last_file_rebuild.clone()), - watcher_config: config.clone(), }); let mut last_update_time = chrono::Local::now().timestamp(); @@ -71,6 +97,7 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { if chrono::Local::now().timestamp() > last_update_time { if let Ok(evt) = evt { let mut messages = Vec::new(); + let mut needs_rebuild = false; for path in evt.paths { let mut file = File::open(path.clone()).unwrap(); if path.extension().map(|p| p.to_str()).flatten() != Some("rs") { @@ -88,9 +115,8 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { if let Ok(old) = syn::parse_file(&old_str) { match find_rsx(&syntax, &old) { DiffResult::CodeChanged => { - log::info!("reload required"); - let _ = reload_tx.send("reload".into()); - break; + needs_rebuild = true; + last_file_rebuild.map.insert(path, src); } DiffResult::RsxChanged(changed) => { log::info!("reloading rsx"); @@ -132,6 +158,12 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { } } } + if needs_rebuild { + log::info!("reload required"); + if let Err(err) = build_manager.build() { + log::error!("{}", err); + } + } if !messages.is_empty() { let _ = hot_reload_tx.send(SetManyRsxMessage(messages)); } @@ -221,11 +253,13 @@ pub async fn startup_default(config: CrateConfig) -> Result<()> { let (reload_tx, _) = broadcast::channel(100); + let build_manager = BuildManager { + config: config.clone(), + reload_tx: reload_tx.clone(), + }; + let ws_reload_state = Arc::new(WsReloadState { update: reload_tx.clone(), - - last_file_rebuild: None, - watcher_config: config.clone(), }); let mut last_update_time = chrono::Local::now().timestamp(); @@ -242,8 +276,10 @@ pub async fn startup_default(config: CrateConfig) -> Result<()> { let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { log::info!("reload required"); if chrono::Local::now().timestamp() > last_update_time { - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); + match build_manager.build() { + Ok(_) => last_update_time = chrono::Local::now().timestamp(), + Err(e) => log::error!("{}", e), + } } }) .unwrap(); @@ -322,43 +358,22 @@ async fn ws_handler( _: Option>, Extension(state): Extension>, ) -> impl IntoResponse { - ws.max_send_queue(1).on_upgrade(|mut socket| async move { + ws.on_upgrade(|mut socket| async move { let mut rx = state.update.subscribe(); let reload_watcher = tokio::spawn(async move { loop { - let v = rx.recv().await.unwrap(); - if v == "reload" { - log::info!("Start to rebuild project..."); - if builder::build(&state.watcher_config).is_ok() { - // change the websocket reload state to true; - // the page will auto-reload. - if state - .watcher_config - .dioxus_config - .web - .watcher - .reload_html - .unwrap_or(false) - { - let _ = Serve::regen_dev_page(&state.watcher_config); - } - if let Some(file_map) = &state.last_file_rebuild { - let mut write = file_map.lock().unwrap(); - write.update(state.watcher_config.crate_dir.clone()); - } - } - // ignore the error - if socket - .send(Message::Text(String::from("reload"))) - .await - .is_err() - { - break; - } - - // flush the errors after recompling - rx = rx.resubscribe(); + rx.recv().await.unwrap(); + // ignore the error + if socket + .send(Message::Text(String::from("reload"))) + .await + .is_err() + { + break; } + + // flush the errors after recompling + rx = rx.resubscribe(); } }); From 815bdcdf0032a37518ee1611d9b0cd08bd2c79f3 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Thu, 16 Jun 2022 13:23:45 -0500 Subject: [PATCH 147/330] clean up logs --- src/server/hot_reload.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index 6a2a58ba0..a0eb43e08 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -78,7 +78,7 @@ pub async fn hot_reload_handler( let mut messages = Vec::new(); { - println!("Finding updates since last reload..."); + log::info!("Finding updates since last compile..."); let handle = state.last_file_rebuild.lock().unwrap(); let update_time = handle.last_updated_time.clone(); for (k, v) in handle.map.iter() { @@ -125,7 +125,7 @@ pub async fn hot_reload_handler( } } } - println!("finished"); + log::info!("finished"); } let msg = SetManyRsxMessage(messages); From 2908e53d1b55d6d5664d1b27046d53966d42bd5e Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 17 Jun 2022 14:50:05 -0500 Subject: [PATCH 148/330] add delay before reading the changed file --- src/server/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 1eb159ae5..16401aa85 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -95,6 +95,8 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { let mut watcher = RecommendedWatcher::new(move |evt: notify::Result| { if chrono::Local::now().timestamp() > last_update_time { + // Give time for the change to take effect before reading the file + std::thread::sleep(std::time::Duration::from_millis(100)); if let Ok(evt) = evt { let mut messages = Vec::new(); let mut needs_rebuild = false; @@ -105,9 +107,6 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { } let mut src = String::new(); file.read_to_string(&mut src).expect("Unable to read file"); - if src.is_empty() { - continue; - } // find changes to the rsx in the file if let Ok(syntax) = syn::parse_file(&src) { let mut last_file_rebuild = last_file_rebuild.lock().unwrap(); From 7025bd43aab4e98c8fe1b5907f51c19117efc814 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 20 Jun 2022 15:44:14 -0500 Subject: [PATCH 149/330] use line!, col!, and row! instead of panic location --- src/server/hot_reload.rs | 2 +- src/server/mod.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index a0eb43e08..7c9a6957e 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -97,7 +97,7 @@ pub async fn hot_reload_handler( if let DiffResult::RsxChanged(changed) = find_rsx(&new_file, &old_file) { for (old, new) in changed.into_iter() { let hr = get_location( - k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), + k, old.to_token_stream(), ); // get the original source code to preserve whitespace diff --git a/src/server/mod.rs b/src/server/mod.rs index 16401aa85..8cdd76373 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -121,10 +121,7 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { log::info!("reloading rsx"); for (old, new) in changed.into_iter() { let hr = get_location( - &path - .strip_prefix(&crate_dir) - .unwrap() - .to_path_buf(), + &path.to_path_buf(), old.to_token_stream(), ); // get the original source code to preserve whitespace From f8014f307b7ae0ac53a9415e4849d35b4a286fc3 Mon Sep 17 00:00:00 2001 From: Demonthos <66571940+Demonthos@users.noreply.github.com> Date: Tue, 21 Jun 2022 10:19:42 -0500 Subject: [PATCH 150/330] depend on dioxus master until next release --- Cargo.toml | 2 +- src/server/hot_reload.rs | 4 ++-- src/server/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f5afe80db..59a840d77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ zip = "0.6.2" tower = "0.4.12" syn = { version = "1.0" } -dioxus-rsx-interpreter = { path = "../dioxus/packages/rsx_interpreter" } +dioxus = { git = "https://github.com/dioxuslabs/dioxus/", features = ["hot_reload"] } proc-macro2 = { version = "1.0", features = ["span-locations"] } diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index 7c9a6957e..ea9c64fc7 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -2,14 +2,14 @@ use axum::{ extract::{ws::Message, Extension, TypedHeader, WebSocketUpgrade}, response::IntoResponse, }; -use dioxus_rsx_interpreter::SetRsxMessage; +use dioxus::rsx_interpreter::SetRsxMessage; use std::{path::PathBuf, sync::Arc}; use super::BuildManager; pub use crate::hot_reload::{find_rsx, DiffResult}; use crate::CrateConfig; -pub use dioxus_rsx_interpreter::{error::Error, CodeLocation, SetManyRsxMessage}; +pub use dioxus::rsx_interpreter::{error::Error, CodeLocation, SetManyRsxMessage}; pub use proc_macro2::TokenStream; pub use std::collections::HashMap; pub use std::sync::Mutex; diff --git a/src/server/mod.rs b/src/server/mod.rs index 8cdd76373..387355ee9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -6,7 +6,7 @@ use axum::{ routing::{get, get_service}, Router, }; -use dioxus_rsx_interpreter::SetRsxMessage; +use dioxus::rsx_interpreter::SetRsxMessage; use notify::{RecommendedWatcher, Watcher}; use syn::spanned::Spanned; From abded864c315400c1b7b0b1f80af9bf182a2b9c1 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 28 Jun 2022 09:59:05 -0500 Subject: [PATCH 151/330] update hot_reload to hot-reload --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 59a840d77..42de2ba4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ zip = "0.6.2" tower = "0.4.12" syn = { version = "1.0" } -dioxus = { git = "https://github.com/dioxuslabs/dioxus/", features = ["hot_reload"] } +dioxus = { git = "https://github.com/dioxuslabs/dioxus/", features = ["hot-reload"] } proc-macro2 = { version = "1.0", features = ["span-locations"] } From c9ac828ec773ad37f5fa5c12cfc610e9506d6ab8 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 28 Jun 2022 10:00:02 -0500 Subject: [PATCH 152/330] fix path seperator --- src/server/hot_reload.rs | 9 ++++++--- src/server/mod.rs | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index ea9c64fc7..d34f079f5 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -97,6 +97,7 @@ pub async fn hot_reload_handler( if let DiffResult::RsxChanged(changed) = find_rsx(&new_file, &old_file) { for (old, new) in changed.into_iter() { let hr = get_location( + &state.watcher_config.crate_dir, k, old.to_token_stream(), ); @@ -150,7 +151,7 @@ pub async fn hot_reload_handler( let error: Error = serde_json::from_str(&err).unwrap(); match error{ Error::ParseError(parse_error) => { - log::error!("parse error:\n--> at {}:{}:{}\n\t{:?}", parse_error.location.file, parse_error.location.line, parse_error.location.column, parse_error.message); + log::error!("parse error:\n--> at {}:{}:{}\n\t{:?}", parse_error.location.file_path, parse_error.location.line, parse_error.location.column, parse_error.message); }, Error::RecompileRequiredError(_) => { if let Err(err) = state.build_manager.build(){ @@ -182,10 +183,12 @@ pub async fn hot_reload_handler( }) } -pub fn get_location(path: &Path, ts: TokenStream) -> CodeLocation { +pub fn get_location(crate_path: &Path, path: &Path, ts: TokenStream) -> CodeLocation { let span = ts.span().start(); + let relative = path.strip_prefix(crate_path).unwrap(); CodeLocation { - file: path.display().to_string(), + file_path: relative.display().to_string(), + crate_path: crate_path.display().to_string(), line: span.line as u32, column: span.column as u32 + 1, } diff --git a/src/server/mod.rs b/src/server/mod.rs index 387355ee9..4bb08170e 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -121,6 +121,7 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { log::info!("reloading rsx"); for (old, new) in changed.into_iter() { let hr = get_location( + &crate_dir, &path.to_path_buf(), old.to_token_stream(), ); From c54d4677302a6bafcd9185fd3340fb59f94c6047 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:40:23 +0800 Subject: [PATCH 153/330] feat: set `port` configurable --- src/cli/cfg.rs | 5 +++++ src/cli/serve/mod.rs | 2 +- src/server/mod.rs | 14 ++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 73f9570d4..9fe453c49 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -40,6 +40,11 @@ pub struct ConfigOptsServe { #[clap(parse(from_os_str))] pub target: Option, + /// Port of dev server + #[clap(long)] + #[clap(default_value_t = 8080)] + pub port: u16, + /// Build a example [default: ""] #[clap(long)] pub example: Option, diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 5511845cb..5528ebade 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -69,7 +69,7 @@ impl Serve { Serve::regen_dev_page(&crate_config)?; // start the develop server - server::startup(crate_config.clone()).await?; + server::startup(self.serve.port, crate_config.clone()).await?; Ok(()) } diff --git a/src/server/mod.rs b/src/server/mod.rs index 387355ee9..096b07cc0 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -50,16 +50,16 @@ struct WsReloadState { update: broadcast::Sender<()>, } -pub async fn startup(config: CrateConfig) -> Result<()> { +pub async fn startup(port: u16, config: CrateConfig) -> Result<()> { if config.hot_reload { - startup_hot_reload(config).await? + startup_hot_reload(port, config).await? } else { - startup_default(config).await? + startup_default(port, config).await? } Ok(()) } -pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { +pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); @@ -179,7 +179,6 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { } // start serve dev-server at 0.0.0.0:8080 - let port = "8080"; log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); let file_service_config = config.clone(); @@ -242,7 +241,7 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> { Ok(()) } -pub async fn startup_default(config: CrateConfig) -> Result<()> { +pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); @@ -289,8 +288,7 @@ pub async fn startup_default(config: CrateConfig) -> Result<()> { .unwrap(); } - // start serve dev-server at 0.0.0.0:8080 - let port = "8080"; + // start serve dev-server at 0.0.0.0 log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); let file_service_config = config.clone(); From f4ed207649e8dbcb36092f5db58834edded7c0de Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 00:22:40 +0800 Subject: [PATCH 154/330] feat: commit code --- src/server/hot_reload.rs | 6 +++--- src/server/mod.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index ea9c64fc7..6f494dfc7 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -34,7 +34,7 @@ pub struct FileMap { impl FileMap { pub fn new(path: PathBuf) -> Self { - log::info!("Searching files for changes since last compile..."); + log::info!("🔮 Searching files for changes since last compile..."); fn find_rs_files(root: PathBuf) -> io::Result> { let mut files = HashMap::new(); if root.is_dir() { @@ -61,7 +61,7 @@ impl FileMap { last_updated_time, map: find_rs_files(path).unwrap(), }; - log::info!("Files updated"); + // log::info!("Files updated"); result } } @@ -78,7 +78,7 @@ pub async fn hot_reload_handler( let mut messages = Vec::new(); { - log::info!("Finding updates since last compile..."); + log::info!("🔮 Finding updates since last compile..."); let handle = state.last_file_rebuild.lock().unwrap(); let update_time = handle.last_updated_time.clone(); for (k, v) in handle.map.iter() { diff --git a/src/server/mod.rs b/src/server/mod.rs index 096b07cc0..75134a1ac 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -27,7 +27,7 @@ pub struct BuildManager { impl BuildManager { fn build(&self) -> Result<()> { - log::info!("Start to rebuild project..."); + log::info!("🪁 Rebuild code"); builder::build(&self.config)?; // change the websocket reload state to true; // the page will auto-reload. @@ -118,7 +118,7 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { last_file_rebuild.map.insert(path, src); } DiffResult::RsxChanged(changed) => { - log::info!("reloading rsx"); + log::info!("🪁 reloading rsx"); for (old, new) in changed.into_iter() { let hr = get_location( &path.to_path_buf(), @@ -269,7 +269,7 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { .unwrap_or_else(|| vec![PathBuf::from("src")]); let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { - log::info!("reload required"); + // log::info!("🚧 reload required"); if chrono::Local::now().timestamp() > last_update_time { match build_manager.build() { Ok(_) => last_update_time = chrono::Local::now().timestamp(), From baab2b9b4f56f120735fd602d2cf923a6988e2f7 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 6 Jul 2022 00:45:22 -0400 Subject: [PATCH 155/330] feat: use local bundle strategy --- .gitignore | 3 +- Cargo.toml | 6 +- build.rs | 50 + extension/dist/.gitignore | 2 + extension/package-lock.json | 4436 +++++++++++++++++++++++++---------- extension/package.json | 42 +- extension/server/.gitignore | 3 + extension/src/extension.ts | 139 -- extension/src/main.ts | 184 ++ src/cli/autoformat/mod.rs | 4 +- src/cli/mod.rs | 5 + src/cli/version.rs | 76 + src/main.rs | 5 + 13 files changed, 3604 insertions(+), 1351 deletions(-) create mode 100644 build.rs create mode 100644 extension/dist/.gitignore create mode 100644 extension/server/.gitignore delete mode 100644 extension/src/extension.ts create mode 100644 extension/src/main.ts create mode 100644 src/cli/version.rs diff --git a/.gitignore b/.gitignore index 2e049011e..5d6f4db1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target Cargo.lock -.idea/ \ No newline at end of file +.idea/ +.DS_Store diff --git a/Cargo.toml b/Cargo.toml index 9f85a89c2..506f14543 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,10 +46,8 @@ flate2 = "1.0.22" tar = "0.4.38" tower = "0.4.12" -dioxus-rsx = { path = "../../dioxus/packages/rsx" } -dioxus-autofmt = { path = "../../dioxus/packages/autofmt" } -# dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } -# dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus.git", branch = "jk/rsx-refactor" } +dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus.git" } +dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus.git" } [[bin]] path = "src/main.rs" diff --git a/build.rs b/build.rs new file mode 100644 index 000000000..15935e2da --- /dev/null +++ b/build.rs @@ -0,0 +1,50 @@ +//! Construct version in the `commit-hash date channel` format + +use std::{env, path::PathBuf, process::Command}; + +fn main() { + set_rerun(); + set_commit_info(); + if option_env!("CFG_RELEASE").is_none() { + println!("cargo:rustc-env=POKE_RA_DEVS=1"); + } +} + +fn set_rerun() { + println!("cargo:rerun-if-env-changed=CFG_RELEASE"); + + let mut manifest_dir = PathBuf::from( + env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."), + ); + + while manifest_dir.parent().is_some() { + let head_ref = manifest_dir.join(".git/HEAD"); + if head_ref.exists() { + println!("cargo:rerun-if-changed={}", head_ref.display()); + return; + } + + manifest_dir.pop(); + } + + println!("cargo:warning=Could not find `.git/HEAD` from manifest dir!"); +} + +fn set_commit_info() { + let output = match Command::new("git") + .arg("log") + .arg("-1") + .arg("--date=short") + .arg("--format=%H %h %cd") + .output() + { + Ok(output) if output.status.success() => output, + _ => return, + }; + let stdout = String::from_utf8(output.stdout).unwrap(); + let mut parts = stdout.split_whitespace(); + let mut next = || parts.next().unwrap(); + println!("cargo:rustc-env=RA_COMMIT_HASH={}", next()); + println!("cargo:rustc-env=RA_COMMIT_SHORT_HASH={}", next()); + println!("cargo:rustc-env=RA_COMMIT_DATE={}", next()) +} diff --git a/extension/dist/.gitignore b/extension/dist/.gitignore new file mode 100644 index 000000000..1287e9bd7 --- /dev/null +++ b/extension/dist/.gitignore @@ -0,0 +1,2 @@ +** +!.gitignore diff --git a/extension/package-lock.json b/extension/package-lock.json index 5de12fb6d..c671ca72c 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,92 +1,82 @@ { - "name": "dioxusstudio", + "name": "dioxus", "version": "0.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "dioxusstudio", + "name": "dioxus", "version": "0.0.1", "license": "MIT", + "dependencies": { + "vsce": "^2.9.2" + }, "devDependencies": { - "@types/node": "^12.12.0", - "@types/vscode": "^1.32.0", - "@typescript-eslint/eslint-plugin": "^4.16.0", - "@typescript-eslint/parser": "^4.16.0", - "eslint": "^7.21.0", - "typescript": "^4.3.5" + "@types/node": "^18.0.2", + "@types/vscode": "^1.68.1", + "@typescript-eslint/eslint-plugin": "^5.30.5", + "@typescript-eslint/parser": "^5.30.5", + "cross-env": "^7.0.3", + "esbuild": "^0.14.27", + "eslint": "^8.19.0", + "eslint-config-prettier": "^8.5.0", + "ovsx": "^0.5.1", + "prettier": "^2.6.2", + "tslib": "^2.3.0", + "typescript": "^4.7.4", + "vsce": "^2.7.0" }, "engines": { - "vscode": "^1.32.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "node_modules/@babel/highlight": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.8.tgz", - "integrity": "sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" + "vscode": "^1.68.1" } }, "node_modules/@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.4", + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" }, "engines": { @@ -94,21 +84,21 @@ } }, "node_modules/@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.4", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" }, "engines": { @@ -116,48 +106,49 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "node_modules/@types/node": { - "version": "12.12.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.35.tgz", - "integrity": "sha512-ASYsaKecA7TUsDrqIGPNk3JeEox0z/0XR/WsJJ8BIX/9+SkMSImQXKWfU/yBrSyc7ZSE/NPqLu36Nur0miCFfQ==", + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.2.tgz", + "integrity": "sha512-b947SdS4GH+g2W33wf5FzUu1KLj5FcSIiNWbU1ZyMvt/X7w48ZsVcsQoirIgE/Oq03WT5Qbn/dkY0hePi4ZXcQ==", "dev": true }, "node_modules/@types/vscode": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.33.0.tgz", - "integrity": "sha512-JSmGiValbrcG5g20jjCfKakLiuWyrcjVezj+SEAEZ4klXQktE5EtowuGlkLVqbkiBK4iY5wy/4yW8OjecuHnjQ==", + "version": "1.68.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.68.1.tgz", + "integrity": "sha512-fXlaq13NT5yHh6yZ3c+UxXloTSk34mIvsNFYyQCeO5Po2BLFAwz7EZT4kQ43B64/aPcnAenyWy3QasrTofBOnQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.16.1.tgz", - "integrity": "sha512-SK777klBdlkUZpZLC1mPvyOWk9yAFCWmug13eAjVQ4/Q1LATE/NbcQL1xDHkptQkZOLnPmLUA1Y54m8dqYwnoQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz", + "integrity": "sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "4.16.1", - "@typescript-eslint/scope-manager": "4.16.1", - "debug": "^4.1.1", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/type-utils": "5.30.5", + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "ignore": "^5.2.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -165,50 +156,26 @@ } } }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.16.1.tgz", - "integrity": "sha512-0Hm3LSlMYFK17jO4iY3un1Ve9x1zLNn4EM50Lia+0EV99NdbK+cn0er7HC7IvBA23mBg3P+8dUkMXy4leL33UQ==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.16.1", - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/typescript-estree": "4.16.1", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - } - }, "node_modules/@typescript-eslint/parser": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.16.1.tgz", - "integrity": "sha512-/c0LEZcDL5y8RyI1zLcmZMvJrsR6SM1uetskFkoh3dvqDKVXPsXI+wFB/CbVw7WkEyyTKobC1mUNp/5y6gRvXg==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.5.tgz", + "integrity": "sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "4.16.1", - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/typescript-estree": "4.16.1", - "debug": "^4.1.1" + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "debug": "^4.3.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -217,29 +184,55 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.16.1.tgz", - "integrity": "sha512-6IlZv9JaurqV0jkEg923cV49aAn8V6+1H1DRfhRcvZUrptQ+UtSKHb5kwTayzOYTJJ/RsYZdcvhOEKiBLyc0Cw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/visitor-keys": "4.16.1" + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.5.tgz", + "integrity": "sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@typescript-eslint/types": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.16.1.tgz", - "integrity": "sha512-nnKqBwMgRlhzmJQF8tnFDZWfunXmJyuXj55xc8Kbfup4PbkzdoDXZvzN8//EiKR27J6vUSU8j4t37yUuYPiLqA==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==", "dev": true, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -247,21 +240,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.16.1.tgz", - "integrity": "sha512-m8I/DKHa8YbeHt31T+UGd/l8Kwr0XCTCZL3H4HMvvLCT7HU9V7yYdinTOv1gf/zfqNeDcCgaFH2BMsS8x6NvJg==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/visitor-keys": "4.16.1", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -273,36 +266,51 @@ } } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz", - "integrity": "sha512-s/aIP1XcMkEqCNcPQtl60ogUYjSM8FU2mq1O7y5cFf3Xcob1z1iXWNB6cC43Op+NGRTFgGolri6s8z/efA9i1w==", + "node_modules/@typescript-eslint/utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.16.1", - "eslint-visitor-keys": "^2.0.0" + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -312,9 +320,9 @@ } }, "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -336,44 +344,35 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-union": { "version": "2.1.0", @@ -384,19 +383,57 @@ "node": ">=8" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "node_modules/azure-devops-node-api": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.1.1.tgz", + "integrity": "sha512-XDG91XzLZ15reP12s3jFkKS8oiagSICjnLwxEYieme4+4h3ZveFOFRA4iYIG40RyHXsiI0mefFYYMFIJbMpWcg==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "tunnel": "0.0.6", + "typed-rest-client": "^1.8.4" } }, "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/boolbase": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true }, "node_modules/brace-expansion": { @@ -421,6 +458,52 @@ "node": ">=8" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -431,9 +514,9 @@ } }, "node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -446,22 +529,57 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chalk/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" }, "engines": { - "node": ">=8" + "node": ">= 6" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" } }, - "node_modules/chalk/node_modules/color-convert": { + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -473,54 +591,45 @@ "node": ">=7.0.0" } }, - "node_modules/chalk/node_modules/color-name": { + "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/chalk/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, "engines": { - "node": ">=8" + "node": ">= 6" } }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -535,22 +644,90 @@ "node": ">= 8" } }, - "node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" } }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -575,74 +752,488 @@ "node": ">=6.0.0" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, "dependencies": { - "ansi-colors": "^4.1.1" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" }, "engines": { - "node": ">=8.6" + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.48.tgz", + "integrity": "sha512-w6N1Yn5MtqK2U1/WZTX9ZqUVb8IOLZkZ5AdHkT6x3cHDMVsYWC7WPdiLmx19w3i4Rwzy5LqsEMtVihG3e4rFzA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "esbuild-android-64": "0.14.48", + "esbuild-android-arm64": "0.14.48", + "esbuild-darwin-64": "0.14.48", + "esbuild-darwin-arm64": "0.14.48", + "esbuild-freebsd-64": "0.14.48", + "esbuild-freebsd-arm64": "0.14.48", + "esbuild-linux-32": "0.14.48", + "esbuild-linux-64": "0.14.48", + "esbuild-linux-arm": "0.14.48", + "esbuild-linux-arm64": "0.14.48", + "esbuild-linux-mips64le": "0.14.48", + "esbuild-linux-ppc64le": "0.14.48", + "esbuild-linux-riscv64": "0.14.48", + "esbuild-linux-s390x": "0.14.48", + "esbuild-netbsd-64": "0.14.48", + "esbuild-openbsd-64": "0.14.48", + "esbuild-sunos-64": "0.14.48", + "esbuild-windows-32": "0.14.48", + "esbuild-windows-64": "0.14.48", + "esbuild-windows-arm64": "0.14.48" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.48.tgz", + "integrity": "sha512-3aMjboap/kqwCUpGWIjsk20TtxVoKck8/4Tu19rubh7t5Ra0Yrpg30Mt1QXXlipOazrEceGeWurXKeFJgkPOUg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.48.tgz", + "integrity": "sha512-vptI3K0wGALiDq+EvRuZotZrJqkYkN5282iAfcffjI5lmGG9G1ta/CIVauhY42MBXwEgDJkweiDcDMRLzBZC4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.48.tgz", + "integrity": "sha512-gGQZa4+hab2Va/Zww94YbshLuWteyKGD3+EsVon8EWTWhnHFRm5N9NbALNbwi/7hQ/hM1Zm4FuHg+k6BLsl5UA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.48.tgz", + "integrity": "sha512-bFjnNEXjhZT+IZ8RvRGNJthLWNHV5JkCtuOFOnjvo5pC0sk2/QVk0Qc06g2PV3J0TcU6kaPC3RN9yy9w2PSLEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.48.tgz", + "integrity": "sha512-1NOlwRxmOsnPcWOGTB10JKAkYSb2nue0oM1AfHWunW/mv3wERfJmnYlGzL3UAOIUXZqW8GeA2mv+QGwq7DToqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.48.tgz", + "integrity": "sha512-gXqKdO8wabVcYtluAbikDH2jhXp+Klq5oCD5qbVyUG6tFiGhrC9oczKq3vIrrtwcxDQqK6+HDYK8Zrd4bCA9Gw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.48.tgz", + "integrity": "sha512-ghGyDfS289z/LReZQUuuKq9KlTiTspxL8SITBFQFAFRA/IkIvDpnZnCAKTCjGXAmUqroMQfKJXMxyjJA69c/nQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.48.tgz", + "integrity": "sha512-vni3p/gppLMVZLghI7oMqbOZdGmLbbKR23XFARKnszCIBpEMEDxOMNIKPmMItQrmH/iJrL1z8Jt2nynY0bE1ug==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.48.tgz", + "integrity": "sha512-+VfSV7Akh1XUiDNXgqgY1cUP1i2vjI+BmlyXRfVz5AfV3jbpde8JTs5Q9sYgaoq5cWfuKfoZB/QkGOI+QcL1Tw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.48.tgz", + "integrity": "sha512-3CFsOlpoxlKPRevEHq8aAntgYGYkE1N9yRYAcPyng/p4Wyx0tPR5SBYsxLKcgPB9mR8chHEhtWYz6EZ+H199Zw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.48.tgz", + "integrity": "sha512-cs0uOiRlPp6ymknDnjajCgvDMSsLw5mST2UXh+ZIrXTj2Ifyf2aAP3Iw4DiqgnyYLV2O/v/yWBJx+WfmKEpNLA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.48.tgz", + "integrity": "sha512-+2F0vJMkuI0Wie/wcSPDCqXvSFEELH7Jubxb7mpWrA/4NpT+/byjxDz0gG6R1WJoeDefcrMfpBx4GFNN1JQorQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.48.tgz", + "integrity": "sha512-BmaK/GfEE+5F2/QDrIXteFGKnVHGxlnK9MjdVKMTfvtmudjY3k2t8NtlY4qemKSizc+QwyombGWTBDc76rxePA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.48.tgz", + "integrity": "sha512-tndw/0B9jiCL+KWKo0TSMaUm5UWBLsfCKVdbfMlb3d5LeV9WbijZ8Ordia8SAYv38VSJWOEt6eDCdOx8LqkC4g==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.48.tgz", + "integrity": "sha512-V9hgXfwf/T901Lr1wkOfoevtyNkrxmMcRHyticybBUHookznipMOHoF41Al68QBsqBxnITCEpjjd4yAos7z9Tw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.48.tgz", + "integrity": "sha512-+IHf4JcbnnBl4T52egorXMatil/za0awqzg2Vy6FBgPcBpisDWT2sVz/tNdrK9kAqj+GZG/jZdrOkj7wsrNTKA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.48.tgz", + "integrity": "sha512-77m8bsr5wOpOWbGi9KSqDphcq6dFeJyun8TA+12JW/GAjyfTwVtOnN8DOt6DSPUfEV+ltVMNqtXUeTeMAxl5KA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.48.tgz", + "integrity": "sha512-EPgRuTPP8vK9maxpTGDe5lSoIBHGKO/AuxDncg5O3NkrPeLNdvvK8oywB0zGaAZXxYWfNNSHskvvDgmfVTguhg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.48.tgz", + "integrity": "sha512-YmpXjdT1q0b8ictSdGwH3M8VCoqPpK1/UArze3X199w6u8hUx3V8BhAi1WjbsfDYRBanVVtduAhh2sirImtAvA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.48.tgz", + "integrity": "sha512-HHaOMCsCXp0rz5BT2crTka6MPWVno121NKApsGs/OIW5QC0ggC69YMGs1aJct9/9FSUF4A1xNE/cLvgB5svR4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz", - "integrity": "sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", + "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", "dev": true, "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -650,47 +1241,25 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", - "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", @@ -703,94 +1272,76 @@ "node": ">=8.0.0" } }, - "node_modules/eslint/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^2.0.0" }, "engines": { - "node": ">=6" + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" }, "funding": { "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" } }, - "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "engines": { "node": ">=10" } }, - "node_modules/eslint/node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "dependencies": { + "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": ">=4.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint/node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/esquery": { @@ -806,26 +1357,35 @@ } }, "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "dependencies": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" }, "engines": { "node": ">=4.0" } }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", @@ -844,6 +1404,15 @@ "node": ">=0.10.0" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -851,20 +1420,31 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" }, "engines": { - "node": ">=8" + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" } }, "node_modules/fast-json-stable-stringify": { @@ -876,18 +1456,27 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "node_modules/fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "dependencies": { "reusify": "^1.0.4" } }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -926,33 +1515,85 @@ } }, "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", + "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "node_modules/get-intrinsic": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", "dev": true }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -964,24 +1605,24 @@ } }, "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 6" + "node": ">=10.13.0" } }, "node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", + "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", "dev": true, "dependencies": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" @@ -991,16 +1632,16 @@ } }, "node_modules/globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" }, "engines": { @@ -1010,28 +1651,94 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby/node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, "engines": { - "node": ">= 4" + "node": ">= 0.4.0" } }, "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/htmlparser2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", + "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "entities": "^4.3.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, "engines": { "node": ">= 4" @@ -1056,7 +1763,7 @@ "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { "node": ">=0.8.19" @@ -1065,7 +1772,7 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", @@ -1078,28 +1785,37 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "dependencies": { + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -1120,23 +1836,16 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -1151,9 +1860,29 @@ "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, + "node_modules/keytar": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz", + "integrity": "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^4.3.0", + "prebuild-install": "^7.0.1" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -1167,10 +1896,19 @@ "node": ">= 0.8.0" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "node_modules/lru-cache": { @@ -1185,6 +1923,37 @@ "node": ">=10" } }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it/node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "dev": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1195,22 +1964,46 @@ } }, "node_modules/micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { - "node": ">=8" + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -1219,22 +2012,85 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "dev": true + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/node-abi": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.22.0.tgz", + "integrity": "sha512-u4uAs/4Zzmp/jjsD9cyFYDXeISfUWaAVWshPmDZOFOv4Xl4SbzTXm53I04C2uRueYJ+0t5PEtLH/owbn2Npf/w==", + "dev": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" @@ -1257,6 +2113,26 @@ "node": ">= 0.8.0" } }, + "node_modules/ovsx": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/ovsx/-/ovsx-0.5.1.tgz", + "integrity": "sha512-3OWq0l7DuVHi2bd2aQe5+QVQlFIqvrcw3/2vGXL404L6Tr+R4QHtzfnYYghv8CCa85xJHjU0RhcaC7pyXkAUbg==", + "dev": true, + "dependencies": { + "commander": "^6.1.0", + "follow-redirects": "^1.14.6", + "is-ci": "^2.0.0", + "leven": "^3.1.0", + "tmp": "^0.2.1", + "vsce": "^2.6.3" + }, + "bin": { + "ovsx": "lib/ovsx" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -1269,10 +2145,53 @@ "node": ">=6" } }, + "node_modules/parse-semver": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", + "integrity": "sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ==", + "dev": true, + "dependencies": { + "semver": "^5.1.0" + } + }, + "node_modules/parse-semver/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/parse5": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", + "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", + "dev": true, + "dependencies": { + "entities": "^4.3.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dev": true, + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -1296,10 +2215,16 @@ "node": ">=8" } }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true + }, "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" @@ -1308,6 +2233,32 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -1317,13 +2268,29 @@ "node": ">= 0.8.0" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, "engines": { - "node": ">=0.4.0" + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, "node_modules/punycode": { @@ -1335,10 +2302,25 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", - "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { @@ -1355,10 +2337,60 @@ } ] }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==", + "dev": true, + "dependencies": { + "mute-stream": "~0.0.4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, "engines": { "node": ">=8" @@ -1367,15 +2399,6 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -1433,10 +2456,36 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, "node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1469,6 +2518,65 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -1478,83 +2586,22 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" + "safe-buffer": "~5.2.0" } }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -1573,60 +2620,63 @@ } }, "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", "dev": true, "dependencies": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" }, "engines": { - "node": ">=10.0.0" + "node": ">=6" } }, - "node_modules/table/node_modules/ajv": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.1.tgz", - "integrity": "sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "dependencies": { + "rimraf": "^3.0.0" + }, + "engines": { + "node": ">=8.17.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1640,15 +2690,15 @@ } }, "node_modules/tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, "node_modules/tsutils": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz", - "integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "dependencies": { "tslib": "^1.8.1" @@ -1660,6 +2710,33 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -1673,18 +2750,32 @@ } }, "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-rest-client": { + "version": "1.8.9", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz", + "integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==", + "dev": true, + "dependencies": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" } }, "node_modules/typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1694,6 +2785,18 @@ "node": ">=4.2.0" } }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "node_modules/underscore": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz", + "integrity": "sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==", + "dev": true + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -1703,12 +2806,138 @@ "punycode": "^2.1.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "node_modules/url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/vsce": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-2.9.2.tgz", + "integrity": "sha512-xyLqL4U82BilUX1t6Ym2opQEa2tLGWYjbgB7+ETeNVXlIJz5sWBJjQJSYJVFOKJSpiOtQclolu88cj7oY6vvPQ==", + "dev": true, + "dependencies": { + "azure-devops-node-api": "^11.0.1", + "chalk": "^2.4.2", + "cheerio": "^1.0.0-rc.9", + "commander": "^6.1.0", + "glob": "^7.0.6", + "hosted-git-info": "^4.0.2", + "keytar": "^7.7.0", + "leven": "^3.1.0", + "markdown-it": "^12.3.2", + "mime": "^1.3.4", + "minimatch": "^3.0.3", + "parse-semver": "^1.1.1", + "read": "^1.0.7", + "semver": "^5.1.0", + "tmp": "^0.2.1", + "typed-rest-client": "^1.8.4", + "url-join": "^4.0.1", + "xml2js": "^0.4.23", + "yauzl": "^2.3.1", + "yazl": "^2.2.2" + }, + "bin": { + "vsce": "vsce" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/vsce/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/vsce/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/vsce/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/vsce/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/vsce/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/vsce/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/vsce/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/vsce/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -1736,218 +2965,241 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/yazl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", + "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3" + } } }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.8.tgz", - "integrity": "sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - } - } - }, "@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "requires": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, - "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", "dev": true, "requires": { - "@nodelib/fs.stat": "2.0.4", + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { - "@nodelib/fs.scandir": "2.1.4", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/node": { - "version": "12.12.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.35.tgz", - "integrity": "sha512-ASYsaKecA7TUsDrqIGPNk3JeEox0z/0XR/WsJJ8BIX/9+SkMSImQXKWfU/yBrSyc7ZSE/NPqLu36Nur0miCFfQ==", + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.2.tgz", + "integrity": "sha512-b947SdS4GH+g2W33wf5FzUu1KLj5FcSIiNWbU1ZyMvt/X7w48ZsVcsQoirIgE/Oq03WT5Qbn/dkY0hePi4ZXcQ==", "dev": true }, "@types/vscode": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.33.0.tgz", - "integrity": "sha512-JSmGiValbrcG5g20jjCfKakLiuWyrcjVezj+SEAEZ4klXQktE5EtowuGlkLVqbkiBK4iY5wy/4yW8OjecuHnjQ==", + "version": "1.68.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.68.1.tgz", + "integrity": "sha512-fXlaq13NT5yHh6yZ3c+UxXloTSk34mIvsNFYyQCeO5Po2BLFAwz7EZT4kQ43B64/aPcnAenyWy3QasrTofBOnQ==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.16.1.tgz", - "integrity": "sha512-SK777klBdlkUZpZLC1mPvyOWk9yAFCWmug13eAjVQ4/Q1LATE/NbcQL1xDHkptQkZOLnPmLUA1Y54m8dqYwnoQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz", + "integrity": "sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.16.1", - "@typescript-eslint/scope-manager": "4.16.1", - "debug": "^4.1.1", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/type-utils": "5.30.5", + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.16.1.tgz", - "integrity": "sha512-0Hm3LSlMYFK17jO4iY3un1Ve9x1zLNn4EM50Lia+0EV99NdbK+cn0er7HC7IvBA23mBg3P+8dUkMXy4leL33UQ==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.16.1", - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/typescript-estree": "4.16.1", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "ignore": "^5.2.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.16.1.tgz", - "integrity": "sha512-/c0LEZcDL5y8RyI1zLcmZMvJrsR6SM1uetskFkoh3dvqDKVXPsXI+wFB/CbVw7WkEyyTKobC1mUNp/5y6gRvXg==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.5.tgz", + "integrity": "sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.16.1", - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/typescript-estree": "4.16.1", - "debug": "^4.1.1" + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.16.1.tgz", - "integrity": "sha512-6IlZv9JaurqV0jkEg923cV49aAn8V6+1H1DRfhRcvZUrptQ+UtSKHb5kwTayzOYTJJ/RsYZdcvhOEKiBLyc0Cw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/visitor-keys": "4.16.1" + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.5.tgz", + "integrity": "sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", + "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.16.1.tgz", - "integrity": "sha512-nnKqBwMgRlhzmJQF8tnFDZWfunXmJyuXj55xc8Kbfup4PbkzdoDXZvzN8//EiKR27J6vUSU8j4t37yUuYPiLqA==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.16.1.tgz", - "integrity": "sha512-m8I/DKHa8YbeHt31T+UGd/l8Kwr0XCTCZL3H4HMvvLCT7HU9V7yYdinTOv1gf/zfqNeDcCgaFH2BMsS8x6NvJg==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.16.1", - "@typescript-eslint/visitor-keys": "4.16.1", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" } }, "@typescript-eslint/visitor-keys": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz", - "integrity": "sha512-s/aIP1XcMkEqCNcPQtl60ogUYjSM8FU2mq1O7y5cFf3Xcob1z1iXWNB6cC43Op+NGRTFgGolri6s8z/efA9i1w==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.16.1", - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "dev": true - } + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" } }, "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, @@ -1963,35 +3215,26 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "array-union": { "version": "2.1.0", @@ -1999,16 +3242,43 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true + "azure-devops-node-api": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.1.1.tgz", + "integrity": "sha512-XDG91XzLZ15reP12s3jFkKS8oiagSICjnLwxEYieme4+4h3ZveFOFRA4iYIG40RyHXsiI0mefFYYMFIJbMpWcg==", + "dev": true, + "requires": { + "tunnel": "0.0.6", + "typed-rest-client": "^1.8.4" + } }, "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "boolbase": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "dev": true }, "brace-expansion": { @@ -2030,6 +3300,32 @@ "fill-range": "^7.0.1" } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2037,77 +3333,92 @@ "dev": true }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", "dev": true, "requires": { - "color-name": "1.1.3" + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + } + }, + "cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2119,19 +3430,59 @@ "which": "^2.0.1" } }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, "requires": { - "ms": "^2.1.1" + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" } }, + "css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "requires": { + "mimic-response": "^3.1.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", "dev": true }, "dir-glob": { @@ -2152,174 +3503,344 @@ "esutils": "^2.0.2" } }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, "requires": { - "ansi-colors": "^4.1.1" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" } }, + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + }, + "domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "requires": { + "domelementtype": "^2.3.0" + } + }, + "domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, + "requires": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true + }, + "esbuild": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.48.tgz", + "integrity": "sha512-w6N1Yn5MtqK2U1/WZTX9ZqUVb8IOLZkZ5AdHkT6x3cHDMVsYWC7WPdiLmx19w3i4Rwzy5LqsEMtVihG3e4rFzA==", + "dev": true, + "requires": { + "esbuild-android-64": "0.14.48", + "esbuild-android-arm64": "0.14.48", + "esbuild-darwin-64": "0.14.48", + "esbuild-darwin-arm64": "0.14.48", + "esbuild-freebsd-64": "0.14.48", + "esbuild-freebsd-arm64": "0.14.48", + "esbuild-linux-32": "0.14.48", + "esbuild-linux-64": "0.14.48", + "esbuild-linux-arm": "0.14.48", + "esbuild-linux-arm64": "0.14.48", + "esbuild-linux-mips64le": "0.14.48", + "esbuild-linux-ppc64le": "0.14.48", + "esbuild-linux-riscv64": "0.14.48", + "esbuild-linux-s390x": "0.14.48", + "esbuild-netbsd-64": "0.14.48", + "esbuild-openbsd-64": "0.14.48", + "esbuild-sunos-64": "0.14.48", + "esbuild-windows-32": "0.14.48", + "esbuild-windows-64": "0.14.48", + "esbuild-windows-arm64": "0.14.48" + } + }, + "esbuild-android-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.48.tgz", + "integrity": "sha512-3aMjboap/kqwCUpGWIjsk20TtxVoKck8/4Tu19rubh7t5Ra0Yrpg30Mt1QXXlipOazrEceGeWurXKeFJgkPOUg==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.48.tgz", + "integrity": "sha512-vptI3K0wGALiDq+EvRuZotZrJqkYkN5282iAfcffjI5lmGG9G1ta/CIVauhY42MBXwEgDJkweiDcDMRLzBZC4g==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.48.tgz", + "integrity": "sha512-gGQZa4+hab2Va/Zww94YbshLuWteyKGD3+EsVon8EWTWhnHFRm5N9NbALNbwi/7hQ/hM1Zm4FuHg+k6BLsl5UA==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.48.tgz", + "integrity": "sha512-bFjnNEXjhZT+IZ8RvRGNJthLWNHV5JkCtuOFOnjvo5pC0sk2/QVk0Qc06g2PV3J0TcU6kaPC3RN9yy9w2PSLEA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.48.tgz", + "integrity": "sha512-1NOlwRxmOsnPcWOGTB10JKAkYSb2nue0oM1AfHWunW/mv3wERfJmnYlGzL3UAOIUXZqW8GeA2mv+QGwq7DToqA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.48.tgz", + "integrity": "sha512-gXqKdO8wabVcYtluAbikDH2jhXp+Klq5oCD5qbVyUG6tFiGhrC9oczKq3vIrrtwcxDQqK6+HDYK8Zrd4bCA9Gw==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.48.tgz", + "integrity": "sha512-ghGyDfS289z/LReZQUuuKq9KlTiTspxL8SITBFQFAFRA/IkIvDpnZnCAKTCjGXAmUqroMQfKJXMxyjJA69c/nQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.48.tgz", + "integrity": "sha512-vni3p/gppLMVZLghI7oMqbOZdGmLbbKR23XFARKnszCIBpEMEDxOMNIKPmMItQrmH/iJrL1z8Jt2nynY0bE1ug==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.48.tgz", + "integrity": "sha512-+VfSV7Akh1XUiDNXgqgY1cUP1i2vjI+BmlyXRfVz5AfV3jbpde8JTs5Q9sYgaoq5cWfuKfoZB/QkGOI+QcL1Tw==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.48.tgz", + "integrity": "sha512-3CFsOlpoxlKPRevEHq8aAntgYGYkE1N9yRYAcPyng/p4Wyx0tPR5SBYsxLKcgPB9mR8chHEhtWYz6EZ+H199Zw==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.48.tgz", + "integrity": "sha512-cs0uOiRlPp6ymknDnjajCgvDMSsLw5mST2UXh+ZIrXTj2Ifyf2aAP3Iw4DiqgnyYLV2O/v/yWBJx+WfmKEpNLA==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.48.tgz", + "integrity": "sha512-+2F0vJMkuI0Wie/wcSPDCqXvSFEELH7Jubxb7mpWrA/4NpT+/byjxDz0gG6R1WJoeDefcrMfpBx4GFNN1JQorQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.48.tgz", + "integrity": "sha512-BmaK/GfEE+5F2/QDrIXteFGKnVHGxlnK9MjdVKMTfvtmudjY3k2t8NtlY4qemKSizc+QwyombGWTBDc76rxePA==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.48.tgz", + "integrity": "sha512-tndw/0B9jiCL+KWKo0TSMaUm5UWBLsfCKVdbfMlb3d5LeV9WbijZ8Ordia8SAYv38VSJWOEt6eDCdOx8LqkC4g==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.48.tgz", + "integrity": "sha512-V9hgXfwf/T901Lr1wkOfoevtyNkrxmMcRHyticybBUHookznipMOHoF41Al68QBsqBxnITCEpjjd4yAos7z9Tw==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.48.tgz", + "integrity": "sha512-+IHf4JcbnnBl4T52egorXMatil/za0awqzg2Vy6FBgPcBpisDWT2sVz/tNdrK9kAqj+GZG/jZdrOkj7wsrNTKA==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.48.tgz", + "integrity": "sha512-77m8bsr5wOpOWbGi9KSqDphcq6dFeJyun8TA+12JW/GAjyfTwVtOnN8DOt6DSPUfEV+ltVMNqtXUeTeMAxl5KA==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.48.tgz", + "integrity": "sha512-EPgRuTPP8vK9maxpTGDe5lSoIBHGKO/AuxDncg5O3NkrPeLNdvvK8oywB0zGaAZXxYWfNNSHskvvDgmfVTguhg==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.48.tgz", + "integrity": "sha512-YmpXjdT1q0b8ictSdGwH3M8VCoqPpK1/UArze3X199w6u8hUx3V8BhAi1WjbsfDYRBanVVtduAhh2sirImtAvA==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.14.48", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.48.tgz", + "integrity": "sha512-HHaOMCsCXp0rz5BT2crTka6MPWVno121NKApsGs/OIW5QC0ggC69YMGs1aJct9/9FSUF4A1xNE/cLvgB5svR4g==", + "dev": true, + "optional": true + }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, "eslint": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz", - "integrity": "sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", + "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", "dev": true, "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", - "minimatch": "^3.0.4", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "dev": true - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true } } }, + "eslint-config-prettier": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "dev": true, + "requires": {} + }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "eslint-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", - "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "eslint-visitor-keys": "^2.0.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true } } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, + "espree": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "dev": true, + "requires": { + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + } + }, "esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", @@ -2330,20 +3851,28 @@ }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } } }, "estraverse": { @@ -2358,6 +3887,12 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2365,17 +3900,27 @@ "dev": true }, "fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "fast-json-stable-stringify": { @@ -2387,18 +3932,27 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" } }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2428,87 +3982,156 @@ } }, "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", + "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "dev": true + }, + "follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "dev": true + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", "dev": true }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", + "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" } }, "globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "htmlparser2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", + "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "dev": true, + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "entities": "^4.3.0" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "import-fresh": { @@ -2524,13 +4147,13 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", @@ -2543,22 +4166,31 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -2573,23 +4205,16 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "json-schema-traverse": { @@ -2601,7 +4226,23 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "keytar": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz", + "integrity": "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==", + "dev": true, + "requires": { + "node-addon-api": "^4.3.0", + "prebuild-install": "^7.0.1" + } + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true }, "levn": { @@ -2614,10 +4255,19 @@ "type-check": "~0.4.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "lru-cache": { @@ -2629,6 +4279,33 @@ "yallist": "^4.0.0" } }, + "markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dev": true, + "requires": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "dependencies": { + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true + } + } + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2636,40 +4313,106 @@ "dev": true }, "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true + }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "dev": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node-abi": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.22.0.tgz", + "integrity": "sha512-u4uAs/4Zzmp/jjsD9cyFYDXeISfUWaAVWshPmDZOFOv4Xl4SbzTXm53I04C2uRueYJ+0t5PEtLH/owbn2Npf/w==", + "dev": true, + "requires": { + "semver": "^7.3.5" + } + }, + "node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true + }, + "nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "requires": { + "boolbase": "^1.0.0" + } + }, + "object-inspect": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" @@ -2689,6 +4432,20 @@ "word-wrap": "^1.2.3" } }, + "ovsx": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/ovsx/-/ovsx-0.5.1.tgz", + "integrity": "sha512-3OWq0l7DuVHi2bd2aQe5+QVQlFIqvrcw3/2vGXL404L6Tr+R4QHtzfnYYghv8CCa85xJHjU0RhcaC7pyXkAUbg==", + "dev": true, + "requires": { + "commander": "^6.1.0", + "follow-redirects": "^1.14.6", + "is-ci": "^2.0.0", + "leven": "^3.1.0", + "tmp": "^0.2.1", + "vsce": "^2.6.3" + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -2698,10 +4455,46 @@ "callsites": "^3.0.0" } }, + "parse-semver": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", + "integrity": "sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ==", + "dev": true, + "requires": { + "semver": "^5.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "parse5": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", + "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", + "dev": true, + "requires": { + "entities": "^4.3.0" + } + }, + "parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dev": true, + "requires": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + } + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "path-key": { @@ -2716,46 +4509,125 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "dev": true, + "requires": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, "queue-microtask": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", - "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true + } + } + }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "resolve-from": { @@ -2788,10 +4660,22 @@ "queue-microtask": "^1.2.2" } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -2812,73 +4696,56 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true + }, + "simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "requires": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "safe-buffer": "~5.2.0" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-json-comments": { @@ -2888,52 +4755,54 @@ "dev": true }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, - "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", "dev": true, "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "dependencies": { - "ajv": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.1.tgz", - "integrity": "sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" } }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "requires": { + "rimraf": "^3.0.0" + } + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2944,18 +4813,41 @@ } }, "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, "tsutils": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz", - "integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" } }, "type-check": { @@ -2968,15 +4860,38 @@ } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, + "typed-rest-client": { + "version": "1.8.9", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz", + "integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==", + "dev": true, + "requires": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" + } + }, "typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "dev": true + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "underscore": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz", + "integrity": "sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==", "dev": true }, "uri-js": { @@ -2988,12 +4903,116 @@ "punycode": "^2.1.0" } }, - "v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "vsce": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/vsce/-/vsce-2.9.2.tgz", + "integrity": "sha512-xyLqL4U82BilUX1t6Ym2opQEa2tLGWYjbgB7+ETeNVXlIJz5sWBJjQJSYJVFOKJSpiOtQclolu88cj7oY6vvPQ==", + "dev": true, + "requires": { + "azure-devops-node-api": "^11.0.1", + "chalk": "^2.4.2", + "cheerio": "^1.0.0-rc.9", + "commander": "^6.1.0", + "glob": "^7.0.6", + "hosted-git-info": "^4.0.2", + "keytar": "^7.7.0", + "leven": "^3.1.0", + "markdown-it": "^12.3.2", + "mime": "^1.3.4", + "minimatch": "^3.0.3", + "parse-semver": "^1.1.1", + "read": "^1.0.7", + "semver": "^5.1.0", + "tmp": "^0.2.1", + "typed-rest-client": "^1.8.4", + "url-join": "^4.0.1", + "xml2js": "^0.4.23", + "yauzl": "^2.3.1", + "yazl": "^2.2.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -3012,7 +5031,23 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", "dev": true }, "yallist": { @@ -3020,6 +5055,25 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "yazl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", + "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3" + } } } } diff --git a/extension/package.json b/extension/package.json index f884637c8..3e4ca4b83 100644 --- a/extension/package.json +++ b/extension/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/DioxusLabs/cli" }, "engines": { - "vscode": "^1.32.0" + "vscode": "^1.68.1" }, "categories": [ - "Other" + "Programming Languages" ], "activationEvents": [ "onCommand:extension.htmlToDioxusRsx", @@ -23,7 +23,7 @@ "onCommand:extension.formatRsx", "onCommand:extension.formatRsxDocument" ], - "main": "./out/extension", + "main": "./out/main", "contributes": { "commands": [ { @@ -45,18 +45,32 @@ ] }, "scripts": { - "vscode:prepublish": "npm run compile", - "compile": "tsc -p ./", - "lint": "eslint . --ext .ts,.tsx", - "watch": "tsc -watch -p ./", - "package": "vsce package" + "vscode:prepublish": "npm run build-base -- --minify", + "package": "vsce package -o rust-analyzer.vsix", + "build-base": "esbuild ./src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node16", + "build": "npm run build-base -- --sourcemap", + "watch": "npm run build-base -- --sourcemap --watch", + "lint": "prettier --check . && eslint -c .eslintrc.js --ext ts ./src ./tests", + "fix": "prettier --write . && eslint -c .eslintrc.js --ext ts ./src ./tests --fix", + "pretest": "tsc && npm run build", + "test": "cross-env TEST_VARIABLE=test node ./out/tests/runTests.js" }, "devDependencies": { - "@types/node": "^12.12.0", - "@types/vscode": "^1.32.0", - "@typescript-eslint/eslint-plugin": "^4.16.0", - "@typescript-eslint/parser": "^4.16.0", - "eslint": "^7.21.0", - "typescript": "^4.3.5" + "@types/node": "^18.0.2", + "@types/vscode": "^1.68.1", + "@typescript-eslint/eslint-plugin": "^5.30.5", + "@typescript-eslint/parser": "^5.30.5", + "cross-env": "^7.0.3", + "esbuild": "^0.14.27", + "eslint": "^8.19.0", + "typescript": "^4.7.4", + "eslint-config-prettier": "^8.5.0", + "ovsx": "^0.5.1", + "prettier": "^2.6.2", + "tslib": "^2.3.0", + "vsce": "^2.7.0" + }, + "dependencies": { + "vsce": "^2.9.2" } } diff --git a/extension/server/.gitignore b/extension/server/.gitignore new file mode 100644 index 000000000..f42761bea --- /dev/null +++ b/extension/server/.gitignore @@ -0,0 +1,3 @@ +** +!Readme.md +!.gitignore diff --git a/extension/src/extension.ts b/extension/src/extension.ts deleted file mode 100644 index 44d5b8f16..000000000 --- a/extension/src/extension.ts +++ /dev/null @@ -1,139 +0,0 @@ -import * as vscode from 'vscode'; -import { spawn } from "child_process"; - -export function activate(context: vscode.ExtensionContext) { - - - function translate(component: boolean) { - const editor = vscode.window.activeTextEditor;// Get the active text editor - if (!editor) return; - - const html = editor.document.getText(editor.selection); - if (html.length == 0) { - vscode.window.showWarningMessage("Please select HTML fragment before invoking this command!"); - return; - } - - let params = ["translate"]; - if (component) params.push("--component"); - params.push("--raw"); - params.push(html); - - const child_proc = spawn("dioxus", params); - - let result = ''; - child_proc.stdout?.on('data', data => result += data); - - child_proc.on('close', () => { - if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); - }); - - child_proc.on('error', (err) => { - vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); - }); - } - - function autoformat_selection() { - const editor = vscode.window.activeTextEditor;// Get the active text editor - if (!editor) return; - - const unformatted = editor.document.getText(editor.selection); - if (unformatted.length == 0) { - vscode.window.showWarningMessage("Please select rsx invoking this command!"); - return; - } - - let args = ["fmt", "--raw", unformatted.toString()]; - const child_proc = spawn("dioxus", args); - let result = ''; - - child_proc.stdout?.on('data', data => result += data); - - child_proc.on('close', () => { - if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); - }); - - child_proc.on('error', (err) => { - vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); - }); - } - - - function autoformat_document(document: vscode.TextDocument) { - // check the settings to make sure format on save is configured - // const formatOnSave: string | undefined = vscode.workspace.getConfiguration('rust').get('formatOnSave'); - - if (document.languageId === "rust" && document.uri.scheme === "file") { - const active_editor = vscode.window.activeTextEditor;// Get the active text editor - - if (active_editor?.document.fileName === document.fileName) { - const text = document.getText(); - - console.error(text); - - const child_proc = spawn("dioxus", ["fmt", "-f", text]); - - let result = ''; - - child_proc.stdout?.on('data', data => result += data); - - type RsxEdit = { - formatted: string, - start: number, - end: number - } - - child_proc.on('close', () => { - - if (result.length > 0) { - let decoded: RsxEdit[] = JSON.parse(result); - - console.log("Decoded edits: ", decoded); - - // Get the active text editor - const cur_editor = vscode.window.activeTextEditor; - - - // even if we build an empty edit stream, it tries to save the editor - // this makes sure the editor is actually saved - if (decoded.length > 0 && cur_editor == active_editor) { - active_editor.edit(editBuilder => { - - for (let edit of decoded) { - console.log("Handling Edit: ", edit); - - let start = document.positionAt(edit.start - 1); - let end = document.positionAt(edit.end + 1); - const range = new vscode.Range(start, end); - - editBuilder.replace(range, `{ ${edit.formatted} }`); - // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { - // }); - // editor.edit(editBuilder => editBuilder.replace(range, `{ ${edit.formatted} }`)).then((could_be_applied) => { - // console.log("Edit applied: ", could_be_applied); - // }); - } - }) - } - } - }); - - child_proc.on('error', (err) => { - vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); - }); - } - } - } - - context.subscriptions.push( - vscode.commands.registerCommand('extension.htmlToDioxusRsx', () => translate(false)), - vscode.commands.registerCommand('extension.htmlToDioxusComponent', () => translate(true)), - vscode.commands.registerCommand('extension.formatRsx', () => autoformat_selection()), - vscode.commands.registerCommand('extension.formatRsxDocument', () => { - const editor = vscode.window.activeTextEditor;// Get the active text editor - if (!editor) return; - autoformat_document(editor.document); - }), - vscode.workspace.onDidSaveTextDocument(autoformat_document) - ); -} diff --git a/extension/src/main.ts b/extension/src/main.ts new file mode 100644 index 000000000..156d45565 --- /dev/null +++ b/extension/src/main.ts @@ -0,0 +1,184 @@ +import * as vscode from 'vscode'; +import { spawn } from "child_process"; + +let serverPath: string = "dioxus"; + +export async function activate(context: vscode.ExtensionContext) { + let somePath = await bootstrap(context); + + if (somePath == undefined) { + await vscode.window.showErrorMessage('Could not find bundled Dioxus-CLI. Please install it manually.'); + return; + } else { + serverPath = somePath; + } + + context.subscriptions.push( + vscode.commands.registerTextEditorCommand('editor.action.clipboardPasteAction', onPasteHandler), + vscode.commands.registerCommand('extension.htmlToDioxusRsx', translateBlock), + vscode.commands.registerCommand('extension.htmlToDioxusComponent', translateComponent), + vscode.commands.registerCommand('extension.formatRsx', fmtSelection), + vscode.commands.registerCommand('extension.formatRsxDocument', formatRsxDocument), + vscode.workspace.onWillSaveTextDocument(fmtDocument) + ); +} + + +function translateComponent() { + translate(true) +} + +function translateBlock() { + translate(false) +} + +function translate(component: boolean) { + const editor = vscode.window.activeTextEditor; + + if (!editor) return; + + const html = editor.document.getText(editor.selection); + if (html.length == 0) { + vscode.window.showWarningMessage("Please select HTML fragment before invoking this command!"); + return; + } + + let params = ["translate"]; + if (component) params.push("--component"); + params.push("--raw", html); + + const child_proc = spawn(serverPath, params); + + let result = ''; + child_proc.stdout?.on('data', data => result += data); + + child_proc.on('close', () => { + if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); + }); + + child_proc.on('error', (err) => { + vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); + }); +} + +function onPasteHandler() { + // check settings to see if we should convert HTML to Rsx + if (vscode.workspace.getConfiguration('dioxus').get('convertOnPaste')) { + convertHtmlToRsxOnPaste(); + } +} + +function convertHtmlToRsxOnPaste() { + const editor = vscode.window.activeTextEditor; + if (!editor) return; + + // get the cursor location + const cursor = editor.selection.active; + + // try to parse the HTML at the cursor location + const html = editor.document.getText(new vscode.Range(cursor, cursor)); +} + +function formatRsxDocument() { + const editor = vscode.window.activeTextEditor; + if (editor) { + fmtDocument(); + } +} + +function fmtSelection() { + const editor = vscode.window.activeTextEditor; + if (!editor) return; + + const unformatted = editor.document.getText(editor.selection); + + if (unformatted.length == 0) { + vscode.window.showWarningMessage("Please select rsx invoking this command!"); + return; + } + + const child_proc = spawn(serverPath, ["fmt", "--raw", unformatted.toString()]); + let result = ''; + + child_proc.stdout?.on('data', data => result += data); + + child_proc.on('close', () => { + if (result.length > 0) editor.edit(editBuilder => editBuilder.replace(editor.selection, result)); + }); + + child_proc.on('error', (err) => { + vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); + }); +} + +function fmtDocument() { + const editor = vscode.window.activeTextEditor; + const document = editor?.document; + if (!document) return; + + // check the settings to make sure format on save is configured + if (document.languageId === "rust" && document.uri.scheme === "file") { + const active_editor = vscode.window.activeTextEditor; + + if (active_editor?.document.fileName === document.fileName) { + const text = document.getText(); + const child_proc = spawn("dioxus", ["fmt", "-f", text]); + + let result = ''; + child_proc.stdout?.on('data', data => result += data); + + type RsxEdit = { + formatted: string, + start: number, + end: number + } + + child_proc.on('close', () => { + if (result.length > 0) { + let decoded: RsxEdit[] = JSON.parse(result); + + if (decoded.length > 0) { + active_editor.edit(editBuilder => { + decoded.map((edit) => { + editBuilder.replace(new vscode.Range( + document.positionAt(edit.start), + document.positionAt(edit.end) + ), edit.formatted); + }); + }, { + undoStopAfter: false, + undoStopBefore: false + }) + } + } + }); + + child_proc.on('error', (err) => { + vscode.window.showWarningMessage(`Errors occurred while translating. Make sure you have the most recent Dioxus-CLI installed! \n${err}`); + }); + } + } +} + + +// I'm using the approach defined in rust-analyzer here +// +// We ship the server as part of the extension, but we need to handle external paths and such +// +// https://github.com/rust-lang/rust-analyzer/blob/fee5555cfabed4b8abbd40983fc4442df4007e49/editors/code/src/main.ts#L270 +async function bootstrap(context: vscode.ExtensionContext): Promise { + + const ext = process.platform === "win32" ? ".exe" : ""; + const bundled = vscode.Uri.joinPath(context.extensionUri, "server", `dioxus${ext}`); + const bundledExists = await vscode.workspace.fs.stat(bundled).then( + () => true, + () => false + ); + + // if bunddled doesn't exist, try using a locally-installed version + if (!bundledExists) { + return "dioxus"; + } + + return bundled.fsPath; +} diff --git a/src/cli/autoformat/mod.rs b/src/cli/autoformat/mod.rs index 3008411db..5c1532d58 100644 --- a/src/cli/autoformat/mod.rs +++ b/src/cli/autoformat/mod.rs @@ -15,7 +15,7 @@ pub struct Autoformat { impl Autoformat { pub fn autoformat(self) -> Result<()> { if let Some(raw) = self.raw { - if let Some(inner) = dioxus_autofmt::fmt_block(&raw) { + if let Some(inner) = dioxus_autofmt::fmt_block(&raw, 0) { println!("{}", inner); } else { // exit process with error @@ -25,7 +25,7 @@ impl Autoformat { } if let Some(file) = self.file { - let edits = dioxus_autofmt::get_format_blocks(&file); + let edits = dioxus_autofmt::fmt_file(&file); let as_json = serde_json::to_string(&edits).unwrap(); println!("{}", as_json); } diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 92e05eaa9..efd72b3cd 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -7,6 +7,7 @@ pub mod create; pub mod serve; pub mod tool; pub mod translate; +pub mod version; use crate::{ cfg::{ConfigOptsBuild, ConfigOptsServe}, @@ -59,6 +60,10 @@ pub enum Commands { /// Clean output artifacts. Clean(clean::Clean), + /// Print the version of this extension + #[clap(name = "version")] + Version(version::Version), + /// Format some rsx #[clap(name = "fmt")] Autoformat(autoformat::Autoformat), diff --git a/src/cli/version.rs b/src/cli/version.rs new file mode 100644 index 000000000..3c77ba419 --- /dev/null +++ b/src/cli/version.rs @@ -0,0 +1,76 @@ +use super::*; + +/// Build the Rust WASM app and all of its assets. +#[derive(Clone, Debug, Parser)] +#[clap(name = "version")] +pub struct Version {} + +impl Version { + pub fn version(self) -> VersionInfo { + version() + } +} + +use std::fmt; + +/// Information about the git repository where rust-analyzer was built from. +pub struct CommitInfo { + pub short_commit_hash: &'static str, + pub commit_hash: &'static str, + pub commit_date: &'static str, +} + +/// Cargo's version. +pub struct VersionInfo { + /// rust-analyzer's version, such as "1.57.0", "1.58.0-beta.1", "1.59.0-nightly", etc. + pub version: &'static str, + + /// The release channel we were built for (stable/beta/nightly/dev). + /// + /// `None` if not built via rustbuild. + pub release_channel: Option<&'static str>, + + /// Information about the Git repository we may have been built from. + /// + /// `None` if not built from a git repo. + pub commit_info: Option, +} + +impl fmt::Display for VersionInfo { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.version)?; + + if let Some(ci) = &self.commit_info { + write!(f, " ({} {})", ci.short_commit_hash, ci.commit_date)?; + }; + Ok(()) + } +} + +/// Returns information about cargo's version. +pub const fn version() -> VersionInfo { + let version = match option_env!("CFG_RELEASE") { + Some(x) => x, + None => "0.0.0", + }; + + let release_channel = option_env!("CFG_RELEASE_CHANNEL"); + let commit_info = match ( + option_env!("RA_COMMIT_SHORT_HASH"), + option_env!("RA_COMMIT_HASH"), + option_env!("RA_COMMIT_DATE"), + ) { + (Some(short_commit_hash), Some(commit_hash), Some(commit_date)) => Some(CommitInfo { + short_commit_hash, + commit_hash, + commit_date, + }), + _ => None, + }; + + VersionInfo { + version, + release_channel, + commit_info, + } +} diff --git a/src/main.rs b/src/main.rs index 72558741e..f72cb7666 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,6 +54,11 @@ async fn main() -> Result<()> { log::error!("format error: {}", e); } } + + Commands::Version(opt) => { + let version = opt.version(); + println!("{}", version); + } } Ok(()) From 719e48c0a5f36cad505d2b0b6dd4a2bc9b212a6e Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 16:16:16 +0800 Subject: [PATCH 156/330] feat: beautify console --- Cargo.toml | 3 ++- src/cli/mod.rs | 6 +----- src/lib.rs | 4 +++- src/server/mod.rs | 45 ++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 42de2ba4c..fa14b36b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-cli" -version = "0.1.4" +version = "0.1.5" authors = ["Jonathan Kelley"] edition = "2021" description = "CLI tool for developing, testing, and publishing Dioxus apps" @@ -14,6 +14,7 @@ license = "MIT/Apache-2.0" clap = { version = "3.0.14", features = ["derive"] } thiserror = "1.0.30" wasm-bindgen-cli-support = "0.2.79" +colored = "2.0.0" # features log = "0.4.14" diff --git a/src/cli/mod.rs b/src/cli/mod.rs index d639d28a7..b456d4705 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -27,7 +27,7 @@ use std::{ /// Build, bundle, & ship your Dioxus app. #[derive(Parser)] -#[clap(name = "dioxus")] +#[clap(name = "dioxus", version)] pub struct Cli { #[clap(subcommand)] pub action: Commands, @@ -35,10 +35,6 @@ pub struct Cli { /// Enable verbose logging. #[clap(short)] pub v: bool, - // // note: dioxus is still roughly compatible with trunk - // /// Path to the Trunk config file [default: Trunk.toml] - // #[clap(long, parse(from_os_str), env = "TRUNK_CONFIG")] - // pub config: Option, } #[derive(Parser)] diff --git a/src/lib.rs b/src/lib.rs index 6d009c18c..9956989b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,5 @@ +pub const DIOXUS_CLI_VERSION: &'static str = "0.1.5"; + pub mod builder; pub mod server; pub mod tools; @@ -19,4 +21,4 @@ pub use error::*; pub mod logging; pub use logging::*; -pub mod hot_reload; +pub mod hot_reload; \ No newline at end of file diff --git a/src/server/mod.rs b/src/server/mod.rs index 446d9d75c..886088fd9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -6,11 +6,12 @@ use axum::{ routing::{get, get_service}, Router, }; +use colored::Colorize; use dioxus::rsx_interpreter::SetRsxMessage; use notify::{RecommendedWatcher, Watcher}; use syn::spanned::Spanned; -use std::{path::PathBuf, sync::Arc}; +use std::{path::PathBuf, process::Command, sync::Arc}; use tower::ServiceBuilder; use tower_http::services::fs::{ServeDir, ServeFileSystemResponseBody}; @@ -180,7 +181,7 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } // start serve dev-server at 0.0.0.0:8080 - log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); + print_console_info(port, &config); let file_service_config = config.clone(); let file_service = ServiceBuilder::new() @@ -290,7 +291,7 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { } // start serve dev-server at 0.0.0.0 - log::info!("📡 Dev-Server is started at: http://127.0.0.1:{}/", port); + print_console_info(port, &config); let file_service_config = config.clone(); let file_service = ServiceBuilder::new() @@ -348,6 +349,44 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { Ok(()) } +fn print_console_info(port: u16, config: &CrateConfig) { + print!( + "{}", + String::from_utf8_lossy( + &Command::new(if cfg!(target_os = "windows") { + "cls" + } else { + "clear" + }) + .output() + .unwrap() + .stdout + ) + ); + + let mut profile = if config.release { "Release" } else { "Debug" }.to_string(); + if config.custom_profile.is_some() { + profile = config.custom_profile.as_ref().unwrap().to_string(); + } + let hot_reload = if config.hot_reload { "RSX" } else { "Normal" }; + let workspace = config.workspace_dir.to_str().unwrap().to_string(); + + println!( + "{} @ v{}\n", + "Dioxus".bold().green(), + crate::DIOXUS_CLI_VERSION + ); + println!( + "\t> Local: {}", + format!("https://localhost:{}/", port).blue() + ); + println!("\t> Profile: {}", profile.green()); + println!("\t> Hot Reload: {}", hot_reload.green()); + println!("\t> Workspace: {}", workspace.yellow()); + + println!("\n{}", "Server startup completed.".bold()); +} + async fn ws_handler( ws: WebSocketUpgrade, _: Option>, From b2c5141fa6f62b4eaf3e4918dc5b6e29c2209785 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 17:36:14 +0800 Subject: [PATCH 157/330] feat: commit code --- src/server/mod.rs | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 886088fd9..b1e527b86 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -369,22 +369,54 @@ fn print_console_info(port: u16, config: &CrateConfig) { profile = config.custom_profile.as_ref().unwrap().to_string(); } let hot_reload = if config.hot_reload { "RSX" } else { "Normal" }; - let workspace = config.workspace_dir.to_str().unwrap().to_string(); + let tools_str = format!( + "{:?}", + config + .dioxus_config + .application + .tools + .clone() + .unwrap_or_default() + .iter() + .map(|d| d.0.clone()) + .collect::>() + ); + let crate_root = crate::cargo::crate_root().unwrap(); + let custom_html_file = if crate_root.join("index.html").is_file() { + "Custom [index.html]" + } else { + "Default" + }; + let url_rewrite = if config + .dioxus_config + .web + .watcher + .index_on_404 + .unwrap_or(false) + { + "True" + } else { + "False" + }; println!( "{} @ v{}\n", "Dioxus".bold().green(), - crate::DIOXUS_CLI_VERSION + crate::DIOXUS_CLI_VERSION, ); println!( - "\t> Local: {}", + "\t> Local : {}", format!("https://localhost:{}/", port).blue() ); - println!("\t> Profile: {}", profile.green()); - println!("\t> Hot Reload: {}", hot_reload.green()); - println!("\t> Workspace: {}", workspace.yellow()); + println!("\t> NetWork : {}", "use --host to expose".white().dimmed()); + println!(""); + println!("\t> Profile : {}", profile.green()); + println!("\t> Hot Reload : {}", hot_reload.cyan()); + println!("\t> Enabled Tools : {}", tools_str.yellow()); + println!("\t> Index Template : {}", custom_html_file.green()); + println!("\t> URL Rewrite : {}", url_rewrite.purple()); - println!("\n{}", "Server startup completed.".bold()); + println!("\n{}", "Server startup completed.\n".bold()); } async fn ws_handler( From 9e64b5dde88609d43ac14cccc571b39318356c05 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 17:46:46 +0800 Subject: [PATCH 158/330] feat: commit code --- src/server/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index b1e527b86..87448cda9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -416,7 +416,7 @@ fn print_console_info(port: u16, config: &CrateConfig) { println!("\t> Index Template : {}", custom_html_file.green()); println!("\t> URL Rewrite : {}", url_rewrite.purple()); - println!("\n{}", "Server startup completed.\n".bold()); + println!("\n{}\n", "Server startup completed.".green().bold()); } async fn ws_handler( From 8dbf571891bad849eb54c57bddd3849f1c02e8bf Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 18:11:25 +0800 Subject: [PATCH 159/330] feat: commit console print --- src/server/mod.rs | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 87448cda9..93e81ea33 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -11,7 +11,7 @@ use dioxus::rsx_interpreter::SetRsxMessage; use notify::{RecommendedWatcher, Watcher}; use syn::spanned::Spanned; -use std::{path::PathBuf, process::Command, sync::Arc}; +use std::{path::PathBuf, process::Command, sync::Arc, net::UdpSocket}; use tower::ServiceBuilder; use tower_http::services::fs::{ServeDir, ServeFileSystemResponseBody}; @@ -408,17 +408,41 @@ fn print_console_info(port: u16, config: &CrateConfig) { "\t> Local : {}", format!("https://localhost:{}/", port).blue() ); - println!("\t> NetWork : {}", "use --host to expose".white().dimmed()); + println!( + "\t> NetWork : {}", + format!( + "http://{}:{}/", + get_ip().unwrap_or(String::from("0.0.0.0")), + port + ).blue() + ); println!(""); println!("\t> Profile : {}", profile.green()); println!("\t> Hot Reload : {}", hot_reload.cyan()); println!("\t> Enabled Tools : {}", tools_str.yellow()); println!("\t> Index Template : {}", custom_html_file.green()); - println!("\t> URL Rewrite : {}", url_rewrite.purple()); + println!("\t> URL Rewrite [index_on_404] : {}", url_rewrite.purple()); println!("\n{}\n", "Server startup completed.".green().bold()); } +fn get_ip() -> Option { + let socket = match UdpSocket::bind("0.0.0.0:0") { + Ok(s) => s, + Err(_) => return None, + }; + + match socket.connect("8.8.8.8:80") { + Ok(()) => (), + Err(_) => return None, + }; + + match socket.local_addr() { + Ok(addr) => return Some(addr.ip().to_string()), + Err(_) => return None, + }; +} + async fn ws_handler( ws: WebSocketUpgrade, _: Option>, From 81b712ec0baab63186769cfa62b1962bfd90af24 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 21:08:46 +0800 Subject: [PATCH 160/330] feat: commit code --- src/server/mod.rs | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 93e81ea33..c5b438768 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -11,7 +11,7 @@ use dioxus::rsx_interpreter::SetRsxMessage; use notify::{RecommendedWatcher, Watcher}; use syn::spanned::Spanned; -use std::{path::PathBuf, process::Command, sync::Arc, net::UdpSocket}; +use std::{net::UdpSocket, path::PathBuf, process::Command, sync::Arc}; use tower::ServiceBuilder; use tower_http::services::fs::{ServeDir, ServeFileSystemResponseBody}; @@ -270,12 +270,17 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { .clone() .unwrap_or_else(|| vec![PathBuf::from("src")]); - let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { - // log::info!("🚧 reload required"); - if chrono::Local::now().timestamp() > last_update_time { - match build_manager.build() { - Ok(_) => last_update_time = chrono::Local::now().timestamp(), - Err(e) => log::error!("{}", e), + let mut watcher = RecommendedWatcher::new(move |info: notify::Result| { + if info.is_ok() { + let info = info.unwrap(); + if chrono::Local::now().timestamp() > last_update_time { + match build_manager.build() { + Ok(_) => { + last_update_time = chrono::Local::now().timestamp(); + print_rebuild_info(info.paths); + } + Err(e) => log::error!("{}", e), + } } } }) @@ -414,7 +419,8 @@ fn print_console_info(port: u16, config: &CrateConfig) { "http://{}:{}/", get_ip().unwrap_or(String::from("0.0.0.0")), port - ).blue() + ) + .blue() ); println!(""); println!("\t> Profile : {}", profile.green()); @@ -426,6 +432,28 @@ fn print_console_info(port: u16, config: &CrateConfig) { println!("\n{}\n", "Server startup completed.".green().bold()); } +fn print_rebuild_info(paths: Vec) { + print!( + "{}", + String::from_utf8_lossy( + &Command::new(if cfg!(target_os = "windows") { + "cls" + } else { + "clear" + }) + .output() + .unwrap() + .stdout + ) + ); + + for path in paths { + let path = path.strip_prefix(crate::crate_root().unwrap()).unwrap().to_path_buf(); + log::info!("Updated {}", format!("{}", path.to_str().unwrap()).green()); + } + log::info!("Project rebuild done.") +} + fn get_ip() -> Option { let socket = match UdpSocket::bind("0.0.0.0:0") { Ok(s) => s, From 61c06ea5987ada72528d7625380c69a0cea5c5d2 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 21:23:35 +0800 Subject: [PATCH 161/330] feat: commit console log --- src/builder.rs | 6 +++++- src/cli/build/mod.rs | 2 +- src/cli/serve/mod.rs | 2 +- src/server/hot_reload.rs | 2 +- src/server/mod.rs | 36 ++++++++++++++++++------------------ 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 02add84ad..f69ce3637 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -13,7 +13,7 @@ use std::{ }; use wasm_bindgen_cli_support::Bindgen; -pub fn build(config: &CrateConfig) -> Result<()> { +pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { // [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) // [2] Generate the appropriate build folders // [3] Wasm-bindgen the .wasm fiile, and move it into the {builddir}/modules/xxxx/xxxx_bg.wasm @@ -52,6 +52,10 @@ pub fn build(config: &CrateConfig) -> Result<()> { cmd.arg("--verbose"); } + if quiet { + cmd.arg("--quiet"); + } + if config.custom_profile.is_some() { let custom_profile = config.custom_profile.as_ref().unwrap(); cmd.arg("--profile"); diff --git a/src/cli/build/mod.rs b/src/cli/build/mod.rs index 661f17a5a..f857bfc13 100644 --- a/src/cli/build/mod.rs +++ b/src/cli/build/mod.rs @@ -34,7 +34,7 @@ impl Build { match platform.as_str() { "web" => { - crate::builder::build(&crate_config)?; + crate::builder::build(&crate_config, false)?; } "desktop" => { crate::builder::build_desktop(&crate_config, false)?; diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 5528ebade..62843d653 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -40,7 +40,7 @@ impl Serve { match platform.as_str() { "web" => { - crate::builder::build(&crate_config)?; + crate::builder::build(&crate_config, false)?; } "desktop" => { crate::builder::build_desktop(&crate_config, true)?; diff --git a/src/server/hot_reload.rs b/src/server/hot_reload.rs index 0338dacc5..3b7812834 100644 --- a/src/server/hot_reload.rs +++ b/src/server/hot_reload.rs @@ -154,7 +154,7 @@ pub async fn hot_reload_handler( log::error!("parse error:\n--> at {}:{}:{}\n\t{:?}", parse_error.location.file_path, parse_error.location.line, parse_error.location.column, parse_error.message); }, Error::RecompileRequiredError(_) => { - if let Err(err) = state.build_manager.build(){ + if let Err(err) = state.build_manager.rebuild(){ log::error!("{}", err); } } diff --git a/src/server/mod.rs b/src/server/mod.rs index c5b438768..6b0b90a68 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -27,9 +27,9 @@ pub struct BuildManager { } impl BuildManager { - fn build(&self) -> Result<()> { - log::info!("🪁 Rebuild code"); - builder::build(&self.config)?; + fn rebuild(&self) -> Result<()> { + log::info!("🪁 Rebuild project"); + builder::build(&self.config, true)?; // change the websocket reload state to true; // the page will auto-reload. if self @@ -158,7 +158,7 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } if needs_rebuild { log::info!("reload required"); - if let Err(err) = build_manager.build() { + if let Err(err) = build_manager.rebuild() { log::error!("{}", err); } } @@ -274,7 +274,7 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { if info.is_ok() { let info = info.unwrap(); if chrono::Local::now().timestamp() > last_update_time { - match build_manager.build() { + match build_manager.rebuild() { Ok(_) => { last_update_time = chrono::Local::now().timestamp(); print_rebuild_info(info.paths); @@ -433,19 +433,19 @@ fn print_console_info(port: u16, config: &CrateConfig) { } fn print_rebuild_info(paths: Vec) { - print!( - "{}", - String::from_utf8_lossy( - &Command::new(if cfg!(target_os = "windows") { - "cls" - } else { - "clear" - }) - .output() - .unwrap() - .stdout - ) - ); + // print!( + // "{}", + // String::from_utf8_lossy( + // &Command::new(if cfg!(target_os = "windows") { + // "cls" + // } else { + // "clear" + // }) + // .output() + // .unwrap() + // .stdout + // ) + // ); for path in paths { let path = path.strip_prefix(crate::crate_root().unwrap()).unwrap().to_path_buf(); From 14a2ec306eb64e1ad8a5a293c0225dbfd1d29487 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 22:37:27 +0800 Subject: [PATCH 162/330] feat: commit code --- src/server/mod.rs | 62 +++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 6b0b90a68..ba9a853f6 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -181,7 +181,7 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } // start serve dev-server at 0.0.0.0:8080 - print_console_info(port, &config); + print_console_info(port, &config, vec![]); let file_service_config = config.clone(); let file_service = ServiceBuilder::new() @@ -270,15 +270,14 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { .clone() .unwrap_or_else(|| vec![PathBuf::from("src")]); + let watcher_config = config.clone(); let mut watcher = RecommendedWatcher::new(move |info: notify::Result| { + let config = watcher_config.clone(); if info.is_ok() { - let info = info.unwrap(); + print_console_info(port, &config, info.unwrap().paths); if chrono::Local::now().timestamp() > last_update_time { match build_manager.rebuild() { - Ok(_) => { - last_update_time = chrono::Local::now().timestamp(); - print_rebuild_info(info.paths); - } + Ok(_) => last_update_time = chrono::Local::now().timestamp(), Err(e) => log::error!("{}", e), } } @@ -296,7 +295,7 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { } // start serve dev-server at 0.0.0.0 - print_console_info(port, &config); + print_console_info(port, &config, vec![]); let file_service_config = config.clone(); let file_service = ServiceBuilder::new() @@ -354,7 +353,7 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { Ok(()) } -fn print_console_info(port: u16, config: &CrateConfig) { +fn print_console_info(port: u16, config: &CrateConfig, changed: Vec) { print!( "{}", String::from_utf8_lossy( @@ -369,6 +368,14 @@ fn print_console_info(port: u16, config: &CrateConfig) { ) ); + // for path in &changed { + // let path = path + // .strip_prefix(crate::crate_root().unwrap()) + // .unwrap() + // .to_path_buf(); + // log::info!("Updated {}", format!("{}", path.to_str().unwrap()).green()); + // } + let mut profile = if config.release { "Release" } else { "Debug" }.to_string(); if config.custom_profile.is_some() { profile = config.custom_profile.as_ref().unwrap().to_string(); @@ -404,11 +411,18 @@ fn print_console_info(port: u16, config: &CrateConfig) { "False" }; - println!( - "{} @ v{}\n", - "Dioxus".bold().green(), - crate::DIOXUS_CLI_VERSION, - ); + if changed.len() <= 0 { + println!( + "{} @ v{}\n", + "Dioxus".bold().green(), + crate::DIOXUS_CLI_VERSION, + ); + } else { + println!( + "Project Reloaded: {}\n", + format!("Changed {} files.", changed.len()).purple().bold() + ); + } println!( "\t> Local : {}", format!("https://localhost:{}/", port).blue() @@ -432,28 +446,6 @@ fn print_console_info(port: u16, config: &CrateConfig) { println!("\n{}\n", "Server startup completed.".green().bold()); } -fn print_rebuild_info(paths: Vec) { - // print!( - // "{}", - // String::from_utf8_lossy( - // &Command::new(if cfg!(target_os = "windows") { - // "cls" - // } else { - // "clear" - // }) - // .output() - // .unwrap() - // .stdout - // ) - // ); - - for path in paths { - let path = path.strip_prefix(crate::crate_root().unwrap()).unwrap().to_path_buf(); - log::info!("Updated {}", format!("{}", path.to_str().unwrap()).green()); - } - log::info!("Project rebuild done.") -} - fn get_ip() -> Option { let socket = match UdpSocket::bind("0.0.0.0:0") { Ok(s) => s, From 3551d1b6a0aeeebc3d52e5399f4f0e70703df325 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 22:44:50 +0800 Subject: [PATCH 163/330] feat: commit code --- src/server/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index ba9a853f6..d6efab958 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -94,14 +94,16 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { .clone() .unwrap_or_else(|| vec![PathBuf::from("src")]); + let watcher_config = config.clone(); let mut watcher = RecommendedWatcher::new(move |evt: notify::Result| { + let config = watcher_config.clone(); if chrono::Local::now().timestamp() > last_update_time { // Give time for the change to take effect before reading the file std::thread::sleep(std::time::Duration::from_millis(100)); if let Ok(evt) = evt { let mut messages = Vec::new(); let mut needs_rebuild = false; - for path in evt.paths { + for path in evt.paths.clone() { let mut file = File::open(path.clone()).unwrap(); if path.extension().map(|p| p.to_str()).flatten() != Some("rs") { continue; @@ -157,7 +159,7 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } } if needs_rebuild { - log::info!("reload required"); + print_console_info(port, &config, evt.paths); if let Err(err) = build_manager.rebuild() { log::error!("{}", err); } From b642dcd739a0403837ca43cd661d8d24ac22012d Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 22:45:08 +0800 Subject: [PATCH 164/330] fix: format code --- src/builder.rs | 4 +++- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index f69ce3637..4feb87839 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -433,7 +433,9 @@ fn build_assets(config: &CrateConfig) -> Result> { let temp = entry.path(); if temp.is_file() { let suffix = temp.extension(); - if suffix.is_none() { continue; } + if suffix.is_none() { + continue; + } let suffix = suffix.unwrap().to_str().unwrap(); if suffix == "scss" || suffix == "sass" { // if file suffix is `scss` / `sass` we need transform it. diff --git a/src/lib.rs b/src/lib.rs index 9956989b7..1b651acee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,4 +21,4 @@ pub use error::*; pub mod logging; pub use logging::*; -pub mod hot_reload; \ No newline at end of file +pub mod hot_reload; From f57dc5212b37bcc799feded01468c0251f60822a Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Wed, 6 Jul 2022 23:01:39 +0800 Subject: [PATCH 165/330] fix: change local `https` to `http` --- src/server/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index d6efab958..3ecce6c26 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -427,7 +427,7 @@ fn print_console_info(port: u16, config: &CrateConfig, changed: Vec) { } println!( "\t> Local : {}", - format!("https://localhost:{}/", port).blue() + format!("http://localhost:{}/", port).blue() ); println!( "\t> NetWork : {}", @@ -444,8 +444,14 @@ fn print_console_info(port: u16, config: &CrateConfig, changed: Vec) { println!("\t> Enabled Tools : {}", tools_str.yellow()); println!("\t> Index Template : {}", custom_html_file.green()); println!("\t> URL Rewrite [index_on_404] : {}", url_rewrite.purple()); + println!(""); - println!("\n{}\n", "Server startup completed.".green().bold()); + if changed.len() <= 0 { + log::info!("{}", "Server startup completed.".green().bold()); + } else { + log::info!("{}", "Project rebuild completed.".green().bold()); + } + } fn get_ip() -> Option { From 7860f8b931ecf7d5757433f53868561929d95e74 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Thu, 7 Jul 2022 23:03:30 +0800 Subject: [PATCH 166/330] feat: commit code --- Cargo.toml | 1 + src/builder.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fa14b36b7..7e982bc78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ regex = "1.5.4" chrono = "0.4.19" anyhow = "1.0.53" hyper = "0.14.17" +loading = "0.3.0" axum = { version = "0.5.1", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } diff --git a/src/builder.rs b/src/builder.rs index 4feb87839..0dce6d71d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -6,7 +6,7 @@ use crate::{ }; use std::{ fs::{copy, create_dir_all, remove_dir_all, File}, - io::Read, + io::{Read, BufRead}, panic, path::PathBuf, process::Command, @@ -42,8 +42,9 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { .arg("build") .arg("--target") .arg("wasm32-unknown-unknown") - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); + .arg("--message-format=json") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()); if config.release { cmd.arg("--release"); @@ -74,7 +75,14 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { ExecutableType::Example(name) => cmd.arg("--example").arg(name), }; + let loading = loading::Loading::default(); + loading.text("Building"); let output = cmd.output()?; + for i in output.stdout.lines() { + // println!("{:?}", i); + } + loading.success("OK"); + loading.end(); if !output.status.success() { log::error!("Build failed!"); From 5edcb9238c33c253ca62831bbd8947d4e8b49c05 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Fri, 8 Jul 2022 09:26:05 +0800 Subject: [PATCH 167/330] feat: cargo format struct --- src/builder.rs | 26 ++++++++++++++++++-------- src/cargo.rs | 25 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 0dce6d71d..a662f8a20 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -77,18 +77,28 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { let loading = loading::Loading::default(); loading.text("Building"); - let output = cmd.output()?; - for i in output.stdout.lines() { - // println!("{:?}", i); + let mut child = cmd.spawn()?; + let out = child.stdout.take().unwrap(); + let mut out = std::io::BufReader::new(out); + let mut s = String::new(); + let mut n = 0; + while let Ok(_) = out.read_line(&mut s) { + // 进程退出后结束循环 + if let Ok(Some(_)) = child.try_wait() { + break; + } + println!("\n{}\n", s); + loading.text(format!("Building {}", n)); + n += 1; } loading.success("OK"); loading.end(); - if !output.status.success() { - log::error!("Build failed!"); - let reason = String::from_utf8_lossy(&output.stderr).to_string(); - return Err(Error::BuildFailed(reason)); - } + // if !output.status.success() { + // log::error!("Build failed!"); + // let reason = String::from_utf8_lossy(&output.stderr).to_string(); + // return Err(Error::BuildFailed(reason)); + // } // [2] Establish the output directory structure let bindgen_outdir = out_dir.join("assets").join("dioxus"); diff --git a/src/cargo.rs b/src/cargo.rs index 251e9d848..9994d5be5 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -1,4 +1,6 @@ //! Utilities for working with cargo and rust files +use serde::Serialize; + use crate::error::{Error, Result}; use std::{ env, fs, @@ -90,3 +92,26 @@ impl Metadata { Err(Error::CargoError("InvalidOutput".to_string())) } } + +#[derive(Serialize, Debug, Clone)] +pub struct CargoFormatInfo { + pub reason: CargoFormatReason, + #[serde(default)] + pub package_id: String, + #[serde(default)] + manifest_path: String, + #[serde(default)] + message: Option +} + +#[derive(Serialize, Debug, Clone)] +pub enum CargoFormatReason { + #[serde(rename = "compiler-message")] + CompilerMessage, + #[serde(rename = "compiler-artifact")] + CompilerArtifact, + #[serde(rename = "build-script-executed")] + BuildScriptExecuted, + #[serde(rename = "build-finished")] + BuildFinished, +} \ No newline at end of file From 0a2bac87154f8c867fc0427fabe21ce04fd3b026 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 00:28:00 +0800 Subject: [PATCH 168/330] feat: commit code --- src/builder.rs | 21 +++++++++++++-------- src/cargo.rs | 10 ++++++---- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index a662f8a20..bdb82fc45 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -2,11 +2,11 @@ use crate::{ config::{CrateConfig, ExecutableType}, error::{Error, Result}, tools::Tool, - DioxusConfig, + CargoFormatInfo, DioxusConfig, }; use std::{ fs::{copy, create_dir_all, remove_dir_all, File}, - io::{Read, BufRead}, + io::{BufRead, Read}, panic, path::PathBuf, process::Command, @@ -80,16 +80,21 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { let mut child = cmd.spawn()?; let out = child.stdout.take().unwrap(); let mut out = std::io::BufReader::new(out); - let mut s = String::new(); - let mut n = 0; - while let Ok(_) = out.read_line(&mut s) { + let mut content = String::new(); + while let Ok(_) = out.read_line(&mut content) { // 进程退出后结束循环 if let Ok(Some(_)) = child.try_wait() { break; } - println!("\n{}\n", s); - loading.text(format!("Building {}", n)); - n += 1; + let content = content.split('\n').collect::>(); + for json in content { + let d = serde_json::from_str::(&json); + if let Ok(d) = d { + println!("\n{:#?}\n", d); + } else { + println!("\n\n{:?}\n\n", json); + } + } } loading.success("OK"); loading.end(); diff --git a/src/cargo.rs b/src/cargo.rs index 9994d5be5..6c5085066 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -1,5 +1,5 @@ //! Utilities for working with cargo and rust files -use serde::Serialize; +use serde::{Serialize, Deserialize}; use crate::error::{Error, Result}; use std::{ @@ -93,7 +93,7 @@ impl Metadata { } } -#[derive(Serialize, Debug, Clone)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct CargoFormatInfo { pub reason: CargoFormatReason, #[serde(default)] @@ -101,10 +101,12 @@ pub struct CargoFormatInfo { #[serde(default)] manifest_path: String, #[serde(default)] - message: Option + target: Option, + #[serde(default)] + message: Option, } -#[derive(Serialize, Debug, Clone)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub enum CargoFormatReason { #[serde(rename = "compiler-message")] CompilerMessage, From eb0145173d0f8d5db715875d3213499172e89ea8 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 00:32:23 +0800 Subject: [PATCH 169/330] feat: add `indicatif` crate --- Cargo.toml | 2 +- src/builder.rs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7e982bc78..a50a06fde 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ regex = "1.5.4" chrono = "0.4.19" anyhow = "1.0.53" hyper = "0.14.17" -loading = "0.3.0" +indicatif = "0.16.2" axum = { version = "0.5.1", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } diff --git a/src/builder.rs b/src/builder.rs index bdb82fc45..ed0921cd1 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -75,8 +75,6 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { ExecutableType::Example(name) => cmd.arg("--example").arg(name), }; - let loading = loading::Loading::default(); - loading.text("Building"); let mut child = cmd.spawn()?; let out = child.stdout.take().unwrap(); let mut out = std::io::BufReader::new(out); @@ -96,8 +94,6 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { } } } - loading.success("OK"); - loading.end(); // if !output.status.success() { // log::error!("Build failed!"); From dfe571df1a6260f31eff5f3e83113c448786e3b1 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 10:09:25 +0800 Subject: [PATCH 170/330] feat: commit prettier_build --- Cargo.toml | 2 +- src/builder.rs | 58 ++++++++++++++++++++++++++++++++------------------ src/cargo.rs | 27 ----------------------- 3 files changed, 38 insertions(+), 49 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a50a06fde..7e982bc78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ regex = "1.5.4" chrono = "0.4.19" anyhow = "1.0.53" hyper = "0.14.17" -indicatif = "0.16.2" +loading = "0.3.0" axum = { version = "0.5.1", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } diff --git a/src/builder.rs b/src/builder.rs index ed0921cd1..5ef084326 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -2,11 +2,14 @@ use crate::{ config::{CrateConfig, ExecutableType}, error::{Error, Result}, tools::Tool, - CargoFormatInfo, DioxusConfig, + DioxusConfig, }; +use cargo_metadata::Message; +use loading::Loading; use std::{ + collections::HashMap, fs::{copy, create_dir_all, remove_dir_all, File}, - io::{BufRead, Read}, + io::Read, panic, path::PathBuf, process::Command, @@ -75,25 +78,7 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { ExecutableType::Example(name) => cmd.arg("--example").arg(name), }; - let mut child = cmd.spawn()?; - let out = child.stdout.take().unwrap(); - let mut out = std::io::BufReader::new(out); - let mut content = String::new(); - while let Ok(_) = out.read_line(&mut content) { - // 进程退出后结束循环 - if let Ok(Some(_)) = child.try_wait() { - break; - } - let content = content.split('\n').collect::>(); - for json in content { - let d = serde_json::from_str::(&json); - if let Ok(d) = d { - println!("\n{:#?}\n", d); - } else { - println!("\n\n{:?}\n\n", json); - } - } - } + prettier_build(cmd).unwrap(); // if !output.status.success() { // log::error!("Build failed!"); @@ -342,6 +327,37 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { Ok(()) } +fn prettier_build(mut cmd: Command) -> anyhow::Result<()> { + let loading = Loading::default(); + let mut record: HashMap = HashMap::new(); + let mut command = cmd.spawn()?; + let reader = std::io::BufReader::new(command.stdout.take().unwrap()); + for message in cargo_metadata::Message::parse_stream(reader) { + match message.unwrap() { + Message::CompilerMessage(_msg) => { + // println!("{:#?}", msg); + } + Message::CompilerArtifact(artifact) => { + record.insert(artifact.package_id.to_string(), artifact.target.name); + } + Message::BuildScriptExecuted(script) => { + let package_id = script.package_id.to_string(); + if let Some(name) = record.get(&package_id) { + loading.text(format!("[{}] build done", name)); + } + } + Message::BuildFinished(finished) => { + if finished.success { + } else { + std::process::exit(1); + } + } + _ => (), // Unknown message + } + } + Ok(()) +} + pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { let crate_root = crate::cargo::crate_root().unwrap(); let custom_html_file = crate_root.join("index.html"); diff --git a/src/cargo.rs b/src/cargo.rs index 6c5085066..251e9d848 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -1,6 +1,4 @@ //! Utilities for working with cargo and rust files -use serde::{Serialize, Deserialize}; - use crate::error::{Error, Result}; use std::{ env, fs, @@ -92,28 +90,3 @@ impl Metadata { Err(Error::CargoError("InvalidOutput".to_string())) } } - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct CargoFormatInfo { - pub reason: CargoFormatReason, - #[serde(default)] - pub package_id: String, - #[serde(default)] - manifest_path: String, - #[serde(default)] - target: Option, - #[serde(default)] - message: Option, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub enum CargoFormatReason { - #[serde(rename = "compiler-message")] - CompilerMessage, - #[serde(rename = "compiler-artifact")] - CompilerArtifact, - #[serde(rename = "build-script-executed")] - BuildScriptExecuted, - #[serde(rename = "build-finished")] - BuildFinished, -} \ No newline at end of file From 98134cfe1ce33d12ab1dcba2fa1ca71b05e8a682 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 10:09:44 +0800 Subject: [PATCH 171/330] feat: commit Cargo.lock --- .gitignore | 1 - Cargo.lock | 4684 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 4684 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 2e049011e..6b39d31a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /target -Cargo.lock .idea/ \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..086673b7a --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,4684 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-task" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" + +[[package]] +name = "async-trait" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atk" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +dependencies = [ + "atk-sys", + "bitflags", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.2", +] + +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2cc6e8e8c993cb61a005fab8c1e5093a29199b7253b05a6883999312935c1ff" +dependencies = [ + "async-trait", + "axum-core", + "base64 0.13.0", + "bitflags", + "bytes", + "futures-util", + "headers", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "sha-1 0.10.0", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-http 0.3.4", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4d047478b986f14a13edad31a009e2e05cb241f9805d0d75e4cba4e129ad4d" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", +] + +[[package]] +name = "backtrace" +version = "0.3.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +dependencies = [ + "byteorder", + "safemem", +] + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "base64ct" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" + +[[package]] +name = "binary-install" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5bc5f8c50dd6a80d0b303ddab79f42ddcb52fd43d68107ecf622c551fd4cd4" +dependencies = [ + "curl", + "dirs 1.0.5", + "failure", + "flate2", + "hex", + "is_executable", + "siphasher", + "tar", + "zip 0.5.13", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake2b_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array 0.14.5", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "blocking" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +dependencies = [ + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "once_cell", +] + +[[package]] +name = "bumpalo" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "bzip2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + +[[package]] +name = "cairo-rs" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.2", +] + +[[package]] +name = "camino" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.12", + "serde", + "serde_json", +] + +[[package]] +name = "cargo_toml" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5809dd3e6444651fd1cdd3dbec71eca438c439a0fcc8081674a14da0afe50185" +dependencies = [ + "serde", + "serde_derive", + "toml", +] + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-expr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-expr" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "time 0.1.44", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.5", +] + +[[package]] +name = "clap" +version = "3.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902" +dependencies = [ + "heck 0.4.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "cocoa" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "colored" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" +dependencies = [ + "atty", + "lazy_static", + "winapi", +] + +[[package]] +name = "colored" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +dependencies = [ + "atty", + "lazy_static", + "winapi", +] + +[[package]] +name = "combine" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "crypto-common" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5999502d32b9c48d492abe66392408144895020ec4709e549e840799f3bb74c0" +dependencies = [ + "generic-array 0.14.5", + "typenum", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "curl" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d855aeef205b43f65a5001e0997d81f8efca7badad4fad7d897aa7f0d0651f" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.55+curl-7.83.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23734ec77368ec583c2e61dd3f0b0e5c98b93abe6d2a004ca06b91dd7e3e2762" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi", +] + +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core 0.10.2", + "darling_macro 0.10.2", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core 0.10.2", + "quote", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", +] + +[[package]] +name = "dioxus" +version = "0.2.4" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "dioxus-core", + "dioxus-core-macro", + "dioxus-desktop", + "dioxus-hooks", + "dioxus-html", + "dioxus-router", + "dioxus-rsx", + "dioxus-rsx-interpreter", + "dioxus-web", +] + +[[package]] +name = "dioxus-cli" +version = "0.1.5" +dependencies = [ + "anyhow", + "atty", + "axum", + "binary-install", + "cargo_metadata", + "cargo_toml", + "chrono", + "clap", + "colored 2.0.0", + "convert_case", + "dioxus", + "dirs 4.0.0", + "fern", + "flate2", + "fs_extra", + "futures", + "headers", + "html_parser", + "hyper", + "loading", + "log", + "notify", + "proc-macro2", + "regex", + "reqwest", + "serde", + "serde_json", + "syn", + "tar", + "thiserror", + "tokio", + "toml", + "tower", + "tower-http 0.2.5", + "walkdir", + "wasm-bindgen-cli-support", + "zip 0.6.2", +] + +[[package]] +name = "dioxus-core" +version = "0.2.1" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "backtrace", + "bumpalo", + "futures-channel", + "futures-util", + "fxhash", + "indexmap", + "log", + "longest-increasing-subsequence", + "once_cell", + "serde", + "slab", + "smallvec", +] + +[[package]] +name = "dioxus-core-macro" +version = "0.2.1" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "dioxus-rsx", + "dioxus-rsx-interpreter", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dioxus-desktop" +version = "0.2.3" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "core-foundation", + "dioxus-core", + "dioxus-html", + "dioxus-interpreter-js", + "dioxus-rsx-interpreter", + "dunce", + "futures-channel", + "interprocess", + "log", + "mime_guess", + "serde", + "serde_json", + "thiserror", + "tokio", + "webbrowser", + "wry", +] + +[[package]] +name = "dioxus-hooks" +version = "0.2.1" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "dioxus-core", + "futures-channel", + "log", +] + +[[package]] +name = "dioxus-html" +version = "0.2.1" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "dioxus-core", + "enumset", + "euclid", + "keyboard-types", + "serde", + "serde_repr", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-interpreter-js" +version = "0.2.1" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-router" +version = "0.2.3" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "futures-channel", + "futures-util", + "log", + "rsx-prelude", + "serde", + "serde_urlencoded", + "thiserror", + "url", +] + +[[package]] +name = "dioxus-rsx" +version = "0.0.0" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dioxus-rsx-interpreter" +version = "0.1.0" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "dioxus-core", + "dioxus-hooks", + "dioxus-html", + "dioxus-rsx", + "dioxus-ssr", + "lazy_static", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", +] + +[[package]] +name = "dioxus-ssr" +version = "0.2.1" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "dioxus-core", +] + +[[package]] +name = "dioxus-web" +version = "0.2.1" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "anyhow", + "console_error_panic_hook", + "dioxus-core", + "dioxus-html", + "dioxus-interpreter-js", + "dioxus-rsx-interpreter", + "futures-channel", + "futures-util", + "fxhash", + "gloo-timers", + "js-sys", + "log", + "once_cell", + "serde-wasm-bindgen", + "serde_json", + "smallstr", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "dirs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" +dependencies = [ + "libc", + "redox_users 0.3.5", + "winapi", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users 0.4.3", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dunce" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-as-inner" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "enumset" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4799cdb24d48f1f8a7a98d06b7fde65a85a2d1e42b25a889f5406aa1fbefe074" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea83a3fbdc1d999ccfbcbee717eab36f8edf2d71693a23ce0d7cca19e085304c" +dependencies = [ + "darling 0.13.4", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "euclid" +version = "0.22.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52c2ef4a78da0ba68fbe1fd920627411096d2ac478f7f4c9f3a54ba6705bade" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "event-listener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[package]] +name = "fern" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bdd7b0849075e79ee9a1836df22c717d1eba30451796fdc631b04565dd11e2a" +dependencies = [ + "colored 1.9.3", + "log", +] + +[[package]] +name = "field-offset" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "filetime" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.13", + "windows-sys", +] + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + +[[package]] +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +dependencies = [ + "bitflags", + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.2", +] + +[[package]] +name = "gdk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps 6.0.2", +] + +[[package]] +name = "gdkx11-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps 6.0.2", + "x11", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" + +[[package]] +name = "gio" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.2", + "winapi", +] + +[[package]] +name = "glib" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" +dependencies = [ + "anyhow", + "heck 0.4.0", + "proc-macro-crate 1.1.3", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "glib-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +dependencies = [ + "libc", + "system-deps 6.0.2", +] + +[[package]] +name = "gloo-timers" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gobject-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.2", +] + +[[package]] +name = "gtk" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +dependencies = [ + "atk", + "bitflags", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps 6.0.2", +] + +[[package]] +name = "gtk3-macros" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" +dependencies = [ + "anyhow", + "proc-macro-crate 1.1.3", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "h2" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" + +[[package]] +name = "headers" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" +dependencies = [ + "base64 0.13.0", + "bitflags", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha-1 0.10.0", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.3", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "html_parser" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec016cabcf7c9c48f9d5fdc6b03f273585bfce640a0f47a69552039e92b1959a" +dependencies = [ + "pest", + "pest_derive", + "serde", + "serde_derive", + "serde_json", + "thiserror", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" + +[[package]] +name = "httparse" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +dependencies = [ + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "inotify" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +dependencies = [ + "bitflags", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "interprocess" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c58ec7fbda1df9a93f587b780659db3c99f61f4be27f9c82c9b37684ffd0366" +dependencies = [ + "blocking", + "cfg-if", + "futures", + "intmap", + "libc", + "once_cell", + "spinning", + "thiserror", + "winapi", +] + +[[package]] +name = "intmap" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae52f28f45ac2bc96edb7714de995cffc174a395fb0abf5bff453587c980d7b9" + +[[package]] +name = "ipconfig" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" +dependencies = [ + "socket2", + "widestring", + "winapi", + "winreg 0.7.0", +] + +[[package]] +name = "ipnet" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" + +[[package]] +name = "is_executable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d553b8abc8187beb7d663e34c065ac4570b273bc9511a50e940e99409c577" +dependencies = [ + "winapi", +] + +[[package]] +name = "itoa" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "javascriptcore-rs" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +dependencies = [ + "bitflags", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "jni" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24967112a1e4301ca5342ea339763613a37592b8a6ce6cf2e4494537c7a42faf" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keyboard-types" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7668b7cff6a51fe61cdde64cd27c8a220786f399501b57ebe36f7d8112fd68" +dependencies = [ + "bitflags", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "kqueue" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d6112e8f37b59803ac47a42d14f1f3a59bbf72fc6857ffc5be455e28a691f8e" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libayatana-appindicator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0379d22a323947cb27b4dbe3b14fc1dcde07c9e9c3eca52ddf97ca0819c28cc4" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "log", +] + +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "loading" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "676420b03272176423578148eee61319e893422694f6d96a394841cb0901357f" + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "longest-increasing-subsequence" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "matchit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndk" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.2.2", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.3.0", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-glue" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3648f3609716eb7dbf5f5b5d4b84fcd67dd4c34efcdb12e4a6c0929c2ac48349" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.4.0", + "ndk-context", + "ndk-macro 0.2.0", + "ndk-sys 0.2.2", +] + +[[package]] +name = "ndk-glue" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.6.0", + "ndk-context", + "ndk-macro 0.3.0", + "ndk-sys 0.3.0", +] + +[[package]] +name = "ndk-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling 0.10.2", + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +dependencies = [ + "darling 0.13.4", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "notify" +version = "5.0.0-pre.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "553f9844ad0b0824605c20fb55a661679782680410abfb1a8144c2e7e437e7a7" +dependencies = [ + "bitflags", + "crossbeam-channel", + "filetime", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "mio", + "serde", + "walkdir", + "winapi", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "object" +version = "0.28.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" + +[[package]] +name = "pango" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +dependencies = [ + "bitflags", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.2", +] + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.3", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.13", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.13", + "smallvec", + "windows-sys", +] + +[[package]] +name = "password-hash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "pbkdf2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +dependencies = [ + "digest 0.10.3", + "hmac", + "password-hash", + "sha2", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +dependencies = [ + "maplit", + "pest", + "sha-1 0.8.2", +] + +[[package]] +name = "pin-project" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.7", +] + +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +dependencies = [ + "getrandom 0.1.16", + "redox_syscall 0.1.57", + "rust-argon2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.7", + "redox_syscall 0.2.13", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +dependencies = [ + "base64 0.13.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tokio-util", + "tower-service", + "trust-dns-resolver", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg 0.10.1", +] + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rsx-prelude" +version = "0.1.0" +source = "git+https://github.com/dioxuslabs/dioxus/#baaa1752d3ccd5918fc472b1071b95a12b019687" +dependencies = [ + "dioxus-core", + "dioxus-core-macro", + "dioxus-hooks", + "dioxus-html", + "dioxus-rsx-interpreter", +] + +[[package]] +name = "rust-argon2" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +dependencies = [ + "base64 0.13.0", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustls" +version = "0.20.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +dependencies = [ + "base64 0.13.0", +] + +[[package]] +name = "ryu" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfc62771e7b829b517cb213419236475f434fb480eddd76112ae182d274434a" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" + +[[package]] +name = "slab" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" + +[[package]] +name = "smallstr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e922794d168678729ffc7e07182721a14219c65814e66e91b839a272fe5ae4f" +dependencies = [ + "smallvec", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soup2" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +dependencies = [ + "bitflags", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", +] + +[[package]] +name = "soup2-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +dependencies = [ + "bitflags", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spinning" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4f0e86297cad2658d92a707320d87bf4e6ae1050287f51d19b67ef3f153a7b" +dependencies = [ + "lock_api", +] + +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "system-deps" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" +dependencies = [ + "cfg-expr 0.9.1", + "heck 0.3.3", + "pkg-config", + "toml", + "version-compare 0.0.11", +] + +[[package]] +name = "system-deps" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a45a1c4c9015217e12347f2a411b57ce2c4fc543913b14b6fe40483328e709" +dependencies = [ + "cfg-expr 0.10.3", + "heck 0.4.0", + "pkg-config", + "toml", + "version-compare 0.1.0", +] + +[[package]] +name = "tao" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df895eb66ff23d1824055114d6fbdd2c297bf70ad85349a4adaee0f8b2a860d1" +dependencies = [ + "bitflags", + "cairo-rs", + "cc", + "cocoa", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gdkx11-sys", + "gio", + "glib", + "glib-sys", + "gtk", + "instant", + "lazy_static", + "libayatana-appindicator", + "libc", + "log", + "ndk 0.4.0", + "ndk-glue 0.4.2", + "ndk-sys 0.2.2", + "objc", + "parking_lot 0.11.2", + "raw-window-handle", + "scopeguard", + "serde", + "tao-core-video-sys", + "unicode-segmentation", + "windows", + "windows_macros", + "x11-dl", +] + +[[package]] +name = "tao-core-video-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271450eb289cb4d8d0720c6ce70c72c8c858c93dd61fc625881616752e6b98f6" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "objc", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall 0.2.13", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +dependencies = [ + "itoa", + "libc", + "num_threads", + "time-macros", +] + +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +dependencies = [ + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06cda1232a49558c46f8a504d5b93101d42c0bf7f911f12a105ba48168f821ae" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aba3f3efabf7fb41fae8534fc20a817013dd1c12cb45441efb6c82e6556b4cd8" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +dependencies = [ + "once_cell", +] + +[[package]] +name = "trust-dns-proto" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "lazy_static", + "log", + "rand", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "parking_lot 0.12.1", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "trust-dns-proto", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "tungstenite" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96a2dea40e7570482f28eb57afbe42d97551905da6a9400acc5c328d24004f5" +dependencies = [ + "base64 0.13.0", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand", + "sha-1 0.10.0", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ucd-trie" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" + +[[package]] +name = "unicode-normalization" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" + +[[package]] +name = "unicode-xid" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + +[[package]] +name = "version-compare" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe88247b92c1df6b6de80ddc290f3976dbdf2f5f5d3fd049a9fb598c6dd5ca73" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "walrus" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb08e48cde54c05f363d984bb54ce374f49e242def9468d2e1b6c2372d291f8" +dependencies = [ + "anyhow", + "id-arena", + "leb128", + "log", + "walrus-macro", + "wasmparser 0.77.0", +] + +[[package]] +name = "walrus-macro" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e5bd22c71e77d60140b0bd5be56155a37e5bd14e24f5f87298040d0cc40d7" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-cli-support" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4016fbd42224de21aab2f009aeaec61067d278a298ba7f8f7f8d40fbffea0822" +dependencies = [ + "anyhow", + "base64 0.9.3", + "log", + "rustc-demangle", + "serde_json", + "tempfile", + "walrus", + "wasm-bindgen-externref-xform", + "wasm-bindgen-multi-value-xform", + "wasm-bindgen-shared", + "wasm-bindgen-threads-xform", + "wasm-bindgen-wasm-conventions", + "wasm-bindgen-wasm-interpreter", + "wit-text", + "wit-validator", + "wit-walrus", +] + +[[package]] +name = "wasm-bindgen-externref-xform" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33c8e2d3f3b6f6647f982911eb4cb44998c8cca97a4fe7afc99f616ebb33a73" +dependencies = [ + "anyhow", + "walrus", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-multi-value-xform" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7015b54357604811162710d5cf274ab85d974fe1e324222dd5b2133afdefe9b9" +dependencies = [ + "anyhow", + "walrus", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" + +[[package]] +name = "wasm-bindgen-threads-xform" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6961b838d9a9c121ba4a1eea1628014cc759469e3defb42bbac9c5ed0f65be14" +dependencies = [ + "anyhow", + "walrus", + "wasm-bindgen-wasm-conventions", +] + +[[package]] +name = "wasm-bindgen-wasm-conventions" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0a0eca38fe89471f57d6903f3e17e732d2d6f995a7af5b23f27df7fee0f0d18" +dependencies = [ + "anyhow", + "walrus", +] + +[[package]] +name = "wasm-bindgen-wasm-interpreter" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b1c9fb7f71137840932bbb853ef1f83d68c88584b716c9bbae38675c9fb8b86" +dependencies = [ + "anyhow", + "log", + "walrus", + "wasm-bindgen-wasm-conventions", +] + +[[package]] +name = "wasmparser" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" + +[[package]] +name = "wasmparser" +version = "0.77.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35c86d22e720a07d954ebbed772d01180501afe7d03d464f413bb5f8914a8d6" + +[[package]] +name = "wast" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b1844f66a2bc8526d71690104c0e78a8e59ffa1597b7245769d174ebb91deb5" +dependencies = [ + "leb128", +] + +[[package]] +name = "web-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a3cffdb686fbb24d9fb8f03a213803277ed2300f11026a3afe1f108dc021b" +dependencies = [ + "jni 0.19.0", + "ndk-glue 0.6.2", + "url", + "web-sys", + "widestring", + "winapi", +] + +[[package]] +name = "webkit2gtk" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29952969fb5e10fe834a52eb29ad0814ccdfd8387159b0933edf1344a1c9cdcc" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup2", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +dependencies = [ + "atk-sys", + "bitflags", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pango-sys", + "pkg-config", + "soup2-sys", + "system-deps 6.0.2", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" +dependencies = [ + "webpki", +] + +[[package]] +name = "webview2-com" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb8e90ac2d9ce39cdb70017aaec641be09fbdd702b7b332b9896d053eb469524" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows_macros", +] + +[[package]] +name = "webview2-com-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515c6c82fcee93f6edaacc72c8e233dbe4ff3ca569dce1901dfc36c404a3e99" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "webview2-com-sys" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92160310b3322397e4ff8a8285a7429d73a07a68fda44ee80879605b93e53f76" +dependencies = [ + "regex", + "serde", + "serde_json", + "thiserror", + "windows", + "windows-bindgen", +] + +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b749ebd2304aa012c5992d11a25d07b406bdbe5f79d371cb7a918ce501a19eb0" +dependencies = [ + "windows_aarch64_msvc 0.30.0", + "windows_i686_gnu 0.30.0", + "windows_i686_msvc 0.30.0", + "windows_x86_64_gnu 0.30.0", + "windows_x86_64_msvc 0.30.0", +] + +[[package]] +name = "windows-bindgen" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "944c545fcae9dd66488308f8b69aa3ba34f53714416ecfcdcbbfa4b6821e27c6" +dependencies = [ + "windows_quote", + "windows_reader", +] + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29277a4435d642f775f63c7d1faeb927adba532886ce0287bd985bffb16b6bca" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_gen" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30dff4d91d22520628bb94b66f2bb313cb16a09a515a32320a84a1b449bc94c0" +dependencies = [ + "windows_quote", + "windows_reader", +] + +[[package]] +name = "windows_i686_gnu" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1145e1989da93956c68d1864f32fb97c8f561a8f89a5125f6a2b7ea75524e4b8" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a09e3a0d4753b73019db171c1339cd4362c8c44baf1bcea336235e955954a6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_macros" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ae44ab917e9005fe710d99d52d227ca0164b10a09be90649142cc3fab825d3" +dependencies = [ + "syn", + "windows_gen", + "windows_quote", + "windows_reader", +] + +[[package]] +name = "windows_quote" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71f02c51a77e6248c1206aaa920802c32d50a05205e229b118d7f3afd3036667" + +[[package]] +name = "windows_reader" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e44e6df0da993cda589c5ac852272fbb2a0ead67a031a017dd3eac11528a2d72" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca64fcb0220d58db4c119e050e7af03c69e6f4f415ef69ec1773d9aab422d5a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08cabc9f0066848fef4bc6a1c1668e6efce38b661d2aeec75d18d8617eebb5f1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi", +] + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "wit-parser" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f5fd97866f4b9c8e1ed57bcf9446f3d0d8ba37e2dd01c3c612c046c053b06f7" +dependencies = [ + "anyhow", + "leb128", + "wit-schema-version", +] + +[[package]] +name = "wit-schema-version" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfee4a6a4716eefa0682e7a3b836152e894a3e4f34a9d6c2c3e1c94429bfe36a" + +[[package]] +name = "wit-text" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33358e95c77d660f1c7c07f4a93c2bd89768965e844e3c50730bb4b42658df5f" +dependencies = [ + "anyhow", + "wast", + "wit-writer", +] + +[[package]] +name = "wit-validator" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c11d93d925420e7872b226c4161849c32be38385ccab026b88df99d8ddc6ba6" +dependencies = [ + "anyhow", + "wasmparser 0.59.0", + "wit-parser", + "wit-schema-version", +] + +[[package]] +name = "wit-walrus" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad559e3e4c6404b2a6a675d44129d62a3836e3b951b90112fa1c5feb852757cd" +dependencies = [ + "anyhow", + "id-arena", + "walrus", + "wit-parser", + "wit-schema-version", + "wit-writer", +] + +[[package]] +name = "wit-writer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ad01ba5e9cbcff799a0689e56a153776ea694cec777f605938cb9880d41a09" +dependencies = [ + "leb128", + "wit-schema-version", +] + +[[package]] +name = "wry" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5676092e1a33448ed0f268717bcbb2e928354b78f4c1f60f3d43641eedea0d9" +dependencies = [ + "block", + "cocoa", + "core-graphics", + "gdk", + "gio", + "glib", + "gtk", + "http", + "jni 0.18.0", + "libc", + "log", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "tao", + "thiserror", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows_macros", +] + +[[package]] +name = "x11" +version = "2.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd0565fa8bfba8c5efe02725b14dff114c866724eff2cfd44d76cea74bcd87a" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[package]] +name = "zip" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "flate2", + "thiserror", + "time 0.1.44", +] + +[[package]] +name = "zip" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time 0.3.11", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.10.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "4.1.6+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.6.3+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" +dependencies = [ + "cc", + "libc", +] From 526a88cab16045cf6b8acba75471cc62f17dca10 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 14:16:19 +0800 Subject: [PATCH 172/330] feat: commit code --- Cargo.lock | 66 +++++++++++++++++++++++++++++----- Cargo.toml | 4 +-- src/builder.rs | 73 +++++++++++++++++++++++-------------- src/cli/serve/mod.rs | 36 ++++++++----------- src/server/mod.rs | 86 +++++++++++++++++++++++++++++++++++--------- 5 files changed, 190 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 086673b7a..4c4720564 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -396,9 +396,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.14.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +checksum = "3abb7553d5b9b8421c6de7cb02606ff15e0c6eea7d8eadd75ef013fd636bec36" dependencies = [ "camino", "cargo-platform", @@ -590,6 +590,21 @@ dependencies = [ "cache-padded", ] +[[package]] +name = "console" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "regex", + "terminal_size", + "unicode-width", + "winapi", +] + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -872,7 +887,7 @@ dependencies = [ "headers", "html_parser", "hyper", - "loading", + "indicatif", "log", "notify", "proc-macro2", @@ -1101,6 +1116,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.31" @@ -1906,6 +1927,17 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "indicatif" +version = "0.17.0-rc.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017d0ce94b8e91e29d2c78ed891e57e5ec3dc4371820a9d96abab4af09eb8ad" +dependencies = [ + "console", + "number_prefix", + "unicode-width", +] + [[package]] name = "inotify" version = "0.9.6" @@ -2145,12 +2177,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "loading" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "676420b03272176423578148eee61319e893422694f6d96a394841cb0901357f" - [[package]] name = "lock_api" version = "0.4.7" @@ -2469,6 +2495,12 @@ dependencies = [ "libc", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "objc" version = "0.2.7" @@ -3525,6 +3557,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "textwrap" version = "0.15.0" @@ -3893,6 +3935,12 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + [[package]] name = "unicode-xid" version = "0.2.3" diff --git a/Cargo.toml b/Cargo.toml index 7e982bc78..da2467fc2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,14 +29,14 @@ notify = { version = "5.0.0-pre.13", features = ["serde"] } html_parser = "0.6.2" binary-install = "0.0.2" convert_case = "0.5.0" -cargo_metadata = "0.14.1" +cargo_metadata = "0.15.0" tokio = { version = "1.16.1", features = ["full"] } atty = "0.2.14" regex = "1.5.4" chrono = "0.4.19" anyhow = "1.0.53" hyper = "0.14.17" -loading = "0.3.0" +indicatif = "0.17.0-rc.11" axum = { version = "0.5.1", features = ["ws", "headers"] } tower-http = { version = "0.2.2", features = ["fs", "trace"] } diff --git a/src/builder.rs b/src/builder.rs index 5ef084326..d164e5418 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -4,19 +4,26 @@ use crate::{ tools::Tool, DioxusConfig, }; -use cargo_metadata::Message; -use loading::Loading; +use cargo_metadata::{diagnostic::Diagnostic, Message}; +use indicatif::{ProgressBar, ProgressStyle}; +use serde::Serialize; use std::{ - collections::HashMap, fs::{copy, create_dir_all, remove_dir_all, File}, io::Read, panic, path::PathBuf, process::Command, + time::Duration, }; use wasm_bindgen_cli_support::Bindgen; -pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { +#[derive(Serialize, Debug, Clone)] +pub struct BuildResult { + pub warnings: Vec, + pub elapsed_time: u128, +} + +pub fn build(config: &CrateConfig, quiet: bool) -> Result { // [1] Build the project with cargo, generating a wasm32-unknown-unknown target (is there a more specific, better target to leverage?) // [2] Generate the appropriate build folders // [3] Wasm-bindgen the .wasm fiile, and move it into the {builddir}/modules/xxxx/xxxx_bg.wasm @@ -78,13 +85,7 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { ExecutableType::Example(name) => cmd.arg("--example").arg(name), }; - prettier_build(cmd).unwrap(); - - // if !output.status.success() { - // log::error!("Build failed!"); - // let reason = String::from_utf8_lossy(&output.stderr).to_string(); - // return Err(Error::BuildFailed(reason)); - // } + let warning_messages = prettier_build(cmd)?; // [2] Establish the output directory structure let bindgen_outdir = out_dir.join("assets").join("dioxus"); @@ -122,8 +123,7 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { .unwrap(); }); if bindgen_result.is_err() { - log::error!("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate."); - return Ok(()); + return Err(Error::BuildFailed("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate.".to_string())); } // check binaryen:wasm-opt tool @@ -193,8 +193,10 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<()> { } let t_end = std::time::Instant::now(); - log::info!("🏁 Done in {}ms!", (t_end - t_start).as_millis()); - Ok(()) + Ok(BuildResult { + warnings: warning_messages, + elapsed_time: (t_end - t_start).as_millis() + }) } pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { @@ -327,27 +329,46 @@ pub fn build_desktop(config: &CrateConfig, is_serve: bool) -> Result<()> { Ok(()) } -fn prettier_build(mut cmd: Command) -> anyhow::Result<()> { - let loading = Loading::default(); - let mut record: HashMap = HashMap::new(); +fn prettier_build(mut cmd: Command) -> anyhow::Result> { + let mut warning_messages: Vec = vec![]; + + let pb = ProgressBar::new_spinner(); + pb.enable_steady_tick(Duration::from_millis(200)); + pb.set_style( + ProgressStyle::with_template("{spinner:.dim.bold} {wide_msg}") + .unwrap() + .tick_chars("/|\\- "), + ); + pb.set_message("Start to build project"); + let mut command = cmd.spawn()?; let reader = std::io::BufReader::new(command.stdout.take().unwrap()); for message in cargo_metadata::Message::parse_stream(reader) { match message.unwrap() { - Message::CompilerMessage(_msg) => { - // println!("{:#?}", msg); + Message::CompilerMessage(msg) => { + let message = msg.message; + match message.level { + cargo_metadata::diagnostic::DiagnosticLevel::Error => { + log::error!("Build Failed: {}", message.message); + std::process::exit(1); + } + cargo_metadata::diagnostic::DiagnosticLevel::Warning => { + warning_messages.push(message.clone()); + } + _ => {} + } } Message::CompilerArtifact(artifact) => { - record.insert(artifact.package_id.to_string(), artifact.target.name); + pb.set_message(format!("Compiling {} ", artifact.package_id)); + pb.tick(); } Message::BuildScriptExecuted(script) => { - let package_id = script.package_id.to_string(); - if let Some(name) = record.get(&package_id) { - loading.text(format!("[{}] build done", name)); - } + let _package_id = script.package_id.to_string(); } Message::BuildFinished(finished) => { if finished.success { + pb.finish_and_clear(); + println!("Done in"); } else { std::process::exit(1); } @@ -355,7 +376,7 @@ fn prettier_build(mut cmd: Command) -> anyhow::Result<()> { _ => (), // Unknown message } } - Ok(()) + Ok(warning_messages) } pub fn gen_page(config: &DioxusConfig, serve: bool) -> String { diff --git a/src/cli/serve/mod.rs b/src/cli/serve/mod.rs index 62843d653..93770b6ed 100644 --- a/src/cli/serve/mod.rs +++ b/src/cli/serve/mod.rs @@ -38,31 +38,25 @@ impl Serve { .clone() }); - match platform.as_str() { - "web" => { - crate::builder::build(&crate_config, false)?; - } - "desktop" => { - crate::builder::build_desktop(&crate_config, true)?; + if platform.as_str() == "desktop" { + crate::builder::build_desktop(&crate_config, true)?; - match &crate_config.executable { - crate::ExecutableType::Binary(name) - | crate::ExecutableType::Lib(name) - | crate::ExecutableType::Example(name) => { - let mut file = crate_config.out_dir.join(name); - if cfg!(windows) { - file.set_extension("exe"); - } - Command::new(crate_config.out_dir.join(file).to_str().unwrap()) - .stdout(Stdio::inherit()) - .output()?; + match &crate_config.executable { + crate::ExecutableType::Binary(name) + | crate::ExecutableType::Lib(name) + | crate::ExecutableType::Example(name) => { + let mut file = crate_config.out_dir.join(name); + if cfg!(windows) { + file.set_extension("exe"); } + Command::new(crate_config.out_dir.join(file).to_str().unwrap()) + .stdout(Stdio::inherit()) + .output()?; } - return Ok(()); - } - _ => { - return custom_error!("Unsoppurt platform target."); } + return Ok(()); + } else if platform != "web" { + return custom_error!("Unsoppurt platform target."); } // generate dev-index page diff --git a/src/server/mod.rs b/src/server/mod.rs index 3ecce6c26..b20d84db3 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -6,6 +6,7 @@ use axum::{ routing::{get, get_service}, Router, }; +use cargo_metadata::diagnostic::Diagnostic; use colored::Colorize; use dioxus::rsx_interpreter::SetRsxMessage; use notify::{RecommendedWatcher, Watcher}; @@ -15,7 +16,7 @@ use std::{net::UdpSocket, path::PathBuf, process::Command, sync::Arc}; use tower::ServiceBuilder; use tower_http::services::fs::{ServeDir, ServeFileSystemResponseBody}; -use crate::{builder, serve::Serve, CrateConfig, Result}; +use crate::{builder, serve::Serve, BuildResult, CrateConfig, Result}; use tokio::sync::broadcast; mod hot_reload; @@ -27,9 +28,9 @@ pub struct BuildManager { } impl BuildManager { - fn rebuild(&self) -> Result<()> { + fn rebuild(&self) -> Result { log::info!("🪁 Rebuild project"); - builder::build(&self.config, true)?; + let result = builder::build(&self.config, true)?; // change the websocket reload state to true; // the page will auto-reload. if self @@ -43,7 +44,7 @@ impl BuildManager { let _ = Serve::regen_dev_page(&self.config); } let _ = self.reload_tx.send(()); - Ok(()) + Ok(result) } } @@ -61,6 +62,8 @@ pub async fn startup(port: u16, config: CrateConfig) -> Result<()> { } pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { + let first_build_result = crate::builder::build(&config, false)?; + log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); @@ -159,9 +162,22 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } } if needs_rebuild { - print_console_info(port, &config, evt.paths); - if let Err(err) = build_manager.rebuild() { - log::error!("{}", err); + match build_manager.rebuild() { + Ok(res) => { + print_console_info( + port, + &config, + PrettierOptions { + changed: evt.paths, + warnings: res.warnings, + elapsed_time: res.elapsed_time, + }, + ); + } + Err(err) => { + log::error!("{}", err); + std::process::exit(1); + } } } if !messages.is_empty() { @@ -183,7 +199,15 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } // start serve dev-server at 0.0.0.0:8080 - print_console_info(port, &config, vec![]); + print_console_info( + port, + &config, + PrettierOptions { + changed: vec![], + warnings: first_build_result.warnings, + elapsed_time: first_build_result.elapsed_time, + }, + ); let file_service_config = config.clone(); let file_service = ServiceBuilder::new() @@ -246,6 +270,8 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { + let first_build_result = crate::builder::build(&config, false)?; + log::info!("🚀 Starting development server..."); let dist_path = config.out_dir.clone(); @@ -276,10 +302,20 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { let mut watcher = RecommendedWatcher::new(move |info: notify::Result| { let config = watcher_config.clone(); if info.is_ok() { - print_console_info(port, &config, info.unwrap().paths); if chrono::Local::now().timestamp() > last_update_time { match build_manager.rebuild() { - Ok(_) => last_update_time = chrono::Local::now().timestamp(), + Ok(res) => { + last_update_time = chrono::Local::now().timestamp(); + print_console_info( + port, + &config, + PrettierOptions { + changed: info.unwrap().paths, + warnings: res.warnings, + elapsed_time: res.elapsed_time, + }, + ); + } Err(e) => log::error!("{}", e), } } @@ -297,8 +333,16 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { } // start serve dev-server at 0.0.0.0 - print_console_info(port, &config, vec![]); - + print_console_info( + port, + &config, + PrettierOptions { + changed: vec![], + warnings: first_build_result.warnings, + elapsed_time: first_build_result.elapsed_time, + }, + ); + let file_service_config = config.clone(); let file_service = ServiceBuilder::new() .and_then( @@ -355,7 +399,14 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { Ok(()) } -fn print_console_info(port: u16, config: &CrateConfig, changed: Vec) { +#[derive(Debug, Default)] +pub struct PrettierOptions { + changed: Vec, + warnings: Vec, + elapsed_time: u128, +} + +fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) { print!( "{}", String::from_utf8_lossy( @@ -413,7 +464,7 @@ fn print_console_info(port: u16, config: &CrateConfig, changed: Vec) { "False" }; - if changed.len() <= 0 { + if options.changed.len() <= 0 { println!( "{} @ v{}\n", "Dioxus".bold().green(), @@ -422,7 +473,9 @@ fn print_console_info(port: u16, config: &CrateConfig, changed: Vec) { } else { println!( "Project Reloaded: {}\n", - format!("Changed {} files.", changed.len()).purple().bold() + format!("Changed {} files.", options.changed.len()) + .purple() + .bold() ); } println!( @@ -446,12 +499,11 @@ fn print_console_info(port: u16, config: &CrateConfig, changed: Vec) { println!("\t> URL Rewrite [index_on_404] : {}", url_rewrite.purple()); println!(""); - if changed.len() <= 0 { + if options.changed.len() <= 0 { log::info!("{}", "Server startup completed.".green().bold()); } else { log::info!("{}", "Project rebuild completed.".green().bold()); } - } fn get_ip() -> Option { From 78c78548e80c1be44589409f3b99f065aa77c781 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 16:41:53 +0800 Subject: [PATCH 173/330] feat: commit prettier_build --- src/builder.rs | 2 +- src/server/mod.rs | 42 +++++++++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index d164e5418..33ce411f6 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -368,7 +368,7 @@ fn prettier_build(mut cmd: Command) -> anyhow::Result> { Message::BuildFinished(finished) => { if finished.success { pb.finish_and_clear(); - println!("Done in"); + log::info!("Build done."); } else { std::process::exit(1); } diff --git a/src/server/mod.rs b/src/server/mod.rs index b20d84db3..5cd5cdcb7 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -342,7 +342,7 @@ pub async fn startup_default(port: u16, config: CrateConfig) -> Result<()> { elapsed_time: first_build_result.elapsed_time, }, ); - + let file_service_config = config.clone(); let file_service = ServiceBuilder::new() .and_then( @@ -434,18 +434,6 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) profile = config.custom_profile.as_ref().unwrap().to_string(); } let hot_reload = if config.hot_reload { "RSX" } else { "Normal" }; - let tools_str = format!( - "{:?}", - config - .dioxus_config - .application - .tools - .clone() - .unwrap_or_default() - .iter() - .map(|d| d.0.clone()) - .collect::>() - ); let crate_root = crate::cargo::crate_root().unwrap(); let custom_html_file = if crate_root.join("index.html").is_file() { "Custom [index.html]" @@ -494,15 +482,35 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) println!(""); println!("\t> Profile : {}", profile.green()); println!("\t> Hot Reload : {}", hot_reload.cyan()); - println!("\t> Enabled Tools : {}", tools_str.yellow()); println!("\t> Index Template : {}", custom_html_file.green()); println!("\t> URL Rewrite [index_on_404] : {}", url_rewrite.purple()); println!(""); + println!( + "\t> Build Time Use : {} millis", + options.elapsed_time.to_string().green().bold() + ); + println!(""); - if options.changed.len() <= 0 { - log::info!("{}", "Server startup completed.".green().bold()); + if options.warnings.len() == 0 { + log::info!("{}\n", "A perfect compilation!".green().bold()); } else { - log::info!("{}", "Project rebuild completed.".green().bold()); + log::warn!( + "{}\n", + format!( + "There were {} warning messages during the build: ", + options.warnings.len() - 1 + ) + .yellow() + .bold() + ); + for info in &options.warnings { + if info.message == format!("{} warnings emitted", options.warnings.len() - 1) { + continue; + } + if let Some(val) = info.rendered.clone() { + log::warn!("{}", val); + } + } } } From 8613518c40e722f5e9abfbb53ed7df034ab2b7a3 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 20:00:17 +0800 Subject: [PATCH 174/330] feat: commit code --- src/server/mod.rs | 58 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 5cd5cdcb7..614e8fa7a 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -495,7 +495,7 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) log::info!("{}\n", "A perfect compilation!".green().bold()); } else { log::warn!( - "{}\n", + "{}", format!( "There were {} warning messages during the build: ", options.warnings.len() - 1 @@ -504,13 +504,63 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) .bold() ); for info in &options.warnings { - if info.message == format!("{} warnings emitted", options.warnings.len() - 1) { + let message = info.message.clone(); + if message == format!("{} warnings emitted", options.warnings.len() - 1) { continue; } - if let Some(val) = info.rendered.clone() { - log::warn!("{}", val); + let mut console = String::new(); + for span in &info.spans { + let file = &span.file_name; + let line = (span.line_start, span.line_end); + let line_str = if line.0 == line.1 { + line.0.to_string() + } else { + format!("{}~{}", line.0, line.1) + }; + let code = span.text.clone(); + // let span_info = format!( + // "[{}: {}]: {} --> {}", + // file, + // if line.0 == line.1 { + // line.0.to_string() + // } else { + // format!("{}~{}", line.0, line.1) + // }, + // if code.len() == 1 { + // code.get(0).unwrap().text.trim().blue().bold().to_string() + // } else { + // format!("\n{}",code.iter() + // .enumerate() + // .map(|(_i, s)| format!("\t{}\n", s.text).blue().bold().to_string()) + // .collect::()) + // }, + // message.yellow().bold() + // ); + let span_info = if code.len() == 1 { + let code = code.get(0).unwrap().text.trim().blue().bold().to_string(); + format!( + "[{}: {}]: '{}' --> {}", + file, + line_str, + code, + message.yellow().bold() + ) + } else { + let code = code + .iter() + .enumerate() + .map(|(_i, s)| format!("\t{}\n", s.text).blue().bold().to_string()) + .collect::(); + format!("[{}: {}]:\n{}", file, line_str, code) + }; + console = format!("{console}\n\t{span_info}"); } + println!("{console}"); } + println!( + "\n{}\n", + "Resolving all warnings will help your code run better!".yellow() + ); } } From bfaa8e3c74aa82d2ad6a5b917af98f9e6cc729f8 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 20:54:16 +0800 Subject: [PATCH 175/330] feat: commit code --- src/server/mod.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 614e8fa7a..e5bffc17e 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -518,24 +518,6 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) format!("{}~{}", line.0, line.1) }; let code = span.text.clone(); - // let span_info = format!( - // "[{}: {}]: {} --> {}", - // file, - // if line.0 == line.1 { - // line.0.to_string() - // } else { - // format!("{}~{}", line.0, line.1) - // }, - // if code.len() == 1 { - // code.get(0).unwrap().text.trim().blue().bold().to_string() - // } else { - // format!("\n{}",code.iter() - // .enumerate() - // .map(|(_i, s)| format!("\t{}\n", s.text).blue().bold().to_string()) - // .collect::()) - // }, - // message.yellow().bold() - // ); let span_info = if code.len() == 1 { let code = code.get(0).unwrap().text.trim().blue().bold().to_string(); format!( @@ -551,7 +533,7 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) .enumerate() .map(|(_i, s)| format!("\t{}\n", s.text).blue().bold().to_string()) .collect::(); - format!("[{}: {}]:\n{}", file, line_str, code) + format!("[{}: {}]:\n{}\n#:{}", file, line_str, code, message) }; console = format!("{console}\n\t{span_info}"); } From d543ea19d0f2647a795b1cd32c243f0591e5f8f1 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 22:02:33 +0800 Subject: [PATCH 176/330] feat: commit some thing --- src/builder.rs | 9 ++++----- src/main.rs | 10 +++++----- src/server/mod.rs | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 33ce411f6..31b99b5f4 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -195,7 +195,7 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result { let t_end = std::time::Instant::now(); Ok(BuildResult { warnings: warning_messages, - elapsed_time: (t_end - t_start).as_millis() + elapsed_time: (t_end - t_start).as_millis(), }) } @@ -339,7 +339,7 @@ fn prettier_build(mut cmd: Command) -> anyhow::Result> { .unwrap() .tick_chars("/|\\- "), ); - pb.set_message("Start to build project"); + pb.set_message("💼 Waiting to strart build the project..."); let mut command = cmd.spawn()?; let reader = std::io::BufReader::new(command.stdout.take().unwrap()); @@ -349,8 +349,7 @@ fn prettier_build(mut cmd: Command) -> anyhow::Result> { let message = msg.message; match message.level { cargo_metadata::diagnostic::DiagnosticLevel::Error => { - log::error!("Build Failed: {}", message.message); - std::process::exit(1); + return Err(anyhow::anyhow!(message.rendered.unwrap_or("Unknown".into()))); } cargo_metadata::diagnostic::DiagnosticLevel::Warning => { warning_messages.push(message.clone()); @@ -368,7 +367,7 @@ fn prettier_build(mut cmd: Command) -> anyhow::Result> { Message::BuildFinished(finished) => { if finished.success { pb.finish_and_clear(); - log::info!("Build done."); + log::info!("👑 Build done."); } else { std::process::exit(1); } diff --git a/src/main.rs b/src/main.rs index 099ff74c0..39b360f7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,31 +9,31 @@ async fn main() -> Result<()> { match args.action { Commands::Translate(opts) => { if let Err(e) = opts.translate() { - log::error!("translate error: {}", e); + log::error!("🚫 Translate failed: {}", e); } } Commands::Build(opts) => { if let Err(e) = opts.build() { - log::error!("build error: {}", e); + log::error!("🚫 Build project failed: {}", e); } } Commands::Clean(opts) => { if let Err(e) = opts.clean() { - log::error!("clean error: {}", e); + log::error!("🚫 Clean project failed: {}", e); } } Commands::Serve(opts) => { if let Err(e) = opts.serve().await { - log::error!("serve error: {}", e); + log::error!("🚫 Serve startup failed: {}", e); } } Commands::Create(opts) => { if let Err(e) = opts.create() { - log::error!("create error: {}", e); + log::error!("🚫 Create project failed: {}", e); } } diff --git a/src/server/mod.rs b/src/server/mod.rs index e5bffc17e..8f50a6cc3 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -176,7 +176,6 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> { } Err(err) => { log::error!("{}", err); - std::process::exit(1); } } } From dfcf4e1f88e6f8296a5691e13bd6a5122c64996d Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 22:17:32 +0800 Subject: [PATCH 177/330] feat: change default config --- README.md | 2 +- src/assets/dioxus.toml | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a939dfcaf..f8515f390 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-

📦✨ dioxus-cli

+

📦✨ Dioxus CLI

Tooling to supercharge dioxus projects

diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index a5e849bfb..5c4f49f98 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -19,6 +19,8 @@ asset_dir = "public" # HTML title tag content title = "dioxus | ⛺" +index_on_404 = true + [web.watcher] watch_path = ["src"] @@ -45,10 +47,12 @@ script = [] binaryen = { wasm_opt = true } # use sass auto will auto check sass file and build it. -[application.tools.sass] + + +# [application.tools.sass] # auto will check the assets dirs, and auto to transform all scss file to css file. -input = "*" +# input = "*" # or you can specify some scss file -> css file # input = [ @@ -57,4 +61,4 @@ input = "*" # "/css/test.scss" # ] -source_map = true \ No newline at end of file +# source_map = true \ No newline at end of file From c97d7f263a4e785db533f726c80aee548d6f1cc0 Mon Sep 17 00:00:00 2001 From: YuKun Liu <41265098+mrxiaozhuox@users.noreply.github.com> Date: Sat, 9 Jul 2022 22:21:21 +0800 Subject: [PATCH 178/330] feat: commit code --- src/assets/dioxus.toml | 2 +- src/assets/index.html | 5 ++--- src/cli/create/mod.rs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/assets/dioxus.toml b/src/assets/dioxus.toml index 5c4f49f98..649aa2c3c 100644 --- a/src/assets/dioxus.toml +++ b/src/assets/dioxus.toml @@ -17,7 +17,7 @@ asset_dir = "public" [web.app] # HTML title tag content -title = "dioxus | ⛺" +title = "Dioxus | An elegant GUI library for Rust" index_on_404 = true diff --git a/src/assets/index.html b/src/assets/index.html index 87d447816..ed3d48135 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -9,10 +9,9 @@
- + String { .clone() .unwrap_or_else(|| "dioxus | ⛺".into()); - html.replace("{app_title}", &title) + replace_or_insert_before("{app_title}", &title, " Date: Wed, 21 Jun 2023 17:27:01 -0700 Subject: [PATCH 326/330] fix some errors not being reported --- src/builder.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index d81408740..c06fb945d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -380,7 +380,17 @@ fn prettier_build(cmd: subprocess::Exec) -> anyhow::Result> { ); pb.set_message("💼 Waiting to start build the project..."); - let stdout = cmd.stream_stdout()?; + struct StopSpinOnDrop(ProgressBar); + + impl Drop for StopSpinOnDrop { + fn drop(&mut self) { + self.0.finish_and_clear(); + } + } + + StopSpinOnDrop(pb.clone()); + + let stdout = cmd.detached().stream_stdout()?; let reader = std::io::BufReader::new(stdout); for message in cargo_metadata::Message::parse_stream(reader) { match message.unwrap() { @@ -388,9 +398,11 @@ fn prettier_build(cmd: subprocess::Exec) -> anyhow::Result> { let message = msg.message; match message.level { cargo_metadata::diagnostic::DiagnosticLevel::Error => { - return Err(anyhow::anyhow!(message - .rendered - .unwrap_or("Unknown".into()))); + return { + Err(anyhow::anyhow!(message + .rendered + .unwrap_or("Unknown".into()))) + }; } cargo_metadata::diagnostic::DiagnosticLevel::Warning => { warning_messages.push(message.clone()); @@ -407,7 +419,6 @@ fn prettier_build(cmd: subprocess::Exec) -> anyhow::Result> { } Message::BuildFinished(finished) => { if finished.success { - pb.finish_and_clear(); log::info!("👑 Build done."); } else { std::process::exit(1); From 9fbeb84921434eb34d91472d486cfbd694b54a28 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 26 Jun 2023 08:53:45 -0700 Subject: [PATCH 327/330] update to git dioxus --- Cargo.lock | 53 ++++++++++++++++++++++++++++++++++++++--------- Cargo.toml | 10 ++++----- src/server/mod.rs | 16 ++++++++------ 3 files changed, 58 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 863ae5823..b0a98d3c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -400,6 +400,15 @@ dependencies = [ "jobserver", ] +[[package]] +name = "cfg-expr" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bbc13bf6290a6b202cc3efb36f7ec2b739a80634215630c8053a313edf6abef" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -727,8 +736,7 @@ dependencies = [ [[package]] name = "dioxus-autofmt" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "935ac336dd077436505f2eda7b7b81515093e8a3fb352ac514cd6901dbd302e7" +source = "git+https://github.com/DioxusLabs/dioxus#11c9abcf7ce731ccb4a44c52de383c090ab319af" dependencies = [ "dioxus-rsx", "prettier-please", @@ -795,8 +803,7 @@ dependencies = [ [[package]] name = "dioxus-core" version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4d15b0bb9c58d015b2295f240600dd76e427758377569fa33783afc295706a" +source = "git+https://github.com/DioxusLabs/dioxus#11c9abcf7ce731ccb4a44c52de383c090ab319af" dependencies = [ "bumpalo", "bumpslab", @@ -814,8 +821,7 @@ dependencies = [ [[package]] name = "dioxus-html" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7682a6615e4e5a460cd3293ce420451abffb719c84c4b54e297b17365f601fb4" +source = "git+https://github.com/DioxusLabs/dioxus#11c9abcf7ce731ccb4a44c52de383c090ab319af" dependencies = [ "async-trait", "dioxus-core", @@ -831,11 +837,11 @@ dependencies = [ [[package]] name = "dioxus-rsx" version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8544632e20f462a64f26502c91e7cf6ae3b30d82956e70543644d2c16b6659d" +source = "git+https://github.com/DioxusLabs/dioxus#11c9abcf7ce731ccb4a44c52de383c090ab319af" dependencies = [ "dioxus-core", "internment", + "krates", "proc-macro2", "quote", "serde", @@ -1011,6 +1017,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.26" @@ -1680,6 +1692,18 @@ dependencies = [ "libc", ] +[[package]] +name = "krates" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942c43a6cba1c201dfe81a943c89fa5c9140b34993e0c027f542c80b92e319a7" +dependencies = [ + "cargo_metadata", + "cfg-expr", + "petgraph", + "semver", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2180,6 +2204,16 @@ dependencies = [ "sha2", ] +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + [[package]] name = "pin-project" version = "1.0.12" @@ -2454,8 +2488,7 @@ dependencies = [ [[package]] name = "rsx-rosetta" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "593810f58a97e3a45e23b84437d5323c2420b46f73cf38fe49133eb59a7524bb" +source = "git+https://github.com/DioxusLabs/dioxus#11c9abcf7ce731ccb4a44c52de383c090ab319af" dependencies = [ "convert_case", "dioxus-autofmt", diff --git a/Cargo.toml b/Cargo.toml index 499f5170e..7dca72934 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,11 +77,11 @@ ctrlc = "3.2.3" # dioxus-rsx = "0.0.1" gitignore = "1.0.7" -dioxus-rsx = { version = "0.0.3" } -dioxus-html = { version = "0.3", features = ["hot-reload-context"] } -dioxus-core = { version = "0.3", features = ["serialize"] } -dioxus-autofmt = "0.3.0" -rsx-rosetta = { version = "0.3" } +dioxus-rsx = { git = "https://github.com/DioxusLabs/dioxus" } +dioxus-html = { git = "https://github.com/DioxusLabs/dioxus", features = ["hot-reload-context"] } +dioxus-core = { git = "https://github.com/DioxusLabs/dioxus", features = ["serialize"] } +dioxus-autofmt = { git = "https://github.com/DioxusLabs/dioxus" } +rsx-rosetta = { git = "https://github.com/DioxusLabs/dioxus" } open = "4.1.0" [[bin]] diff --git a/src/server/mod.rs b/src/server/mod.rs index 8e5861270..4f19f00d2 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -150,10 +150,10 @@ pub async fn startup_hot_reload( let dist_path = config.out_dir.clone(); let (reload_tx, _) = broadcast::channel(100); - let map = FileMap::::new(config.crate_dir.clone()); - // for err in errors { - // log::error!("{}", err); - // } + let FileMapBuildResult { map, errors } = FileMap::::create(config.crate_dir.clone()).unwrap(); + for err in errors { + log::error!("{}", err); + } let file_map = Arc::new(Mutex::new(map)); let build_manager = Arc::new(BuildManager { config: config.clone(), @@ -219,10 +219,11 @@ pub async fn startup_hot_reload( let mut map = file_map.lock().unwrap(); match map.update_rsx(&path, &crate_dir) { - UpdateResult::UpdatedRsx(msgs) => { + + Ok( UpdateResult::UpdatedRsx(msgs) )=> { messages.extend(msgs); } - UpdateResult::NeedsRebuild => { + Ok(UpdateResult::NeedsRebuild) => { match build_manager.rebuild() { Ok(res) => { print_console_info( @@ -242,6 +243,9 @@ pub async fn startup_hot_reload( } return; } + Err(err) => { + log::error!("{}", err); + } } } for msg in messages { From 42011b7aa7b27509d130716c7395a537c94cd921 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Mon, 26 Jun 2023 13:12:42 -0700 Subject: [PATCH 328/330] improve dioxus create --- Cargo.lock | 1701 ++++++++++++++++++++++++++++---------- Cargo.toml | 4 +- src/cli/cfg.rs | 4 +- src/cli/create/mod.rs | 106 ++- src/cli/mod.rs | 1 - src/cli/translate/mod.rs | 2 +- src/server/mod.rs | 6 +- 7 files changed, 1326 insertions(+), 498 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0a98d3c8..707a02b6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,14 +19,13 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher", "cpufeatures", - "opaque-debug", ] [[package]] @@ -35,20 +34,51 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "const-random", + "getrandom 0.2.10", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "1.0.1" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "aligned" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80a21b9440a626c7fc8573a9e3d3a06b75c7c97754c2949bc7857b90353ca655" +dependencies = [ + "as-slice", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -64,6 +94,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -73,12 +109,67 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +[[package]] +name = "anymap2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" + [[package]] name = "arrayref" version = "0.3.7" @@ -91,6 +182,15 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -113,7 +213,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] @@ -217,9 +317,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -237,7 +337,7 @@ dependencies = [ "dirs 1.0.5", "failure", "flate2", - "hex", + "hex 0.3.2", "is_executable", "siphasher", "tar", @@ -301,10 +401,31 @@ dependencies = [ ] [[package]] -name = "bumpalo" -version = "3.12.1" +name = "bstr" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +dependencies = [ + "memchr", + "once_cell", + "regex-automata", + "serde", +] + +[[package]] +name = "btoi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" +dependencies = [ + "num-traits", +] + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bumpslab" @@ -357,6 +478,43 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-generate" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7b2f627381dc7523340c606559dddf6083cb2e6134368381da5778638f906d8" +dependencies = [ + "anyhow", + "clap", + "console", + "dialoguer", + "env_logger", + "git2", + "gix-config", + "heck 0.4.1", + "home", + "ignore", + "indicatif", + "liquid", + "liquid-core", + "liquid-derive", + "liquid-lib", + "log", + "names", + "paste", + "path-absolutize", + "regex", + "remove_dir_all", + "rhai", + "sanitize-filename", + "semver", + "serde", + "tempfile", + "thiserror", + "toml 0.7.5", + "walkdir", +] + [[package]] name = "cargo-platform" version = "0.1.2" @@ -388,7 +546,7 @@ checksum = "e72c3ff59e3b7d24630206bb63a73af65da4ed5df1f76ee84dfafb9fee2ba60e" dependencies = [ "serde", "serde_derive", - "toml", + "toml 0.5.11", ] [[package]] @@ -417,13 +575,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "time 0.1.45", "wasm-bindgen", @@ -432,61 +590,61 @@ dependencies = [ [[package]] name = "cipher" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "generic-array", + "crypto-common", + "inout", ] [[package]] name = "clap" -version = "3.2.25" +version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" dependencies = [ - "atty", - "bitflags", + "clap_builder", "clap_derive", - "clap_lex", - "indexmap", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex", "strsim", - "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.25" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" dependencies = [ "heck 0.4.1", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.22", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "colorchoice" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" @@ -512,15 +670,37 @@ dependencies = [ [[package]] name = "console" -version = "0.15.5" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.42.0", + "windows-sys 0.45.0", +] + +[[package]] +name = "const-random" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "proc-macro-hack", + "tiny-keccak", ] [[package]] @@ -553,9 +733,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ "libc", ] @@ -581,13 +761,19 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -600,12 +786,12 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.2.5" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcf33c2a618cbe41ee43ae6e9f2e48368cd9f9db2896f10167d8d762679f639" +checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e" dependencies = [ "nix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -619,15 +805,15 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "socket2", + "socket2 0.4.9", "winapi", ] [[package]] name = "curl-sys" -version = "0.4.61+curl-8.0.1" +version = "0.4.63+curl-8.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d05c10f541ae6f3bc5b3d923c20001f47db7d5f0b2bc6ad16490133842db79" +checksum = "aeb0fef7046022a1e2ad67a004978f0e3cacb9e3123dc62ce768f92197b771dc" dependencies = [ "cc", "libc", @@ -639,47 +825,12 @@ dependencies = [ ] [[package]] -name = "cxx" -version = "1.0.94" +name = "cvt" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.15", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.15", + "cfg-if", ] [[package]] @@ -702,7 +853,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] @@ -713,20 +864,32 @@ checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -754,6 +917,7 @@ dependencies = [ "atty", "axum", "binary-install", + "cargo-generate", "cargo_metadata", "cargo_toml", "chrono", @@ -774,7 +938,7 @@ dependencies = [ "headers", "html_parser", "hyper", - "hyper-rustls", + "hyper-rustls 0.23.2", "indicatif", "lazy_static", "log", @@ -792,12 +956,13 @@ dependencies = [ "tar", "thiserror", "tokio", - "toml", + "toml 0.5.11", + "toml_edit", "tower", "tower-http 0.2.5", "walkdir", "wasm-bindgen-cli-support", - "zip 0.6.5", + "zip 0.6.6", ] [[package]] @@ -809,7 +974,7 @@ dependencies = [ "bumpslab", "futures-channel", "futures-util", - "indexmap", + "indexmap 1.9.3", "log", "longest-increasing-subsequence", "rustc-hash", @@ -879,6 +1044,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + [[package]] name = "either" version = "1.8.1" @@ -914,25 +1085,44 @@ dependencies = [ [[package]] name = "enumset" -version = "1.0.13" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b025475ad197bd8b4a9bdce339216b6cf3bd568bf2e107c286b51613f0b3cf" +checksum = "e875f1719c16de097dee81ed675e2d9bb63096823ed3f0ca827b7dea3028bbbb" dependencies = [ "enumset_derive", ] [[package]] name = "enumset_derive" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c2852ff17a4c9a2bb2abbca3074737919cb05dc24b0a8ca9498081a7033dd6" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "errno" version = "0.3.1" @@ -1056,13 +1246,27 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_at" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15550ecca96ea332ec143fb450701074143b70d358e50b32b1f847ccff2e1cf7" +dependencies = [ + "aligned", + "cfg-if", + "cvt", + "libc", + "nix", + "windows-sys 0.48.0", +] + [[package]] name = "fs_extra" version = "1.3.0" @@ -1134,7 +1338,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] @@ -1190,9 +1394,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -1201,9 +1405,24 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "git2" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] [[package]] name = "gitignore" @@ -1214,6 +1433,232 @@ dependencies = [ "glob", ] +[[package]] +name = "gix-actor" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc22b0cdc52237667c301dd7cdc6ead8f8f73c9f824e9942c8ebd6b764f6c0bf" +dependencies = [ + "bstr 1.5.0", + "btoi", + "gix-date", + "itoa", + "nom", + "thiserror", +] + +[[package]] +name = "gix-config" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fbad5ce54a8fc997acc50febd89ec80fa6e97cb7f8d0654cb229936407489d8" +dependencies = [ + "bstr 1.5.0", + "gix-config-value", + "gix-features 0.28.1", + "gix-glob", + "gix-path", + "gix-ref", + "gix-sec", + "log", + "memchr", + "nom", + "once_cell", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-config-value" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d09154c0c8677e4da0ec35e896f56ee3e338e741b9599fae06075edd83a4081c" +dependencies = [ + "bitflags", + "bstr 1.5.0", + "gix-path", + "libc", + "thiserror", +] + +[[package]] +name = "gix-date" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96271912ce39822501616f177dea7218784e6c63be90d5f36322ff3a722aae2" +dependencies = [ + "bstr 1.5.0", + "itoa", + "thiserror", + "time 0.3.22", +] + +[[package]] +name = "gix-features" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b76f9a80f6dd7be66442ae86e1f534effad9546676a392acc95e269d0c21c22" +dependencies = [ + "gix-hash 0.10.4", + "libc", + "sha1_smol", + "walkdir", +] + +[[package]] +name = "gix-features" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf69b0f5c701cc3ae22d3204b671907668f6437ca88862d355eaf9bc47a4f897" +dependencies = [ + "gix-hash 0.11.3", + "libc", +] + +[[package]] +name = "gix-fs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b37a1832f691fdc09910bd267f9a2e413737c1f9ec68c6e31f9e802616278a9" +dependencies = [ + "gix-features 0.29.0", +] + +[[package]] +name = "gix-glob" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993" +dependencies = [ + "bitflags", + "bstr 1.5.0", +] + +[[package]] +name = "gix-hash" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a258595457bc192d1f1c59d0d168a1e34e2be9b97a614e14995416185de41a7" +dependencies = [ + "hex 0.4.3", + "thiserror", +] + +[[package]] +name = "gix-hash" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0dd58cdbe7ffa4032fc111864c80d5f8cecd9a2c9736c97ae7e5be834188272" +dependencies = [ + "hex 0.4.3", + "thiserror", +] + +[[package]] +name = "gix-lock" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c693d7f05730fa74a7c467150adc7cea393518410c65f0672f80226b8111555" +dependencies = [ + "gix-tempfile", + "gix-utils", + "thiserror", +] + +[[package]] +name = "gix-object" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df068db9180ee935fbb70504848369e270bdcb576b05c0faa8b9fd3b86fc017" +dependencies = [ + "bstr 1.5.0", + "btoi", + "gix-actor", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-validate", + "hex 0.4.3", + "itoa", + "nom", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-path" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32370dce200bb951df013e03dff35b4233fc7a89458642b047629b91734a7e19" +dependencies = [ + "bstr 1.5.0", + "thiserror", +] + +[[package]] +name = "gix-ref" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e909396ed3b176823991ccc391c276ae2a015e54edaafa3566d35123cfac9d" +dependencies = [ + "gix-actor", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-validate", + "memmap2", + "nom", + "thiserror", +] + +[[package]] +name = "gix-sec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ffa5bf0772f9b01de501c035b6b084cf9b8bb07dec41e3afc6a17336a65f47" +dependencies = [ + "bitflags", + "dirs 4.0.0", + "gix-path", + "libc", + "windows 0.43.0", +] + +[[package]] +name = "gix-tempfile" +version = "5.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71a0d32f34e71e86586124225caefd78dabc605d0486de580d717653addf182" +dependencies = [ + "gix-fs", + "libc", + "once_cell", + "parking_lot", + "tempfile", +] + +[[package]] +name = "gix-utils" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca284c260845bc0724050aec59c7a596407678342614cdf5a1d69e044f29a36" +dependencies = [ + "fastrand", +] + +[[package]] +name = "gix-validate" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d092b594c8af00a3a31fe526d363ee8a51a6f29d8496cdb991ed2f01ec0ec13" +dependencies = [ + "bstr 1.5.0", + "thiserror", +] + [[package]] name = "glob" version = "0.3.1" @@ -1221,10 +1666,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "h2" -version = "0.3.18" +name = "globset" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +dependencies = [ + "aho-corasick 0.7.20", + "bstr 1.5.0", + "fnv", + "log", + "regex", +] + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -1232,7 +1690,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1245,9 +1703,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "headers" version = "0.3.8" @@ -1318,6 +1782,12 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "hmac" version = "0.12.1" @@ -1327,6 +1797,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -1393,10 +1872,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] -name = "hyper" -version = "0.14.26" +name = "humantime" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1409,7 +1894,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1425,10 +1910,23 @@ dependencies = [ "http", "hyper", "log", - "rustls", + "rustls 0.20.8", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +dependencies = [ + "http", + "hyper", + "rustls 0.21.2", + "tokio", + "tokio-rustls 0.24.1", ] [[package]] @@ -1446,26 +1944,25 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows 0.48.0", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -1493,14 +1990,31 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", ] +[[package]] +name = "ignore" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +dependencies = [ + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1508,16 +2022,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", ] [[package]] name = "indicatif" -version = "0.17.3" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +checksum = "8ff8cc23a7393a397ed1d7f56e6365cba772aba9f9912ab968b03043c395d057" dependencies = [ "console", + "instant", "number_prefix", "portable-atomic", "unicode-width", @@ -1543,6 +2068,15 @@ dependencies = [ "libc", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "instant" version = "0.1.12" @@ -1554,19 +2088,19 @@ dependencies = [ [[package]] name = "internment" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a798d7677f07d6f1e77be484ea8626ddb1566194de399f1206306820c406371" +checksum = "161079c3ad892faa215fcfcf3fd7a6a3c9288df2b06a2c2bad7fbfad4f01d69d" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", "parking_lot", ] [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -1575,14 +2109,14 @@ dependencies = [ [[package]] name = "ipconfig" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.3", "widestring", - "winapi", - "winreg", + "windows-sys 0.48.0", + "winreg 0.50.0", ] [[package]] @@ -1609,6 +2143,18 @@ dependencies = [ "once_cell", ] +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "is-wsl" version = "0.4.0" @@ -1654,9 +2200,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -1704,6 +2250,16 @@ dependencies = [ "semver", ] +[[package]] +name = "kstring" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" +dependencies = [ + "serde", + "static_assertions", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1718,9 +2274,37 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.143" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "libgit2-sys" +version = "0.15.2+1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libssh2-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] [[package]] name = "libz-sys" @@ -1734,15 +2318,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1751,15 +2326,72 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "liquid" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f68ae1011499ae2ef879f631891f21c78e309755f4a5e483c4a8f12e10b609" +dependencies = [ + "doc-comment", + "liquid-core", + "liquid-derive", + "liquid-lib", + "serde", +] + +[[package]] +name = "liquid-core" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e0724dfcaad5cfb7965ea0f178ca0870b8d7315178f4a7179f5696f7f04d5f" +dependencies = [ + "anymap2", + "itertools", + "kstring", + "liquid-derive", + "num-traits", + "pest", + "pest_derive", + "regex", + "serde", + "time 0.3.22", +] + +[[package]] +name = "liquid-derive" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc2fb41a9bb4257a3803154bdf7e2df7d45197d1941c9b1a90ad815231630721" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.22", +] + +[[package]] +name = "liquid-lib" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2a17e273a6fb1fb6268f7a5867ddfd0bd4683c7e19b51084f3d567fad4348c0" +dependencies = [ + "itertools", + "liquid-core", + "once_cell", + "percent-encoding", + "regex", + "time 0.3.22", + "unicode-segmentation", +] [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -1767,12 +2399,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "longest-increasing-subsequence" @@ -1791,9 +2420,9 @@ dependencies = [ [[package]] name = "lua-src" -version = "544.0.1" +version = "546.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "708ba3c844d5e9d38def4a09dd871c17c370f519b3c4b7261fbabe4a613a814c" +checksum = "8cb00c1380f1b4b4928dd211c07301ffa34872a239e590bd3219d9e5b213face" dependencies = [ "cc", ] @@ -1831,6 +2460,15 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + [[package]] name = "mime" version = "0.3.17" @@ -1873,23 +2511,23 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "mlua" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8ce6788556a67d90567809c7de94dfef2ff1f47ff897aeee935bcfbcdf5735" +checksum = "07366ed2cd22a3b000aed076e2b68896fb46f06f1f5786c5962da73c0af01577" dependencies = [ - "bstr", + "bstr 0.2.17", "cc", "futures-core", "futures-task", @@ -1918,6 +2556,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "names" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" +dependencies = [ + "rand", +] + [[package]] name = "native-tls" version = "0.2.11" @@ -1959,10 +2606,19 @@ dependencies = [ ] [[package]] -name = "notify" -version = "5.1.0" +name = "normpath" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" +checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "notify" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" dependencies = [ "bitflags", "crossbeam-channel", @@ -1974,17 +2630,7 @@ dependencies = [ "mio", "serde", "walkdir", - "windows-sys 0.42.0", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", + "windows-sys 0.45.0", ] [[package]] @@ -2006,6 +2652,15 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + [[package]] name = "number_prefix" version = "0.4.0" @@ -2014,40 +2669,35 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.30.3" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "open" -version = "4.1.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" +checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" dependencies = [ "is-wsl", + "libc", "pathdiff", ] [[package]] name = "openssl" -version = "0.10.52" +version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ "bitflags", "cfg-if", @@ -2066,7 +2716,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] @@ -2077,9 +2727,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.87" +version = "0.9.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" dependencies = [ "cc", "libc", @@ -2096,12 +2746,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "os_str_bytes" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" - [[package]] name = "parking_lot" version = "0.12.1" @@ -2114,15 +2758,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.48.0", ] [[package]] @@ -2136,6 +2780,30 @@ dependencies = [ "subtle", ] +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "path-absolutize" +version = "3.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f1d4993b16f7325d90c18c3c6a3327db7808752db8d208cea0acee0abd52c52" +dependencies = [ + "path-dedot", +] + +[[package]] +name = "path-dedot" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d55e486337acb9973cdea3ec5638c1b3bcb22e573b2b7b41969e0c744d5a15e" +dependencies = [ + "once_cell", +] + [[package]] name = "pathdiff" version = "0.2.1" @@ -2156,15 +2824,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" +checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" dependencies = [ "thiserror", "ucd-trie", @@ -2172,9 +2840,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" +checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" dependencies = [ "pest", "pest_generator", @@ -2182,22 +2850,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" +checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] name = "pest_meta" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" +checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" dependencies = [ "once_cell", "pest", @@ -2211,27 +2879,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.22", ] [[package]] @@ -2254,9 +2922,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "portable-atomic" -version = "0.3.19" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" +checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" [[package]] name = "ppv-lite86" @@ -2299,10 +2967,16 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.56" +name = "proc-macro-hack" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] @@ -2315,9 +2989,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -2349,7 +3023,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.10", ] [[package]] @@ -2393,35 +3067,57 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.9", + "getrandom 0.2.10", "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.8.1" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.2", "memchr", "regex-syntax", ] [[package]] -name = "regex-syntax" -version = "0.7.1" +name = "regex-automata" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "remove_dir_all" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23895cfadc1917fed9c6ed76a8c2903615fa3704f7493ff82b364c6540acc02b" +dependencies = [ + "aligned", + "cfg-if", + "cvt", + "fs_at", + "lazy_static", + "libc", + "normpath", + "windows-sys 0.45.0", +] [[package]] name = "reqwest" -version = "0.11.17" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", @@ -2430,7 +3126,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.0", "hyper-tls", "ipnet", "js-sys", @@ -2440,14 +3136,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.2", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", "trust-dns-resolver", @@ -2457,7 +3153,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -2470,6 +3166,32 @@ dependencies = [ "quick-error", ] +[[package]] +name = "rhai" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd29fa1f740be6dc91982013957e08c3c4232d7efcfe19e12da87d50bad47758" +dependencies = [ + "ahash 0.8.3", + "bitflags", + "instant", + "num-traits", + "rhai_codegen", + "smallvec", + "smartstring", +] + +[[package]] +name = "rhai_codegen" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db74e3fdd29d969a0ec1f8e79171a6f0f71d0429293656901db382d248c4c021" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "ring" version = "0.16.20" @@ -2525,9 +3247,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" dependencies = [ "bitflags", "errno", @@ -2550,10 +3272,22 @@ dependencies = [ ] [[package]] -name = "rustls-native-certs" -version = "0.6.2" +name = "rustls" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -2567,7 +3301,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -2591,6 +3335,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "sanitize-filename" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c502bdb638f1396509467cb0580ef3b29aa2a45c5d43e5d84928241280296c" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "schannel" version = "0.1.21" @@ -2606,12 +3360,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scratch" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" - [[package]] name = "sct" version = "0.7.0" @@ -2624,9 +3372,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags", "core-foundation", @@ -2637,9 +3385,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -2656,9 +3404,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.162" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" dependencies = [ "serde_derive", ] @@ -2675,20 +3423,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.162" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" dependencies = [ "itoa", "ryu", @@ -2703,7 +3451,16 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", +] + +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", ] [[package]] @@ -2741,16 +3498,28 @@ dependencies = [ ] [[package]] -name = "sha2" -version = "0.10.6" +name = "sha1_smol" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", "digest", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -2787,6 +3556,17 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + [[package]] name = "socket2" version = "0.4.9" @@ -2797,12 +3577,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -2827,9 +3623,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -2844,9 +3640,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" dependencies = [ "proc-macro2", "quote", @@ -2904,12 +3700,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" version = "1.0.40" @@ -2927,7 +3717,17 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", ] [[package]] @@ -2943,12 +3743,16 @@ dependencies = [ [[package]] name = "time" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" +checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" dependencies = [ + "itoa", + "libc", + "num_threads", "serde", "time-core", + "time-macros", ] [[package]] @@ -2957,6 +3761,24 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +[[package]] +name = "time-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +dependencies = [ + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2974,9 +3796,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.0" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", @@ -2986,7 +3808,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.4.9", "tokio-macros", "windows-sys 0.48.0", ] @@ -2999,7 +3821,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] @@ -3018,11 +3840,21 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.8", "tokio", "webpki", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.2", + "tokio", +] + [[package]] name = "tokio-tungstenite" version = "0.17.2" @@ -3058,6 +3890,40 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower" version = "0.4.13" @@ -3149,20 +4015,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.22", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -3265,10 +4131,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] -name = "unicode-ident" -version = "1.0.8" +name = "unicode-bom" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "63ec69f541d875b783ca40184d655f2927c95f0bffd486faa83cd3ac3529ec32" + +[[package]] +name = "unicode-ident" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -3305,12 +4177,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", ] @@ -3320,6 +4192,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vcpkg" version = "0.2.15" @@ -3353,7 +4231,7 @@ dependencies = [ "leb128", "log", "walrus-macro", - "wasmparser 0.77.0", + "wasmparser", ] [[package]] @@ -3370,11 +4248,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -3398,9 +4275,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3408,24 +4285,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.22", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-cli-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d4780c659b883a19ddb7ced365db19f7f45cd182d832ee14de2b7ef52e88a9f" +checksum = "d21c60239a09bf9bab8dfa752be4e6c637db22296b9ded493800090448692da9" dependencies = [ "anyhow", "base64 0.9.3", @@ -3441,16 +4318,13 @@ dependencies = [ "wasm-bindgen-threads-xform", "wasm-bindgen-wasm-conventions", "wasm-bindgen-wasm-interpreter", - "wit-text", - "wit-validator", - "wit-walrus", ] [[package]] name = "wasm-bindgen-externref-xform" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d154c3843bf3b635b602ad41b56f505f8f1a25f8a0133fca4bbd0918d74efdc" +checksum = "bafbe1984f67cc12645f12ab65e6145e8ddce1ab265d0be58435f25bb0ce2608" dependencies = [ "anyhow", "walrus", @@ -3458,9 +4332,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -3470,9 +4344,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3480,22 +4354,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.22", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-multi-value-xform" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00a577fbd4be358ef8095432189b5c2e6b6e71f5081797c2032572f77d65d26" +checksum = "581419e3995571a1d2d066e360ca1c0c09da097f5a53c98e6f00d96eddaf0ffe" dependencies = [ "anyhow", "walrus", @@ -3503,15 +4377,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-bindgen-threads-xform" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa93941bae037b7b4fac4ecfc132294b828036c5990a806d0e6fd9284297d94" +checksum = "e05d272073981137e8426cf2a6830d43d1f84f988a050b2f8b210f0e266b8983" dependencies = [ "anyhow", "walrus", @@ -3520,9 +4394,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-wasm-conventions" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f5de325048d945c90600fdf66b13521f3340d85971287775c36aa99c04466b" +checksum = "0e9c65b1ff5041ea824ca24c519948aec16fb6611c617d601623c0657dfcd47b" dependencies = [ "anyhow", "walrus", @@ -3530,9 +4404,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-wasm-interpreter" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f695df44962e3a107436282232a2daa185b8453c16be8ddfb637cd2601f31128" +checksum = "7c5c796220738ab5d44666f37205728a74141c0039d1166bcf8110b26bafaa1e" dependencies = [ "anyhow", "log", @@ -3555,30 +4429,15 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.59.0" +version = "0.77.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" - -[[package]] -name = "wasmparser" -version = "0.77.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35c86d22e720a07d954ebbed772d01180501afe7d03d464f413bb5f8914a8d6" - -[[package]] -name = "wast" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1844f66a2bc8526d71690104c0e78a8e59ffa1597b7245769d174ebb91deb5" -dependencies = [ - "leb128", -] +checksum = "5fe3d5405e9ea6c1317a656d6e0820912d8b7b3607823a7596117c8f666daf6f" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -3605,9 +4464,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -3640,6 +4499,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows" version = "0.48.0" @@ -3796,6 +4670,15 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "winnow" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" @@ -3806,67 +4689,13 @@ dependencies = [ ] [[package]] -name = "wit-parser" -version = "0.2.0" +name = "winreg" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5fd97866f4b9c8e1ed57bcf9446f3d0d8ba37e2dd01c3c612c046c053b06f7" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "anyhow", - "leb128", - "wit-schema-version", -] - -[[package]] -name = "wit-schema-version" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfee4a6a4716eefa0682e7a3b836152e894a3e4f34a9d6c2c3e1c94429bfe36a" - -[[package]] -name = "wit-text" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33358e95c77d660f1c7c07f4a93c2bd89768965e844e3c50730bb4b42658df5f" -dependencies = [ - "anyhow", - "wast", - "wit-writer", -] - -[[package]] -name = "wit-validator" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c11d93d925420e7872b226c4161849c32be38385ccab026b88df99d8ddc6ba6" -dependencies = [ - "anyhow", - "wasmparser 0.59.0", - "wit-parser", - "wit-schema-version", -] - -[[package]] -name = "wit-walrus" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad559e3e4c6404b2a6a675d44129d62a3836e3b951b90112fa1c5feb852757cd" -dependencies = [ - "anyhow", - "id-arena", - "walrus", - "wit-parser", - "wit-schema-version", - "wit-writer", -] - -[[package]] -name = "wit-writer" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ad01ba5e9cbcff799a0689e56a153776ea694cec777f605938cb9880d41a09" -dependencies = [ - "leb128", - "wit-schema-version", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -3878,6 +4707,12 @@ dependencies = [ "libc", ] +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" + [[package]] name = "zip" version = "0.5.13" @@ -3894,9 +4729,9 @@ dependencies = [ [[package]] name = "zip" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e92305c174683d78035cbf1b70e18db6329cc0f1b9cae0a52ca90bf5bfe7125" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ "aes", "byteorder", @@ -3908,7 +4743,7 @@ dependencies = [ "hmac", "pbkdf2", "sha1", - "time 0.3.21", + "time 0.3.22", "zstd", ] diff --git a/Cargo.toml b/Cargo.toml index 7dca72934..de3644f9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT/Apache-2.0" [dependencies] # cli core -clap = { version = "3.0.14", features = ["derive"] } +clap = { version = "4.2", features = ["derive"] } thiserror = "1.0.30" wasm-bindgen-cli-support = "0.2" colored = "2.0.0" @@ -83,6 +83,8 @@ dioxus-core = { git = "https://github.com/DioxusLabs/dioxus", features = ["seria dioxus-autofmt = { git = "https://github.com/DioxusLabs/dioxus" } rsx-rosetta = { git = "https://github.com/DioxusLabs/dioxus" } open = "4.1.0" +cargo-generate = "0.18.3" +toml_edit = "0.19.11" [[bin]] path = "src/main.rs" diff --git a/src/cli/cfg.rs b/src/cli/cfg.rs index 20ed7c40e..30ca89ce9 100644 --- a/src/cli/cfg.rs +++ b/src/cli/cfg.rs @@ -4,7 +4,7 @@ use super::*; #[derive(Clone, Debug, Default, Deserialize, Parser)] pub struct ConfigOptsBuild { /// The index HTML file to drive the bundling process [default: index.html] - #[clap(parse(from_os_str))] + #[arg(long)] pub target: Option, /// Build in release mode [default: false] @@ -37,7 +37,7 @@ pub struct ConfigOptsBuild { #[derive(Clone, Debug, Default, Deserialize, Parser)] pub struct ConfigOptsServe { /// The index HTML file to drive the bundling process [default: index.html] - #[clap(parse(from_os_str))] + #[arg(short, long)] pub target: Option, /// Port of dev server diff --git a/src/cli/create/mod.rs b/src/cli/create/mod.rs index c448e66d1..86a5e0a3f 100644 --- a/src/cli/create/mod.rs +++ b/src/cli/create/mod.rs @@ -1,14 +1,9 @@ use super::*; -use crate::custom_error; +use cargo_generate::{GenerateArgs, TemplatePath}; -/// Build the Rust WASM app and all of its assets. #[derive(Clone, Debug, Default, Deserialize, Parser)] #[clap(name = "create")] pub struct Create { - /// Init project name - #[clap(default_value = ".")] - name: String, - /// Template path #[clap(default_value = "gh:dioxuslabs/dioxus-template", long)] template: String, @@ -16,69 +11,66 @@ pub struct Create { impl Create { pub fn create(self) -> Result<()> { - if Self::name_valid_check(self.name.clone()) { - return custom_error!("❗Unsupported project name: '{}'.", &self.name); - } + let mut args = GenerateArgs::default(); + args.template_path = TemplatePath { + auto_path: Some(self.template), + ..Default::default() + }; - let project_path = PathBuf::from(&self.name); - - if project_path.join("Dioxus.toml").is_file() || project_path.join("Cargo.toml").is_file() { - return custom_error!("🧨 Folder '{}' is initialized.", &self.name); - } - - log::info!("🔧 Start: Creating new project '{}'.", self.name); - - let output = Command::new("cargo") - .arg("generate") - .arg("--help") - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .output()?; + let path = cargo_generate::generate(args)?; + // first run cargo fmt + let mut cmd = Command::new("cargo"); + let cmd = cmd.arg("fmt").current_dir(&path); + let output = cmd.output().expect("failed to execute process"); if !output.status.success() { - log::warn!("Tool is not installed: cargo-generate, try to install it."); - let install_output = Command::new("cargo") - .arg("install") - .arg("cargo-generate") - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .output()?; - if !install_output.status.success() { - return custom_error!("Try to install cargo-generate failed."); - } + log::error!("cargo fmt failed"); + log::error!("stdout: {}", String::from_utf8_lossy(&output.stdout)); + log::error!("stderr: {}", String::from_utf8_lossy(&output.stderr)); } - let generate_output = Command::new("cargo") - .arg("generate") - .arg(&self.template) - .arg("--name") - .arg(&self.name) - .arg("--force") - .stdout(Stdio::piped()) - .stderr(Stdio::inherit()) - .output()?; + // then format the toml + let toml_paths = [path.join("Cargo.toml"), path.join("Dioxus.toml")]; + for toml_path in &toml_paths { + let toml = std::fs::read_to_string(toml_path)?; + let mut toml = toml.parse::().map_err(|e| { + anyhow::anyhow!( + "failed to parse toml at {}: {}", + toml_path.display(), + e.to_string() + ) + })?; - if !generate_output.status.success() { - return custom_error!("Generate project failed. Try to update cargo-generate."); + toml.as_table_mut().fmt(); + + let as_string = toml.to_string(); + let new_string = remove_tripple_newlines(&as_string); + let mut file = std::fs::File::create(toml_path)?; + file.write_all(new_string.as_bytes())?; } - let mut dioxus_file = File::open(project_path.join("Dioxus.toml"))?; - let mut meta_file = String::new(); - dioxus_file.read_to_string(&mut meta_file)?; - meta_file = meta_file.replace("{{project-name}}", &self.name); - meta_file = meta_file.replace("{{default-platform}}", "web"); - File::create(project_path.join("Dioxus.toml"))?.write_all(meta_file.as_bytes())?; + // remove any tripple newlines from the readme + let readme_path = path.join("README.md"); + let readme = std::fs::read_to_string(&readme_path)?; + let new_readme = remove_tripple_newlines(&readme); + let mut file = std::fs::File::create(readme_path)?; + file.write_all(new_readme.as_bytes())?; - println!(); - log::info!("💡 Project initialized:"); - log::info!("🎯> cd ./{}", self.name); - log::info!("🎯> dioxus serve"); + log::info!("Generated project at {}", path.display()); Ok(()) } +} - fn name_valid_check(name: String) -> bool { - let r = Regex::new(r"^[a-zA-Z][a-zA-Z0-9\-_]$").unwrap(); - r.is_match(&name) +fn remove_tripple_newlines(string: &str) -> String { + let mut new_string = String::new(); + for char in string.chars() { + if char == '\n' { + if new_string.ends_with("\n\n") { + continue; + } + } + new_string.push(char); } + new_string } diff --git a/src/cli/mod.rs b/src/cli/mod.rs index a27b1b794..0d9174bdf 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -17,7 +17,6 @@ use crate::{ }; use clap::{Parser, Subcommand}; use html_parser::Dom; -use regex::Regex; use serde::Deserialize; use std::{ fs::{remove_dir_all, File}, diff --git a/src/cli/translate/mod.rs b/src/cli/translate/mod.rs index 3056a6c77..67067db31 100644 --- a/src/cli/translate/mod.rs +++ b/src/cli/translate/mod.rs @@ -22,7 +22,7 @@ pub struct Translate { pub raw: Option, /// Output file, stdout if not present - #[clap(parse(from_os_str))] + #[arg(short, long)] pub output: Option, } diff --git a/src/server/mod.rs b/src/server/mod.rs index 4f19f00d2..a63a7e6b7 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -150,7 +150,8 @@ pub async fn startup_hot_reload( let dist_path = config.out_dir.clone(); let (reload_tx, _) = broadcast::channel(100); - let FileMapBuildResult { map, errors } = FileMap::::create(config.crate_dir.clone()).unwrap(); + let FileMapBuildResult { map, errors } = + FileMap::::create(config.crate_dir.clone()).unwrap(); for err in errors { log::error!("{}", err); } @@ -219,8 +220,7 @@ pub async fn startup_hot_reload( let mut map = file_map.lock().unwrap(); match map.update_rsx(&path, &crate_dir) { - - Ok( UpdateResult::UpdatedRsx(msgs) )=> { + Ok(UpdateResult::UpdatedRsx(msgs)) => { messages.extend(msgs); } Ok(UpdateResult::NeedsRebuild) => { From a9d7b4d32a6fcfc1963023129f64cbfb14a19d19 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 28 Jun 2023 17:21:23 -0700 Subject: [PATCH 329/330] Prepare CLI for move into mainline --- .../cli/.github}/workflows/build.yml | 0 .../cli/.github}/workflows/docs.yml | 0 .../cli/.github}/workflows/main.yml | 0 .gitignore => packages/cli/.gitignore | 0 {.vscode => packages/cli/.vscode}/settings.json | 0 Cargo.lock => packages/cli/Cargo.lock | 0 Cargo.toml => packages/cli/Cargo.toml | 0 Dioxus.toml => packages/cli/Dioxus.toml | 0 README.md => packages/cli/README.md | 0 build.rs => packages/cli/build.rs | 0 {docs => packages/cli/docs}/.gitignore | 0 {docs => packages/cli/docs}/book.toml | 0 {docs => packages/cli/docs}/src/SUMMARY.md | 0 {docs => packages/cli/docs}/src/cmd/README.md | 0 {docs => packages/cli/docs}/src/cmd/build.md | 0 {docs => packages/cli/docs}/src/cmd/clean.md | 0 {docs => packages/cli/docs}/src/cmd/serve.md | 0 {docs => packages/cli/docs}/src/cmd/translate.md | 0 {docs => packages/cli/docs}/src/configure.md | 0 {docs => packages/cli/docs}/src/creating.md | 0 {docs => packages/cli/docs}/src/installation.md | 0 {docs => packages/cli/docs}/src/introduction.md | 0 {docs => packages/cli/docs}/src/plugin/README.md | 0 .../cli/docs}/src/plugin/interface/command.md | 0 .../cli/docs}/src/plugin/interface/dirs.md | 0 .../cli/docs}/src/plugin/interface/log.md | 0 .../cli/docs}/src/plugin/interface/network.md | 0 .../cli/docs}/src/plugin/interface/os.md | 0 .../cli/docs}/src/plugin/interface/path.md | 0 {examples => packages/cli/examples}/README.md | 0 {examples => packages/cli/examples}/plugin/init.lua | 0 .../cli/examples}/plugin/interface.lua | 0 {extension => packages/cli/extension}/.eslintrc.js | 0 {extension => packages/cli/extension}/.gitignore | 0 {extension => packages/cli/extension}/DEV.md | 0 {extension => packages/cli/extension}/LICENSE.txt | 0 {extension => packages/cli/extension}/README.md | 0 .../cli/extension}/dist/.gitignore | 0 .../cli/extension}/package-lock.json | 0 {extension => packages/cli/extension}/package.json | 0 .../cli/extension}/server/.gitignore | 0 {extension => packages/cli/extension}/src/main.ts | 0 .../cli/extension}/static/icon.png | Bin {extension => packages/cli/extension}/tsconfig.json | 0 rustfmt.toml => packages/cli/rustfmt.toml | 0 {src => packages/cli/src}/assets/autoreload.js | 0 {src => packages/cli/src}/assets/dioxus.toml | 0 {src => packages/cli/src}/assets/index.html | 0 {src => packages/cli/src}/builder.rs | 0 {src => packages/cli/src}/cargo.rs | 0 {src => packages/cli/src}/cli/autoformat/mod.rs | 0 {src => packages/cli/src}/cli/build/mod.rs | 0 {src => packages/cli/src}/cli/cfg.rs | 0 {src => packages/cli/src}/cli/clean/mod.rs | 0 {src => packages/cli/src}/cli/config/mod.rs | 0 {src => packages/cli/src}/cli/create/mod.rs | 0 {src => packages/cli/src}/cli/mod.rs | 0 {src => packages/cli/src}/cli/plugin/mod.rs | 0 {src => packages/cli/src}/cli/serve/mod.rs | 0 {src => packages/cli/src}/cli/tool/mod.rs | 0 {src => packages/cli/src}/cli/translate/mod.rs | 0 {src => packages/cli/src}/cli/version.rs | 0 {src => packages/cli/src}/config.rs | 0 {src => packages/cli/src}/error.rs | 0 {src => packages/cli/src}/lib.rs | 0 {src => packages/cli/src}/logging.rs | 0 {src => packages/cli/src}/main.rs | 0 .../cli/src}/plugin/interface/command.rs | 0 {src => packages/cli/src}/plugin/interface/dirs.rs | 0 {src => packages/cli/src}/plugin/interface/fs.rs | 0 {src => packages/cli/src}/plugin/interface/log.rs | 0 {src => packages/cli/src}/plugin/interface/mod.rs | 0 .../cli/src}/plugin/interface/network.rs | 0 {src => packages/cli/src}/plugin/interface/os.rs | 0 {src => packages/cli/src}/plugin/interface/path.rs | 0 {src => packages/cli/src}/plugin/mod.rs | 0 {src => packages/cli/src}/plugin/types.rs | 0 {src => packages/cli/src}/server/mod.rs | 0 {src => packages/cli/src}/server/proxy.rs | 0 {src => packages/cli/src}/tools.rs | 0 {tests => packages/cli/tests}/main.rs | 0 {tests => packages/cli/tests}/svg.html | 0 {tests => packages/cli/tests}/test.html | 0 83 files changed, 0 insertions(+), 0 deletions(-) rename {.github => packages/cli/.github}/workflows/build.yml (100%) rename {.github => packages/cli/.github}/workflows/docs.yml (100%) rename {.github => packages/cli/.github}/workflows/main.yml (100%) rename .gitignore => packages/cli/.gitignore (100%) rename {.vscode => packages/cli/.vscode}/settings.json (100%) rename Cargo.lock => packages/cli/Cargo.lock (100%) rename Cargo.toml => packages/cli/Cargo.toml (100%) rename Dioxus.toml => packages/cli/Dioxus.toml (100%) rename README.md => packages/cli/README.md (100%) rename build.rs => packages/cli/build.rs (100%) rename {docs => packages/cli/docs}/.gitignore (100%) rename {docs => packages/cli/docs}/book.toml (100%) rename {docs => packages/cli/docs}/src/SUMMARY.md (100%) rename {docs => packages/cli/docs}/src/cmd/README.md (100%) rename {docs => packages/cli/docs}/src/cmd/build.md (100%) rename {docs => packages/cli/docs}/src/cmd/clean.md (100%) rename {docs => packages/cli/docs}/src/cmd/serve.md (100%) rename {docs => packages/cli/docs}/src/cmd/translate.md (100%) rename {docs => packages/cli/docs}/src/configure.md (100%) rename {docs => packages/cli/docs}/src/creating.md (100%) rename {docs => packages/cli/docs}/src/installation.md (100%) rename {docs => packages/cli/docs}/src/introduction.md (100%) rename {docs => packages/cli/docs}/src/plugin/README.md (100%) rename {docs => packages/cli/docs}/src/plugin/interface/command.md (100%) rename {docs => packages/cli/docs}/src/plugin/interface/dirs.md (100%) rename {docs => packages/cli/docs}/src/plugin/interface/log.md (100%) rename {docs => packages/cli/docs}/src/plugin/interface/network.md (100%) rename {docs => packages/cli/docs}/src/plugin/interface/os.md (100%) rename {docs => packages/cli/docs}/src/plugin/interface/path.md (100%) rename {examples => packages/cli/examples}/README.md (100%) rename {examples => packages/cli/examples}/plugin/init.lua (100%) rename {examples => packages/cli/examples}/plugin/interface.lua (100%) rename {extension => packages/cli/extension}/.eslintrc.js (100%) rename {extension => packages/cli/extension}/.gitignore (100%) rename {extension => packages/cli/extension}/DEV.md (100%) rename {extension => packages/cli/extension}/LICENSE.txt (100%) rename {extension => packages/cli/extension}/README.md (100%) rename {extension => packages/cli/extension}/dist/.gitignore (100%) rename {extension => packages/cli/extension}/package-lock.json (100%) rename {extension => packages/cli/extension}/package.json (100%) rename {extension => packages/cli/extension}/server/.gitignore (100%) rename {extension => packages/cli/extension}/src/main.ts (100%) rename {extension => packages/cli/extension}/static/icon.png (100%) rename {extension => packages/cli/extension}/tsconfig.json (100%) rename rustfmt.toml => packages/cli/rustfmt.toml (100%) rename {src => packages/cli/src}/assets/autoreload.js (100%) rename {src => packages/cli/src}/assets/dioxus.toml (100%) rename {src => packages/cli/src}/assets/index.html (100%) rename {src => packages/cli/src}/builder.rs (100%) rename {src => packages/cli/src}/cargo.rs (100%) rename {src => packages/cli/src}/cli/autoformat/mod.rs (100%) rename {src => packages/cli/src}/cli/build/mod.rs (100%) rename {src => packages/cli/src}/cli/cfg.rs (100%) rename {src => packages/cli/src}/cli/clean/mod.rs (100%) rename {src => packages/cli/src}/cli/config/mod.rs (100%) rename {src => packages/cli/src}/cli/create/mod.rs (100%) rename {src => packages/cli/src}/cli/mod.rs (100%) rename {src => packages/cli/src}/cli/plugin/mod.rs (100%) rename {src => packages/cli/src}/cli/serve/mod.rs (100%) rename {src => packages/cli/src}/cli/tool/mod.rs (100%) rename {src => packages/cli/src}/cli/translate/mod.rs (100%) rename {src => packages/cli/src}/cli/version.rs (100%) rename {src => packages/cli/src}/config.rs (100%) rename {src => packages/cli/src}/error.rs (100%) rename {src => packages/cli/src}/lib.rs (100%) rename {src => packages/cli/src}/logging.rs (100%) rename {src => packages/cli/src}/main.rs (100%) rename {src => packages/cli/src}/plugin/interface/command.rs (100%) rename {src => packages/cli/src}/plugin/interface/dirs.rs (100%) rename {src => packages/cli/src}/plugin/interface/fs.rs (100%) rename {src => packages/cli/src}/plugin/interface/log.rs (100%) rename {src => packages/cli/src}/plugin/interface/mod.rs (100%) rename {src => packages/cli/src}/plugin/interface/network.rs (100%) rename {src => packages/cli/src}/plugin/interface/os.rs (100%) rename {src => packages/cli/src}/plugin/interface/path.rs (100%) rename {src => packages/cli/src}/plugin/mod.rs (100%) rename {src => packages/cli/src}/plugin/types.rs (100%) rename {src => packages/cli/src}/server/mod.rs (100%) rename {src => packages/cli/src}/server/proxy.rs (100%) rename {src => packages/cli/src}/tools.rs (100%) rename {tests => packages/cli/tests}/main.rs (100%) rename {tests => packages/cli/tests}/svg.html (100%) rename {tests => packages/cli/tests}/test.html (100%) diff --git a/.github/workflows/build.yml b/packages/cli/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build.yml rename to packages/cli/.github/workflows/build.yml diff --git a/.github/workflows/docs.yml b/packages/cli/.github/workflows/docs.yml similarity index 100% rename from .github/workflows/docs.yml rename to packages/cli/.github/workflows/docs.yml diff --git a/.github/workflows/main.yml b/packages/cli/.github/workflows/main.yml similarity index 100% rename from .github/workflows/main.yml rename to packages/cli/.github/workflows/main.yml diff --git a/.gitignore b/packages/cli/.gitignore similarity index 100% rename from .gitignore rename to packages/cli/.gitignore diff --git a/.vscode/settings.json b/packages/cli/.vscode/settings.json similarity index 100% rename from .vscode/settings.json rename to packages/cli/.vscode/settings.json diff --git a/Cargo.lock b/packages/cli/Cargo.lock similarity index 100% rename from Cargo.lock rename to packages/cli/Cargo.lock diff --git a/Cargo.toml b/packages/cli/Cargo.toml similarity index 100% rename from Cargo.toml rename to packages/cli/Cargo.toml diff --git a/Dioxus.toml b/packages/cli/Dioxus.toml similarity index 100% rename from Dioxus.toml rename to packages/cli/Dioxus.toml diff --git a/README.md b/packages/cli/README.md similarity index 100% rename from README.md rename to packages/cli/README.md diff --git a/build.rs b/packages/cli/build.rs similarity index 100% rename from build.rs rename to packages/cli/build.rs diff --git a/docs/.gitignore b/packages/cli/docs/.gitignore similarity index 100% rename from docs/.gitignore rename to packages/cli/docs/.gitignore diff --git a/docs/book.toml b/packages/cli/docs/book.toml similarity index 100% rename from docs/book.toml rename to packages/cli/docs/book.toml diff --git a/docs/src/SUMMARY.md b/packages/cli/docs/src/SUMMARY.md similarity index 100% rename from docs/src/SUMMARY.md rename to packages/cli/docs/src/SUMMARY.md diff --git a/docs/src/cmd/README.md b/packages/cli/docs/src/cmd/README.md similarity index 100% rename from docs/src/cmd/README.md rename to packages/cli/docs/src/cmd/README.md diff --git a/docs/src/cmd/build.md b/packages/cli/docs/src/cmd/build.md similarity index 100% rename from docs/src/cmd/build.md rename to packages/cli/docs/src/cmd/build.md diff --git a/docs/src/cmd/clean.md b/packages/cli/docs/src/cmd/clean.md similarity index 100% rename from docs/src/cmd/clean.md rename to packages/cli/docs/src/cmd/clean.md diff --git a/docs/src/cmd/serve.md b/packages/cli/docs/src/cmd/serve.md similarity index 100% rename from docs/src/cmd/serve.md rename to packages/cli/docs/src/cmd/serve.md diff --git a/docs/src/cmd/translate.md b/packages/cli/docs/src/cmd/translate.md similarity index 100% rename from docs/src/cmd/translate.md rename to packages/cli/docs/src/cmd/translate.md diff --git a/docs/src/configure.md b/packages/cli/docs/src/configure.md similarity index 100% rename from docs/src/configure.md rename to packages/cli/docs/src/configure.md diff --git a/docs/src/creating.md b/packages/cli/docs/src/creating.md similarity index 100% rename from docs/src/creating.md rename to packages/cli/docs/src/creating.md diff --git a/docs/src/installation.md b/packages/cli/docs/src/installation.md similarity index 100% rename from docs/src/installation.md rename to packages/cli/docs/src/installation.md diff --git a/docs/src/introduction.md b/packages/cli/docs/src/introduction.md similarity index 100% rename from docs/src/introduction.md rename to packages/cli/docs/src/introduction.md diff --git a/docs/src/plugin/README.md b/packages/cli/docs/src/plugin/README.md similarity index 100% rename from docs/src/plugin/README.md rename to packages/cli/docs/src/plugin/README.md diff --git a/docs/src/plugin/interface/command.md b/packages/cli/docs/src/plugin/interface/command.md similarity index 100% rename from docs/src/plugin/interface/command.md rename to packages/cli/docs/src/plugin/interface/command.md diff --git a/docs/src/plugin/interface/dirs.md b/packages/cli/docs/src/plugin/interface/dirs.md similarity index 100% rename from docs/src/plugin/interface/dirs.md rename to packages/cli/docs/src/plugin/interface/dirs.md diff --git a/docs/src/plugin/interface/log.md b/packages/cli/docs/src/plugin/interface/log.md similarity index 100% rename from docs/src/plugin/interface/log.md rename to packages/cli/docs/src/plugin/interface/log.md diff --git a/docs/src/plugin/interface/network.md b/packages/cli/docs/src/plugin/interface/network.md similarity index 100% rename from docs/src/plugin/interface/network.md rename to packages/cli/docs/src/plugin/interface/network.md diff --git a/docs/src/plugin/interface/os.md b/packages/cli/docs/src/plugin/interface/os.md similarity index 100% rename from docs/src/plugin/interface/os.md rename to packages/cli/docs/src/plugin/interface/os.md diff --git a/docs/src/plugin/interface/path.md b/packages/cli/docs/src/plugin/interface/path.md similarity index 100% rename from docs/src/plugin/interface/path.md rename to packages/cli/docs/src/plugin/interface/path.md diff --git a/examples/README.md b/packages/cli/examples/README.md similarity index 100% rename from examples/README.md rename to packages/cli/examples/README.md diff --git a/examples/plugin/init.lua b/packages/cli/examples/plugin/init.lua similarity index 100% rename from examples/plugin/init.lua rename to packages/cli/examples/plugin/init.lua diff --git a/examples/plugin/interface.lua b/packages/cli/examples/plugin/interface.lua similarity index 100% rename from examples/plugin/interface.lua rename to packages/cli/examples/plugin/interface.lua diff --git a/extension/.eslintrc.js b/packages/cli/extension/.eslintrc.js similarity index 100% rename from extension/.eslintrc.js rename to packages/cli/extension/.eslintrc.js diff --git a/extension/.gitignore b/packages/cli/extension/.gitignore similarity index 100% rename from extension/.gitignore rename to packages/cli/extension/.gitignore diff --git a/extension/DEV.md b/packages/cli/extension/DEV.md similarity index 100% rename from extension/DEV.md rename to packages/cli/extension/DEV.md diff --git a/extension/LICENSE.txt b/packages/cli/extension/LICENSE.txt similarity index 100% rename from extension/LICENSE.txt rename to packages/cli/extension/LICENSE.txt diff --git a/extension/README.md b/packages/cli/extension/README.md similarity index 100% rename from extension/README.md rename to packages/cli/extension/README.md diff --git a/extension/dist/.gitignore b/packages/cli/extension/dist/.gitignore similarity index 100% rename from extension/dist/.gitignore rename to packages/cli/extension/dist/.gitignore diff --git a/extension/package-lock.json b/packages/cli/extension/package-lock.json similarity index 100% rename from extension/package-lock.json rename to packages/cli/extension/package-lock.json diff --git a/extension/package.json b/packages/cli/extension/package.json similarity index 100% rename from extension/package.json rename to packages/cli/extension/package.json diff --git a/extension/server/.gitignore b/packages/cli/extension/server/.gitignore similarity index 100% rename from extension/server/.gitignore rename to packages/cli/extension/server/.gitignore diff --git a/extension/src/main.ts b/packages/cli/extension/src/main.ts similarity index 100% rename from extension/src/main.ts rename to packages/cli/extension/src/main.ts diff --git a/extension/static/icon.png b/packages/cli/extension/static/icon.png similarity index 100% rename from extension/static/icon.png rename to packages/cli/extension/static/icon.png diff --git a/extension/tsconfig.json b/packages/cli/extension/tsconfig.json similarity index 100% rename from extension/tsconfig.json rename to packages/cli/extension/tsconfig.json diff --git a/rustfmt.toml b/packages/cli/rustfmt.toml similarity index 100% rename from rustfmt.toml rename to packages/cli/rustfmt.toml diff --git a/src/assets/autoreload.js b/packages/cli/src/assets/autoreload.js similarity index 100% rename from src/assets/autoreload.js rename to packages/cli/src/assets/autoreload.js diff --git a/src/assets/dioxus.toml b/packages/cli/src/assets/dioxus.toml similarity index 100% rename from src/assets/dioxus.toml rename to packages/cli/src/assets/dioxus.toml diff --git a/src/assets/index.html b/packages/cli/src/assets/index.html similarity index 100% rename from src/assets/index.html rename to packages/cli/src/assets/index.html diff --git a/src/builder.rs b/packages/cli/src/builder.rs similarity index 100% rename from src/builder.rs rename to packages/cli/src/builder.rs diff --git a/src/cargo.rs b/packages/cli/src/cargo.rs similarity index 100% rename from src/cargo.rs rename to packages/cli/src/cargo.rs diff --git a/src/cli/autoformat/mod.rs b/packages/cli/src/cli/autoformat/mod.rs similarity index 100% rename from src/cli/autoformat/mod.rs rename to packages/cli/src/cli/autoformat/mod.rs diff --git a/src/cli/build/mod.rs b/packages/cli/src/cli/build/mod.rs similarity index 100% rename from src/cli/build/mod.rs rename to packages/cli/src/cli/build/mod.rs diff --git a/src/cli/cfg.rs b/packages/cli/src/cli/cfg.rs similarity index 100% rename from src/cli/cfg.rs rename to packages/cli/src/cli/cfg.rs diff --git a/src/cli/clean/mod.rs b/packages/cli/src/cli/clean/mod.rs similarity index 100% rename from src/cli/clean/mod.rs rename to packages/cli/src/cli/clean/mod.rs diff --git a/src/cli/config/mod.rs b/packages/cli/src/cli/config/mod.rs similarity index 100% rename from src/cli/config/mod.rs rename to packages/cli/src/cli/config/mod.rs diff --git a/src/cli/create/mod.rs b/packages/cli/src/cli/create/mod.rs similarity index 100% rename from src/cli/create/mod.rs rename to packages/cli/src/cli/create/mod.rs diff --git a/src/cli/mod.rs b/packages/cli/src/cli/mod.rs similarity index 100% rename from src/cli/mod.rs rename to packages/cli/src/cli/mod.rs diff --git a/src/cli/plugin/mod.rs b/packages/cli/src/cli/plugin/mod.rs similarity index 100% rename from src/cli/plugin/mod.rs rename to packages/cli/src/cli/plugin/mod.rs diff --git a/src/cli/serve/mod.rs b/packages/cli/src/cli/serve/mod.rs similarity index 100% rename from src/cli/serve/mod.rs rename to packages/cli/src/cli/serve/mod.rs diff --git a/src/cli/tool/mod.rs b/packages/cli/src/cli/tool/mod.rs similarity index 100% rename from src/cli/tool/mod.rs rename to packages/cli/src/cli/tool/mod.rs diff --git a/src/cli/translate/mod.rs b/packages/cli/src/cli/translate/mod.rs similarity index 100% rename from src/cli/translate/mod.rs rename to packages/cli/src/cli/translate/mod.rs diff --git a/src/cli/version.rs b/packages/cli/src/cli/version.rs similarity index 100% rename from src/cli/version.rs rename to packages/cli/src/cli/version.rs diff --git a/src/config.rs b/packages/cli/src/config.rs similarity index 100% rename from src/config.rs rename to packages/cli/src/config.rs diff --git a/src/error.rs b/packages/cli/src/error.rs similarity index 100% rename from src/error.rs rename to packages/cli/src/error.rs diff --git a/src/lib.rs b/packages/cli/src/lib.rs similarity index 100% rename from src/lib.rs rename to packages/cli/src/lib.rs diff --git a/src/logging.rs b/packages/cli/src/logging.rs similarity index 100% rename from src/logging.rs rename to packages/cli/src/logging.rs diff --git a/src/main.rs b/packages/cli/src/main.rs similarity index 100% rename from src/main.rs rename to packages/cli/src/main.rs diff --git a/src/plugin/interface/command.rs b/packages/cli/src/plugin/interface/command.rs similarity index 100% rename from src/plugin/interface/command.rs rename to packages/cli/src/plugin/interface/command.rs diff --git a/src/plugin/interface/dirs.rs b/packages/cli/src/plugin/interface/dirs.rs similarity index 100% rename from src/plugin/interface/dirs.rs rename to packages/cli/src/plugin/interface/dirs.rs diff --git a/src/plugin/interface/fs.rs b/packages/cli/src/plugin/interface/fs.rs similarity index 100% rename from src/plugin/interface/fs.rs rename to packages/cli/src/plugin/interface/fs.rs diff --git a/src/plugin/interface/log.rs b/packages/cli/src/plugin/interface/log.rs similarity index 100% rename from src/plugin/interface/log.rs rename to packages/cli/src/plugin/interface/log.rs diff --git a/src/plugin/interface/mod.rs b/packages/cli/src/plugin/interface/mod.rs similarity index 100% rename from src/plugin/interface/mod.rs rename to packages/cli/src/plugin/interface/mod.rs diff --git a/src/plugin/interface/network.rs b/packages/cli/src/plugin/interface/network.rs similarity index 100% rename from src/plugin/interface/network.rs rename to packages/cli/src/plugin/interface/network.rs diff --git a/src/plugin/interface/os.rs b/packages/cli/src/plugin/interface/os.rs similarity index 100% rename from src/plugin/interface/os.rs rename to packages/cli/src/plugin/interface/os.rs diff --git a/src/plugin/interface/path.rs b/packages/cli/src/plugin/interface/path.rs similarity index 100% rename from src/plugin/interface/path.rs rename to packages/cli/src/plugin/interface/path.rs diff --git a/src/plugin/mod.rs b/packages/cli/src/plugin/mod.rs similarity index 100% rename from src/plugin/mod.rs rename to packages/cli/src/plugin/mod.rs diff --git a/src/plugin/types.rs b/packages/cli/src/plugin/types.rs similarity index 100% rename from src/plugin/types.rs rename to packages/cli/src/plugin/types.rs diff --git a/src/server/mod.rs b/packages/cli/src/server/mod.rs similarity index 100% rename from src/server/mod.rs rename to packages/cli/src/server/mod.rs diff --git a/src/server/proxy.rs b/packages/cli/src/server/proxy.rs similarity index 100% rename from src/server/proxy.rs rename to packages/cli/src/server/proxy.rs diff --git a/src/tools.rs b/packages/cli/src/tools.rs similarity index 100% rename from src/tools.rs rename to packages/cli/src/tools.rs diff --git a/tests/main.rs b/packages/cli/tests/main.rs similarity index 100% rename from tests/main.rs rename to packages/cli/tests/main.rs diff --git a/tests/svg.html b/packages/cli/tests/svg.html similarity index 100% rename from tests/svg.html rename to packages/cli/tests/svg.html diff --git a/tests/test.html b/packages/cli/tests/test.html similarity index 100% rename from tests/test.html rename to packages/cli/tests/test.html From 01aec9f062b75ad198ae9e7b501c52b7324bfd1c Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 28 Jun 2023 17:24:09 -0700 Subject: [PATCH 330/330] remove fleet cruft --- .fleet/settings.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .fleet/settings.json diff --git a/.fleet/settings.json b/.fleet/settings.json deleted file mode 100644 index e69de29bb..000000000