diff --git a/.github/workflows/check-examples.yml b/.github/workflows/check-examples.yml index 364fa6c..b97c10b 100644 --- a/.github/workflows/check-examples.yml +++ b/.github/workflows/check-examples.yml @@ -11,7 +11,7 @@ env: jobs: test: - name: Test on ${{ matrix.os }} (using rustc ${{ matrix.rust }}) + name: Check examples ${{ matrix.os }} (using rustc ${{ matrix.rust }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -39,9 +39,6 @@ jobs: - name: Cargo generate-lockfile run: cargo generate-lockfile - - name: Run Rustfmt - run: cargo fmt -- --check - - uses: Swatinem/rust-cache@v2 - name: Run cargo check on all examples diff --git a/.github/workflows/check-stable.yml b/.github/workflows/check-stable.yml new file mode 100644 index 0000000..ab1c074 --- /dev/null +++ b/.github/workflows/check-stable.yml @@ -0,0 +1,45 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Check examples ${{ matrix.os }} (using rustc ${{ matrix.rust }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - stable + os: + - ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt + + - name: Add wasm32-unknown-unknown + run: rustup target add wasm32-unknown-unknown + + - name: Setup cargo-make + uses: davidB/rust-cargo-make@v1 + + - name: Cargo generate-lockfile + run: cargo generate-lockfile + + - uses: Swatinem/rust-cache@v2 + + - name: Run cargo check on all examples + run: cargo make check-stable diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7891ea7..f2638cf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,7 +11,7 @@ env: jobs: test: - name: Test on ${{ matrix.os }} (using rustc ${{ matrix.rust }}) + name: Run `cargo check` ${{ matrix.os }} (using rustc ${{ matrix.rust }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -39,9 +39,6 @@ jobs: - name: Cargo generate-lockfile run: cargo generate-lockfile - - name: Run Rustfmt - run: cargo fmt -- --check - - uses: Swatinem/rust-cache@v2 - name: Run cargo check on all libraries diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 0000000..3341567 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,34 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Run rustfmt + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - nightly + os: + - ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt + + - name: Run Rustfmt + run: cargo fmt -- --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e06a37a..20ac478 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ env: jobs: test: - name: Test on ${{ matrix.os }} (using rustc ${{ matrix.rust }}) + name: Run tests ${{ matrix.os }} (using rustc ${{ matrix.rust }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -39,9 +39,6 @@ jobs: - name: Cargo generate-lockfile run: cargo generate-lockfile - - name: Run Rustfmt - run: cargo fmt -- --check - - uses: Swatinem/rust-cache@v2 - name: Run tests with all features diff --git a/Cargo.toml b/Cargo.toml index 9dee313..a66fc73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,22 +25,22 @@ members = [ exclude = ["benchmarks", "examples"] [workspace.package] -version = "0.2.2" +version = "0.2.3" [workspace.dependencies] -leptos = { path = "./leptos", default-features = false, version = "0.2.2" } -leptos_dom = { path = "./leptos_dom", default-features = false, version = "0.2.2" } -leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.2.2" } -leptos_macro = { path = "./leptos_macro", default-features = false, version = "0.2.2" } -leptos_reactive = { path = "./leptos_reactive", default-features = false, version = "0.2.2" } -leptos_server = { path = "./leptos_server", default-features = false, version = "0.2.2" } -server_fn = { path = "./server_fn", default-features = false, version = "0.2.2" } -server_fn_macro = { path = "./server_fn_macro", default-features = false, version = "0.2.2" } -server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", default-features = false, version = "0.2.2" } -leptos_config = { path = "./leptos_config", default-features = false, version = "0.2.2" } -leptos_router = { path = "./router", version = "0.2.2" } -leptos_meta = { path = "./meta", default-feature = false, version = "0.2.2" } -leptos_integration_utils = { path = "./integrations/utils", version = "0.2.2" } +leptos = { path = "./leptos", default-features = false, version = "0.2.3" } +leptos_dom = { path = "./leptos_dom", default-features = false, version = "0.2.3" } +leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.2.3" } +leptos_macro = { path = "./leptos_macro", default-features = false, version = "0.2.3" } +leptos_reactive = { path = "./leptos_reactive", default-features = false, version = "0.2.3" } +leptos_server = { path = "./leptos_server", default-features = false, version = "0.2.3" } +server_fn = { path = "./server_fn", default-features = false, version = "0.2.3" } +server_fn_macro = { path = "./server_fn_macro", default-features = false, version = "0.2.3" } +server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", default-features = false, version = "0.2.3" } +leptos_config = { path = "./leptos_config", default-features = false, version = "0.2.3" } +leptos_router = { path = "./router", version = "0.2.3" } +leptos_meta = { path = "./meta", default-feature = false, version = "0.2.3" } +leptos_integration_utils = { path = "./integrations/utils", version = "0.2.3" } [profile.release] codegen-units = 1 diff --git a/Makefile.toml b/Makefile.toml index 529f472..42b5da0 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -7,9 +7,6 @@ # make tasks run at the workspace root default_to_workspace = false -[tasks.ci] -dependencies = ["check", "check-examples", "test"] - [tasks.check] clear = true dependencies = ["check-all", "check-wasm"] @@ -28,9 +25,7 @@ clear = true dependencies = [ { name = "check", path = "examples/counter" }, { name = "check", path = "examples/counter_isomorphic" }, - { name = "check", path = "examples/counter_without_macros" }, { name = "check", path = "examples/counters" }, - { name = "check", path = "examples/counters_stable" }, { name = "check", path = "examples/error_boundary" }, { name = "check", path = "examples/errors_axum" }, { name = "check", path = "examples/fetch" }, @@ -49,6 +44,13 @@ dependencies = [ { name = "check", path = "examples/todomvc" }, ] +[tasks.check-stable] +clear = true +dependencies = [ + { name = "check", path = "examples/counter_without_macros" }, + { name = "check", path = "examples/counters_stable" }, +] + [tasks.test] clear = true dependencies = ["test-all"] diff --git a/examples/counter_without_macros/Makefile.toml b/examples/counter_without_macros/Makefile.toml index ab91756..b81bb05 100644 --- a/examples/counter_without_macros/Makefile.toml +++ b/examples/counter_without_macros/Makefile.toml @@ -1,9 +1,9 @@ [tasks.build] command = "cargo" -args = ["+nightly", "build-all-features"] +args = ["+stable", "build-all-features"] install_crate = "cargo-all-features" [tasks.check] command = "cargo" -args = ["+nightly", "check-all-features"] +args = ["+stable", "check-all-features"] install_crate = "cargo-all-features" diff --git a/leptos_macro/Cargo.toml b/leptos_macro/Cargo.toml index 4e1e860..c15a0eb 100644 --- a/leptos_macro/Cargo.toml +++ b/leptos_macro/Cargo.toml @@ -40,7 +40,11 @@ default = ["ssr"] csr = ["leptos_dom/web", "leptos_reactive/csr"] hydrate = ["leptos_dom/web", "leptos_reactive/hydrate"] ssr = ["leptos_dom/ssr", "leptos_reactive/ssr"] -stable = ["leptos_dom/stable", "leptos_reactive/stable"] +stable = [ + "leptos_dom/stable", + "leptos_reactive/stable", + "server_fn_macro/stable", +] tracing = [] [package.metadata.cargo-all-features] diff --git a/leptos_server/Cargo.toml b/leptos_server/Cargo.toml index 17f36e8..1d56d91 100644 --- a/leptos_server/Cargo.toml +++ b/leptos_server/Cargo.toml @@ -40,6 +40,7 @@ stable = [ #"leptos/stable", "leptos_dom/stable", "leptos_reactive/stable", + "server_fn/stable", ] [package.metadata.cargo-all-features] diff --git a/meta/Cargo.toml b/meta/Cargo.toml index c479e3e..dafc120 100644 --- a/meta/Cargo.toml +++ b/meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leptos_meta" -version = "0.2.2" +version = "0.2.3" edition = "2021" authors = ["Greg Johnston"] license = "MIT" diff --git a/router/Cargo.toml b/router/Cargo.toml index 8e7f629..ac406cc 100644 --- a/router/Cargo.toml +++ b/router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leptos_router" -version = "0.2.2" +version = "0.2.3" edition = "2021" authors = ["Greg Johnston"] license = "MIT" diff --git a/server_fn/Cargo.toml b/server_fn/Cargo.toml index 227f7d2..e9518d2 100644 --- a/server_fn/Cargo.toml +++ b/server_fn/Cargo.toml @@ -9,7 +9,7 @@ description = "RPC for any web framework." readme = "../README.md" [dependencies] -server_fn_macro_default = { path = "./server_fn_macro_default", version = "0.2.0" } +server_fn_macro_default = { workspace = true } form_urlencoded = "1" serde = { version = "1", features = ["derive"] } serde_urlencoded = "0.7" @@ -33,3 +33,4 @@ once_cell = "1.17.1" [features] ssr = [] +stable = ["server_fn_macro_default/stable"] diff --git a/server_fn/server_fn_macro_default/Cargo.toml b/server_fn/server_fn_macro_default/Cargo.toml index 9ca7b64..f385fe4 100644 --- a/server_fn/server_fn_macro_default/Cargo.toml +++ b/server_fn/server_fn_macro_default/Cargo.toml @@ -16,5 +16,8 @@ syn = { version = "1", features = ["full"] } server_fn_macro = { workspace = true } [dev-dependencies] -server_fn = { workspace = true } +server_fn = { version = "0.2" } serde = "1" + +[features] +stable = [] diff --git a/server_fn_macro/Cargo.toml b/server_fn_macro/Cargo.toml index 36fb70b..513c13f 100644 --- a/server_fn_macro/Cargo.toml +++ b/server_fn_macro/Cargo.toml @@ -18,3 +18,6 @@ proc-macro2 = "1" proc-macro-error = "1" xxhash-rust = { version = "0.8.6", features = ["const_xxh64"] } const_format = "0.2.30" + +[features] +stable = [] diff --git a/server_fn_macro/src/lib.rs b/server_fn_macro/src/lib.rs index f5377ed..dd9e58d 100644 --- a/server_fn_macro/src/lib.rs +++ b/server_fn_macro/src/lib.rs @@ -276,7 +276,7 @@ impl Parse for ServerFnName { "\"Cbor\"" => syn::parse_quote!(Encoding::Cbor), _ => abort!(encoding, "Encoding Not Found"), }) - .unwrap_or(syn::parse_quote!(Encoding::Url)); + .unwrap_or_else(|_| syn::parse_quote!(Encoding::Url)); Ok(Self { struct_name,