Skip to content

Commit

Permalink
chore(infra): justfile and fmt the toml files (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter authored Jul 2, 2024
1 parent b2eb21b commit 44090d4
Show file tree
Hide file tree
Showing 19 changed files with 120 additions and 80 deletions.
15 changes: 3 additions & 12 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,17 @@ tu = "run -p cargo-rst -- update"


[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.x86_64-unknown-linux-musl]
rustflags = [
"-C",
"target-feature=-crt-static",
]
rustflags = ["-C", "target-feature=-crt-static"]
9 changes: 9 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include = [
"Cargo.toml",
"crates/*/*.toml",
"tasks/*/*.toml",
]

[formatting]
align_entries = true
column_width = 120
20 changes: 7 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
cargo-features = ["strip"]

[workspace]
members = ["crates/*", "tasks/*"]
members = ["crates/*", "tasks/*"]
resolver = "2"

[workspace.features]
serializable = ["serde"]

[workspace.dependencies]
markdown = "=1.0.0-alpha.16"
serde = { version = "1.0.130" }
swc_core = { version = "0.79.0", features = [
"ecma_ast",
"ecma_visit",
"ecma_codegen",
"ecma_parser",
"common",
] }
pretty_assertions="1.3.0"
serde_yaml = "0.9.19"
serde_json = "1.0.70"
markdown = "=1.0.0-alpha.16"
serde = { version = "1.0.130" }
swc_core = { version = "0.79.0", features = ["ecma_ast", "ecma_visit", "ecma_codegen", "ecma_parser", "common"] }
pretty_assertions = "1.3.0"
serde_yaml = "0.9.19"
serde_json = "1.0.70"
10 changes: 5 additions & 5 deletions crates/binding/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "mdx_rs_binding"
name = "mdx_rs_binding"
version = "0.1.0"
edition = "2021"

Expand All @@ -17,14 +17,14 @@ mimalloc-rust = { version = "0.2", features = ["local-dynamic-tls"] }
[dependencies]
mdx_rs = { path = "../mdx_rs" }
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.9.1", default-features = false, features = ["napi7"] }
napi-derive = "2.9.1"
napi = { version = "2.9.1", default-features = false, features = ["napi7"] }
napi-derive = "2.9.1"
crossbeam-channel = "0.5.6"
mdx_plugin_toc = { path = "../plugin_toc" }
mdx_plugin_toc = { path = "../plugin_toc" }

[build-dependencies]
napi-build = "2.0.1"

[profile.release]
lto = true
lto = true
codegen-units = 1
4 changes: 2 additions & 2 deletions crates/hast/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "hast"
name = "hast"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
markdown = { workspace = true }
markdown = { workspace = true }
pretty_assertions = { workspace = true }
28 changes: 14 additions & 14 deletions crates/mdx_rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = "mdx_rs"
name = "mdx_rs"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
mdx_plugin_code_block = { path = "../plugin_code_block" }
mdx_plugin_highlighter = { path = "../plugin_highlighter" }
mdx_plugin_container = { path = "../plugin_container" }
mdx_plugin_external_link = { path = "../plugin_external_link" }
mdx_plugin_frontmatter = { path = "../plugin_frontmatter" }
mdx_plugin_header_anchor = { path = "../plugin_header_anchor" }
mdx_plugin_code_block = { path = "../plugin_code_block" }
mdx_plugin_highlighter = { path = "../plugin_highlighter" }
mdx_plugin_container = { path = "../plugin_container" }
mdx_plugin_external_link = { path = "../plugin_external_link" }
mdx_plugin_frontmatter = { path = "../plugin_frontmatter" }
mdx_plugin_header_anchor = { path = "../plugin_header_anchor" }
mdx_plugin_normalize_link = { path = "../plugin_normalize_link" }
mdx_plugin_toc = { path = "../plugin_toc" }
mdx_plugin_html = { path = "../plugin_html" }
hast = { path = "../hast" }
markdown = { workspace = true }
pretty_assertions = { workspace = true }
swc_core = { workspace = true }
slugger = { path = "../slugger" }
mdx_plugin_toc = { path = "../plugin_toc" }
mdx_plugin_html = { path = "../plugin_html" }
hast = { path = "../hast" }
markdown = { workspace = true }
pretty_assertions = { workspace = true }
swc_core = { workspace = true }
slugger = { path = "../slugger" }
6 changes: 3 additions & 3 deletions crates/plugin_code_block/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "mdx_plugin_code_block"
name = "mdx_plugin_code_block"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hast = { path = "../hast" }
swc_core = { workspace = true }
hast = { path = "../hast" }
swc_core = { workspace = true }
8 changes: 4 additions & 4 deletions crates/plugin_container/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "mdx_plugin_container"
version = "0.1.0"
edition = "2021"
name = "mdx_plugin_container"
version = "0.1.0"
edition = "2021"
keywords = ["markdown", "mdx", "compile"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hast = { path = "../hast" }
hast = { path = "../hast" }
4 changes: 2 additions & 2 deletions crates/plugin_external_link/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "mdx_plugin_external_link"
name = "mdx_plugin_external_link"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hast = { path = "../hast" }
hast = { path = "../hast" }
6 changes: 3 additions & 3 deletions crates/plugin_frontmatter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "mdx_plugin_frontmatter"
name = "mdx_plugin_frontmatter"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
markdown = { workspace = true }
markdown = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
serde_yaml = { workspace = true }
6 changes: 3 additions & 3 deletions crates/plugin_header_anchor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "mdx_plugin_header_anchor"
name = "mdx_plugin_header_anchor"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hast = { path = "../hast" }
hast = { path = "../hast" }
slugger = { path = "../slugger" }
utils = { path = "../utils" }
utils = { path = "../utils" }
4 changes: 2 additions & 2 deletions crates/plugin_highlighter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "mdx_plugin_highlighter"
name = "mdx_plugin_highlighter"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
markdown = { workspace = true }
markdown = { workspace = true }
4 changes: 2 additions & 2 deletions crates/plugin_html/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "mdx_plugin_html"
name = "mdx_plugin_html"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hast = { path = "../hast" }
hast = { path = "../hast" }
4 changes: 2 additions & 2 deletions crates/plugin_normalize_link/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "mdx_plugin_normalize_link"
name = "mdx_plugin_normalize_link"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hast = { path = "../hast" }
hast = { path = "../hast" }
markdown = { workspace = true }
6 changes: 3 additions & 3 deletions crates/plugin_toc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "mdx_plugin_toc"
name = "mdx_plugin_toc"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
markdown = { workspace = true }
slugger = { path = "../slugger" }
utils = { path = "../utils" }
slugger = { path = "../slugger" }
utils = { path = "../utils" }
6 changes: 3 additions & 3 deletions crates/slugger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "slugger"
name = "slugger"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
regex = "1.5.4"
lazy_static = "1.4.0"
regex = "1.5.4"
lazy_static = "1.4.0"
4 changes: 2 additions & 2 deletions crates/utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "utils"
name = "utils"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
[dependencies]
46 changes: 46 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env -S just --justfile

# https://github.com/oxc-project/oxc/blob/main/justfile
_default:
just --list -u

alias r := ready
alias c := codecov
alias t := test

# Initialize the project by installing all the necessary tools.
# Make sure you have cargo-binstall installed.
# You can download the pre-compiled binary from <https://github.com/cargo-bins/cargo-binstall#installation>
# or install via `cargo install cargo-binstall`
init:
cargo binstall cargo-nextest cargo-watch cargo-insta cargo-edit typos-cli taplo-cli cargo-llvm-cov -y

# When ready, run the same CI commands
ready:
typos
cargo fmt
just check
just test
just lint
git status

# Format all files
fmt:
cargo fmt
taplo format

# Run cargo check
check:
cargo check --workspace --all-targets --all-features --locked

# Run all the tests
test:
cargo nextest run

# Lint the whole project
lint:
cargo clippy --workspace --all-targets --all-features -- --deny warnings

# Get code coverage
codecov:
cargo codecov --html
10 changes: 5 additions & 5 deletions tasks/benchmark/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "mdx_rs_benchmark"
version = "0.0.0"
publish = false
name = "mdx_rs_benchmark"
version = "0.0.0"
publish = false


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
mdx_rs = { path = "../../crates/mdx_rs" }
mdx_rs = { path = "../../crates/mdx_rs" }
criterion = { version = "0.5.1", default-features = false }
pico-args = {version = "0.5.0"}
pico-args = { version = "0.5.0" }

0 comments on commit 44090d4

Please sign in to comment.