Skip to content
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
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- **Leptos SSR/hydrate**: Use browser dev tools to check hydration mismatches. Ensure client-only code is gated with `#[cfg(feature = "hydrate")]`.
- **ML training**: Models saved in `kord/model/`. Training data expected in specific formats - check `KordItem` struct and `TrainConfig` paths.
- **Feature compilation**: Complex feature dependencies - use `cargo check --features "..."` to verify specific combinations work.
- **Tool installation**: Use `cargo-binstall` for faster installation of cargo tools (cargo-make, cargo-leptos, wasm-pack). Install via: `curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash`

## Where to Change Things (examples)
- Extend chord grammar: edit `kord/chord.pest` and parser in `kord/src/core/parser.rs` (mirror existing rule patterns and tests).
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Copilot Setup Steps"

# Optional but recommended: lets you validate it via PRs, and manually from Actions tab.
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# Copilot requires this exact job name.
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2025-12-22
components: rustfmt, clippy

# rust-cache should run AFTER toolchain selection (it keys off rustc version).
- name: Rust cache
uses: Swatinem/rust-cache@v2

# Installs using cargo-binstall under the hood.
- name: Install cargo tools (prebuilt)
uses: brndnmtthws/rust-action-cargo-binstall@v1
with:
packages: cargo-make cargo-leptos wasm-pack wkg cargo-nextest cargo-llvm-cov leptosfmt

- name: Prefetch deps
run: cargo fetch

- name: Smoke build (core)
run: cargo make build
13 changes: 9 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,20 @@ cargo make test
```bash
cargo clean -p kord-web && cargo check -p kord-web --features ssr,hydrate
```
- If `cargo leptos` is missing, install it:
- If `cargo leptos` is missing, install it (prefer binstall for speed):
```bash
cargo install cargo-leptos
cargo binstall cargo-leptos
# or: cargo install cargo-leptos
```
- WASM/WASI tooling often needed for advanced flows:
```bash
cargo install wkg # for OCI publishing
cargo install wasm-pack # for npm/wasm builds
cargo binstall wkg # for OCI publishing
cargo binstall wasm-pack # for npm/wasm builds
brew install wasmtime || sudo apt-get install wasmtime
```
- For faster tool installation, use cargo-binstall:
```bash
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
```

---
Expand Down
14 changes: 9 additions & 5 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ Before running the release process, ensure you have:
- ✅ **npm authentication**: `npm login` or `npm adduser`
- ✅ **GitHub Container Registry authentication**: `docker login ghcr.io -u USERNAME`
- ✅ **wasm32-wasip2 target**: `rustup target add wasm32-wasip2`
- ✅ **Required tools**:
- ✅ **Required tools** (prefer cargo-binstall for speed):
```bash
cargo install cargo-release # For version bumping
cargo install cargo-make # For task orchestration
cargo install wkg # For OCI publishing
cargo install wasm-pack # For npm WASM builds
# Install cargo-binstall first for faster subsequent installations
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

# Then install tools via binstall
cargo binstall --no-confirm cargo-release # For version bumping
cargo binstall --no-confirm cargo-make # For task orchestration
cargo binstall --no-confirm wkg # For OCI publishing
cargo binstall --no-confirm wasm-pack # For npm WASM builds
```

### Complete Release Process
Expand Down
50 changes: 42 additions & 8 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,57 @@ dependencies = ["install-cargo-binstall"]
command = "cargo"
args = ["binstall", "wkg", "--no-confirm"]

[tasks.install-leptosfmt]
dependencies = ["install-cargo-binstall"]
command = "cargo"
args = ["binstall", "leptosfmt", "--no-confirm"]

[tasks.install-cargo-release]
dependencies = ["install-cargo-binstall"]
command = "cargo"
args = ["binstall", "cargo-release", "--no-confirm"]

[tasks.install-cargo-leptos]
dependencies = ["install-cargo-binstall"]
command = "cargo"
args = ["binstall", "cargo-leptos", "--no-confirm"]

[tasks.install-sd]
dependencies = ["install-cargo-binstall"]
command = "cargo"
args = ["binstall", "sd", "--no-confirm"]

[tasks.tools]
dependencies = [
"install-nextest",
"install-llvm-cov",
"install-wasm-pack",
"install-wkg",
"install-leptosfmt",
"install-cargo-release",
"install-cargo-leptos",
"install-sd",
]

# Build / test tasks.

[tasks.fmt]
[tasks.fmt-rust]
cwd = "."
workspace = false
command = "cargo"
args = ["fmt"]

[tasks.fmt-leptos]
cwd = "."
workspace = false
dependencies = ["install-leptosfmt"]
command = "leptosfmt"
args = ["kord-web/**/*.rs"]

[tasks.fmt]
workspace = false
dependencies = ["fmt-rust", "fmt-leptos"]

[tasks.build]
cwd = "."
workspace = false
Expand All @@ -56,7 +91,7 @@ args = ["build"]
[tasks.test]
cwd = "."
workspace = false
install_crate = "cargo-nextest"
dependencies = ["install-nextest"]
command = "cargo"
args = ["nextest", "run", "--features", "ml_train ml_infer ml_sample_process"]

Expand All @@ -83,7 +118,7 @@ args = ["test", "--${WASM_TEST_BROWSER}", "--headless", "--features", "hydrate"]
[tasks.test-web-server]
cwd = "kord-web"
workspace = false
install_crate = "cargo-nextest"
dependencies = ["install-nextest"]
command = "cargo"
args = ["nextest", "run", "--lib"]

Expand Down Expand Up @@ -155,7 +190,7 @@ dependencies = ["fmt", "test"]
[tasks.release]
cwd = "."
workspace = false
install_crate = "cargo-release"
dependencies = ["install-cargo-release"]
command = "cargo"
args = ["release", "--workspace", "--no-publish", "--execute"]

Expand All @@ -167,7 +202,7 @@ args = ["build", "--release", "--bin", "kord", "-p", "kord"]

[tasks.build-npm]
cwd = "kord"
install_crate = "wasm-pack"
dependencies = ["install-wasm-pack"]
command = "wasm-pack"
args = [
"build",
Expand All @@ -183,7 +218,7 @@ args = [

[tasks.build-web]
cwd = "kord-web"
install_crate = "cargo-leptos"
dependencies = ["install-cargo-leptos"]
command = "cargo"
args = ["leptos", "build", "--release"]

Expand Down Expand Up @@ -217,8 +252,7 @@ args = [
]

[tasks.rename-npm-package]
dependencies = ["build-npm"]
install_crate = "sd"
dependencies = ["build-npm", "install-sd"]
cwd = "pkg"
command = "sd"
args = ["\"name\": \"kord\"", "\"name\": \"kordweb\"", "package.json"]
Expand Down
15 changes: 13 additions & 2 deletions kord-web/src/app/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ pub fn DescribePage() -> impl IntoView {
<PageTitle>"Describe a Chord"</PageTitle>
<section class="kord-describe">
<Flex vertical=true gap=FlexGap::Large>
<Flex vertical=true gap=FlexGap::Medium class="kord-content__section kord-describe__card">
<Flex
vertical=true
gap=FlexGap::Medium
class="kord-content__section kord-describe__card"
>
<div class="kord-describe__hint">
<p>"Type any chord symbol to see its full breakdown."</p>
<p>"We support complex extensions like Cm7(#11)/G or Cø7."</p>
Expand All @@ -75,7 +79,14 @@ pub fn DescribePage() -> impl IntoView {
<h3 class="kord-describe__results-title">"Chord Breakdown"</h3>
<Show
when=move || chord_result.with(|result| result.is_some())
fallback=move || view! { <p class="kord-describe__empty">"Enter a chord symbol to preview its structure."</p> }.into_view()
fallback=move || {
view! {
<p class="kord-describe__empty">
"Enter a chord symbol to preview its structure."
</p>
}
.into_view()
}
>
{move || {
let chord = chord_result.get().expect("chord exists when show renders");
Expand Down
Loading
Loading