build: run tasks from workpace or member directory (#1339)

This commit is contained in:
Joseph Cruz 2023-07-13 16:46:51 -04:00 committed by GitHub
parent d1ef5fce9f
commit 3481a6ee53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 82 additions and 93 deletions

View file

@ -3,113 +3,25 @@
# cargo install --force cargo-make # cargo install --force cargo-make
############ ############
[config] [env]
# make tasks run at the workspace root CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
default_to_workspace = false
[tasks.check]
clear = true
dependencies = [
"check-all",
"check-wasm",
"check-all-release",
"check-wasm-release",
]
[tasks.check-all]
command = "cargo"
args = ["+nightly", "check-all-features"]
install_crate = "cargo-all-features"
[tasks.check-wasm]
clear = true
dependencies = [{ name = "check-wasm", path = "leptos" }]
[tasks.check-all-release]
command = "cargo"
args = ["+nightly", "check-all-features"]
install_crate = "cargo-all-features"
[tasks.check-wasm-release]
clear = true
dependencies = [{ name = "check-wasm-release", path = "leptos" }]
[tasks.check-examples]
clear = true
dependencies = [
{ name = "check", path = "examples/counter" },
{ name = "check", path = "examples/counter_isomorphic" },
{ name = "check", path = "examples/counters" },
{ name = "check", path = "examples/error_boundary" },
{ name = "check", path = "examples/errors_axum" },
{ name = "check", path = "examples/fetch" },
{ name = "check", path = "examples/hackernews" },
{ name = "check", path = "examples/hackernews_axum" },
{ name = "check", path = "examples/js-framework-benchmark" },
{ name = "check", path = "examples/leptos-tailwind-axum" },
{ name = "check", path = "examples/login_with_token_csr_only" },
{ name = "check", path = "examples/parent_child" },
{ name = "check", path = "examples/router" },
{ name = "check", path = "examples/session_auth_axum" },
{ name = "check", path = "examples/slots" },
{ name = "check", path = "examples/ssr_modes" },
{ name = "check", path = "examples/ssr_modes_axum" },
{ name = "check", path = "examples/tailwind" },
{ name = "check", path = "examples/tailwind_csr_trunk" },
{ name = "check", path = "examples/timer" },
{ name = "check", path = "examples/todo_app_sqlite" },
{ name = "check", path = "examples/todo_app_sqlite_axum" },
{ name = "check", path = "examples/todo_app_sqlite_viz" },
{ name = "check", path = "examples/todomvc" },
]
[tasks.check-stable] [tasks.check-stable]
workspace = false
clear = true clear = true
dependencies = [ dependencies = [
{ name = "check", path = "examples/counter_without_macros" }, { name = "check", path = "examples/counter_without_macros" },
{ name = "check", path = "examples/counters_stable" }, { name = "check", path = "examples/counters_stable" },
] ]
[tasks.test]
clear = true
dependencies = [
"test-all",
"test-leptos_macro-example",
"doc-leptos_macro-example",
]
[tasks.test-all]
command = "cargo"
args = ["+nightly", "test-all-features"]
install_crate = "cargo-all-features"
[tasks.test-leptos_macro-example]
description = "Tests the leptos_macro/example to check if macro handles doc comments correctly"
command = "cargo"
args = ["+nightly", "test", "--doc"]
cwd = "leptos_macro/example"
install_crate = false
[tasks.doc-leptos_macro-example]
description = "Docs the leptos_macro/example to check if macro handles doc comments correctly"
command = "cargo"
args = ["+nightly", "doc"]
cwd = "leptos_macro/example"
install_crate = false
[tasks.ci-examples] [tasks.ci-examples]
workspace = false
cwd = "examples" cwd = "examples"
command = "cargo" command = "cargo"
args = ["make", "ci-clean"] args = ["make", "ci-clean"]
[tasks.clean-examples] [tasks.clean-examples]
workspace = false
cwd = "examples" cwd = "examples"
command = "cargo" command = "cargo"
args = ["make", "clean"] args = ["make", "clean"]
[env]
RUSTFLAGS = ""
LEPTOS_OUTPUT_NAME = "ci" # allows examples to check/build without cargo-leptos
[env.github-actions]
RUSTFLAGS = "-D warnings"

22
cargo-make/main.toml Normal file
View file

@ -0,0 +1,22 @@
[env]
RUSTFLAGS = ""
LEPTOS_OUTPUT_NAME = "ci" # allows examples to check/build without cargo-leptos
[env.github-actions]
RUSTFLAGS = "-D warnings"
[tasks.check]
alias = "check-all"
[tasks.check-all]
command = "cargo"
args = ["+nightly", "check-all-features"]
install_crate = "cargo-all-features"
[tasks.test]
alias = "test-all"
[tasks.test-all]
command = "cargo"
args = ["+nightly", "test-all-features"]
install_crate = "cargo-all-features"

View file

@ -0,0 +1 @@
extend = { path = "../../cargo-make/main.toml" }

View file

@ -0,0 +1 @@
extend = { path = "../../cargo-make/main.toml" }

View file

@ -0,0 +1 @@
extend = { path = "../../cargo-make/main.toml" }

View file

@ -0,0 +1 @@
extend = { path = "../../cargo-make/main.toml" }

View file

@ -1,3 +1,14 @@
extend = { path = "../cargo-make/main.toml" }
[tasks.check]
clear = true
dependencies = [
"check-all",
"check-wasm",
"check-release",
"check-wasm-release",
]
[tasks.check-wasm] [tasks.check-wasm]
clear = true clear = true
dependencies = ["check-hydrate", "check-csr"] dependencies = ["check-hydrate", "check-csr"]
@ -43,3 +54,7 @@ args = [
"--features=csr", "--features=csr",
"--target=wasm32-unknown-unknown", "--target=wasm32-unknown-unknown",
] ]
[tasks.check-release]
command = "cargo"
args = ["check", "--release"]

