mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 07:34:35 -05:00
Introducing cargo all-features clippy|nextest part of build process (#3767)
* fix: intoducing cargo all-features clippy * fix: change check to clippy for better diagnostics * chore: build is redundant * fix: lint task * feat: speed up tests by 2x with cargo-nextest * fix: re-add flags * fix: router example build process * fix: correct clippy arguments * fix: adapt examples makefile to new tools * fix(CI): add cargo-all-features part of CI dep * fix: just warn if there is no tests * fix(CI): add clippy and rustfmt components * fix: nextest in examples * fix: clippy should not run on empty set of features in examples (quickfix) * fix: pin cargo-all-features installation to a branch * fix: nextest --no-tests=warn? * fix: do not use built-in cargo-make workflows * fix: remove --all-targets * fix: do not run tests in parallel in certain examples * fix: disable nextest for examples * fix: properly override the make task * chore: run tests with no-deps * fix: hackernews_islands_axum * fix(CI): properly use --no-deps * fix(CI): --no-deps is not supported in tests * fix(CI): run doctests separately due to stable rust limitation in nextest * fix(examples): makefile lint recursion * fix(CI): run tests correctly * fix: remove unused clear in test makefile * fix: --no-deps positional arg in clippy * fix: run doctests for all-features * fix: running cargo-all-features over doctests * fix: improve playwright makefile
This commit is contained in:
5
.github/workflows/run-cargo-make-task.yml
vendored
5
.github/workflows/run-cargo-make-task.yml
vendored
@@ -59,6 +59,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
targets: wasm32-unknown-unknown
|
targets: wasm32-unknown-unknown
|
||||||
|
components: clippy,rustfmt
|
||||||
- name: Install binstall
|
- name: Install binstall
|
||||||
uses: cargo-bins/cargo-binstall@main
|
uses: cargo-bins/cargo-binstall@main
|
||||||
- name: Install wasm-bindgen
|
- name: Install wasm-bindgen
|
||||||
@@ -67,6 +68,10 @@ jobs:
|
|||||||
run: cargo binstall cargo-leptos --locked --no-confirm
|
run: cargo binstall cargo-leptos --locked --no-confirm
|
||||||
- name: Install cargo-make
|
- name: Install cargo-make
|
||||||
run: cargo binstall cargo-make --no-confirm
|
run: cargo binstall cargo-make --no-confirm
|
||||||
|
- name: Install nextest
|
||||||
|
run: cargo binstall cargo-nextest --no-confirm
|
||||||
|
- name: Install cargo-all-features
|
||||||
|
run: cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
- name: Install Trunk
|
- name: Install Trunk
|
||||||
if: contains(inputs.directory, 'examples')
|
if: contains(inputs.directory, 'examples')
|
||||||
run: cargo binstall trunk --no-confirm
|
run: cargo binstall trunk --no-confirm
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
|||||||
workspace = false
|
workspace = false
|
||||||
clear = true
|
clear = true
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "check", path = "examples/counter_without_macros" },
|
{ name = "lint", path = "examples/counter_without_macros" },
|
||||||
{ name = "check", path = "examples/counters_stable" },
|
{ name = "lint", path = "examples/counters_stable" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[tasks.ci-examples]
|
[tasks.ci-examples]
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
[tasks.check]
|
|
||||||
alias = "check-all"
|
|
||||||
|
|
||||||
[tasks.check-all]
|
|
||||||
command = "cargo"
|
|
||||||
args = ["check-all-features"]
|
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
@@ -6,13 +6,15 @@ env = { LEPTOS_PROJECT_DIRECTORY = "../" }
|
|||||||
args = ["fmt", "--", "--check", "--config-path", "${LEPTOS_PROJECT_DIRECTORY}"]
|
args = ["fmt", "--", "--check", "--config-path", "${LEPTOS_PROJECT_DIRECTORY}"]
|
||||||
|
|
||||||
[tasks.clippy-each-feature]
|
[tasks.clippy-each-feature]
|
||||||
dependencies = ["install-clippy"]
|
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = [
|
args = [
|
||||||
"clippy",
|
"all-features",
|
||||||
"--all-features",
|
"clippy",
|
||||||
"--no-deps",
|
"--no-deps",
|
||||||
"--",
|
"--",
|
||||||
"-D",
|
"-D",
|
||||||
"clippy::print_stdout",
|
"clippy::print_stdout",
|
||||||
]
|
]
|
||||||
|
install_script = '''
|
||||||
|
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
|
'''
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
extend = [
|
extend = [{ path = "./lint.toml" }, { path = "./test.toml" }]
|
||||||
{ path = "./check.toml" },
|
|
||||||
{ path = "./lint.toml" },
|
|
||||||
{ path = "./test.toml" },
|
|
||||||
]
|
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
RUSTFLAGS = ""
|
RUSTFLAGS = ""
|
||||||
@@ -12,4 +8,4 @@ LEPTOS_OUTPUT_NAME = "ci" # allows examples to check/build without cargo-leptos
|
|||||||
RUSTFLAGS = "-D warnings"
|
RUSTFLAGS = "-D warnings"
|
||||||
|
|
||||||
[tasks.ci]
|
[tasks.ci]
|
||||||
dependencies = ["lint", "test-flow"]
|
dependencies = ["lint", "test-each-feature", "doctests"]
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
[tasks.test]
|
[tasks.test-each-feature]
|
||||||
alias = "test-all"
|
env = { "NEXTEST_NO_TESTS" = "warn" }
|
||||||
|
|
||||||
[tasks.test-all]
|
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["test-all-features"]
|
args = ["all-features", "nextest", "run", "--all-targets"]
|
||||||
install_crate = "cargo-all-features"
|
install_script = '''
|
||||||
|
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
|
'''
|
||||||
|
|
||||||
|
# This can be removed once doctests is supported in nextest
|
||||||
|
# https://github.com/nextest-rs/nextest/issues/16
|
||||||
|
[tasks.doctests]
|
||||||
|
command = "cargo"
|
||||||
|
args = ["all-features", "test", "--doc"]
|
||||||
|
install_script = '''
|
||||||
|
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
|
'''
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ panic = "abort"
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
||||||
skip_feature_sets = [["ssr", "hydrate"]]
|
skip_feature_sets = [["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
extend = [{ path = "./lint.toml" }]
|
|
||||||
|
|
||||||
[tasks.make-target-site-dir]
|
[tasks.make-target-site-dir]
|
||||||
command = "mkdir"
|
command = "mkdir"
|
||||||
args = ["-p", "target/site"]
|
args = ["-p", "target/site"]
|
||||||
@@ -22,20 +20,16 @@ clear = true
|
|||||||
dependencies = ["check-debug", "check-release"]
|
dependencies = ["check-debug", "check-release"]
|
||||||
|
|
||||||
[tasks.check-debug]
|
[tasks.check-debug]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features"]
|
args = ["all-features", "clippy"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|
||||||
[tasks.check-release]
|
[tasks.check-release]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features", "--release"]
|
args = ["all-features", "clippy", "--release"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|
||||||
[tasks.lint]
|
|
||||||
dependencies = ["make-target-site-dir", "check-style"]
|
|
||||||
|
|
||||||
[tasks.start-client]
|
[tasks.start-client]
|
||||||
dependencies = ["install-cargo-leptos"]
|
dependencies = ["install-cargo-leptos"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["leptos", "watch", "--release", "-P"]
|
args = ["leptos", "watch", "--release", "-P"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[tasks.cargo-all-features]
|
||||||
|
install_script = '''
|
||||||
|
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
|
'''
|
||||||
|
|
||||||
[tasks.install-cargo-leptos]
|
[tasks.install-cargo-leptos]
|
||||||
install_crate = { crate_name = "cargo-leptos", binary = "cargo-leptos", test_arg = "--help" }
|
install_crate = { crate_name = "cargo-leptos", binary = "cargo-leptos", test_arg = "--help" }
|
||||||
args = ["--locked"]
|
args = ["--locked"]
|
||||||
@@ -16,14 +21,14 @@ clear = true
|
|||||||
dependencies = ["check-debug", "check-release"]
|
dependencies = ["check-debug", "check-release"]
|
||||||
|
|
||||||
[tasks.check-debug]
|
[tasks.check-debug]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features"]
|
args = ["all-features", "clippy"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|
||||||
[tasks.check-release]
|
[tasks.check-release]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features", "--release"]
|
args = ["all-features", "clippy", "--release"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|
||||||
[tasks.start-client]
|
[tasks.start-client]
|
||||||
dependencies = ["install-cargo-leptos"]
|
dependencies = ["install-cargo-leptos"]
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
[tasks.build]
|
[tasks.cargo-all-features]
|
||||||
command = "cargo"
|
install_script = '''
|
||||||
args = ["build-all-features"]
|
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
install_crate = "cargo-all-features"
|
'''
|
||||||
|
|
||||||
[tasks.check]
|
[tasks.build]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features"]
|
args = ["all-features", "build"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
[tasks.cargo-all-features]
|
||||||
|
install_script = '''
|
||||||
|
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
|
'''
|
||||||
|
|
||||||
[tasks.build]
|
[tasks.build]
|
||||||
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "--help" }
|
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "--help" }
|
||||||
clear = true
|
clear = true
|
||||||
@@ -14,11 +19,11 @@ clear = true
|
|||||||
dependencies = ["check-debug", "check-release"]
|
dependencies = ["check-debug", "check-release"]
|
||||||
|
|
||||||
[tasks.check-debug]
|
[tasks.check-debug]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features"]
|
args = ["all-features", "clippy"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|
||||||
[tasks.check-release]
|
[tasks.check-release]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features", "--release"]
|
args = ["all-features", "clippy", "--release"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
[tasks.pre-clippy]
|
[tasks.cargo-all-features]
|
||||||
env = { CARGO_MAKE_CLIPPY_ARGS = "--no-deps --all-targets --all-features -- -D warnings" }
|
install_script = '''
|
||||||
|
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
|
||||||
|
'''
|
||||||
|
|
||||||
[tasks.check-style]
|
[tasks.lint]
|
||||||
dependencies = ["check-format-flow", "clippy-flow"]
|
dependencies = ["check-format-flow", "clippy-each-feature"]
|
||||||
|
|
||||||
|
[tasks.clippy-each-feature]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
|
command = "cargo"
|
||||||
|
args = ["all-features", "clippy", "--no-deps", "--", "-D", "warnings"]
|
||||||
|
|
||||||
[tasks.check-format]
|
[tasks.check-format]
|
||||||
env = { LEPTOS_PROJECT_DIRECTORY = "../../" }
|
env = { LEPTOS_PROJECT_DIRECTORY = "../../" }
|
||||||
|
|||||||
@@ -1,22 +1,19 @@
|
|||||||
extend = [
|
extend = [
|
||||||
{ path = "./compile.toml" },
|
{ path = "./compile.toml" },
|
||||||
{ path = "./clean.toml" },
|
{ path = "./clean.toml" },
|
||||||
{ path = "./lint.toml" },
|
{ path = "./lint.toml" },
|
||||||
{ path = "./node.toml" },
|
{ path = "./node.toml" },
|
||||||
{ path = "./process.toml" },
|
{ path = "./process.toml" },
|
||||||
]
|
]
|
||||||
|
|
||||||
# CI Stages
|
# CI Stages
|
||||||
|
|
||||||
[tasks.ci]
|
[tasks.ci]
|
||||||
dependencies = ["prepare", "lint", "build", "test-flow", "integration-test"]
|
dependencies = ["prepare", "lint", "test-flow", "integration-test"]
|
||||||
|
|
||||||
[tasks.prepare]
|
[tasks.prepare]
|
||||||
dependencies = ["setup-node"]
|
dependencies = ["setup-node"]
|
||||||
|
|
||||||
[tasks.lint]
|
|
||||||
dependencies = ["check-style"]
|
|
||||||
|
|
||||||
[tasks.integration-test]
|
[tasks.integration-test]
|
||||||
|
|
||||||
# Support Local Runs
|
# Support Local Runs
|
||||||
|
|||||||
@@ -1,22 +1,8 @@
|
|||||||
extend = [
|
extend = [
|
||||||
{ path = "../cargo-make/playwright.toml" },
|
{ path = "../cargo-make/playwright.toml" },
|
||||||
{ path = "../cargo-make/trunk_server.toml" },
|
{ path = "../cargo-make/trunk_server.toml" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[tasks.integration-test]
|
[tasks.integration-test]
|
||||||
|
dependencies = ["build", "start-client", "test-playwright"]
|
||||||
description = "Run integration test with automated start and stop of processes"
|
description = "Run integration test with automated start and stop of processes"
|
||||||
env = { SPAWN_CLIENT_PROCESS = "1" }
|
|
||||||
run_task = { name = ["start", "wait-test-stop"], parallel = true }
|
|
||||||
|
|
||||||
[tasks.wait-test-stop]
|
|
||||||
private = true
|
|
||||||
dependencies = ["wait-server", "test-playwright", "stop"]
|
|
||||||
|
|
||||||
[tasks.wait-server]
|
|
||||||
script = '''
|
|
||||||
for run in {1..12}; do
|
|
||||||
echo "Waiting to ensure server is started..."
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
echo "Times up, running tests"
|
|
||||||
'''
|
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ command = "trunk"
|
|||||||
args = ["build"]
|
args = ["build"]
|
||||||
|
|
||||||
[tasks.start-client]
|
[tasks.start-client]
|
||||||
command = "trunk"
|
script = '''
|
||||||
args = ["serve", "${@}"]
|
trunk serve -q "${@}" &
|
||||||
|
'''
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["actix-files", "actix-web", "leptos_actix"]
|
denylist = ["actix-files", "actix-web", "leptos_actix"]
|
||||||
skip_feature_sets = [["ssr", "hydrate"]]
|
skip_feature_sets = [["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ extend = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tasks.build]
|
[tasks.build]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["build-all-features"]
|
args = ["all-features", "build"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|
||||||
[tasks.check]
|
[tasks.check]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["check-all-features"]
|
args = ["all-features", "clippy"]
|
||||||
install_crate = "cargo-all-features"
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "leptos_axum"]
|
||||||
skip_feature_sets = [["ssr", "hydrate"]]
|
skip_feature_sets = [["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ codegen-units = 1
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["actix-files", "actix-web", "leptos_actix"]
|
denylist = ["actix-files", "actix-web", "leptos_actix"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "http", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "http", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "http", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "http", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
max_combination_size = 2
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
extend = [
|
extend = [
|
||||||
{ path = "../cargo-make/main.toml" },
|
{ path = "../cargo-make/main.toml" },
|
||||||
{ path = "../cargo-make/cargo-leptos-compress.toml" },
|
{ path = "../cargo-make/cargo-leptos-compress.toml" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.ci]
|
||||||
|
dependencies = [
|
||||||
|
"prepare",
|
||||||
|
"make-target-site-dir",
|
||||||
|
"lint",
|
||||||
|
"test-flow",
|
||||||
|
"integration-test",
|
||||||
]
|
]
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
|
|
||||||
CLIENT_PROCESS_NAME = "hackernews_islands"
|
CLIENT_PROCESS_NAME = "hackernews_islands"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ use axum::{
|
|||||||
http::{header, Request, Response, StatusCode, Uri},
|
http::{header, Request, Response, StatusCode, Uri},
|
||||||
response::{IntoResponse, Response as AxumResponse},
|
response::{IntoResponse, Response as AxumResponse},
|
||||||
};
|
};
|
||||||
|
use rust_embed::Embed;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
@@ -11,7 +12,7 @@ const DEV_MODE: bool = false;
|
|||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
const DEV_MODE: bool = true;
|
const DEV_MODE: bool = true;
|
||||||
|
|
||||||
#[derive(rust_embed::RustEmbed)]
|
#[derive(Embed)]
|
||||||
#[folder = "target/site/"]
|
#[folder = "target/site/"]
|
||||||
struct Assets;
|
struct Assets;
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "http", "leptos_axum"]
|
denylist = ["axum", "tower", "http", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ panic = "abort"
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ panic = "abort"
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -4,15 +4,16 @@ extend = [
|
|||||||
{ path = "../cargo-make/trunk_server.toml" },
|
{ path = "../cargo-make/trunk_server.toml" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[tasks.build]
|
[tasks.clippy-each-feature]
|
||||||
|
dependencies = ["cargo-all-features"]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["build-all-features", "--target", "wasm32-unknown-unknown"]
|
args = [
|
||||||
install_crate = "cargo-all-features"
|
"all-features",
|
||||||
|
"clippy",
|
||||||
[tasks.check]
|
"--target",
|
||||||
command = "cargo"
|
"wasm32-unknown-unknown",
|
||||||
args = ["check-all-features", "--target", "wasm32-unknown-unknown"]
|
"--no-deps",
|
||||||
install_crate = "cargo-all-features"
|
"--",
|
||||||
|
"-D",
|
||||||
[tasks.pre-clippy]
|
"warnings",
|
||||||
env = { CARGO_MAKE_CLIPPY_ARGS = "--all-targets --all-features --target wasm32-unknown-unknown -- -D warnings" }
|
]
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["actix-files", "actix-web", "leptos_actix"]
|
denylist = ["actix-files", "actix-web", "leptos_actix"]
|
||||||
skip_feature_sets = [["ssr", "hydrate"]]
|
skip_feature_sets = [["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ panic = "abort"
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
||||||
skip_feature_sets = [["ssr", "hydrate"]]
|
skip_feature_sets = [["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ panic = "abort"
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
||||||
skip_feature_sets = [["ssr", "hydrate"]]
|
skip_feature_sets = [["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ condition = { env_true = ["RUN_AUTOMATICALLY"] }
|
|||||||
[tasks.test-ui]
|
[tasks.test-ui]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = [
|
args = [
|
||||||
"test",
|
"test",
|
||||||
"--test",
|
"--test",
|
||||||
"app_suite",
|
"app_suite",
|
||||||
"--",
|
"--",
|
||||||
"--retry",
|
"--retry",
|
||||||
"2",
|
"2",
|
||||||
"--fail-fast",
|
"--fail-fast",
|
||||||
"${@}",
|
"${@}",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ denylist = [
|
|||||||
"leptos_actix",
|
"leptos_actix",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tokio", "tower", "tower-http", "leptos_axum"]
|
denylist = ["axum", "tokio", "tower", "tower-http", "leptos_axum"]
|
||||||
skip_feature_sets = [["ssr", "hydrate"]]
|
skip_feature_sets = [["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["actix-files", "actix-web", "leptos_actix", "sqlx"]
|
denylist = ["actix-files", "actix-web", "leptos_actix", "sqlx"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ condition = { env_true = ["RUN_AUTOMATICALLY"] }
|
|||||||
[tasks.test-ui]
|
[tasks.test-ui]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = [
|
args = [
|
||||||
"test",
|
"test",
|
||||||
"--test",
|
"--test",
|
||||||
"app_suite",
|
"app_suite",
|
||||||
"--",
|
"--",
|
||||||
"--retry",
|
"--retry",
|
||||||
"2",
|
"2",
|
||||||
"--fail-fast",
|
"--fail-fast",
|
||||||
"${@}",
|
"${@}",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ condition = { env_true = ["RUN_AUTOMATICALLY"] }
|
|||||||
[tasks.test-ui]
|
[tasks.test-ui]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = [
|
args = [
|
||||||
"test",
|
"test",
|
||||||
"--test",
|
"--test",
|
||||||
"app_suite",
|
"app_suite",
|
||||||
"--",
|
"--",
|
||||||
"--retry",
|
"--retry",
|
||||||
"2",
|
"2",
|
||||||
"--fail-fast",
|
"--fail-fast",
|
||||||
"${@}",
|
"${@}",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ ssr = [
|
|||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|
||||||
[package.metadata.leptos]
|
[package.metadata.leptos]
|
||||||
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ condition = { env_true = ["RUN_AUTOMATICALLY"] }
|
|||||||
[tasks.test-ui]
|
[tasks.test-ui]
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = [
|
args = [
|
||||||
"test",
|
"test",
|
||||||
"--test",
|
"--test",
|
||||||
"app_suite",
|
"app_suite",
|
||||||
"--",
|
"--",
|
||||||
"--retry",
|
"--retry",
|
||||||
"5",
|
"5",
|
||||||
"--fail-fast",
|
"--fail-fast",
|
||||||
"${@}",
|
"${@}",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ web-sys = { version = "0.3.70", features = ["Storage"] }
|
|||||||
wasm-bindgen-test = "0.3.42"
|
wasm-bindgen-test = "0.3.42"
|
||||||
|
|
||||||
[package.metadata.cargo-all-features]
|
[package.metadata.cargo-all-features]
|
||||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ extend = { path = "../cargo-make/main.toml" }
|
|||||||
[tasks.check]
|
[tasks.check]
|
||||||
clear = true
|
clear = true
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"check-all",
|
"clippy-each-feature",
|
||||||
"check-wasm",
|
"check-wasm",
|
||||||
"check-release",
|
"check-release",
|
||||||
"check-wasm-release",
|
"check-wasm-release",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ extend = { path = "../cargo-make/main.toml" }
|
|||||||
[tasks.test]
|
[tasks.test]
|
||||||
clear = true
|
clear = true
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"test-all",
|
"test-each-feature",
|
||||||
"test-leptos_macro-example",
|
"test-leptos_macro-example",
|
||||||
"doc-leptos_macro-example",
|
"doc-leptos_macro-example",
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user