Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(infra): improve the configuration of justfile #7526

Merged
merged 8 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions crates/rspack_allocator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
shulaoda marked this conversation as resolved.
Show resolved Hide resolved
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]
Expand Down
10 changes: 5 additions & 5 deletions crates/rspack_ast/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
10 changes: 5 additions & 5 deletions crates/rspack_ast_viewer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 5 additions & 5 deletions crates/rspack_base64/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"] }
Expand Down
10 changes: 5 additions & 5 deletions crates/rspack_futures/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"] }
10 changes: 5 additions & 5 deletions crates/rspack_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 5 additions & 5 deletions crates/rspack_napi_macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 5 additions & 5 deletions crates/rspack_tracing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
86 changes: 81 additions & 5 deletions justfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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

shulaoda marked this conversation as resolved.
Show resolved Hide resolved
# 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
Loading