View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

1
leptos_dom/Makefile.toml Normal file
View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

View file

@ -0,0 +1,23 @@
extend = { path = "../cargo-make/main.toml" }
[tasks.test]
clear = true
dependencies = [
"test-all",
"test-leptos_macro-example",
"doc-leptos_macro-example",
]
[tasks.test-leptos_macro-example]
description = "Tests the leptos_macro/example to check if macro handles doc comments correctly"
command = "cargo"
args = ["+nightly", "test", "--doc"]
cwd = "example"
install_crate = false
[tasks.doc-leptos_macro-example]
description = "Docs the leptos_macro/example to check if macro handles doc comments correctly"
command = "cargo"
args = ["+nightly", "doc"]
cwd = "example"
install_crate = false

View file

@ -1553,6 +1553,7 @@ pub(crate) fn component_to_tokens(
global_class: Option<&TokenTree>, global_class: Option<&TokenTree>,
) -> TokenStream { ) -> TokenStream {
let name = node.name(); let name = node.name();
#[cfg(debug_assertions)]
let component_name = ident_from_tag_name(node.name()); let component_name = ident_from_tag_name(node.name());
let span = node.name().span(); let span = node.name().span();
@ -1685,6 +1686,7 @@ pub(crate) fn component_to_tokens(
} }
}); });
#[allow(unused_mut)] // used in debug
let mut component = quote! { let mut component = quote! {
::leptos::component_view( ::leptos::component_view(
&#name, &#name,
@ -2120,6 +2122,7 @@ impl IdeTagHelper {
/// open_tag(open_tag.props().slots().children().build()) /// open_tag(open_tag.props().slots().children().build())
/// } /// }
/// ``` /// ```
#[cfg(debug_assertions)]
pub fn add_component_completion( pub fn add_component_completion(
component: &mut TokenStream, component: &mut TokenStream,
node: &NodeElement, node: &NodeElement,

View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

1
meta/Makefile.toml Normal file
View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

1
router/Makefile.toml Normal file
View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

1
server_fn/Makefile.toml Normal file
View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

View file

@ -0,0 +1 @@
extend = { path = "../../cargo-make/main.toml" }

View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }