Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f9061f218c | |||
| 739a4f4f1a | |||
| f0fec05ccb | |||
| 8c47afb21e | |||
| fccbe16b2a | |||
| 908bf42993 | |||
| 77d3886a45 | |||
| 6991f9cb11 | |||
| 32f4d6a7cb | |||
| aeecda31d7 | |||
| 68097d4121 | |||
| c3e55bb03e | |||
| af4c13e165 | |||
| a7b133d72b | |||
| 991c0392f9 | |||
| 71dd3cdddd | |||
| 81d560cf91 | |||
| caef42067c | |||
| 353c859e22 |
Generated
+1
-1
@@ -6720,7 +6720,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
|
||||
[[package]]
|
||||
name = "vesting-contract"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
dependencies = [
|
||||
"cosmwasm-std",
|
||||
"cw-storage-plus",
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Add window for showing logs for when the terminal is not available.
|
||||
|
||||
## [nym-wallet-v1.0.9](https://github.com/nymtech/nym/releases/tag/nym-wallet-v1.0.8) (2022-09-08)
|
||||
|
||||
- wallet: change default `nymd` URL to https://rpc.nymtech.net
|
||||
|
||||
Generated
+460
-848
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,7 @@
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
||||
"@storybook/react": "^6.5.8",
|
||||
"@svgr/webpack": "^6.1.1",
|
||||
"@tauri-apps/cli": "^1.0.0-rc.5",
|
||||
"@tauri-apps/cli": "^1.0.5",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^12.0.0",
|
||||
"@types/bs58": "^4.0.1",
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Nym Wallet Logs</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root-log"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -13,10 +13,10 @@ rust-version = "1.58"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "=1.0.0-rc.2", features = [] }
|
||||
tauri-build = { version = "=1.0.4", features = [] }
|
||||
|
||||
tauri-codegen = "=1.0.0-rc.1"
|
||||
tauri-macros = "=1.0.0-rc.1"
|
||||
tauri-codegen = "=1.0.4"
|
||||
tauri-macros = "=1.0.4"
|
||||
|
||||
[dependencies]
|
||||
bip39 = "1.0"
|
||||
@@ -26,17 +26,19 @@ colored = "2.0"
|
||||
dirs = "4.0"
|
||||
dotenv = "0.15.0"
|
||||
eyre = "0.6.5"
|
||||
fern = { version = "0.6.1", features = ["colored"] }
|
||||
futures = "0.3.15"
|
||||
itertools = "0.10"
|
||||
log = "0.4"
|
||||
log = { version = "0.4", features = ["serde"] }
|
||||
once_cell = "1.7.2"
|
||||
pretty_env_logger = "0.4"
|
||||
rand = "0.6.5"
|
||||
reqwest = {version = "0.11.9", features = ["json"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
serde_repr = "0.1"
|
||||
strum = { version = "0.23", features = ["derive"] }
|
||||
tauri = { version = "=1.0.0-rc.2", features = ["clipboard-all", "shell-open", "updater", "window-maximize"] }
|
||||
tauri = { version = "=1.0.5", features = ["clipboard-all", "shell-open", "updater", "window-maximize"] }
|
||||
tendermint-rpc = "0.23.0"
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "1.10", features = ["full"] }
|
||||
|
||||
@@ -118,6 +118,8 @@ pub enum BackendError {
|
||||
NoCoinsRegistered { network: Network },
|
||||
#[error("Signature error {0}")]
|
||||
SignatureError(String),
|
||||
#[error("Unable to open a new window")]
|
||||
NewWindowError,
|
||||
}
|
||||
|
||||
impl Serialize for BackendError {
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use fern::colors::ColoredLevelConfig;
|
||||
use serde::Serialize;
|
||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
use tauri::Manager;
|
||||
|
||||
pub fn setup_logging(app_handle: tauri::AppHandle) -> Result<(), log::SetLoggerError> {
|
||||
let colors = ColoredLevelConfig::new();
|
||||
let base_config = fern::Dispatch::new()
|
||||
.level(global_level())
|
||||
.filter_lowlevel_external_components()
|
||||
.show_operations();
|
||||
|
||||
let stdout_config = fern::Dispatch::new()
|
||||
.format(move |out, message, record| {
|
||||
out.finish(format_args!(
|
||||
"{}[{}][{}] {}",
|
||||
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
||||
record.target(),
|
||||
colors.color(record.level()),
|
||||
message,
|
||||
))
|
||||
})
|
||||
.chain(std::io::stdout());
|
||||
|
||||
let tauri_event_config = fern::Dispatch::new()
|
||||
.format(move |out, message, record| {
|
||||
out.finish(format_args!(
|
||||
"{}[{}] {}",
|
||||
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
|
||||
record.target(),
|
||||
message,
|
||||
))
|
||||
})
|
||||
.chain(fern::Output::call(move |record| {
|
||||
let msg = LogMessage {
|
||||
message: record.args().to_string(),
|
||||
level: record.level().into(),
|
||||
};
|
||||
app_handle.emit_all("log://log", msg).unwrap();
|
||||
}));
|
||||
|
||||
base_config
|
||||
.chain(stdout_config)
|
||||
.chain(tauri_event_config)
|
||||
.apply()
|
||||
}
|
||||
|
||||
trait FernExt {
|
||||
fn show_operations(self) -> Self;
|
||||
fn filter_lowlevel_external_components(self) -> Self;
|
||||
}
|
||||
|
||||
impl FernExt for fern::Dispatch {
|
||||
fn show_operations(self) -> Self {
|
||||
if ::std::env::var("RUST_TRACE_OPERATIONS").is_ok() {
|
||||
self.level_for("nym_wallet::operations", log::LevelFilter::Trace)
|
||||
} else {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
fn filter_lowlevel_external_components(self) -> Self {
|
||||
self.level_for("hyper", log::LevelFilter::Warn)
|
||||
.level_for("tokio_reactor", log::LevelFilter::Warn)
|
||||
.level_for("reqwest", log::LevelFilter::Warn)
|
||||
.level_for("mio", log::LevelFilter::Warn)
|
||||
.level_for("want", log::LevelFilter::Warn)
|
||||
.level_for("sled", log::LevelFilter::Warn)
|
||||
.level_for("tungstenite", log::LevelFilter::Warn)
|
||||
.level_for("tokio_tungstenite", log::LevelFilter::Warn)
|
||||
.level_for("rustls", log::LevelFilter::Warn)
|
||||
.level_for("tokio_util", log::LevelFilter::Warn)
|
||||
}
|
||||
}
|
||||
|
||||
fn global_level() -> log::LevelFilter {
|
||||
if let Ok(s) = ::std::env::var("RUST_LOG") {
|
||||
log::LevelFilter::from_str(&s).unwrap_or(log::LevelFilter::Info)
|
||||
} else {
|
||||
log::LevelFilter::Info
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Clone)]
|
||||
struct LogMessage {
|
||||
message: String,
|
||||
level: LogLevel,
|
||||
}
|
||||
|
||||
// Serialize to u16 instead of strings.
|
||||
#[derive(Debug, Clone, Deserialize_repr, Serialize_repr)]
|
||||
#[repr(u16)]
|
||||
enum LogLevel {
|
||||
Trace = 1,
|
||||
Debug,
|
||||
Info,
|
||||
Warn,
|
||||
Error,
|
||||
}
|
||||
|
||||
impl From<log::Level> for LogLevel {
|
||||
fn from(level: log::Level) -> Self {
|
||||
match level {
|
||||
log::Level::Trace => LogLevel::Trace,
|
||||
log::Level::Debug => LogLevel::Debug,
|
||||
log::Level::Info => LogLevel::Info,
|
||||
log::Level::Warn => LogLevel::Warn,
|
||||
log::Level::Error => LogLevel::Error,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,22 @@
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
use tauri::{Manager, Menu};
|
||||
|
||||
use mixnet_contract_common::{Gateway, MixNode};
|
||||
use tauri::Menu;
|
||||
|
||||
use crate::menu::AddDefaultSubmenus;
|
||||
use crate::operations::help;
|
||||
use crate::operations::mixnet;
|
||||
use crate::operations::signatures;
|
||||
use crate::operations::simulate;
|
||||
use crate::operations::validator_api;
|
||||
use crate::operations::vesting;
|
||||
use crate::state::WalletState;
|
||||
|
||||
mod config;
|
||||
mod error;
|
||||
mod log;
|
||||
mod menu;
|
||||
mod network_config;
|
||||
mod operations;
|
||||
@@ -16,20 +27,11 @@ mod state;
|
||||
mod utils;
|
||||
mod wallet_storage;
|
||||
|
||||
use crate::menu::AddDefaultSubmenus;
|
||||
use crate::operations::mixnet;
|
||||
use crate::operations::signatures;
|
||||
use crate::operations::simulate;
|
||||
use crate::operations::validator_api;
|
||||
use crate::operations::vesting;
|
||||
|
||||
use crate::state::WalletState;
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
fn main() {
|
||||
dotenv::dotenv().ok();
|
||||
setup_logging();
|
||||
|
||||
let context = tauri::generate_context!();
|
||||
tauri::Builder::default()
|
||||
.manage(WalletState::default())
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
@@ -149,35 +151,15 @@ fn main() {
|
||||
simulate::mixnet::simulate_compound_delegator_reward,
|
||||
signatures::sign::sign,
|
||||
signatures::sign::verify,
|
||||
help::log::help_log_toggle_window,
|
||||
])
|
||||
.menu(Menu::new().add_default_app_submenu_if_macos())
|
||||
.run(tauri::generate_context!())
|
||||
.menu(Menu::os_default(&context.package_info().name).add_default_app_submenus())
|
||||
.on_menu_event(|event| {
|
||||
if event.menu_item_id() == menu::SHOW_LOG_WINDOW {
|
||||
let _r = help::log::help_log_toggle_window(event.window().app_handle());
|
||||
}
|
||||
})
|
||||
.setup(|app| Ok(log::setup_logging(app.app_handle())?))
|
||||
.run(context)
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
||||
fn setup_logging() {
|
||||
let mut log_builder = pretty_env_logger::formatted_timed_builder();
|
||||
if let Ok(s) = ::std::env::var("RUST_LOG") {
|
||||
log_builder.parse_filters(&s);
|
||||
} else {
|
||||
// default to 'Info'
|
||||
log_builder.filter(None, log::LevelFilter::Info);
|
||||
}
|
||||
|
||||
if ::std::env::var("RUST_TRACE_OPERATIONS").is_ok() {
|
||||
log_builder.filter_module("nym_wallet::operations", log::LevelFilter::Trace);
|
||||
}
|
||||
|
||||
log_builder
|
||||
.filter_module("hyper", log::LevelFilter::Warn)
|
||||
.filter_module("tokio_reactor", log::LevelFilter::Warn)
|
||||
.filter_module("reqwest", log::LevelFilter::Warn)
|
||||
.filter_module("mio", log::LevelFilter::Warn)
|
||||
.filter_module("want", log::LevelFilter::Warn)
|
||||
.filter_module("sled", log::LevelFilter::Warn)
|
||||
.filter_module("tungstenite", log::LevelFilter::Warn)
|
||||
.filter_module("tokio_tungstenite", log::LevelFilter::Warn)
|
||||
.filter_module("rustls", log::LevelFilter::Warn)
|
||||
.filter_module("tokio_util", log::LevelFilter::Warn)
|
||||
.init();
|
||||
}
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
use tauri::Menu;
|
||||
#[cfg(target_os = "macos")]
|
||||
use tauri::{MenuItem, Submenu};
|
||||
use tauri::{CustomMenuItem, Submenu};
|
||||
|
||||
pub const SHOW_LOG_WINDOW: &str = "show_log_window";
|
||||
|
||||
pub trait AddDefaultSubmenus {
|
||||
fn add_default_app_submenu_if_macos(self) -> Self;
|
||||
fn add_default_app_submenus(self) -> Self;
|
||||
}
|
||||
|
||||
impl AddDefaultSubmenus for Menu {
|
||||
fn add_default_app_submenu_if_macos(self) -> Menu {
|
||||
#[cfg(target_os = "macos")]
|
||||
return self.add_submenu(Submenu::new(
|
||||
"Menu",
|
||||
Menu::new()
|
||||
.add_native_item(MenuItem::Copy)
|
||||
.add_native_item(MenuItem::Cut)
|
||||
.add_native_item(MenuItem::Paste)
|
||||
.add_native_item(MenuItem::Hide)
|
||||
.add_native_item(MenuItem::HideOthers)
|
||||
.add_native_item(MenuItem::SelectAll)
|
||||
.add_native_item(MenuItem::ShowAll)
|
||||
.add_native_item(MenuItem::Quit),
|
||||
));
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
return self;
|
||||
fn add_default_app_submenus(self) -> Self {
|
||||
if ::std::env::var("NYM_WALLET_ENABLE_LOG").is_ok() {
|
||||
let submenu = Submenu::new(
|
||||
"Help",
|
||||
Menu::new().add_item(CustomMenuItem::new(SHOW_LOG_WINDOW, "Show logs")),
|
||||
);
|
||||
return self.add_submenu(submenu);
|
||||
}
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
use crate::error::BackendError;
|
||||
use tauri::Manager;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn help_log_toggle_window(app_handle: tauri::AppHandle) -> Result<(), BackendError> {
|
||||
if let Some(current_log_window) = app_handle.windows().get("log") {
|
||||
log::info!("Closing log window...");
|
||||
if let Err(e) = current_log_window.close() {
|
||||
log::error!("Unable to close log window: {:?}", e);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
log::info!("Creating log window...");
|
||||
match tauri::WindowBuilder::new(&app_handle, "log", tauri::WindowUrl::App("log.html".into()))
|
||||
.title("Nym Wallet Logs")
|
||||
.build()
|
||||
{
|
||||
Ok(window) => {
|
||||
if let Err(e) = window.set_focus() {
|
||||
log::error!("Unable to focus log window: {:?}", e);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Err(e) => {
|
||||
log::error!("Unable to create log window: {:?}", e);
|
||||
Err(BackendError::NewWindowError)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
pub mod log;
|
||||
@@ -104,10 +104,12 @@ async fn _connect_with_mnemonic(
|
||||
|
||||
// Take the oppertunity to list all the known validators while we have the state.
|
||||
for network in WalletNetwork::iter() {
|
||||
log::debug!(
|
||||
"List of validators for {network}: [\n{}\n]",
|
||||
// fern really wants us to not evaluate this inside the debug macro argument
|
||||
let f = format!(
|
||||
"{}",
|
||||
state.get_config_validator_entries(network).format(",\n")
|
||||
);
|
||||
log::debug!("List of validators for {network}: [\n{}\n]", f,);
|
||||
}
|
||||
|
||||
state.config().clone()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod help;
|
||||
pub mod mixnet;
|
||||
pub mod signatures;
|
||||
pub mod simulate;
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
import React, { FC, useEffect, useRef, useState } from 'react';
|
||||
import type { UnlistenFn } from '@tauri-apps/api/event';
|
||||
import { listen } from '@tauri-apps/api/event';
|
||||
import { Box, Paper, Chip, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material';
|
||||
|
||||
// see https://github.com/tauri-apps/tauri-plugin-log/blob/dev/webview-src/index.ts#L4
|
||||
enum LogLevel {
|
||||
Trace = 1,
|
||||
Debug,
|
||||
Info,
|
||||
Warn,
|
||||
Error,
|
||||
}
|
||||
|
||||
const getLogLevelName = (value: LogLevel) => {
|
||||
switch (value) {
|
||||
case LogLevel.Trace:
|
||||
return 'Trace';
|
||||
case LogLevel.Debug:
|
||||
return 'Debug';
|
||||
case LogLevel.Info:
|
||||
return 'Info';
|
||||
case LogLevel.Warn:
|
||||
return 'Warn';
|
||||
case LogLevel.Error:
|
||||
return 'Error';
|
||||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
};
|
||||
|
||||
// see https://github.com/tauri-apps/tauri-plugin-log/blob/dev/webview-src/index.ts#L147
|
||||
interface RecordPayload {
|
||||
level: LogLevel;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export const LogViewer: FC = () => {
|
||||
const unlisten = useRef<UnlistenFn>();
|
||||
const messages = useRef<RecordPayload[]>([]);
|
||||
const [messageCount, setMessageCount] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
listen('log://log', (event) => {
|
||||
console.log(event.payload);
|
||||
const payload = event.payload as RecordPayload;
|
||||
messages.current.unshift(payload);
|
||||
setMessageCount((prev) => prev + 1);
|
||||
}).then((fn) => {
|
||||
unlisten.current = fn;
|
||||
});
|
||||
|
||||
return () => {
|
||||
if (unlisten.current) {
|
||||
unlisten.current();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Box sx={{ height: '100vh', width: '100vw', display: 'grid', gridTemplateRows: '1fr auto' }}>
|
||||
<Box sx={{ overflowY: 'hidden', p: 2 }}>
|
||||
<TableContainer component={Paper} sx={{ maxHeight: '100%' }}>
|
||||
<Table size="small" stickyHeader>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Severity</TableCell>
|
||||
<TableCell>Log message</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{messages.current.map((m) => (
|
||||
<TableRow sx={{ '&:last-child td, &:last-child th': { border: 0 } }}>
|
||||
<TableCell sx={{ padding: 1 }}>
|
||||
<Chip label={getLogLevelName(m.level)} variant="outlined" size="small" />
|
||||
</TableCell>
|
||||
<TableCell sx={{ padding: 1, fontFamily: 'Monospace' }}>{m.message}</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Box>
|
||||
<Box
|
||||
sx={{
|
||||
p: 1,
|
||||
textAlign: 'right',
|
||||
fontSize: 'small',
|
||||
borderTop: '2px solid',
|
||||
borderTopColor: (theme) => theme.palette.divider,
|
||||
}}
|
||||
>
|
||||
{messageCount} log entries since opening this window
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
import { LogViewer } from './components/LogViewer';
|
||||
import { ErrorFallback } from './components';
|
||||
import { NymWalletTheme } from './theme';
|
||||
|
||||
const Log = () => (
|
||||
<ErrorBoundary FallbackComponent={ErrorFallback}>
|
||||
<NymWalletTheme>
|
||||
<LogViewer />
|
||||
</NymWalletTheme>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
|
||||
const root = document.getElementById('root-log');
|
||||
|
||||
ReactDOM.render(<Log />, root);
|
||||
@@ -1,11 +1,12 @@
|
||||
export * from './account';
|
||||
export * from './actions';
|
||||
export * from './contract';
|
||||
export * from './vesting';
|
||||
export * from './delegation';
|
||||
export * from './logging';
|
||||
export * from './network';
|
||||
export * from './queries';
|
||||
export * from './utils';
|
||||
export * from './delegation';
|
||||
export * from './rewards';
|
||||
export * from './simulate';
|
||||
export * from './signature';
|
||||
export * from './simulate';
|
||||
export * from './utils';
|
||||
export * from './vesting';
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import { invokeWrapper } from './wrapper';
|
||||
|
||||
export const helpLogToggleWindow = async () => invokeWrapper<void>('help_log_toggle_window', {});
|
||||
@@ -2,6 +2,11 @@ const path = require('path');
|
||||
const { mergeWithRules } = require('webpack-merge');
|
||||
const { webpackCommon } = require('@nymproject/webpack');
|
||||
|
||||
const entry = {
|
||||
app: path.resolve(__dirname, 'src/index.tsx'),
|
||||
log: path.resolve(__dirname, 'src/log.tsx'),
|
||||
};
|
||||
|
||||
module.exports = mergeWithRules({
|
||||
module: {
|
||||
rules: {
|
||||
@@ -9,10 +14,18 @@ module.exports = mergeWithRules({
|
||||
use: 'replace',
|
||||
},
|
||||
},
|
||||
})(webpackCommon(__dirname, 'public/index.html'), {
|
||||
entry: path.resolve(__dirname, 'src/index.tsx'),
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
publicPath: '/',
|
||||
})(
|
||||
webpackCommon(__dirname, [
|
||||
{ filename: 'index.html', chunks: ['app'], template: path.resolve(__dirname, 'public/index.html') },
|
||||
{ filename: 'log.html', chunks: ['log'], template: path.resolve(__dirname, 'public/log.html') },
|
||||
]),
|
||||
{
|
||||
entry,
|
||||
output: {
|
||||
clean: true,
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: '[name].bundle.js',
|
||||
publicPath: '/',
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
const path = require('path');
|
||||
const { default: merge } = require('webpack-merge');
|
||||
const common = require('./webpack.common');
|
||||
|
||||
@@ -7,5 +6,9 @@ module.exports = merge(common, {
|
||||
node: {
|
||||
__dirname: false,
|
||||
},
|
||||
entry: path.resolve(__dirname, './src/index'),
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -61,10 +61,17 @@ module.exports = (baseDir, htmlPath) => ({
|
||||
plugins: [
|
||||
// new CleanWebpackPlugin(),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: path.resolve(baseDir, htmlPath || 'src/index.html'),
|
||||
}),
|
||||
... Array.isArray(htmlPath)
|
||||
? htmlPath.map(
|
||||
(item) =>
|
||||
new HtmlWebpackPlugin(item),
|
||||
)
|
||||
: [
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: path.resolve(baseDir, htmlPath || 'src/index.html'),
|
||||
})
|
||||
],
|
||||
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
typescript: {
|
||||
|
||||
@@ -4826,104 +4826,95 @@
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/api/-/api-1.0.2.tgz#5228720e35d50fd08df87067dc29e7306c1f7a10"
|
||||
integrity sha512-yuNW0oeJ1/ZA7wNF1KgxhHrSu5viPVzY/UgUczzN5ptLM8dH15Juy5rEGkoHfeXGju90Y/l22hi3BtIrp/za+w==
|
||||
|
||||
"@tauri-apps/cli-darwin-arm64@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.0.0-rc.5.tgz#9374be8c96afa1cf77b5647bc81fe1a05006757d"
|
||||
integrity sha512-X+3EIAUGfoL8uE6PBADZC8FcUISe4JPQCxXgaVv6ehoZGoCh/pFJF7AvBGTQxbnvngqM7Xce4Lmh63Io2/5ggw==
|
||||
|
||||
"@tauri-apps/cli-darwin-arm64@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.0.3.tgz#aa14aff2465274d502ab1d22ce1bbbcd66695705"
|
||||
integrity sha512-J0KkbpHwaTEaQFWA/yx+LDYwhV+MMI1GJsHqT1L7cIsDD/DoFyVQq8kDCZ71xTx61g0fgLwbXeTenpLEcegRpw==
|
||||
|
||||
"@tauri-apps/cli-darwin-x64@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.0.0-rc.5.tgz#4db1dd56a228bfafe5b3f64c7661abbe5606e804"
|
||||
integrity sha512-fEpgOdAvKdq9C5/yip8RnwP1VS+nRrtKdzzplu4jY6njDVH/Vom8mg+EfXkCY5RveCaoskJMFgUvt10IGeZHBA==
|
||||
"@tauri-apps/cli-darwin-arm64@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.0.5.tgz#6fd17a8d9e0e7982b5c9887639407fdec783a744"
|
||||
integrity sha512-oxpFb9ZeMiC3xPUJ9NsXWCnnwFSVkPbJUvDKpc9IaoDIUpsMTV72W4P0Nh0uQRbyhx4modPpstt7+ONypNVYNg==
|
||||
|
||||
"@tauri-apps/cli-darwin-x64@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.0.3.tgz#e470f37d0d284bf72b64327ec6f5a6052f0ae8ed"
|
||||
integrity sha512-xO6bBCzLFIg9IelF7djUDqOpLXFv9jvaEwGgMacbhNHrqmH8DdgFqQ0vChUnNkSHxGvbl48Ob/w9tPajfGsW/w==
|
||||
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.0.0-rc.5.tgz#0f1ff84c534908a54fbe63b45004abc6d4f03f4d"
|
||||
integrity sha512-V7sWSBrpLyvkQxpkHIM8JltYqQhiTpThySDjO8POtrTqkRwM5BXORcCYhxTAKCedecfYK/RNUJ6Q0t7+3jS6DQ==
|
||||
"@tauri-apps/cli-darwin-x64@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.0.5.tgz#6aaaadd68739c4c4f86546f3d17b2fb60a5a0c04"
|
||||
integrity sha512-hRNYC6L9edz2dEqK33tssPylF2ti6x6udidBlGWc5GSoeEb/05qKMEA1MESQYKBG+4q+wjJvACA2vvz6AfgJ3Q==
|
||||
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.0.3.tgz#000ea7499059618345fb742363f4e66d55fd7c71"
|
||||
integrity sha512-0lOBJgtklVw8ZQPw9wBiYMLontW+TgZ45wNz/jawx2TFWy8XZVflKXGR82/Cc1RyYKgxJTgzpbHhH0ueA2hUGg==
|
||||
|
||||
"@tauri-apps/cli-linux-arm64-gnu@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.0.0-rc.5.tgz#c5d2f1dd962d80a1958261229778b410b86254d4"
|
||||
integrity sha512-HhM+2FInxtUAI/41LF4fDEzmhLQUq6DOoo7fLN94vgWlhsPyWZoDGP9pA043XbO86+4OX5JZUW1SnTVXMwEaMA==
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.0.5.tgz#d2d01c8b85ee3771656386bfda3852af8ed811da"
|
||||
integrity sha512-hc/Jp3TtFpxB8XVkLEwWy7MNcUBlS8rNCafQBUt4KSElXB+/oGo50jPO+wd5GSMSOR59UCzH08v11P0b+sAa/w==
|
||||
|
||||
"@tauri-apps/cli-linux-arm64-gnu@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.0.3.tgz#467d9081a1890d7693cc964cc92087c95ef26f93"
|
||||
integrity sha512-NS7ki2JPCFzntV5X5xiPfseTHyb7K0zlX8Ntvu39ARaFBbIWKe7xBKpp1bBNiKFoHlfXFAe28yQtPh3xsuuLaQ==
|
||||
|
||||
"@tauri-apps/cli-linux-arm64-musl@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.0.0-rc.5.tgz#f485db9ca5402f5d2c4585801a3aaa4519bd67e8"
|
||||
integrity sha512-DhHdKOhf3+peA/sM0c9CpxK89cp8GVwOB5osFW55fxBZbD0mJFeL2SzjkgfGFqFu6Ci/ZiibQGfEp8XTC8OsYA==
|
||||
"@tauri-apps/cli-linux-arm64-gnu@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.0.5.tgz#7ca848120c2e90b57188aaa9daee11cf29e2e2f4"
|
||||
integrity sha512-btFlkD2PG+yzJBZzWeJmyCy8ZV+iys2Jl66Fs4g9lSi3KrBDnyfQ26RpGZb2pRfkkcVP8/x1WSfByO+Rj+PTBA==
|
||||
|
||||
"@tauri-apps/cli-linux-arm64-musl@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.0.3.tgz#8def78eafe9d96e2d07b44da1b375dd1ff97afa8"
|
||||
integrity sha512-ak3xFnuk4pxLgsBD3CqscNICUVrEIwcFUP6WEKLAkvOrfozeZ14YE3hdTQF3fpKWa5TvROiJcS/0I62FkGtRkQ==
|
||||
|
||||
"@tauri-apps/cli-linux-x64-gnu@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.0.0-rc.5.tgz#e468939585bc98e80ec827d0a3d8ba06a7cc38e8"
|
||||
integrity sha512-pZzsOHRGG/mdcn7fF/yOIOdeVzGxZUtZqvlGSd90ZM9Ps3//uYGCBHoNTbeSwp/V6+D0KVDaSCbm9lYlHoXcdA==
|
||||
"@tauri-apps/cli-linux-arm64-musl@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.0.5.tgz#5ba65790849e0737f560f3ccd12f7a2a88c25b23"
|
||||
integrity sha512-p5JFdWab2AWhfgAZW/mgOLu+YiIJXKV0NdATGmdiBgQCMmz1k/FM8iOFApCgGbo3/zkR58cJ7Z7hyWmQ07M6Pw==
|
||||
|
||||
"@tauri-apps/cli-linux-x64-gnu@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.0.3.tgz#9ff0f8d4cf9b16a28ce85ba743812f621cb2e115"
|
||||
integrity sha512-qj1fYINU5EYLxjpdlKLy/ZYev7EyIhiV1vxkYZzoY4w+9UW75+qv77QLWRgWnmN/Z6RyxP50PUuUfUPDV111+A==
|
||||
|
||||
"@tauri-apps/cli-linux-x64-musl@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.0.0-rc.5.tgz#a1308e93850555f2b6c97b5d7cdbbb9afaa803e2"
|
||||
integrity sha512-COwWCbOhEjBlzGRGTa0ESO4/AiC0cBZ2UEPExRn++S+kWSPJ2vsyMdCLu3hiMy1ABSIRcQ4Vc68M1iVkLhOHHw==
|
||||
"@tauri-apps/cli-linux-x64-gnu@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.0.5.tgz#d06430c608316cb5a29ec805d4c5d078a293c3ae"
|
||||
integrity sha512-fOXR635AXxwSO7MCfBhMLnGpcg1H83XGw9ocuyg4jjvtE8QoYPwC4ksfb5lLhDVMui9iIKY93NAK3EkQiSGGmQ==
|
||||
|
||||
"@tauri-apps/cli-linux-x64-musl@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.0.3.tgz#89841db0c2f99178e5cef96b024f5e80a1e5dbad"
|
||||
integrity sha512-jJZrZNltnobavoCxgQyUm8d2vfZHAOG5I5xSpqD4PSAl1hR72Z6rHCEp3RzOxgk92yoPJapu/rvTXj2RudfcJQ==
|
||||
|
||||
"@tauri-apps/cli-linux-x64-musl@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.0.5.tgz#813c90531f4001453e73b3ad2d4c75929412a249"
|
||||
integrity sha512-8be4zJVkuMs427JqONhFx5Ia5zWsQ5tbZXd80C3dHNL+5/3VIOK6nGQ0iijyZSLXiE9JKEH2jp1EHB+1TVJRcw==
|
||||
|
||||
"@tauri-apps/cli-win32-ia32-msvc@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.0.3.tgz#ae437c3b85314f1d25ae08894a21d6435353d77b"
|
||||
integrity sha512-n3JWIpSaqs80lBt3B3qqWpjfcYzuQ0SzkIXCppBM6zBKORR6mJRLgMdM1D22b7PfqTCfkpJpufpwWvFvIsZFsQ==
|
||||
|
||||
"@tauri-apps/cli-win32-x64-msvc@1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.0.0-rc.5.tgz#d15c95143d9123d10c510e28ba90df5349b68ecd"
|
||||
integrity sha512-zzizUmPWvnWjj+IUCk36kVjS9j1Bg5JmnwOW5QdX26+a64q5vocmVimCgrfZ5STw3sDFXE++S55ghpzhhH5o+g==
|
||||
"@tauri-apps/cli-win32-ia32-msvc@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.0.5.tgz#a3eb6f56c3f4ba35f6311e1fb31bd30e6892b316"
|
||||
integrity sha512-WpnIfzS1e4InGhvd1IDSKC3w6kbI5c6oJgMmtkMTBlhjhiZXhZmQF4XA784A5Y13pzsbXnbNJKOp8DuPVkoTRQ==
|
||||
|
||||
"@tauri-apps/cli-win32-x64-msvc@1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.0.3.tgz#a63d15b7ca5d6f7e29d25baf5152c4438d98f5e7"
|
||||
integrity sha512-Sg/s4SAwIV2hix3P5oyj3SDTXAtmbCDXwEzOr+19CRvto10wDzUD8itJroZPSIuL+NtL4kjmDnoI4gd/1Mrvdw==
|
||||
|
||||
"@tauri-apps/cli@^1.0.0-rc.5":
|
||||
version "1.0.0-rc.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-1.0.0-rc.5.tgz#db8ca22c9f55f5400d1c6addd78ee1df5dc15a29"
|
||||
integrity sha512-Q3D0R5YdZRA5EcL206hwwKCyXpet2mRDcfaRTU/IXwF73bS4AMja+JdAGfO2cyHuSvXd+b//Cgbei2zCG8M6hw==
|
||||
optionalDependencies:
|
||||
"@tauri-apps/cli-darwin-arm64" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-darwin-x64" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-linux-arm64-gnu" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-linux-arm64-musl" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-linux-x64-gnu" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-linux-x64-musl" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-win32-x64-msvc" "1.0.0-rc.5"
|
||||
"@tauri-apps/cli-win32-x64-msvc@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.0.5.tgz#f1e0860166e8f86b550e35aaf22ef95d6da5a7c8"
|
||||
integrity sha512-8iEhVD3X4LZfrlxEPOV+mAj4QrJrEqKTICiJnwmgjvhYQOOsNHzg5kca7pcBbqcgorQOBydLpfGJtxWRusVPaw==
|
||||
|
||||
"@tauri-apps/cli@^1.0.2":
|
||||
version "1.0.3"
|
||||
@@ -4940,6 +4931,21 @@
|
||||
"@tauri-apps/cli-win32-ia32-msvc" "1.0.3"
|
||||
"@tauri-apps/cli-win32-x64-msvc" "1.0.3"
|
||||
|
||||
"@tauri-apps/cli@^1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-1.0.5.tgz#a15a61e8467be29277b72707c4189c58c33d94bf"
|
||||
integrity sha512-vbY+MwK+xN65x0R/o16UQPxBtJl8pmzVzC0TZKokZfmeOkomoqOEOinSwznAMeyR1ZMJW+fXVgJCPvGsRQ0LGg==
|
||||
optionalDependencies:
|
||||
"@tauri-apps/cli-darwin-arm64" "1.0.5"
|
||||
"@tauri-apps/cli-darwin-x64" "1.0.5"
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf" "1.0.5"
|
||||
"@tauri-apps/cli-linux-arm64-gnu" "1.0.5"
|
||||
"@tauri-apps/cli-linux-arm64-musl" "1.0.5"
|
||||
"@tauri-apps/cli-linux-x64-gnu" "1.0.5"
|
||||
"@tauri-apps/cli-linux-x64-musl" "1.0.5"
|
||||
"@tauri-apps/cli-win32-ia32-msvc" "1.0.5"
|
||||
"@tauri-apps/cli-win32-x64-msvc" "1.0.5"
|
||||
|
||||
"@tauri-apps/tauri-forage@^1.0.0-beta.2":
|
||||
version "1.0.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/@tauri-apps/tauri-forage/-/tauri-forage-1.0.0-beta.2.tgz#c11b438ba32731dc7b4c8689d9fda4130baadc07"
|
||||
@@ -7492,15 +7498,10 @@ caniuse-api@^3.0.0:
|
||||
lodash.memoize "^4.1.2"
|
||||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001313:
|
||||
version "1.0.30001313"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001313.tgz#a380b079db91621e1b7120895874e2fd62ed2e2f"
|
||||
integrity sha512-rI1UN0koZUiKINjysQDuRi2VeSCce3bYJNmDcj3PIKREiAmjakugBul1QSkg/fPrlULYl6oWfGg3PbgOSY9X4Q==
|
||||
|
||||
caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001312:
|
||||
version "1.0.30001312"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f"
|
||||
integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001312, caniuse-lite@^1.0.30001313:
|
||||
version "1.0.30001390"
|
||||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001390.tgz"
|
||||
integrity sha512-sS4CaUM+/+vqQUlCvCJ2WtDlV81aWtHhqeEVkLokVJJa3ViN4zDxAGfq9R8i1m90uGHxo99cy10Od+lvn3hf0g==
|
||||
|
||||
capture-exit@^2.0.0:
|
||||
version "2.0.0"
|
||||
|
||||
Reference in New Issue
Block a user