Workspace, build tooling and CI: the cl command, profiles, one feature set, workflows

This commit is contained in:
aiongg
2026-11-12 14:09:31 +00:00
parent 6cb00467a5
commit 673e9e8e63
33 changed files with 2125 additions and 1450 deletions
+5
View File
@@ -39,6 +39,11 @@ jobs:
targets: wasm32-unknown-unknown
- run: cargo fmt --check
- run: cargo clippy -p craft-ai-core --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-ai-core --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-ai-core --locked
# The model promises to compile for the web.
- run: cargo check -p craft-ai-core --target wasm32-unknown-unknown --locked
+5
View File
@@ -41,6 +41,11 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y acl
- run: cargo fmt --check
- run: cargo clippy -p craft-atomic -p craft-settings --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-atomic -p craft-settings --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-atomic -p craft-settings --locked -- --nocapture
- name: Check inherited Linux ACLs
if: runner.os == 'Linux'
+6 -1
View File
@@ -45,6 +45,11 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: cargo fmt -p craft-crw --check
- run: cargo clippy -p craft-crw --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-crw --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-crw --locked
wasm:
@@ -95,7 +100,7 @@ jobs:
key: crw-samples-${{ hashFiles('crates/crw/tests/samples.json') }}
- name: Fetch the pinned CC0 sample files (raw.pixls.us)
run: python scripts/fetch-crw-samples.py "$RUNNER_TEMP/crw-samples"
- run: cargo test -p craft-crw --release --locked --test samples -- --nocapture
- run: cargo test -p craft-crw --release --locked --lib -- integration::samples --nocapture
env:
CRAFT_CRW_SAMPLES: ${{ runner.temp }}/crw-samples
CRAFT_CRW_REQUIRE_SAMPLES: "1"
+4
View File
@@ -39,4 +39,8 @@ jobs:
targets: aarch64-apple-darwin
- run: cargo clippy -p craft-dialogs --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-dialogs --target aarch64-apple-darwin --locked -- -D warnings
- name: Docs (links and missing docs)
run: cargo doc -p craft-dialogs --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-dialogs --locked
+5
View File
@@ -42,6 +42,11 @@ jobs:
- run: cargo fmt --check
- run: cargo clippy -p craft-doc --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-doc --all-targets --all-features --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-doc --all-features --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-doc --locked -- --nocapture
- run: cargo test -p craft-doc --all-features --locked -- --nocapture
- run: cargo check -p craft-doc --all-features --locked --target wasm32-unknown-unknown
+5
View File
@@ -38,4 +38,9 @@ jobs:
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy -p craft-docpath --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-docpath --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-docpath --locked -- --nocapture
+33
View File
@@ -0,0 +1,33 @@
name: Docs
# Builds the documentation of every workspace crate with warnings as errors, so a public item
# without a doc comment or a broken doc link fails, including crates no other workflow covers.
on:
workflow_dispatch:
push:
branches: [main]
paths: ['crates/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/docs.yml']
pull_request:
paths: ['crates/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/docs.yml']
permissions:
contents: read
jobs:
docs:
timeout-minutes: 30
name: Workspace docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# The token isn't needed after checkout; cargo runs build scripts and proc macros from
# dependencies, so don't leave it in .git/config for that third-party code to read.
persist-credentials: false
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: Docs (links and missing docs)
run: cargo doc --workspace --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
+5
View File
@@ -41,5 +41,10 @@ jobs:
targets: wasm32-unknown-unknown
- run: cargo fmt --check
- run: cargo clippy -p craft-ecproj-format --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-ecproj-format --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-ecproj-format --locked -- --nocapture
- run: cargo check -p craft-ecproj-format --locked --target wasm32-unknown-unknown
+5
View File
@@ -39,6 +39,11 @@ jobs:
targets: wasm32-unknown-unknown
- run: cargo fmt --check
- run: cargo clippy -p craft-font-store --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-font-store --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-font-store --locked
- run: cargo clippy -p craft-font-catalog --all-targets --locked -- -D warnings
- run: cargo test -p craft-font-catalog --locked
+5
View File
@@ -38,4 +38,9 @@ jobs:
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy -p craft-i18n --all-targets --features collate --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-i18n --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-i18n --features collate --locked -- --nocapture
+4
View File
@@ -42,5 +42,9 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: cargo fmt -p craft-jpeg --check
- run: cargo clippy -p craft-jpeg --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
run: cargo doc -p craft-jpeg --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-jpeg --locked
- run: cargo check -p craft-jpeg --locked --target wasm32-unknown-unknown
+8 -4
View File
@@ -3,9 +3,9 @@ name: Keymap
on:
push:
branches: [main]
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
pull_request:
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
workflow_dispatch:
permissions:
@@ -50,9 +50,13 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: cargo fmt -p craft-keymap --check
- run: cargo clippy -p craft-keymap --all-targets --no-default-features --locked -- -D warnings
# `snapshot` covers `ui` and `egui` and compiles the dialog screenshots, which need a GPU
# `screen-testing` covers `ui` and compiles the dialog screenshots, which need a GPU
# to run, so the test steps leave them out.
- run: cargo clippy -p craft-keymap --all-targets --features snapshot --locked -- -D warnings
- run: cargo clippy -p craft-keymap --all-targets --features screen-testing --locked -- -D warnings
- name: Docs (links and missing docs)
run: cargo doc -p craft-keymap --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
# Doctests run once, in the `ui` step.
- name: Test core
run: cargo test -p craft-keymap --no-default-features --lib --tests --locked
+4
View File
@@ -49,6 +49,10 @@ jobs:
- run: cargo clippy -p craft-media --all-targets --locked --all-features -- -D warnings
- run: cargo clippy -p craft-media-testkit --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-media --all-targets --locked --no-default-features --features serde -- -D warnings
- name: Docs (links and missing docs)
run: cargo doc -p craft-media -p craft-media-testkit --all-features --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo check -p craft-media --all-features --locked --target wasm32-unknown-unknown
test:
timeout-minutes: 15
+5
View File
@@ -41,5 +41,10 @@ jobs:
targets: wasm32-unknown-unknown
- run: cargo fmt --check
- run: cargo clippy -p craft-pcraft-format --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-pcraft-format --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-pcraft-format --locked -- --nocapture
- run: cargo check -p craft-pcraft-format --locked --target wasm32-unknown-unknown
+5
View File
@@ -54,6 +54,11 @@ jobs:
echo "CRAFT_PDF_TEST_FONT_DIR=$RUNNER_TEMP/craft-pdf-test-fonts" >> "$GITHUB_ENV"
- run: cargo fmt --check
- run: cargo clippy -p craft-pdf --all-targets --all-features --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-pdf --all-features --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-pdf --all-features --locked
- run: cargo test --manifest-path crates/pdf/read-only-contract/Cargo.toml --locked
backends:
+5
View File
@@ -34,6 +34,11 @@ jobs:
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy -p craft-print --all-targets -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-print --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- name: Prepare the Windows test driver
if: runner.os == 'Windows'
shell: powershell
+42
View File
@@ -0,0 +1,42 @@
name: Suite themes
on:
workflow_dispatch:
push:
branches: [main]
paths: ['crates/theme/**', 'crates/theme-store/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/theme.yml']
pull_request:
paths: ['crates/theme/**', 'crates/theme-store/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/theme.yml']
permissions:
contents: read
jobs:
theme:
timeout-minutes: 15
name: Theme lint, tests, WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# The token isn't needed after checkout; cargo runs build scripts and proc macros from
# dependencies, so don't leave it in .git/config for that third-party code to read.
persist-credentials: false
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
components: rustfmt, clippy
targets: wasm32-unknown-unknown
- run: cargo fmt -p craft-theme --check
- run: cargo clippy -p craft-theme --all-targets --all-features --locked -- -D warnings
- run: cargo clippy -p craft-theme --all-targets --locked -- -D warnings
- run: cargo test -p craft-theme --all-features --locked
- run: cargo check -p craft-theme --all-features --locked --target wasm32-unknown-unknown
- run: cargo check -p craft-ui --lib --locked
- run: cargo fmt -p craft-theme-store --check
- run: cargo clippy -p craft-theme-store --all-targets --all-features --locked -- -D warnings
- name: Docs (links and missing docs)
run: cargo doc -p craft-theme -p craft-theme-store --all-features --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-theme-store --all-features --locked
- run: cargo check -p craft-theme-store --all-features --locked --target wasm32-unknown-unknown
+11 -6
View File
@@ -3,9 +3,9 @@ name: Shared UI
on:
push:
branches: [main]
paths: ["crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
paths: ["crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/ui-macros/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
pull_request:
paths: ["crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
paths: ["crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/ui-macros/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
workflow_dispatch:
permissions:
@@ -49,10 +49,15 @@ jobs:
key: craft-ui
save-if: ${{ github.ref == 'refs/heads/main' }}
- run: cargo fmt --check
- run: cargo clippy -p craft-ui --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-ui --all-targets --all-features --locked -- -D warnings
- run: cargo test -p craft-ui --locked
- run: cargo test -p craft-ui --all-features --locked
- run: cargo clippy -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-targets --all-features --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-features --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --locked
- run: cargo test -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-features --locked
wasm:
timeout-minutes: 15
name: UI WASM
+8 -3
View File
@@ -41,8 +41,13 @@ jobs:
toolchain: stable
components: rustfmt, clippy
- run: cargo fmt --check
# Default (no egui) and the egui feature both build and lint cleanly.
# Default (no egui) and the ui feature both build and lint cleanly.
- run: cargo clippy -p craft-update --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-update --all-targets --locked --features egui -- -D warnings
- run: cargo clippy -p craft-update --all-targets --locked --features ui -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-update --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-update --locked -- --nocapture
- run: cargo test -p craft-update --locked --features egui -- --nocapture
- run: cargo test -p craft-update --locked --features ui -- --nocapture
+5
View File
@@ -41,5 +41,10 @@ jobs:
targets: wasm32-unknown-unknown
- run: cargo fmt --check
- run: cargo clippy -p craft-vectorcraft-format --all-targets --locked -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-vectorcraft-format --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-vectorcraft-format --locked -- --nocapture
- run: cargo check -p craft-vectorcraft-format --locked --target wasm32-unknown-unknown
+4
View File
@@ -53,5 +53,9 @@ jobs:
- run: cargo fmt --check
- run: cargo clippy -p craft-web-api --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-web-api --all-targets --locked --target wasm32-unknown-unknown -- -D warnings
- name: Docs (links and missing docs)
run: cargo doc -p craft-web-api --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-web-api --locked
- run: cargo test -p craft-web-api --locked --target wasm32-unknown-unknown
+4
View File
@@ -45,6 +45,10 @@ jobs:
- run: cargo fmt -p craft-web-host --check
- run: cargo clippy -p craft-web-host --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-web-host --all-targets --locked --target wasm32-unknown-unknown -- -D warnings
- name: Docs (links and missing docs)
run: cargo doc -p craft-web-host --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-web-host --locked
- name: Read the wasm-bindgen version from Cargo.lock
id: wasm-bindgen
+8 -3
View File
@@ -41,8 +41,13 @@ jobs:
toolchain: stable
components: rustfmt, clippy
- run: cargo fmt --check
# Default (no egui) and the egui feature both build and lint cleanly.
# Default (no egui) and the ui feature both build and lint cleanly.
- run: cargo clippy -p craft-window --all-targets --locked -- -D warnings
- run: cargo clippy -p craft-window --all-targets --locked --features egui -- -D warnings
- run: cargo clippy -p craft-window --all-targets --locked --features ui -- -D warnings
- name: Docs (links and missing docs)
if: runner.os == 'Linux'
run: cargo doc -p craft-window --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings
- run: cargo test -p craft-window --locked -- --nocapture
- run: cargo test -p craft-window --locked --features egui -- --nocapture
- run: cargo test -p craft-window --locked --features ui -- --nocapture
+3 -3
View File
@@ -14,6 +14,8 @@ author, source and license. Library code and original assets are under the repos
| `crates/cms/tests/data/FOGRA39.txt` (unmodified) | Fogra | [Fogra characterisation data](https://fogra.org/en/downloads/work-tools/characterisation-data), `FOGRA39_to_FOGRA60_v2.zip` | Fogra terms: free use and redistribution, unmodified, with Fogra identified as the source; "FOGRA39" identifies the reference data only and implies no certification, approval or endorsement by Fogra (full text in [NOTICE](NOTICE)) |
| `vendor/linesweeper/tests/regression/`, `vendor/linesweeper/proptest-regressions/`, the `.snap` files under `vendor/linesweeper/src/` and the path data in `vendor/linesweeper/benches/painted_dreams.rs` (all unmodified; hashes in `vendor/linesweeper/SOURCE.json`) | As published in the package, whose manifest names Joe Neeman as author and records no other source | [linesweeper 0.5.0](https://crates.io/crates/linesweeper/0.5.0) | MIT OR Apache-2.0 (the package's `license` field) |
| `crates/i18n/data/collation.postcard` | Unicode, Inc. (ICU 78.1 collation data, CLDR 48.2.1); generated by `crates/i18n/data/generate-collation.sh` | [ICU](https://github.com/unicode-org/icu/releases/tag/release-78.1rc) | Unicode-3.0 |
| `crates/i18n/data/numbers.postcard` | Unicode, Inc. (CLDR 48.2.1 decimal symbols, digits and plural rules); generated by `crates/i18n/data/generate.sh` with `icu4x-datagen` 2.3.0 | [CLDR 48.2.1](https://cldr.unicode.org/) | Unicode-3.0 |
| `crates/i18n/data/dates.postcard` | Unicode, Inc. (CLDR 48.2.1 Gregorian date and time patterns, month and weekday names, week data); generated by `crates/i18n/data/generate.sh` with `icu4x-datagen` 2.3.0 | [CLDR 48.2.1](https://cldr.unicode.org/) | Unicode-3.0 |
| `crates/text/assets/hyphen/en-us.dic` | Grady Ward (Moby Hyphenator II), converted by DesignCraft | [Project Gutenberg eBook #3204](https://www.gutenberg.org/ebooks/3204) | Public domain |
| `crates/proof/data/en-words.dic` | Grady Ward (Moby Hyphenator II word list); break points dropped by craft-proof contributors with `crates/proof/examples/en_words.rs` | [Project Gutenberg eBook #3204](https://www.gutenberg.org/ebooks/3204), via craft-i18n `language-data/en-us/en-us.dic` | Public domain |
| `crates/proof/data/en-extra.txt` | WordCraft contributors (original list, no other dictionary copied) | craft-i18n `language-data/en-us/en-extra.txt` | MIT OR Apache-2.0 |
@@ -22,9 +24,7 @@ author, source and license. Library code and original assets are under the repos
| Word-break dictionaries and LSTM models embedded through `icu_segmenter_data` (optional `craft-text` features `thai`, `lao`, `khmer`, `burmese`) | Unicode, Inc. and ICU4X contributors | [ICU4X](https://github.com/unicode-org/icu4x) | Unicode-3.0 |
| `crates/ui/tests/fonts/NotoSansArabic-test.ttf` (subset to the test strings, default weight set to 100, width axis dropped) | The Noto Project Authors | [google/fonts@7085eb8 `ofl/notosansarabic`](https://github.com/google/fonts/tree/7085eb89a950e85db5b166b7a58d414544b4140c/ofl/notosansarabic), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansArabic.txt`) |
| `crates/ui/tests/fonts/NotoSansCJKsc-test.otf` (subset to the test strings) | The Noto Project Authors (Adobe, Google) | [notofonts/noto-cjk@f8d1575 `Sans/OTF/SimplifiedChinese`](https://github.com/notofonts/noto-cjk/tree/f8d157532fbfaeda587e826d4cd5b21a49186f7c/Sans/OTF/SimplifiedChinese), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansCJK.txt`) |
| `crates/ui/tests/fonts/NotoSansArabic-screens.ttf` (instance at weight 400 and width 100, subset to the screen test strings) | The Noto Project Authors | [google/fonts@7085eb8 `ofl/notosansarabic`](https://github.com/google/fonts/tree/7085eb89a950e85db5b166b7a58d414544b4140c/ofl/notosansarabic), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansArabic.txt`) |
| `crates/ui/tests/fonts/NotoSansCJKsc-screens.otf` (subset to printable ASCII and the screen test strings) | The Noto Project Authors (Adobe, Google) | [notofonts/noto-cjk@f8d1575 `Sans/OTF/SimplifiedChinese`](https://github.com/notofonts/noto-cjk/tree/f8d157532fbfaeda587e826d4cd5b21a49186f7c/Sans/OTF/SimplifiedChinese), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansCJK.txt`) |
| `crates/ui/tests/fonts/NotoSansThai-screens.ttf` (instance at weight 400 and width 100, subset to the screen test strings) | The Noto Project Authors | [google/fonts@8b0a1d0 `ofl/notosansthai`](https://github.com/google/fonts/tree/8b0a1d0f5983c89bc2b93f1b5fb55f9e252744b5/ofl/notosansthai), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansThai.txt`) |
| `crates/imaging/tests/fonts/NotoSansArabic-digits.ttf` (instance at weight 400 and width 100, subset to the Arabic-Indic digits and separators U+0660–U+066C) | The Noto Project Authors | [google/fonts@7085eb8 `ofl/notosansarabic`](https://github.com/google/fonts/tree/7085eb89a950e85db5b166b7a58d414544b4140c/ofl/notosansarabic), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansArabic.txt`) |
| `crates/crw/tests/samples.json` (manifest only; the 11 raw files are not bundled, `scripts/fetch-crw-samples.py` downloads them outside the checkout) | The photographers who contributed each file to raw.pixls.us (Canon EOS D30, D60, 10D ×3, 300D ×2, Digital Rebel, PowerShot G1, G5, G6) | [raw.pixls.us](https://raw.pixls.us/), each file's `getfile.php` URL and SHA-256 in the manifest | CC0-1.0 (as published by raw.pixls.us for each file) |
| `crates/crw/src/tables.rs`, `crates/crw/clean-room/logs/table_sel*.json` | craft-crw contributors (derived in LightCraft, 2026-10, by known-plaintext alignment of the sample files' entropy streams; `crates/crw/clean-room/02-crw-format.md`) | this repository | MIT OR Apache-2.0 |
| `crates/crw/clean-room/logs/private-corpus.tsv` (file names, sizes and SHA-256 of the maintainer's own EOS D60 files; no image content) | craft-crw contributors (LightCraft derivation record) | this repository | MIT OR Apache-2.0 |
Generated
+1515 -1391
View File
File diff suppressed because it is too large Load Diff
+88 -14
View File
@@ -15,6 +15,7 @@ repository = "https://github.com/storytold/craft-libs"
craft-platform = { path = "crates/platform" }
craft-aep = { path = "crates/aep" }
craft-affinity = { path = "crates/affinity" }
craft-win32 = { path = "crates/win32" }
craft-ai-core = { path = "crates/ai-core" }
craft-pdf = { path = "crates/pdf", version = "=0.1.0" }
craft-pdn = { path = "crates/pdn" }
@@ -27,6 +28,7 @@ bytemuck = "1"
kurbo = "0.13"
thiserror = "2"
craft-aaf = { path = "crates/aaf" }
craft-behavior = { path = "crates/behavior" }
craft-atomic = { path = "crates/atomic" }
craft-captions = { path = "crates/captions" }
craft-cfb = { path = "crates/cfb" }
@@ -36,6 +38,11 @@ craft-crs = { path = "crates/crs" }
craft-crw = { path = "crates/crw" }
craft-csv = { path = "crates/csv" }
craft-dav = { path = "crates/dav" }
craft-automation = { path = "crates/automation" }
craft-browse = { path = "crates/browse" }
craft = { path = "crates/craft" }
craft-color = { path = "crates/color" }
craft-design-lint = { path = "crates/design-lint" }
craft-dialogs = { path = "crates/dialogs" }
craft-doc-binary = { path = "crates/doc-binary" }
craft-docx = { path = "crates/docx" }
@@ -45,6 +52,7 @@ craft-eps = { path = "crates/eps" }
craft-doc = { path = "crates/doc" }
craft-docpath = { path = "crates/docpath" }
craft-dpx = { path = "crates/dpx" }
craft-draw = { path = "crates/draw" }
craft-ecproj-format = { path = "crates/ecproj-format" }
craft-figma-rest = { path = "crates/figma-rest" }
craft-exr = { path = "crates/exr" }
@@ -61,15 +69,18 @@ craft-html = { path = "crates/html" }
craft-heif = { path = "crates/heif" }
craft-fig = { path = "crates/fig" }
craft-fonts-build = { path = "crates/fonts-build" }
craft-host = { path = "crates/host" }
craft-i18n = { path = "crates/i18n" }
craft-idml = { path = "crates/idml" }
craft-jmap = { path = "crates/jmap" }
craft-ical = { path = "crates/ical" }
craft-imaging = { path = "crates/imaging" }
craft-jpeg = { path = "crates/jpeg" }
craft-kiwi = { path = "crates/kiwi" }
craft-keymap = { path = "crates/keymap" }
craft-assuan = { path = "crates/assuan" }
craft-kra = { path = "crates/kra" }
craft-layers = { path = "crates/layers" }
craft-audio = { path = "crates/audio" }
# No default features, so craft-audio's `encode` builds craft-media without `isobmff`.
craft-latex = { path = "crates/latex" }
@@ -94,6 +105,7 @@ craft-penpot = { path = "crates/penpot" }
craft-pcraft-format = { path = "crates/pcraft-format" }
craft-plotter = { path = "crates/plotter" }
craft-prepress = { path = "crates/prepress" }
craft-pages = { path = "crates/pages" }
craft-print = { path = "crates/print" }
craft-proof = { path = "crates/proof" }
craft-raster-codecs = { path = "crates/raster-codecs" }
@@ -104,6 +116,7 @@ craft-rtf = { path = "crates/rtf" }
craft-raw = { path = "crates/raw" }
craft-sheet = { path = "crates/sheet" }
craft-sketch = { path = "crates/sketch" }
craft-review = { path = "crates/review" }
craft-settings = { path = "crates/settings" }
craft-silhouette-studio = { path = "crates/silhouette-studio" }
craft-svg = { path = "crates/svg" }
@@ -114,7 +127,18 @@ craft-tga = { path = "crates/tga" }
craft-timeline = { path = "crates/timeline" }
craft-tiff = { path = "crates/tiff" }
craft-metadata = { path = "crates/metadata" }
craft-table = { path = "crates/table" }
craft-theme = { path = "crates/theme" }
craft-theme-store = { path = "crates/theme-store" }
craft-ui = { path = "crates/ui" }
craft-ui-canvas = { path = "crates/ui-canvas" }
craft-ui-contract = { path = "crates/ui-contract" }
craft-ui-panels = { path = "crates/ui-panels" }
craft-ui-patterns = { path = "crates/ui-patterns" }
craft-ui-shell = { path = "crates/ui-shell" }
craft-ui-test-kit = { path = "crates/ui-test-kit" }
craft-ui-widgets = { path = "crates/ui-widgets" }
craft-ui-macros = { path = "crates/ui-macros" }
craft-update = { path = "crates/update" }
craft-vcard = { path = "crates/vcard" }
craft-vectorcraft-format = { path = "crates/vectorcraft-format" }
@@ -131,11 +155,15 @@ craft-ews = { path = "crates/ews" }
craft-video = { path = "crates/video" }
craft-web-api = { path = "crates/web-api" }
craft-window = { path = "crates/window" }
# egui's colour types alone, for crates that convert to and from them without egui.
ecolor = { version = "0.37", default-features = false }
craft-web-host = { path = "crates/web-host" }
craft-webp = { path = "crates/webp" }
egui = { version = "0.37", default-features = false }
bitflags = "2"
md5 = { package = "md-5", version = "0.10", default-features = false }
rayon = "1"
smallvec = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
proptest = "1"
@@ -146,6 +174,9 @@ chrono = { version = "0.4.45", default-features = false, features = ["std"] }
[workspace.lints.rust]
unsafe_code = "forbid"
# Every public item has a doc comment; a self-evident field or variant carries
# `#[allow(missing_docs)]` instead.
missing_docs = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(craft_pdf_unicode_fixtures)"] }
[workspace.lints.clippy]
@@ -165,20 +196,20 @@ hayro-jbig2 = { path = "vendor/hayro-jbig2" }
hayro-cmap = { path = "vendor/hayro-cmap" }
hayro-postscript = { path = "vendor/hayro-postscript" }
linesweeper = { path = "vendor/linesweeper" }
ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui-winit = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_glow = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_extras = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
eframe = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
ecolor = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
emath = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
epaint = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
epaint_default_fonts = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui-winit = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui-wgpu = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui_glow = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui_extras = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui_kittest = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui_system_font_provider = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
eframe = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui_demo_lib = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
egui_inspection = { git = "https://github.com/aiongg/egui.git", rev = "4b93a86c52348eb53e883c9b6b9f59c573608e07" }
winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
# symphonia's FLAC decoder restores LPC samples as `residual + (prediction as i32)`. In a valid
@@ -196,3 +227,46 @@ opt-level = 3
# 2 MiB stack of a test thread. The apps this reader came from build their crates at this level.
[profile.dev.package.craft-affinity]
opt-level = 1
# Dev and test builds never run LTO: with `lto = false` (cargo's default) rustc runs thin-local LTO across every
# optimised crate's 256 codegen units on each rebuild, which multiplied the incremental rebuild of the framework
# crates. Off, a one-line edit re-optimises only the changed units.
[profile.dev]
lto = "off"
# Dependencies (egui, rendering, text shaping, syn) run optimised in dev and test builds, so
# screen tests, design-lint and the debug gallery run at a usable speed. They build once per
# target dir; the workspace's own crates stay unoptimised and incremental.
[profile.dev.package."*"]
opt-level = 2
# The workspace crates whose code runs in every screen-test frame (the framework runtime, the theme's colour maths
# and the behaviour cores), and craft-proof, whose tests parse and check whole dictionaries, build at opt-level 1:
# unoptimised, they made the test binaries several times slower. The crates above the runtime (widgets, panels,
# canvas, patterns, shell) stay at opt-level 0: their code is a few percent of a frame, and at opt-level 0 a one-line
# edit rebuilds in seconds instead of the better part of a minute.
[profile.dev.package.craft-ui-contract]
opt-level = 1
[profile.dev.package.craft-theme]
opt-level = 1
[profile.dev.package.craft-behavior]
opt-level = 1
[profile.dev.package.craft-proof]
opt-level = 1
# The gallery on the Mac: optimised like release, but the workspace's crates build in many small
# units, incrementally, so a change to craft-ui rebuilds in minutes. Dependencies keep release
# settings and build once in target/gallery. `cargo run --profile gallery -p craft-ui-gallery`.
[profile.gallery]
inherits = "release"
incremental = true
codegen-units = 256
opt-level = 1
# The workspace's own crates build at opt-level 1 in the gallery profile: rustc shares generic instantiations across
# crates at opt-level 0, 1, s and z only, so at 1 a change in a framework crate no longer makes every dependant
# re-generate its own copies of that crate's generics and inlined functions (a one-line edit rebuilt the gallery in
# 25 s at opt-level 1 and 69–84 s at 3). `package."*"` matches the dependencies only: they keep release optimisation,
# so this changes nothing in their settings.
[profile.gallery.package."*"]
codegen-units = 16
opt-level = 3
+6
View File
@@ -53,6 +53,12 @@ craft-proof Language data, embedded at build time from craft-i18n's language-dat
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
crates/text/assets/hyphen/en-us.pat: CC0-1.0, trained from en-us.dic by DesignCraft's trainer.
crates/text/assets/spell/en-us-scowl-50.txt.deflate: SCOWL (Spell Checker Oriented Word Lists)
2020.12.07, size 50, American English, Copyright 2000-2018 by Kevin Atkinson, http://wordlist.aspell.net/.
Permission to use, copy, modify, distribute and sell these word lists is granted without fee
provided the copyright and permission notice appears in all copies; the full notice, with the
notices of the lists SCOWL draws on, is in crates/text/assets/spell/LICENSE-SCOWL.txt and must
ship with any application that enables craft-text's `spell` feature.
Hyphenation patterns for other languages, embedded through the hypher crate only when the
matching craft-text feature is enabled (none are by default). They come from hyph-utf8,
https://github.com/hyphenation/tex-hyphen, as packaged in https://github.com/typst/hypher
+56 -21
View File
@@ -26,18 +26,19 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
## Libraries
- [`craft-platform`](crates/platform/README.md): optional native dialog lifecycle, Linux/BSD desktop appearance observation and browser download ownership; application policy stays in the apps.
- [`craft-aep`](crates/aep/README.md): After Effects projects: the `.aep` (RIFX) and `.aepx`
container as a lossless chunk tree that writes back byte for byte, and a typed, read-only view
of compositions, layers, properties, keyframes, effects, masks, shapes, text and footage.
Clean room, from EffectCraft. Mapping onto an app's document stays in the app.
- [`craft-ai-core`](crates/ai-core/README.md): the data model and contract for AI in the Craft Apps (connections, models, tools, requests, jobs, consent, history, route spec). Pure, no I/O, wasm-safe. Contract in [docs/ai-shared-layer.md](docs/ai-shared-layer.md).
- [`craft-pdf`](crates/pdf/README.md): independently optional PDF parsing, interpretation, rasterization and guarded authoring. Apps retain layout, fonts, editing and export policy; writer-only consumers do not enable the shared reader.
- [`craft-pdn`](crates/pdn/README.md): Paint.NET documents (`.pdn`, PDN3), read: the layer list, blend modes and chunked gzip pixel blocks, with a data-only MS-NRBF (.NET binary serialization) reader. From PhotoCraft.
- [`craft-aaf`](crates/aaf/README.md): clean-room AAF (Edit Protocol, structured storage) and OMF Interchange 2.0 (Bento) readers and writers over one mob-style composition model with exact times, clip gain, markers, nested compositions and embedded PCM essence. From FilmCraft.
- [`craft-assuan`](crates/assuan/README.md): the Assuan protocol and gpg-agent's operations (key lookup, signing a digest, decrypting a session key) over any `Read + Write` stream, with a bounded canonical S-expression reader. No sockets; everything the agent sends is capped.
- [`craft-affinity`](crates/affinity/README.md): bounded reader for native Affinity documents (`.af`, `.afdesign`, `.afphoto`, `.afpub`): archive, object stream and a neutral document model with layers, artboards, vectors, text, tables, images and masks. Read only; mapping onto an app's document stays in the app.
- [`craft-automation`](crates/automation/README.md): drive a running app from tests, agents and the CLI: control channel, screenshot queue, frame profiler and trace (native only); recorded actions, their playback and the Actions panel (every target).
- [`craft-atomic`](crates/atomic/README.md): Crash-safe atomic file writing and replacement with same-directory staging, directory fsync, Apple `F_FULLFSYNC` fallback, transient lock backoff, and fault injection for the Craft suite.
- [`craft-captions`](crates/captions/README.md): caption and subtitle files behind one neutral
model (cues with exact tick times): SubRip, WebVTT, Scenarist SCC, MacCaption MCC, EBU STL and
@@ -49,11 +50,17 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
- [`craft-dav`](crates/dav/README.md): WebDAV multistatus documents (RFC 4918) with the CalDAV and
CardDAV namespaces, from MailCraft: read fail-closed into a bounded `craft-xml` tree with fixed
prefixes, and the successful properties of each response. No I/O.
- [`craft-browse`](crates/browse/README.md): browsing: standard folders, volumes and lazy folder
listings, linked-file statuses kept current, file thumbnails decoded by the app in jobs, and
(`ui` feature) the tile grid, media bin, places tree, compare tile, links list and relink dialog.
- [`craft-cms`](crates/cms/README.md): pure-Rust ICC v2/v4 colour management: profile parsing
and writing, transforms, rendering intents, black point compensation, soft proofing, gamut
checks, 3D LUTs and built-in profiles (sRGB, Display P3, synthetic coated CMYK and others).
- [`craft-crs`](crates/crs/README.md): Adobe Camera Raw settings (the `crs:` namespace of an XMP packet or `.xmp` sidecar, read through craft-metadata): the settings by name, numbers, tone curve points, local corrections and the crop, read and written. From PhotoCraft.
- [`craft-codepage`](crates/codepage/README.md): legacy 8-bit code pages, one table each: the single-byte Windows pages, Mac OS Roman and fifteen DOS pages, keyed by Windows code page number, with the RTF/Word font charsets. craft-rtf, craft-dxf and craft-mime decode through it.
- [`craft-color`](crates/color/README.md): colour picker, wells, swatch tables, ramps and the hex
field; the Color Picker dialog, droppers, eyedropper, samplers, screen picker, Color and Swatches
panels (`ui` feature); swatch files, the display transform and harmonies.
- [`craft-crw`](crates/crw/README.md): clean-room Canon CRW (CIFF) raw decoder, from LightCraft:
the heap container, the entropy coding derived by black-box analysis (frozen code tables), sensor
black and white levels and as-shot white balance. The complete derivation record (plan, sources
@@ -71,6 +78,8 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
- [`craft-docpath`](crates/docpath/src/lib.rs): decides whether a path or `file:` URL stored in a
document may be opened. Paths stored in documents are followed only when they are local or on the
document's own network share; other network paths, device paths and non-file URLs are refused.
`links` keeps a document's linked files: their status, the identity check, folder remaps and
folder searches.
- [`craft-dpx`](crates/dpx/src/lib.rs): DPX (SMPTE ST 268) and Kodak Cineon frames, from PhotoCraft,
FilmCraft and EffectCraft: header fields and code values at 8, 10, 12 and 16 bits in both byte
orders, filled and packed, RGB, RGBA, ABGR, luma and Y'CbCr descriptors, and a writer for both
@@ -86,6 +95,9 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
- [`craft-docx`](crates/docx/README.md): DOCX (WordprocessingML) read and written on `craft-wordmodel`, with
Word XML (Flat OPC) and Word 2003 XML, password-protected packages and Restrict Editing hashes.
WordCraft's DOCX crate on `craft-opc`, `craft-xml` and `craft-offcrypto`.
- [`craft-draw`](crates/draw/README.md): vector and shape tools; the gradient editor and
on-canvas gradient overlay, the pen and path overlays, the crop frame and perspective crop, and the
free transform box and fields (`ui` feature).
- [`craft-dxf`](crates/dxf/src/lib.rs): DXF tag reader and writer, from CADCraft: ASCII and
binary DXF as (group code, value) tags, split into sections and entities, with pre-2007 code
pages and version detection, and written back; and `model`, the drawing above the tags (header
@@ -112,13 +124,16 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
manifests and rank channels. The optional `decode` feature adds bounded part listing, flat
decoding (scan lines, tiles, every compression of the `exr` crate) and writing.
- [`craft-flow`](crates/flow/README.md): the flow model every text format maps to (paragraphs with a kind, lists and formatted spans; tables; pictures, fields, notes, equations), converted to and from a craft-wordmodel `Document`.
- [`craft-imaging`](crates/imaging/README.md): raster image editing; the scope counting (every
target) and, with the `ui` feature, the warp grid, the levels editor, the Channels panel and the
scope panel with its clipping overlay.
- [`craft-font-catalog`](crates/font-catalog/README.md): the installed fonts on every platform
(font folders, fontconfig and Flatpak host folders, CoreText, DirectWrite, the font store),
lookup by family, style, localized, legacy, full and PostScript names, family loads shared
between threads, and rescans when fonts are installed or removed.
- [`craft-font-manager`](crates/font-manager/README.md): Craft Font Manager as a library: search
and filters over the Google Fonts index, installed fonts by family, the font store interface,
and (`egui` feature) `FontsPanel`, the whole interface as one panel for the launcher's Fonts tab
and (`ui` feature) `FontsPanel`, the whole interface as one panel for the launcher's Fonts tab
and the standalone app.
- [`craft-font-store`](crates/font-store/README.md): the suite's font store: the pinned Google
Fonts and Noto indexes plus indexes the user adds (never curated), exact lookup by family and
@@ -172,11 +187,6 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
CCITT Group 3 and 4 decoding and Group 4 encoding, JBIG2 decoding and lossless encoding. Every
decoder is bounded and returns its partial output on damage. From PdfCraft; a PDF filter chain
is built on it in `craft-pdf`.
- [`craft-timeline`](crates/timeline/README.md): editorial timeline interchange: exact media time and SMPTE timecode, import/export reports, media path and `file://` URL handling, Avid Log Exchange (ALE) and CMX 3600 EDL documents, format detection. From FilmCraft.
- [`craft-metadata`](crates/metadata/README.md): photo metadata, from LightCraft: EXIF (read and write,
maker-note lens and focus point, every tag by name), IPTC-IIM, XMP packets (read, write, and a merge
that keeps what another program wrote), GPX track logs, and the blocks that carry them in JPEG, PNG,
WebP, TIFF-based, RAF and CR3 files. One `Metadata` model for all of them. Built on `craft-tiff`.
- [`craft-tiff`](crates/tiff/README.md): TIFF and BigTIFF IFD reader and writer, from LightCraft:
every field type, the IFD chain, SubIFDs and Exif/GPS/Interop pointer IFDs, maker-note IFDs
(Canon, Nikon, Sony, Fujifilm, Olympus, Panasonic, Pentax), strip and tile layout. Bounded and
@@ -210,6 +220,9 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
scopes, conflicts, user overrides stored through craft-settings and import of other
applications' shortcut sets. Command catalogs, file readers and the shortcut editor UI stay
in each app.
- [`craft-layers`](crates/layers/README.md): the Layers panel over the app's `LayerTree`: rows
with thumbnails and masks, blend, opacity, lock and fill rows, the filter bar, Layers Panel
Options, drag and drop, and events the app applies with its own commands and undo. UI-only.
- [`craft-audio`](crates/audio/README.md): audio file I/O and codecs (WAV, AIFF, FLAC, AAC, Opus,
AC-3/E-AC-3, MP1/MP2, MP3 encoding), streaming and seeking, and packet decoding for any demuxer. See its
README for formats and features.
@@ -251,6 +264,10 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
- [`craft-opc`](crates/opc/README.md): Open Packaging Conventions, the ZIP container of DOCX, XLSX and PPTX
files: bounded readers (every part up front, or on demand), part names, relationships, content
types and a deterministic package writer. What the parts hold stays with each format's crate.
- [`craft-pages`](crates/pages/README.md): pages for the document apps: page layout and fit modes,
paper sizes and page setup, page ranges and numbering; with `ui`, the page view, thumbnails, Page
Setup, margin handles, header and footer zones, text selection, reading view, page list and
document tables. The document, its layout and rendering stay in each app.
- [`craft-pcraft-format`](crates/pcraft-format/README.md): the envelope of PhotoCraft's `.pcraft`
bundle: `Manifest<D>` with the document as a type parameter, `TileRef`, the entry paths, the
manifest decode limits and the migration runner. The document model stays in PhotoCraft.
@@ -271,7 +288,6 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
craft-i18n's `language-data/`, embedded at build time from `CRAFT_I18N_DIR`: English and the
carry-over locales by default, the set `CRAFT_PROOF_EMBED` names otherwise (`en` for English
only); other languages come from installed Language packs.
- [`craft-pst`](crates/pst/README.md): Outlook personal folders files (`.pst`, [MS-PST]) read over any
`Read + Seek`, from MailCraft: the node database, property and table contexts, folders, messages,
recipients, attachments, attached messages and named properties, ANSI and Unicode, encoded or not,
@@ -280,11 +296,15 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
- [`craft-quit`](crates/quit/src/lib.rs): native macOS quit, egui close handling and an optional
app menu. Unsaved-document decisions and save prompts stay in each app.
- [`craft-rtf`](crates/rtf/README.md): Rich Text Format: a tokenizer, text decoding in the file's code pages
(`\uN`, `\'hh`, single-byte and East Asian multibyte pages), escaping and dates, and a reader and writer
for a small neutral model (paragraphs, character formatting, outline levels, tables).
- [`craft-settings`](crates/settings/README.md): `config.toml` settings storage for every app: platform folders, portable mode and overrides, atomic saves while running, backup, damaged-file recovery and schema migrations. Policy in [docs/settings-storage.md](docs/settings-storage.md).
- [`craft-review`](crates/review/README.md): review: the comments panel, comment pins, thread
popover and composer, Acrobat's annotation tool, the signature pad, version history and the
revisions panel, presence, voting, cursor chat and join over the app's own transport (`ui`
feature).
- [`craft-settings`](crates/settings/README.md): `config.toml` settings storage for every app: platform folders, portable mode and overrides, atomic saves while running, backup, damaged-file recovery and schema migrations, plus remembered dialog options and preset folders (also on wasm32). Policy in [docs/settings-storage.md](docs/settings-storage.md).
- [`craft-sheet`](crates/sheet/README.md): spreadsheet vocabulary shared by `craft-xls`, `craft-xlsx` and `craft-ods`: cell positions and A1 text, cell values and error values, sheet-name quoting, Excel's built-in number formats and indexed colour palette. Not a file format; no dependencies.
- [`craft-sf2`](crates/sf2/README.md): SoundFont 2 (`.sf2`) reader: the sample pool and, per preset, the key and velocity regions a note sounds, with tuning, loop points, pan, level and volume envelope resolved from the preset and instrument zones. Bounded on hostile input. From LoopCraft.
- [`craft-silhouette-studio`](crates/silhouette-studio/src/lib.rs): bounded, fail-closed reader for Silhouette Studio `.studio` and `.studio3` documents: outlines, line colours and page size in millimetres. Protected designs are refused.
@@ -300,16 +320,33 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
check for drawing a tree with resvg. Apps take usvg from here, not as their own dependency.
- [`craft-svg-paths`](crates/svg-paths/src/lib.rs): the former name of `craft-svg`'s `paths`,
`color` and `write`; re-exports them for existing users.
- [`craft-table`](crates/table/README.md): spreadsheet widgets: the cell grid with Excel's
keys, outline bands, the PivotTable field list, the condition builder, chart painting, slicers,
reference picking, selection statistics, error tags and filter buttons (`ui` feature).
- [`craft-text`](crates/text/README.md): text processing below the composer. Its `hyphen` module finds
hyphenation points, with a bundled US English dictionary and patterns and optional hypher patterns
for 47 more languages (one cargo feature each).
- [`craft-ui`](crates/ui/README.md): SVG catalogs, icon buttons, tabs, pane controls, transactional docking, print settings and theme helpers for egui frontends;
assets, themes, localization and command handling stay in each app. Requires Rust 1.95 or later.
for 47 more languages (one cargo feature each). With `ui`, the canvas text editor, Character and
Paragraph controls, text style panels and Check Spelling dialog, and the paged-text controls
(ruler, Tabs, Paragraph, Columns and Hyperlink dialogs, notes editor, find); `spell` and `find`
(regex) are features.
- [`craft-timeline`](crates/timeline/README.md): timelines: exact media time, frame rates,
timecode, the playback clock, a frame cache and frame server (egui-free); the timeline panel,
ruler, clips, keyframe lanes, graph editor, transport, timecode fields, preview, overview and
render queue (`ui` feature).
- [`craft-metadata`](crates/metadata/README.md): photo metadata, from LightCraft: EXIF (read and write,
maker-note lens and focus point, every tag by name), IPTC-IIM, XMP packets (read, write, and a merge
that keeps what another program wrote), GPX track logs, and the blocks that carry them in JPEG, PNG,
WebP, TIFF-based, RAF and CR3 files. One `Metadata` model for all of them. Built on `craft-tiff`.
- `craft-ui`: the UI library on egui: runtime, style, fonts, primitives, the component contract, layout,
components (docking, dialogs, canvas, lists, text, menus and more), patterns and the shell. Assets, themes, localization and commands
stay in each app. Design and architecture in [docs/craft-framework.md](docs/craft-framework.md).
Requires Rust 1.95 or later.
- [`craft-vcard`](crates/vcard/README.md): vCard contacts, from MailCraft: vCard 2.1, 3.0 and 4.0 read
(legacy character sets, quoted-printable, labels and Apple label groups, `KEY` certificates and
OpenPGP public keys), vCard 3.0 written. Bounded and panic-free on hostile input. The mapping onto
an app's contact type stays in each app.
- `craft-ui-macros`: the derives and macros of `craft-ui` (`Component`, `Props`, `ComponentStyle`, `Pattern`,
`CommandSet`, words, stories and trials); use them through `craft-ui`.
- [`craft-vectorcraft-format`](crates/vectorcraft-format/README.md): the envelope of VectorCraft's
`.vectorcraft` file: its members, versions, embedded images and the data after the JSON, with the
document as a type parameter. The document and its migrations stay in VectorCraft.
@@ -338,12 +375,10 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
- [`craft-xcf`](crates/xcf/README.md): GIMP XCF images (`.xcf`, `.xcf.gz`), read: header, properties, parasites, layers with their item paths, channels, and tiled pixels (uncompressed, RLE, zlib) at every precision, under a caller's byte budget. From PhotoCraft.
- [`craft-xml`](crates/xml/README.md): bounded XML for hostile input: an owned element tree with limits on size, depth, nodes and attributes, streaming of repeated elements, namespace handling (as written, by local name, or canonical prefixes by URI), escaping and a writer. No DTDs and no entity expansion.
- [`craft-zip`](crates/zip/README.md): ZIP archives from untrusted files: an entry-count check before the archive is indexed (ZIP64 included), entry reads within per-entry and total budgets that count real bytes, duplicate-name detection, a strict structure preflight, and a deterministic stored/deflate writer. The shared ZIP layer for the package formats.
- [Shared UI component audit](docs/ui-components-audit.md): source inventory, extraction priorities
and compatibility boundaries across the Craft suite.
- [Theme infrastructure](docs/theme-infrastructure.md): eight-app comparison and the small shared
widget-state styling boundary.
- [Panel docking](docs/ui-docking.md): validated panel moves, floating groups, workspace adapters
and an optional egui docking surface.
- [Docking](docs/ui-docking.md): the dock model, `DockArea`, `SplitArea` and `PaneArea`.
- [Dialogs](docs/ui-dialogs.md): `Dialog`, `DialogHost`, the dialog stack and the standard prompts.
- [Craft framework](docs/craft-framework.md): the design, installation, architecture, design system, foundations, components, accessibility, tests, and the migration and landing plan
- [Development workflow](docs/development.md): the `cl` commands, the one fixed feature set, what not to run locally, the profiles, the job pool and what a new worktree's first build costs
## License and credits
+1 -1
View File
@@ -4,5 +4,5 @@ allow-panic-in-tests = true
allow-indexing-slicing-in-tests = true
cognitive-complexity-threshold = 30
disallowed-types = [
{ path = "egui::ComboBox", reason = "use craft_ui::ComboBox: egui's combo box menu can't grow back while open (egui#5225)" },
{ path = "egui::ComboBox", reason = "use craft_ui::controls::Select: egui's combo box menu can't grow back while open (egui#5225)" },
]
+4
View File
@@ -0,0 +1,4 @@
[lint]
paths = ["crates/behavior", "crates/ui", "crates/ui-contract", "crates/ui-widgets", "crates/ui-panels", "crates/ui-canvas", "crates/ui-patterns", "crates/ui-shell", "crates/ui-macros", "crates/ui-gallery", "crates/update/src/stack_dialogs.rs", "crates/update/src/updater.rs", "crates/update/tests/it", "crates/dialogs/src/ui", "crates/dialogs/tests/it", "crates/print/src/ui", "crates/print/tests/it", "crates/theme-store/src/ui", "crates/theme-store/tests/it", "crates/browse/src/ui", "crates/browse/src/thumbs/source.rs", "crates/browse/tests/it", "crates/layers/src/ui", "crates/layers/tests/it", "crates/table/src/ui", "crates/table/tests/it", "crates/timeline/src/ui", "crates/timeline/src/rates.rs", "crates/timeline/tests/it", "crates/menu/src", "crates/menu/tests/it", "crates/automation/src/ui", "crates/automation/src/control.rs", "crates/automation/src/screenshot.rs", "crates/automation/src/server.rs", "crates/automation/src/synthetic.rs", "crates/automation/tests/it", "crates/pages/src/ui", "crates/pages/tests/it", "crates/review/src/ui", "crates/review/tests/it", "crates/font-manager/src", "crates/font-manager/tests/it", "crates/text/src/ui", "crates/text/tests/it", "crates/imaging/src/ui", "crates/imaging/tests/it", "crates/color/src/ui", "crates/color/tests/it", "crates/draw/src/ui", "crates/draw/tests/it"]
include-tests = true
deny-unused = true
+1 -1
View File
@@ -3,7 +3,7 @@
The manifest is crates/crw/tests/samples.json (name, raw.pixls.us URL, SHA-256, licence). Files
already present with the right hash are kept. Then run the tests with
`CRAFT_CRW_SAMPLES=<destination> cargo test -p craft-crw --release --test samples`.
`CRAFT_CRW_SAMPLES=<destination> cargo test -p craft-crw --release -- integration::samples`.
"""
import argparse
+2 -2
View File
@@ -11,11 +11,11 @@ fi
cd "$root"
case "${1:-}" in
"")
cargo test -p craft-plate-test --test ghostscript -- --ignored --nocapture
cargo test -p craft-plate-test -- integration::ghostscript --ignored --nocapture
echo "report: ${CARGO_TARGET_DIR:-target}/plate-test/report.md"
;;
--flatten)
cargo test -p craft-prepress --features flatten --test flatten_plates -- --ignored --nocapture
cargo test -p craft-prepress --features flatten -- integration::flatten_plates --ignored --nocapture
echo "report: ${CARGO_TARGET_DIR:-target}/plate-test/flattened/report.md"
;;
*)
Executable
+258
View File
@@ -0,0 +1,258 @@
#!/usr/bin/env -S python3 -I
"""The craft-libs build loop: cargo with one fixed feature set, so every local build shares one variant of each crate.
cl check <crate> [cargo args] cargo check -p <crate> --tests, canonical features
cl test <crate> [cargo args] [-- test args] cargo test -p <crate> --tests, canonical features
cl build gallery [cargo args] the debug gallery binary (target/debug/craft-ui-gallery)
cl build <crate> [cargo args] cargo build -p <crate>, canonical features
cl render <crate|ui> <Component> [--story <name>] [--out <dir>] [--threads N]
the component's stories as PNGs through the story-render bin
cl features <crate> print the canonical --features value for <crate>
cl doctor check the manifests for drift from the one feature set
cl cargo <args...> cargo through the job pool, no features added
Every cargo command runs through a job-pool launcher when it is on the
PATH, else plain cargo. CARGO_TARGET_DIR defaults to <worktree>-target when that directory exists beside the worktree.
Why one feature set: cargo builds a crate once per distinct feature set, and everything above it again. The gallery
turns on craft-ui's `app`, the story renderer `snapshot`, the tests `testing` and the domain crates' `screen-testing`;
a command that leaves one of them off builds a second variant of the framework (minutes) and the dependants above it.
The canonical set for a crate is its own test feature (`screen-testing`, else `testing`) plus, for every crate that
depends on the framework, craft-ui's `app`, `testing` and `snapshot` (or craft-ui-contract's `testing` and `snapshot`
and craft-ui-shell's `app` for the framework crates themselves). Builds that take other features (CI's
`--all-features`, wasm checks) belong on GitHub. docs/development.md has the whole picture.
Guards: `--all-features`, `--bins` and workspace-wide builds are refused with the reason; after every command, a new
feature variant of a framework crate in the target directory is named, with its feature set; `cl doctor` (also run
before every command, it reads a few manifests) reports manifest lines that would bring the churn back.
"""
import json
import os
import re
import shutil
import subprocess
import sys
FRAMEWORK = ["craft-ui-contract", "craft-ui-widgets", "craft-ui-panels", "craft-ui-canvas", "craft-ui-patterns", "craft-ui-shell", "craft-ui"]
ANCHORS = {
# package -> the features of its framework dependencies that every local build keeps on
"craft-ui": ["craft-ui-contract/snapshot", "craft-ui-shell/app"],
"craft-ui-shell": ["app", "craft-ui-contract/snapshot"],
"craft-ui-patterns": ["craft-ui-contract/snapshot"],
"craft-ui-canvas": ["craft-ui-contract/snapshot"],
"craft-ui-panels": ["craft-ui-contract/snapshot"],
"craft-ui-widgets": ["craft-ui-contract/snapshot"],
"craft-ui-contract": ["snapshot"],
"craft-ui-test-kit": ["craft-ui-contract/snapshot"],
"craft-ui-gallery": ["apps", "craft-ui/snapshot"],
"story-render": [],
}
FACADE_ANCHORS = ["craft-ui/app", "craft-ui/testing", "craft-ui/snapshot"]
# Domain crates the story renderer can link, by the crate's short name.
RENDER_FEATURES = {
"automation", "browse", "color", "draw", "imaging", "layers", "menu", "pages", "print", "review", "table", "text",
"theme-store", "timeline", "dialogs", "font-manager", "update",
}
REFUSED = {
"--all-features": "it enables snapshot, system_fonts, color_fonts, all-languages and more, a set no loop uses, which rebuilds every dependency and the whole framework once; CI runs it",
"--bins": "the gallery's binaries are 1 GB links each; build the one you need (`cl build gallery`)",
"--workspace": "a workspace-wide build or test takes the better part of an hour; build the crate you changed, CI runs the rest",
"--all": "a workspace-wide build or test takes the better part of an hour; build the crate you changed, CI runs the rest",
"--all-targets": "it builds every binary and benchmark too; use `cl check` or `cl test` (--tests)",
}
# The manifest lines the one feature set rests on: (file, regex that must match, what its absence brings back).
PINS = [
("crates/ui-macros/Cargo.toml", r'^syn = \{[^\n]*"full"[^\n]*"visit"[^\n]*"visit-mut"[^\n]*"fold"[^\n]*"extra-traits"',
"craft-ui-macros must ask syn for full, visit, visit-mut, fold and extra-traits, or any derive crate in a build changes the shared syn and rebuilds the framework"),
("crates/ui-macros/Cargo.toml", r'^proc-macro2 = \{[^\n]*"span-locations"',
"craft-ui-macros must ask proc-macro2 for span-locations, or a build with design-lint in it changes the shared proc-macro2 and rebuilds the framework"),
("crates/ui-contract/Cargo.toml", r'^craft-window = \{[^\n]*features = \[[^\]]*"ui"',
"craft-ui-contract must depend on craft-window with ui, or the shell's app flips craft-window under the whole framework"),
]
def fail(message):
print(f"cl: {message}", file=sys.stderr)
sys.exit(2)
def worktree():
top = subprocess.run(["git", "rev-parse", "--show-toplevel"], capture_output=True, text=True)
if top.returncode != 0:
fail("not inside a git worktree")
return top.stdout.strip()
def metadata(top):
out = subprocess.run(
["cargo", "metadata", "--no-deps", "--format-version", "1", "--offline"], cwd=top, capture_output=True, text=True
)
if out.returncode != 0:
fail("cargo metadata failed:\n" + out.stderr)
return {p["name"]: p for p in json.loads(out.stdout)["packages"]}
def package(packages, name):
if name in packages:
return packages[name]
if "craft-" + name in packages:
return packages["craft-" + name]
fail(f"no workspace package named {name}")
def canonical(packages, name):
"""The canonical feature list of a package."""
p = package(packages, name)
features = []
if "screen-testing" in p["features"]:
features.append("screen-testing")
elif "testing" in p["features"] and p["name"] != "craft-ui-test-kit":
features.append("testing")
if p["name"] in ANCHORS:
features += ANCHORS[p["name"]]
elif any(d["name"] == "craft-ui" for d in p["dependencies"]):
features += FACADE_ANCHORS
return p["name"], features
def doctor(top, packages, quiet=False):
"""Manifest lines that would bring the variant churn back. Returns the number of problems."""
problems = []
for path, pattern, why in PINS:
text = open(os.path.join(top, path)).read()
if not re.search(pattern, text, re.M):
problems.append(f"{path}: {why}")
for p in packages.values():
manifest = os.path.relpath(p["manifest_path"], top)
for d in p["dependencies"]:
if d["name"] == "egui" and d["kind"] == "dev" and d["features"]:
problems.append(f"{manifest}: the egui dev-dependency asks for {d['features']}; a feature on a dev-dependency "
"line changes egui under the framework between a crate's tests and its render")
gallery = packages.get("craft-ui-gallery")
if gallery:
for d in gallery["dependencies"]:
if d["name"].startswith("craft-") and "screen-testing" in d["features"] and not d["optional"]:
problems.append(f"crates/ui-gallery/Cargo.toml: {d['name']} must be optional (one feature per domain crate), or the story renderer links every crate")
for problem in problems:
print(f"cl doctor: {problem}", file=sys.stderr)
if not problems and not quiet:
print("cl doctor: the manifests keep the one feature set", file=sys.stderr)
return len(problems)
def target_dir(top, env):
if "CARGO_TARGET_DIR" not in env and os.path.isdir(top + "-target"):
env["CARGO_TARGET_DIR"] = top + "-target"
return env.get("CARGO_TARGET_DIR", os.path.join(top, "target"))
def variants(target):
"""The framework crates' lib variants in the target dir's debug profile: {(crate, hash): features}."""
found = {}
fp = os.path.join(target, "debug", ".fingerprint")
if not os.path.isdir(fp):
return found
for d in os.listdir(fp):
m = re.match(r"(craft-ui(?:-[a-z]+)?)-([0-9a-f]{16})$", d)
if not m or m.group(1) not in FRAMEWORK:
continue
for f in os.listdir(os.path.join(fp, d)):
if f.startswith("lib-") and f.endswith(".json"):
try:
j = json.load(open(os.path.join(fp, d, f)))
except (OSError, ValueError):
continue
found[(m.group(1), m.group(2))] = j.get("features", "")
return found
def report_new_variants(before, after):
new = {k: v for k, v in after.items() if k not in before}
if not new:
return
by_crate, olds = {}, {}
for (crate, _), feats in new.items():
by_crate.setdefault(crate, set()).add(feats)
for (crate, _), feats in before.items():
olds.setdefault(crate, set()).add(feats)
for crate in FRAMEWORK:
if crate not in by_crate:
continue
feats = " | ".join(sorted(by_crate[crate]))
same = [f for f in by_crate[crate] if f in olds.get(crate, set())]
why = ("same features as a variant already here, so a crate below it changed its features (another crate's dependencies "
"or dev-dependencies, or the gallery's apps)" if same else "a feature set this target dir had not built")
print(f"cl: new variant of {crate} built, features {feats}: {why}; {len(olds.get(crate, []))} variant(s) were there before. "
"Expected once per crate family (docs/development.md); otherwise check the command against `cl features`.",
file=sys.stderr)
def run(top, cargo_args):
for arg in cargo_args:
if arg in REFUSED:
fail(f"{arg} refused: {REFUSED[arg]}")
env = dict(os.environ)
target = target_dir(top, env)
launcher = ["job-pool"] if shutil.which("job-pool") else []
cmd = launcher + ["cargo"] + cargo_args
print("cl: " + " ".join(cmd) + f" (target {target})", file=sys.stderr)
sys.stdout.flush()
before = variants(target)
rc = subprocess.run(cmd, cwd=top, env=env).returncode
report_new_variants(before, variants(target))
sys.exit(rc)
def with_features(args, features):
return args + (["--features", ",".join(features)] if features else [])
def main():
if len(sys.argv) < 2 or sys.argv[1] in ("-h", "--help"):
print(__doc__.strip())
sys.exit(0)
command, rest = sys.argv[1], sys.argv[2:]
top = worktree()
packages = metadata(top)
if command == "doctor":
sys.exit(1 if doctor(top, packages) else 0)
doctor(top, packages, quiet=True)
if command == "cargo":
run(top, rest)
if command == "features":
if not rest:
fail("cl features <crate>")
print(",".join(canonical(packages, rest[0])[1]))
return
if command in ("check", "test", "build"):
if not rest:
fail(f"cl {command} <crate> [args]")
name, args = rest[0], rest[1:]
if command == "build" and name == "gallery":
pkg, features = canonical(packages, "craft-ui-gallery")
run(top, with_features(["build", "-p", pkg, "--bin", "craft-ui-gallery"], features) + args)
pkg, features = canonical(packages, name)
if command == "check":
run(top, with_features(["check", "-p", pkg, "--tests"], features) + args)
if command == "test":
run(top, with_features(["test", "-p", pkg, "--tests"], features) + args)
run(top, with_features(["build", "-p", pkg], features) + args)
if command == "render":
if len(rest) < 2:
fail("cl render <crate|ui> <Component> [--story <name>] [--out <dir>] [--threads N]")
crate, component, options = rest[0], rest[1], rest[2:]
short = crate.removeprefix("craft-")
features = []
if short != "ui":
if short not in RENDER_FEATURES:
fail(f"{crate} is not a crate the story renderer links; one of: ui, " + ", ".join(sorted(RENDER_FEATURES)))
features = [short]
if "--out" not in options:
options += ["--out", os.path.join(os.environ.get("CL_RENDER_DIR", os.path.expanduser("~/.cache/story-render")), component)]
run(top, with_features(["run", "-q", "-p", "story-render", "--bin", "story-render"], features) + ["--", "--only", component] + options)
fail(f"unknown command {command}; see cl --help")
if __name__ == "__main__":
main()