diff --git a/crates/rspack_allocator/Cargo.toml b/crates/rspack_allocator/Cargo.toml index 3a8cbac135b..0f3885e1441 100644 --- a/crates/rspack_allocator/Cargo.toml +++ b/crates/rspack_allocator/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_allocator" -repository = "https://github.com/web-infra-dev/rspack" -version = "0.1.0" description = "rspack allocator" +edition = "2021" +license = "MIT" +name = "rspack_allocator" +repository = "https://github.com/web-infra-dev/rspack" +version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [target.'cfg(target_os = "linux")'.dependencies] diff --git a/crates/rspack_ast/Cargo.toml b/crates/rspack_ast/Cargo.toml index 4b3d0e764f4..0ad41dd79fb 100644 --- a/crates/rspack_ast/Cargo.toml +++ b/crates/rspack_ast/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_ast" -repository = "https://github.com/web-infra-dev/rspack" -version = "0.1.0" description = "rspack ast" +edition = "2021" +license = "MIT" +name = "rspack_ast" +repository = "https://github.com/web-infra-dev/rspack" +version = "0.1.0" [dependencies] anyhow = { workspace = true } swc_core = { workspace = true, features = [ diff --git a/crates/rspack_ast_viewer/Cargo.toml b/crates/rspack_ast_viewer/Cargo.toml index e2446e5f00f..c9dabb30d59 100644 --- a/crates/rspack_ast_viewer/Cargo.toml +++ b/crates/rspack_ast_viewer/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_ast_viewer" -publish = false -version = "0.1.0" description = "rspack ast viewer" +edition = "2021" +license = "MIT" +name = "rspack_ast_viewer" +publish = false +version = "0.1.0" [[bin]] name = "rspack-ast-viewer" path = "src/main.rs" diff --git a/crates/rspack_base64/Cargo.toml b/crates/rspack_base64/Cargo.toml index da13be43328..7fe54164eec 100644 --- a/crates/rspack_base64/Cargo.toml +++ b/crates/rspack_base64/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_base64" -repository = "https://github.com/web-infra-dev/rspack" -version = "0.1.0" description = "rspack base64" +edition = "2021" +license = "MIT" +name = "rspack_base64" +repository = "https://github.com/web-infra-dev/rspack" +version = "0.1.0" [dependencies] base64-simd = { version = "0.8.0", features = ["alloc"] } diff --git a/crates/rspack_futures/Cargo.toml b/crates/rspack_futures/Cargo.toml index a7acc5f325a..b8d6e3a465b 100644 --- a/crates/rspack_futures/Cargo.toml +++ b/crates/rspack_futures/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_futures" -repository = "https://github.com/web-infra-dev/rspack" -version = "0.1.0" description = "rspack futures" +edition = "2021" +license = "MIT" +name = "rspack_futures" +repository = "https://github.com/web-infra-dev/rspack" +version = "0.1.0" [dependencies] async-scoped = { workspace = true, features = ["use-tokio"] } diff --git a/crates/rspack_macros/Cargo.toml b/crates/rspack_macros/Cargo.toml index 6bd7b95fdd8..4e45428f6ef 100644 --- a/crates/rspack_macros/Cargo.toml +++ b/crates/rspack_macros/Cargo.toml @@ -1,11 +1,11 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_macros" -repository = "https://github.com/web-infra-dev/rspack" -version = "0.1.0" description = "rspack macros" +edition = "2021" +license = "MIT" +name = "rspack_macros" +repository = "https://github.com/web-infra-dev/rspack" +version = "0.1.0" [lib] proc-macro = true diff --git a/crates/rspack_napi_macros/Cargo.toml b/crates/rspack_napi_macros/Cargo.toml index 2949ca2d837..26904588496 100644 --- a/crates/rspack_napi_macros/Cargo.toml +++ b/crates/rspack_napi_macros/Cargo.toml @@ -1,11 +1,11 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_napi_macros" -repository = "https://github.com/web-infra-dev/rspack" -version = "0.1.0" description = "rspack macros plugin" +edition = "2021" +license = "MIT" +name = "rspack_napi_macros" +repository = "https://github.com/web-infra-dev/rspack" +version = "0.1.0" [lib] proc-macro = true diff --git a/crates/rspack_tracing/Cargo.toml b/crates/rspack_tracing/Cargo.toml index 7e704858818..4ade23be902 100644 --- a/crates/rspack_tracing/Cargo.toml +++ b/crates/rspack_tracing/Cargo.toml @@ -1,10 +1,10 @@ [package] -edition = "2021" -license = "MIT" -name = "rspack_tracing" -repository = "https://github.com/web-infra-dev/rspack" -version = "0.1.0" description = "rspack tracing" +edition = "2021" +license = "MIT" +name = "rspack_tracing" +repository = "https://github.com/web-infra-dev/rspack" +version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/justfile b/justfile old mode 100644 new mode 100755 index f6773de8b92..9786ad2cef3 --- a/justfile +++ b/justfile @@ -1,6 +1,82 @@ -# Setup the tools needed to develop -setup-tools: - cargo install cargo-release insta -# publish rust crates -release-crates: +#!/usr/bin/env -S just --justfile + +# Set shell configurations +set windows-shell := ["powershell"] +set shell := ["bash", "-cu"] + +# Default target: List all tasks with updated information +_default: + just --list -u + +# Setup environment for Rust and Node.js +setup: + # Install Rust-related tools + cargo install cargo-binstall + cargo binstall taplo-cli cargo-release cargo-insta cargo-deny -y + + # Setup Node.js environment + corepack enable + pnpm install + + @echo '✅ Setup complete!' + +# Check readiness of the project +ready: + just fmt + just check + just lint + just test + @echo '✅ All passed!' + +# Publish Rust crates to crates.io +release-rust: cargo release publish --no-verify --execute --no-confirm + +# Format Rust, TOML files, and JavaScript code +fmt: + cargo fmt --all -- --emit=files + taplo fmt + pnpm format:js + +# Lint Rust and JavaScript code +lint: + cargo clippy --workspace --all-targets -- --deny warnings + pnpm lint:js + +# Check Rust code for compilation errors +check: + cargo check --workspace + +# Run tests for both Rust and Node.js +test: + just test-rust + just test-node + +# Run Rust tests +test-rust: + cargo test --no-fail-fast + +# Supported mode: unit, ci, webpack, plugin +test-node mode="unit": + pnpm install + pnpm build:cli:debug + pnpm test:{{mode}} + +# Support `just build [debug|release] (--force)` +build mode="debug" *args="": + pnpm --filter @rspack/binding build:{{mode}} + pnpm --filter "@rspack/*" build {{args}} + +# Support `just watch [all|rust|node] [debug|release]` +watch target="all" mode="debug": + just _watch-{{target}} {{mode}} + +_watch-all mode: + pnpm --filter @rspack/binding watch:{{mode}} + pnpm --filter "@rspack/*" watch + +_watch-rust mode: + pnpm --filter @rspack/binding watch:{{mode}} + +_watch-node: + pnpm --filter "@rspack/*" watch \ No newline at end of file