frontend: fix build script triggers

This commit is contained in:
L-Nafaryus 2024-03-20 12:29:55 +05:00
parent 5a3a25982c
commit 90be183e7e
Signed by: L-Nafaryus
GPG Key ID: 582F8B0866B294A1
6 changed files with 75 additions and 20 deletions

65
Cargo.lock generated
View File

@ -262,6 +262,16 @@ dependencies = [
"generic-array",
]
[[package]]
name = "bstr"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706"
dependencies = [
"memchr",
"serde",
]
[[package]]
name = "bumpalo"
version = "3.15.4"
@ -333,6 +343,31 @@ dependencies = [
"libc",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
dependencies = [
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
[[package]]
name = "crypto-common"
version = "0.1.6"
@ -511,6 +546,7 @@ version = "0.1.0"
dependencies = [
"askama",
"askama_axum",
"ignore",
"npm_rs",
"rust-embed",
]
@ -583,6 +619,19 @@ version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "globset"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1"
dependencies = [
"aho-corasick",
"bstr",
"log",
"regex-automata 0.4.6",
"regex-syntax 0.8.2",
]
[[package]]
name = "h2"
version = "0.4.2"
@ -728,6 +777,22 @@ dependencies = [
"cc",
]
[[package]]
name = "ignore"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1"
dependencies = [
"crossbeam-deque",
"globset",
"log",
"memchr",
"regex-automata 0.4.6",
"same-file",
"walkdir",
"winapi-util",
]
[[package]]
name = "indexmap"
version = "2.2.5"

View File

@ -4,6 +4,7 @@ version = "0.1.0"
edition = "2021"
[build-dependencies]
ignore = "0.4.22"
npm_rs = "1.0.0"
[dependencies]

View File

@ -1,24 +1,17 @@
use ignore::Walk;
use npm_rs::*;
use std::{fs, io};
fn main() {
// TODO: add cargo:rerun-if-changed for important files
let paths = fs::read_dir(".")
.unwrap()
.filter(|entry| entry.is_ok())
.map(|file| file.map(|e| e.path()))
.collect::<Result<Vec<_>, io::Error>>()
.unwrap();
/*for path in paths {
println!("cargo:rerun-if-changed={}", path.to_str().unwrap());
}*/
//println!("cargo:rerun-if-changed=src/main.ts");
for entry in Walk::new(".")
.filter_map(Result::ok)
.filter(|e| !e.path().is_dir())
.filter(|e| e.file_name() != "package-lock.json")
{
println!("cargo:rerun-if-changed={}", entry.path().display());
}
NpmEnv::default()
.with_node_env(&NodeEnv::from_cargo_profile().unwrap_or_default())
.with_env("FOO", "bar")
.init_env()
.install(None)
.run("build")

View File

@ -11,10 +11,8 @@ async function login() {
method: "POST",
headers: {
"Content-Type": "application/json",
//"Access-Control-Allow-Origin": "*"
},
credentials: "include",
//mode: "cors",
body: JSON.stringify({ email: email.value, password: password.value })
})
.then(async response => {

View File

@ -4,8 +4,6 @@ import router from '@/router';
import '@/assets/style.css';
import Me from '@/views/Me.vue'
import Home from '@/views/Home.vue'
createApp(App)
.use(router)
.mount('#app');

View File

@ -109,7 +109,7 @@ async fn home() -> impl IntoResponse {
}
async fn user_login() -> impl IntoResponse {
frontend::BaseTemplate { view: "signin" }
frontend::BaseTemplate { view: "app" }
}
async fn user(Path(user): Path<String>) -> impl IntoResponse {}