feat: update template
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
5cf5519524
commit
c01c27a0a4
2667
cuddle-leptos/Cargo.lock
generated
2667
cuddle-leptos/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -9,25 +9,25 @@ lto = true
|
|||||||
opt-level = 'z'
|
opt-level = 'z'
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
leptos = { version = "0.6", features = ["nightly"] }
|
leptos = { version = "0.7.2", features = ["nightly"] }
|
||||||
leptos_meta = { version = "0.6", features = ["nightly"] }
|
leptos_meta = { version = "0.7.2" }
|
||||||
leptos_router = { version = "0.6", features = ["nightly"] }
|
leptos_router = { version = "0.7.2", features = ["nightly"] }
|
||||||
leptos_axum = { version = "0.6" }
|
leptos_axum = { version = "0.7.2" }
|
||||||
server_fn = { version = "0.6", features = [] }
|
server_fn = { version = "0.7.2", features = [] }
|
||||||
|
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
axum = "0.7"
|
axum = "0.8"
|
||||||
cfg-if = "1"
|
cfg-if = "1"
|
||||||
console_error_panic_hook = "0.1.7"
|
console_error_panic_hook = "0.1.7"
|
||||||
console_log = "1"
|
console_log = "1"
|
||||||
http = "1"
|
http = "1"
|
||||||
log = "0.4.21"
|
log = "0.4.21"
|
||||||
simple_logger = "5.0.0"
|
simple_logger = "5.0.0"
|
||||||
thiserror = "1"
|
thiserror = "2"
|
||||||
tokio = { version = "1.37.0", features = ["full"] }
|
tokio = { version = "1.37.0", features = ["full"] }
|
||||||
tower = { version = "0.5.0", features = ["full"] }
|
tower = { version = "0.5.0", features = ["full"] }
|
||||||
tower-http = { version = "0.5", features = ["full"] }
|
tower-http = { version = "0.6", features = ["full"] }
|
||||||
wasm-bindgen = "=0.2.93"
|
wasm-bindgen = "=0.2.99"
|
||||||
|
|
||||||
# See https://github.com/akesson/cargo-leptos for documentation of all the parameters.
|
# See https://github.com/akesson/cargo-leptos for documentation of all the parameters.
|
||||||
|
|
||||||
@ -65,6 +65,9 @@ site-addr = "127.0.0.1:3000"
|
|||||||
# The port to use for automatic reload monitoring
|
# The port to use for automatic reload monitoring
|
||||||
reload-port = 3001
|
reload-port = 3001
|
||||||
|
|
||||||
|
# Optional, Activates the tailwind build
|
||||||
|
tailwind-input-file = "style/tailwind.css"
|
||||||
|
|
||||||
# [Optional] Command to use when running end2end tests. It will run in the end2end dir.
|
# [Optional] Command to use when running end2end tests. It will run in the end2end dir.
|
||||||
# [Windows] for non-WSL use "npx.cmd playwright test"
|
# [Windows] for non-WSL use "npx.cmd playwright test"
|
||||||
# This binary name can be checked in Powershell with Get-Command npx
|
# This binary name can be checked in Powershell with Get-Command npx
|
||||||
|
@ -16,3 +16,4 @@ tokio.workspace = true
|
|||||||
tower.workspace = true
|
tower.workspace = true
|
||||||
tower-http.workspace = true
|
tower-http.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
dotenvy = "0.15.7"
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
use app::App;
|
|
||||||
use axum::response::Response as AxumResponse;
|
|
||||||
use axum::{
|
|
||||||
body::Body,
|
|
||||||
extract::State,
|
|
||||||
http::{Request, Response, StatusCode, Uri},
|
|
||||||
response::IntoResponse,
|
|
||||||
};
|
|
||||||
use leptos::*;
|
|
||||||
use tower::ServiceExt;
|
|
||||||
use tower_http::services::ServeDir;
|
|
||||||
|
|
||||||
pub async fn file_and_error_handler(
|
|
||||||
uri: Uri,
|
|
||||||
State(options): State<LeptosOptions>,
|
|
||||||
req: Request<Body>,
|
|
||||||
) -> AxumResponse {
|
|
||||||
let root = options.site_root.clone();
|
|
||||||
let res = get_static_file(uri.clone(), &root).await.unwrap();
|
|
||||||
|
|
||||||
if res.status() == StatusCode::OK {
|
|
||||||
res.into_response()
|
|
||||||
} else {
|
|
||||||
let handler =
|
|
||||||
leptos_axum::render_app_to_stream(options.to_owned(), move || view! { <App/> });
|
|
||||||
handler(req).await.into_response()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
|
|
||||||
let req = Request::builder()
|
|
||||||
.uri(uri.clone())
|
|
||||||
.body(Body::empty())
|
|
||||||
.unwrap();
|
|
||||||
// `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
|
|
||||||
// This path is relative to the cargo root
|
|
||||||
match ServeDir::new(root).oneshot(req).await {
|
|
||||||
Ok(res) => Ok(res.map(Body::new)),
|
|
||||||
Err(err) => Err((
|
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
|
||||||
format!("Something went wrong: {err}"),
|
|
||||||
)),
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +1,14 @@
|
|||||||
use app::*;
|
use app::*;
|
||||||
use axum::Router;
|
use axum::Router;
|
||||||
use fileserv::file_and_error_handler;
|
use leptos::prelude::*;
|
||||||
use leptos::*;
|
|
||||||
use leptos_axum::{generate_route_list, LeptosRoutes};
|
use leptos_axum::{generate_route_list, LeptosRoutes};
|
||||||
|
use state::State;
|
||||||
use tokio::signal;
|
use tokio::signal;
|
||||||
|
|
||||||
pub mod fileserv;
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
|
let _ = dotenvy::dotenv();
|
||||||
|
|
||||||
simple_logger::init_with_level(log::Level::Debug).expect("couldn't initialize logging");
|
simple_logger::init_with_level(log::Level::Debug).expect("couldn't initialize logging");
|
||||||
|
|
||||||
// Setting get_configuration(None) means we'll be using cargo-leptos's env values
|
// Setting get_configuration(None) means we'll be using cargo-leptos's env values
|
||||||
@ -16,15 +16,31 @@ async fn main() {
|
|||||||
// <https://github.com/leptos-rs/start-axum#executing-a-server-on-a-remote-machine-without-the-toolchain>
|
// <https://github.com/leptos-rs/start-axum#executing-a-server-on-a-remote-machine-without-the-toolchain>
|
||||||
// Alternately a file can be specified such as Some("Cargo.toml")
|
// Alternately a file can be specified such as Some("Cargo.toml")
|
||||||
// The file would need to be included with the executable when moved to deployment
|
// The file would need to be included with the executable when moved to deployment
|
||||||
let conf = get_configuration(None).await.unwrap();
|
let conf = get_configuration(None).unwrap();
|
||||||
|
|
||||||
let leptos_options = conf.leptos_options;
|
let leptos_options = conf.leptos_options;
|
||||||
|
let state = State {};
|
||||||
|
|
||||||
let addr = leptos_options.site_addr;
|
let addr = leptos_options.site_addr;
|
||||||
let routes = generate_route_list(App);
|
let routes = generate_route_list(App);
|
||||||
|
|
||||||
// build our application with a route
|
// build our application with a route
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.leptos_routes(&leptos_options, routes, App)
|
.leptos_routes_with_context(
|
||||||
.fallback(file_and_error_handler)
|
&leptos_options,
|
||||||
|
routes,
|
||||||
|
{
|
||||||
|
let state = state.clone();
|
||||||
|
move || {
|
||||||
|
provide_context(state.clone());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
let leptos_options = leptos_options.clone();
|
||||||
|
move || shell(leptos_options.clone())
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.fallback(leptos_axum::file_and_error_handler(shell))
|
||||||
.with_state(leptos_options);
|
.with_state(leptos_options);
|
||||||
|
|
||||||
// run our app with hyper
|
// run our app with hyper
|
||||||
|
@ -12,14 +12,35 @@ leptos_router.workspace = true
|
|||||||
server_fn.workspace = true
|
server_fn.workspace = true
|
||||||
leptos_axum = { workspace = true, optional = true }
|
leptos_axum = { workspace = true, optional = true }
|
||||||
|
|
||||||
tokio = {workspace = true, optional = true}
|
tokio = { workspace = true, optional = true }
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
http.workspace = true
|
http.workspace = true
|
||||||
cfg-if.workspace = true
|
cfg-if.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
|
cynic = { version = "3.9.1", optional = true, features = [
|
||||||
|
"http-reqwest",
|
||||||
|
"reqwest",
|
||||||
|
"serde_json",
|
||||||
|
] }
|
||||||
|
reqwest = { version = "0.12.11", optional = true, features = ["json"] }
|
||||||
|
axum = { workspace = true, optional = true, features = ["macros"] }
|
||||||
|
serde_json = { version = "1.0.134", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
|
hydrate = ["leptos/hydrate"]
|
||||||
ssr = ["leptos/ssr", "leptos_meta/ssr", "leptos_router/ssr", "dep:leptos_axum", "dep:tokio"]
|
ssr = [
|
||||||
|
"leptos/ssr",
|
||||||
|
"leptos_meta/ssr",
|
||||||
|
"leptos_router/ssr",
|
||||||
|
"dep:leptos_axum",
|
||||||
|
"dep:tokio",
|
||||||
|
"dep:cynic",
|
||||||
|
"dep:reqwest",
|
||||||
|
"dep:axum",
|
||||||
|
"dep:serde_json",
|
||||||
|
]
|
||||||
|
cynic = ["dep:cynic"]
|
||||||
|
reqwest = ["dep:reqwest"]
|
||||||
|
axum = ["dep:axum"]
|
||||||
|
serde_json = ["dep:serde_json"]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use cfg_if::cfg_if;
|
use cfg_if::cfg_if;
|
||||||
use http::status::StatusCode;
|
use http::status::StatusCode;
|
||||||
use leptos::*;
|
use leptos::prelude::*;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[cfg(feature = "ssr")]
|
#[cfg(feature = "ssr")]
|
||||||
@ -28,7 +28,7 @@ pub fn ErrorTemplate(
|
|||||||
#[prop(optional)] errors: Option<RwSignal<Errors>>,
|
#[prop(optional)] errors: Option<RwSignal<Errors>>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
let errors = match outside_errors {
|
let errors = match outside_errors {
|
||||||
Some(e) => create_rw_signal(e),
|
Some(e) => RwSignal::new(e),
|
||||||
None => match errors {
|
None => match errors {
|
||||||
Some(e) => e,
|
Some(e) => e,
|
||||||
None => panic!("No Errors found and we expected errors!"),
|
None => panic!("No Errors found and we expected errors!"),
|
||||||
|
@ -1,32 +1,52 @@
|
|||||||
use crate::error_template::{AppError, ErrorTemplate};
|
use crate::error_template::{AppError, ErrorTemplate};
|
||||||
|
|
||||||
use leptos::*;
|
use leptos::prelude::*;
|
||||||
use leptos_meta::*;
|
use leptos_meta::*;
|
||||||
use leptos_router::*;
|
use leptos_router::{components::*, StaticSegment};
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
pub mod error_template;
|
pub mod error_template;
|
||||||
|
|
||||||
|
#[cfg(feature = "ssr")]
|
||||||
|
pub mod state;
|
||||||
|
|
||||||
|
pub fn shell(options: LeptosOptions) -> impl IntoView {
|
||||||
|
view! {
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<AutoReload options=options.clone() />
|
||||||
|
<HydrationScripts options />
|
||||||
|
<MetaTags />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<App />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn App() -> impl IntoView {
|
pub fn App() -> impl IntoView {
|
||||||
// Provides context that manages stylesheets, titles, meta tags, etc.
|
// Provides context that manages stylesheets, titles, meta tags, etc.
|
||||||
provide_meta_context();
|
provide_meta_context();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
<Stylesheet id="leptos" href="/pkg/%%name%%.css"/>
|
<Stylesheet id="leptos" href="/pkg/%%name%%.css" />
|
||||||
|
|
||||||
// sets the document title
|
// sets the document title
|
||||||
<Title text="%%name%%"/>
|
<Title text="%%name%%" />
|
||||||
|
|
||||||
// content for this welcome page
|
// content for this welcome page
|
||||||
<Router fallback=|| {
|
<Router>
|
||||||
|
<main class="">
|
||||||
|
<Routes fallback=|| {
|
||||||
let mut outside_errors = Errors::default();
|
let mut outside_errors = Errors::default();
|
||||||
outside_errors.insert_with_default_key(AppError::NotFound);
|
outside_errors.insert_with_default_key(AppError::NotFound);
|
||||||
view! { <ErrorTemplate outside_errors/> }.into_view()
|
view! { <ErrorTemplate outside_errors /> }.into_view()
|
||||||
}>
|
}>
|
||||||
<main>
|
<Route path=StaticSegment("") view=pages::home::HomePage />
|
||||||
<Routes>
|
|
||||||
<Route ssr=SsrMode::Async path="" view=HomePage/>
|
|
||||||
</Routes>
|
</Routes>
|
||||||
</main>
|
</main>
|
||||||
</Router>
|
</Router>
|
||||||
@ -34,6 +54,8 @@ pub fn App() -> impl IntoView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
fn HomePage() -> impl IntoView {
|
pub fn HomePage() -> impl IntoView {
|
||||||
view! {<h1> Hello %%name%% </h1>}
|
view! {
|
||||||
|
<h1> "%%name%%" </h1>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
14
cuddle-leptos/crates/app/src/state.rs
Normal file
14
cuddle-leptos/crates/app/src/state.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
use axum::extract::FromRef;
|
||||||
|
use leptos::prelude::expect_context;
|
||||||
|
use server_fn::ServerFnError;
|
||||||
|
|
||||||
|
#[derive(FromRef, Clone)]
|
||||||
|
pub struct State {}
|
||||||
|
|
||||||
|
pub async fn get_state() -> Result<State, ServerFnError> {
|
||||||
|
let state = expect_context::<crate::state::State>();
|
||||||
|
let axum::extract::State(state): axum::extract::State<crate::state::State> =
|
||||||
|
leptos_axum::extract_with_state(&state).await?;
|
||||||
|
|
||||||
|
Ok(state)
|
||||||
|
}
|
@ -1,12 +1,10 @@
|
|||||||
use app::*;
|
#[wasm_bindgen::prelude::wasm_bindgen]
|
||||||
use leptos::*;
|
|
||||||
use wasm_bindgen::prelude::wasm_bindgen;
|
|
||||||
|
|
||||||
#[wasm_bindgen]
|
|
||||||
pub fn hydrate() {
|
pub fn hydrate() {
|
||||||
|
use app::*;
|
||||||
|
|
||||||
// initializes logging using the `log` crate
|
// initializes logging using the `log` crate
|
||||||
_ = console_log::init_with_level(log::Level::Debug);
|
_ = console_log::init_with_level(log::Level::Debug);
|
||||||
console_error_panic_hook::set_once();
|
console_error_panic_hook::set_once();
|
||||||
|
|
||||||
leptos::mount_to_body(App);
|
leptos::mount::hydrate_body(App);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "cuddle-leptos",
|
|
||||||
"templating": "tera",
|
|
||||||
"delimiter": "[[]]",
|
|
||||||
"prompt": {
|
|
||||||
"name": {
|
|
||||||
"description": "Project name"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,16 +6,26 @@ vars:
|
|||||||
service: "%%name%%"
|
service: "%%name%%"
|
||||||
registry: kasperhermansen
|
registry: kasperhermansen
|
||||||
|
|
||||||
clusters:
|
ingress:
|
||||||
clank-prod:
|
- external: "true"
|
||||||
replicas: "3"
|
- internal: "true"
|
||||||
namespace: prod
|
|
||||||
|
|
||||||
|
cuddle/clusters:
|
||||||
deployment:
|
dev:
|
||||||
registry: git@git.front.kjuulh.io:kjuulh/clank-clusters
|
|
||||||
env:
|
env:
|
||||||
|
service.host: "0.0.0.0:3000"
|
||||||
|
content.url: https://content.front.kjuulh.io/graphql
|
||||||
|
content.base.url: https://content.front.kjuulh.io
|
||||||
|
content.token:
|
||||||
|
vault: true
|
||||||
prod:
|
prod:
|
||||||
clusters:
|
env:
|
||||||
- clank-prod
|
service.host: "0.0.0.0:3000"
|
||||||
|
content.url: https://content.front.kjuulh.io/graphql
|
||||||
|
content.base.url: https://content.front.kjuulh.io
|
||||||
|
content.token:
|
||||||
|
vault: true
|
||||||
|
|
||||||
|
scripts:
|
||||||
|
generate_graphql:
|
||||||
|
type: shell
|
||||||
|
95
cuddle-leptos/end2end/package-lock.json
generated
95
cuddle-leptos/end2end/package-lock.json
generated
@ -13,61 +13,96 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@playwright/test": {
|
"node_modules/@playwright/test": {
|
||||||
"version": "1.28.0",
|
"version": "1.49.1",
|
||||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.1.tgz",
|
||||||
"integrity": "sha512-vrHs5DFTPwYox5SGKq/7TDn/S4q6RA1zArd7uhO6EyP9hj3XgZBBM12ktMbnDQNxh/fL1IUKsTNLxihmsU38lQ==",
|
"integrity": "sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*",
|
"playwright": "1.49.1"
|
||||||
"playwright-core": "1.28.0"
|
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/fsevents": {
|
||||||
"version": "18.11.9",
|
"version": "2.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==",
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/playwright-core": {
|
|
||||||
"version": "1.28.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.28.0.tgz",
|
|
||||||
"integrity": "sha512-nJLknd28kPBiCNTbqpu6Wmkrh63OEqJSFw9xOfL9qxfNwody7h6/L3O2dZoWQ6Oxcm0VOHjWmGiCUGkc0X3VZA==",
|
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/playwright": {
|
||||||
|
"version": "1.49.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz",
|
||||||
|
"integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"playwright-core": "1.49.1"
|
||||||
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "2.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/playwright-core": {
|
||||||
|
"version": "1.49.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz",
|
||||||
|
"integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"playwright-core": "cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@playwright/test": {
|
"@playwright/test": {
|
||||||
"version": "1.28.0",
|
"version": "1.49.1",
|
||||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.1.tgz",
|
||||||
"integrity": "sha512-vrHs5DFTPwYox5SGKq/7TDn/S4q6RA1zArd7uhO6EyP9hj3XgZBBM12ktMbnDQNxh/fL1IUKsTNLxihmsU38lQ==",
|
"integrity": "sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*",
|
"playwright": "1.49.1"
|
||||||
"playwright-core": "1.28.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"fsevents": {
|
||||||
"version": "18.11.9",
|
"version": "2.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==",
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"playwright": {
|
||||||
|
"version": "1.49.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz",
|
||||||
|
"integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"fsevents": "2.3.2",
|
||||||
|
"playwright-core": "1.49.1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"playwright-core": {
|
"playwright-core": {
|
||||||
"version": "1.28.0",
|
"version": "1.49.1",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz",
|
||||||
"integrity": "sha512-nJLknd28kPBiCNTbqpu6Wmkrh63OEqJSFw9xOfL9qxfNwody7h6/L3O2dZoWQ6Oxcm0VOHjWmGiCUGkc0X3VZA==",
|
"integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
cuddle-leptos/leptosfmt.toml
Normal file
12
cuddle-leptos/leptosfmt.toml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
max_width = 100 # Maximum width of each line
|
||||||
|
tab_spaces = 4 # Number of spaces per tab
|
||||||
|
indentation_style = "Auto" # "Tabs", "Spaces" or "Auto"
|
||||||
|
newline_style = "Auto" # "Unix", "Windows" or "Auto"
|
||||||
|
attr_value_brace_style = "WhenRequired" # "Always", "AlwaysUnlessLit", "WhenRequired" or "Preserve"
|
||||||
|
macro_names = ["leptos::view", "view"] # Macro names which will be formatted
|
||||||
|
closing_tag_style = "Preserve" # "Preserve", "SelfClosing" or "NonSelfClosing"
|
||||||
|
|
||||||
|
# Attribute values can be formatted by custom formatters
|
||||||
|
# Every attribute name may only select one formatter (this might change later on)
|
||||||
|
[attr_values]
|
||||||
|
class = "Tailwind" # "Tailwind" is the only attribute value formatter available for now
|
2
cuddle-leptos/rust-analyzer.toml
Normal file
2
cuddle-leptos/rust-analyzer.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[rustfmt]
|
||||||
|
overrideCommand = ["leptosfmt", "--stdin", "--rustfmt"]
|
1
cuddle-leptos/rustfmt.toml
Normal file
1
cuddle-leptos/rustfmt.toml
Normal file
@ -0,0 +1 @@
|
|||||||
|
edition = "2021"
|
5
cuddle-leptos/scripts/generate_graphql.sh
Executable file
5
cuddle-leptos/scripts/generate_graphql.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
graphql-schema download --endpoint http://localhost:1337/graphql --output-file crates/app/graphql/content-schema.graphql
|
@ -6,6 +6,6 @@
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: var(--main-font);
|
font-family: var(--main-font);
|
||||||
background-color: var(--main-background);
|
//background-color: var(--main-background);
|
||||||
color: var(--main-color);
|
//color: var(--main-color);
|
||||||
}
|
}
|
7
cuddle-leptos/style/tailwind.css
Normal file
7
cuddle-leptos/style/tailwind.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
.page-center {
|
||||||
|
@apply max-w-4xl mx-auto px-4 h-full;
|
||||||
|
}
|
13
cuddle-leptos/tailwind.config.js
Normal file
13
cuddle-leptos/tailwind.config.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
module.exports = {
|
||||||
|
content: {
|
||||||
|
files: ["*.html", "./crates/app/src/**/*.rs"],
|
||||||
|
transform: {
|
||||||
|
rs: (content) => content.replace(/(?:^|\s)class:/g, ' '),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user