feat: support some event

This commit is contained in:
YuKun Liu committed 2022-09-21 16:56:36 -07:00
1 parent 59b8a84530
commit 37ef7c3ff9
7 files changed
+51 -44

No files matched your search

+3 -3
View File
@@ -11,7 +11,7 @@ pub struct Build {
}
impl Build {
pub fn build(self, plugin_manager: PluginManager) -> Result<()> {
pub fn build(self) -> Result<()> {
let mut crate_config = crate::CrateConfig::new()?;
// change the release state.
@@ -34,7 +34,7 @@ impl Build {
.clone()
});
let _ = plugin_manager.on_build_start(&crate_config, &platform);
let _ = PluginManager::on_build_start(&crate_config, &platform);
match platform.as_str() {
"web" => {
@@ -65,7 +65,7 @@ impl Build {
)?;
file.write_all(temp.as_bytes())?;
let _ = plugin_manager.on_build_finish(&crate_config, &platform);
let _ = PluginManager::on_build_finish(&crate_config, &platform);
Ok(())
}
+2 -4
View File
@@ -1,5 +1,3 @@
use crate::plugin::PluginManager;
use super::*;
use std::{
io::Write,
@@ -16,7 +14,7 @@ pub struct Serve {
}
impl Serve {
pub async fn serve(self, plugin_manager: PluginManager) -> Result<()> {
pub async fn serve(self) -> Result<()> {
let mut crate_config = crate::CrateConfig::new()?;
// change the relase state.
@@ -65,7 +63,7 @@ impl Serve {
Serve::regen_dev_page(&crate_config)?;
// start the develop server
server::startup(self.serve.port, crate_config.clone(), plugin_manager).await?;
server::startup(self.serve.port, crate_config.clone()).await?;
Ok(())
}