diff --git a/.github/workflows/web-deploy.yml b/.github/workflows/web-deploy.yml new file mode 100644 index 00000000..50efe6c1 --- /dev/null +++ b/.github/workflows/web-deploy.yml @@ -0,0 +1,91 @@ +# Builds DraftCraft's browser version (apps/draftcraft-web, wasm via Trunk) from `main` and publishes it to +# GitHub Pages at https://app.draftcraft.dev/ (Settings › Pages › Source: GitHub Actions) on every push to +# `main`, so the site is always the live main. Only in withshalom/draftcraft-app (WithShalom Studios' fork of +# SkryxDev/DraftCraft); any other branch or repository builds nothing. This file is the fork's own: it is +# not part of the pull requests sent upstream. +name: web-deploy + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +# A custom domain, when there is one: set it here and point its DNS at GitHub Pages. +env: + CUSTOM_DOMAIN: app.draftcraft.dev + TRUNK_VERSION: 0.21.14 + TRUNK_SHA256: f2b4680cd239693a646a2795e4633c625328d7b2a044fbe749fa3a2fe9e7036b + +jobs: + build: + # Only in withshalom/draftcraft-app, only from main. + if: github.repository == 'withshalom/draftcraft-app' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + timeout-minutes: 90 + env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Install Rust (stable) with the wasm target + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 + with: + toolchain: stable + targets: wasm32-unknown-unknown + + - name: Cache cargo and target + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 + with: + key: web-deploy + + - name: Install Trunk (checksum verified, as upstream's release does) + run: | + url="https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" + curl --proto '=https' --proto-redir =https -fsSL -o "$RUNNER_TEMP/trunk.tar.gz" "$url" + echo "$TRUNK_SHA256 $RUNNER_TEMP/trunk.tar.gz" | sha256sum -c - + tar -xz -C "$HOME/.cargo/bin" -f "$RUNNER_TEMP/trunk.tar.gz" trunk + trunk --version + + - name: Build (release) + working-directory: apps/draftcraft-web + run: trunk build --release + + - name: Check the site uses relative URLs + run: | + test -f dist/web/index.html + if grep -Eq '(src|href)="/[^/]' dist/web/index.html; then + echo "index.html has root-absolute URLs" >&2 + exit 1 + fi + + - name: Add Pages files + run: | + touch dist/web/.nojekyll + if [ -n "$CUSTOM_DOMAIN" ]; then echo "$CUSTOM_DOMAIN" > dist/web/CNAME; fi + + - uses: actions/configure-pages@v5 + + - uses: actions/upload-pages-artifact@v3 + with: + path: dist/web + + deploy: + if: github.repository == 'withshalom/draftcraft-app' && github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/AGENTS.md b/AGENTS.md index c8bf35aa..797447a6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,7 +18,7 @@ People trust DraftCraft with their drawings; a crash loses their work. **This ou - Every workspace crate manifest carries `[lints] workspace = true`; every production crate root carries `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]`. ## Non-negotiables -- **Clean-room.** AutoCAD may only be *observed* black-box (run it, look at its UI with your own drawings). Never read, disassemble or copy anything inside an Autodesk install; never copy Autodesk fonts (SHX), hatch patterns (`.pat`), linetypes (`.lin`), templates, CUI/PGP files, icons, artwork or help text; never commit files produced by AutoCAD or screenshots of it. File formats come from public specifications (Autodesk's published DXF Reference, the Open Design Alliance's public DWG specification) and our own tests. Never copy or link GPL/LGPL/AGPL code (LibreDWG, LibreCAD, QCAD, FreeCAD's planegcs, SolveSpace, OpenCASCADE) — don't even read their sources. +- **Clean-room.** Take no proprietary code or information directly from the application software. AutoCAD may only be *observed* black-box (run it, look at its UI with your own drawings). Never read, disassemble or copy anything inside an Autodesk install; never copy Autodesk fonts (SHX), hatch patterns (`.pat`), linetypes (`.lin`), templates, CUI/PGP files, icons, artwork or help text; never commit screenshots of AutoCAD. DWG and DXF files are a different matter, whichever program saved them, AutoCAD included: they are the files people exchange, and reading them, testing against them and keeping them in the repository as test drawings is interoperability and allowed (a drawing kept here needs its row in `ATTRIBUTION.md` like any other file asset). File formats come from public specifications (Autodesk's published DXF Reference, the Open Design Alliance's public DWG specification), from DWG and DXF files themselves, and from our own tests. Never copy or link GPL/LGPL/AGPL code (LibreDWG, LibreCAD, QCAD, FreeCAD's planegcs, SolveSpace, OpenCASCADE) — don't even read their sources. - **Assets.** DraftCraft contains **no Autodesk, Adobe or Avid iconography, images, fonts, patterns or artwork — ever**, and no brand marks other than DraftCraft's own. Every icon is drawn in code (`crates/ui-egui/src/icons.rs`), every hatch pattern and linetype is our own definition (`crates/doc/src/library.rs`), the drafting font is our own (`crates/fonts/src/stroke.rs`). Any file asset must be original, public domain/CC0, OSI-licensed or redistributable Creative Commons, and **must have a row in `ATTRIBUTION.md`** with author, source and licence (`cargo xtask assets` enforces it). - **Fonts** come from [`storytold/craft-fonts`](https://github.com/storytold/craft-fonts), an optional build input (`CRAFT_FONTS_DIR`, embedded by `crates/fonts/build.rs`), never a `Cargo.toml` dependency and never committed here. Code and tests must work without it. - **Everything is a command.** User-visible behaviour = a command in `crates/engine/src/cmd/*` (`CommandSpec`: id = AutoCAD's command name in lower case, label, menu path, shortcut, aliases, params doc, `enabled`, JSON `run`, optional `interactive` prompt machine) + tests. UI-only commands live in `crates/ui-egui/src/menus.rs` (`UI_COMMANDS`). The ribbon, menus, command line, scripts, CLI, control channel and MCP all reach the same commands. diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 1c879bd0..f06f6b25 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -54,6 +54,22 @@ contributors, and where a line says so by Skryx Dev: | `assets/app-icon/draftcraft-1024.png` | WithShalom Studios (DraftCraft) | original work for DraftCraft, drawn by `packaging/compass-icon.py` in [withshalom/draftcraft](https://github.com/withshalom/draftcraft) (2026) | MIT OR Apache-2.0 (the DraftCraft name and marks: [docs/brand/LICENSE-brand.txt](docs/brand/LICENSE-brand.txt)) | | | `assets/app-icon/draftcraft-macos-512.png` | WithShalom Studios (DraftCraft) | original work for DraftCraft, drawn by `packaging/compass-icon.py` in [withshalom/draftcraft](https://github.com/withshalom/draftcraft) (2026) | MIT OR Apache-2.0 (the DraftCraft name and marks: [docs/brand/LICENSE-brand.txt](docs/brand/LICENSE-brand.txt)) | | | `examples/apartment.dxf` | the DraftCraft contributors | sample drawing made with the CLI's commands | MIT OR Apache-2.0 | Original | +| `crates/io/tests/data/mi201/mi201-r12.dxf` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DXF by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r14.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2000.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2000.dxf` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DXF by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2004.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2004.dxf` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DXF by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2007.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2007.dxf` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DXF by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2010.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2010.dxf` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DXF by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2013.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2013.dxf` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DXF by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2018-from-ascii-dxf.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2018-from-binary-dxf.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2018.dwg` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DWG by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | +| `crates/io/tests/data/mi201/mi201-r2018.dxf` | WithShalom Studios (MosaicIron) | the owner's own part drawing MI-201 (a bent clip plate), saved as DXF by AutoCAD; from [withshalom/blackcad](https://github.com/withshalom/blackcad) `corpus/mosaiciron-mi201` | MIT OR Apache-2.0 | Test drawing for the DWG reader; the DXF of each version is the reference for its DWG | ## Interface translations diff --git a/Cargo.lock b/Cargo.lock index 67af9182..d98313c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1220,7 +1220,7 @@ checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" [[package]] name = "draftcraft" -version = "2.1.0" +version = "3.0.0" dependencies = [ "chrono", "clap", @@ -1250,7 +1250,7 @@ dependencies = [ [[package]] name = "draftcraft-cli" -version = "2.1.0" +version = "3.0.0" dependencies = [ "clap", "clap_complete", @@ -1266,14 +1266,14 @@ dependencies = [ [[package]] name = "draftcraft-color" -version = "2.1.0" +version = "3.0.0" dependencies = [ "serde", ] [[package]] name = "draftcraft-constraints" -version = "2.1.0" +version = "3.0.0" dependencies = [ "draftcraft-doc", "draftcraft-geom", @@ -1283,7 +1283,7 @@ dependencies = [ [[package]] name = "draftcraft-doc" -version = "2.1.0" +version = "3.0.0" dependencies = [ "draftcraft-color", "draftcraft-geom", @@ -1294,7 +1294,7 @@ dependencies = [ [[package]] name = "draftcraft-dwg" -version = "2.1.0" +version = "3.0.0" dependencies = [ "acadrust", "log", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "draftcraft-dxf" -version = "2.1.0" +version = "3.0.0" dependencies = [ "encoding_rs", "log", @@ -1311,7 +1311,7 @@ dependencies = [ [[package]] name = "draftcraft-engine" -version = "2.1.0" +version = "3.0.0" dependencies = [ "craft-docpath", "draftcraft-color", @@ -1334,7 +1334,7 @@ dependencies = [ [[package]] name = "draftcraft-fonts" -version = "2.1.0" +version = "3.0.0" dependencies = [ "draftcraft-geom", "encoding_rs", @@ -1346,14 +1346,14 @@ dependencies = [ [[package]] name = "draftcraft-geom" -version = "2.1.0" +version = "3.0.0" dependencies = [ "serde", ] [[package]] name = "draftcraft-io" -version = "2.1.0" +version = "3.0.0" dependencies = [ "acadrust", "craft-pdf", @@ -1376,7 +1376,7 @@ dependencies = [ [[package]] name = "draftcraft-mcp" -version = "2.1.0" +version = "3.0.0" dependencies = [ "clap", "draftcraft-engine", @@ -1390,7 +1390,7 @@ dependencies = [ [[package]] name = "draftcraft-render" -version = "2.1.0" +version = "3.0.0" dependencies = [ "draftcraft-color", "draftcraft-doc", @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "draftcraft-ui-egui" -version = "2.1.0" +version = "3.0.0" dependencies = [ "chrono", "craft-ui", @@ -1432,7 +1432,7 @@ dependencies = [ [[package]] name = "draftcraft-web" -version = "2.1.0" +version = "3.0.0" dependencies = [ "craft-web-host", "draftcraft-engine", @@ -6210,7 +6210,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee" [[package]] name = "xtask" -version = "2.1.0" +version = "3.0.0" dependencies = [ "chrono", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 4ed33777..430776c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"] # default-members [workspace.package] -version = "2.1.0" +version = "3.0.0" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" diff --git a/apps/draftcraft-web/index.html b/apps/draftcraft-web/index.html index f1bdf8d4..2ec834f0 100644 --- a/apps/draftcraft-web/index.html +++ b/apps/draftcraft-web/index.html @@ -5,6 +5,15 @@ DraftCraft + + + + + + + + +