Compare commits

...

50 Commits

Author SHA1 Message Date
3df618c88e x 2025-06-06 19:36:30 -04:00
3a224a0bc8 x 2025-06-06 19:36:04 -04:00
3f7c34853f x 2025-06-06 19:34:08 -04:00
9a5c659520 x 2025-06-06 19:33:30 -04:00
279ea4c17a x 2025-06-06 19:33:09 -04:00
de007ccf42 x 2025-06-06 19:28:13 -04:00
4c43279b2a x 2025-06-06 19:25:20 -04:00
0042afb7ef x 2025-06-06 19:24:43 -04:00
b70f78c41e x 2025-06-06 19:22:55 -04:00
4d94bb1c22 x 2025-06-06 19:22:27 -04:00
03a281a7e5 x 2025-06-06 19:21:48 -04:00
e74b52e8c9 x 2025-06-06 19:20:50 -04:00
d9883e9059 x 2025-06-06 19:14:48 -04:00
e5cb099c32 x 2025-06-06 19:14:05 -04:00
4497d282d2 x 2025-06-06 19:12:26 -04:00
662ad9b679 x 2025-06-06 19:11:44 -04:00
01ef730c9b x 2025-06-06 19:10:46 -04:00
bfe6b09c05 x 2025-06-06 19:10:17 -04:00
a1107ac6ec x 2025-06-06 19:08:42 -04:00
6b312af3a2 x 2025-06-06 19:07:56 -04:00
d3c35673c7 x 2025-06-06 19:07:10 -04:00
14892a6cfd x 2025-06-06 19:05:10 -04:00
81636a9d42 x 2025-06-06 19:01:44 -04:00
46f18f9cbc x 2025-06-06 19:00:56 -04:00
619e8ac41d x 2025-06-06 18:59:11 -04:00
92543c041c x 2025-06-06 18:57:33 -04:00
3aa5db46de x 2025-06-06 18:56:30 -04:00
15326f06a1 x 2025-06-06 18:55:51 -04:00
2cb9979abe x 2025-06-06 18:54:55 -04:00
2ce2b33eed x 2025-06-06 18:54:25 -04:00
5ae475eadd x 2025-06-06 18:50:28 -04:00
6b1dc30906 x 2025-06-06 18:39:19 -04:00
a5190f67b4 x 2025-06-06 18:28:49 -04:00
aa03807c23 x 2025-06-06 18:28:30 -04:00
0630ab77aa x 2025-06-06 18:23:10 -04:00
04e85e1d91 x 2025-06-06 18:22:35 -04:00
6b268c4084 x 2025-06-06 18:22:12 -04:00
fefe66aa91 x 2025-06-06 18:21:50 -04:00
c7df0f0266 x 2025-06-06 18:21:23 -04:00
95b6b9a026 x 2025-06-06 18:20:17 -04:00
a66a0824a2 x 2025-06-06 18:19:30 -04:00
bee1362d37 x 2025-06-06 18:18:04 -04:00
42b56c2472 x 2025-06-06 18:17:31 -04:00
16ef6801e5 x 2025-06-06 18:17:18 -04:00
5adcfd7a19 x 2025-06-06 18:17:02 -04:00
9c1fff9c96 x 2025-06-06 18:16:26 -04:00
8bf72fee8e x 2025-06-06 18:15:32 -04:00
776613b676 x 2025-06-06 18:14:51 -04:00
e2bee4d901 x 2025-06-06 18:08:56 -04:00
31abafd902 let's go 2025-06-06 18:04:00 -04:00
2 changed files with 42 additions and 203 deletions

197
Makefile
View File

@ -1,170 +1,55 @@
.PHONY: all
all: install check build
# Zoo Design Studio
### Developer manual
###############################################################################
# INSTALL
Welcome to Zoo Design Studio GitHub repository! Below are various recipes you can type into `make`. To build everything, type `make all`. [](:)
#
.PHONY: **all**
**all**: **install**
## Installation
.PHONY: **install**
You will need NodeJS. From there the build system will install Rust as well, followed by hundreds of millions of dependencies /s [](:)
```sh :
ifeq ($(OS),Windows_NT)
export WINDOWS := true
ifndef MSYSTEM
export POWERSHELL := true
endif
export WINDOWS := true
ifndef MSYSTEM
export POWERSHELL := true
endif
endif
#\
```
```sh :
ifdef WINDOWS
CARGO ?= $(USERPROFILE)/.cargo/bin/cargo.exe
WASM_PACK ?= $(USERPROFILE)/.cargo/bin/wasm-pack.exe
CARGO ?= $(USERPROFILE)/.cargo/bin/cargo.exe
WASM_PACK ?= $(USERPROFILE)/.cargo/bin/wasm-pack.exe
else
CARGO ?= $(shell which cargo || echo ~/.cargo/bin/cargo)
WASM_PACK ?= $(shell which wasm-pack || echo ~/.cargo/bin/wasm-pack)
CARGO ?= $(shell which cargo || echo ~/.cargo/bin/cargo)
WASM_PACK ?= $(shell which wasm-pack || echo ~/.cargo/bin/wasm-pack)
endif
#\
```
.PHONY: install
install: node_modules/.package-lock.json $(CARGO) $(WASM_PACK) ## Install dependencies
### Installing dependencies
node_modules/.package-lock.json: package.json package-lock.json
npm prune
npm install
**install**: node_modules/.package-lock.json []($) $(CARGO) []($) $(WASM_PACK)
$(CARGO):
ifdef WINDOWS
npm run install:rust:windows
else
npm run install:rust
endif
- node_modules/.package-lock.json: package.json package-lock.json
- `npm prune`
- `npm install`
$(WASM_PACK):
ifdef WINDOWS
npm run install:wasm-pack:cargo
else
npm run install:wasm-pack:sh
endif
- $(CARGO):
- `npm run install:rust`
###############################################################################
# BUILD
- $(WASM_PACK):
- `npm run install:wasm-pack:sh`
CARGO_SOURCES := rust/.cargo/config.toml $(wildcard rust/Cargo.*) $(wildcard rust/**/Cargo.*)
KCL_SOURCES := $(wildcard public/kcl-samples/**/*.kcl)
RUST_SOURCES := $(wildcard rust/**/*.rs)
REACT_SOURCES := $(wildcard src/*.tsx) $(wildcard src/**/*.tsx)
TYPESCRIPT_SOURCES := tsconfig.* $(wildcard src/*.ts) $(wildcard src/**/*.ts)
VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx)
.PHONY: build
build: install public/kcl_wasm_lib_bg.wasm public/kcl-samples/manifest.json .vite/build/main.js
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES)
ifdef WINDOWS
npm run build:wasm:dev:windows
else
npm run build:wasm:dev
endif
public/kcl-samples/manifest.json: $(KCL_SOURCES)
cd rust/kcl-lib && EXPECTORATE=overwrite cargo test generate_manifest
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
npm run tronb:vite:dev
###############################################################################
# CHECK
.PHONY: check
check: format lint
.PHONY: format
format: install ## Format the code
npm run fmt
.PHONY: lint
lint: install ## Lint the code
npm run tsc
npm run lint
###############################################################################
# RUN
TARGET ?= desktop
.PHONY: run
run: run-$(TARGET)
.PHONY: run-web
run-web: install build ## Start the web app
npm run start
.PHONY: run-desktop
run-desktop: install build ## Start the desktop app
npm run tron:start
###############################################################################
# TEST
E2E_GREP ?=
E2E_WORKERS ?=
E2E_FAILURES ?= 1
.PHONY: test
test: test-unit test-e2e
.PHONY: test-unit
test-unit: install ## Run the unit tests
npm run test:rust
npm run test:unit:components
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
npm run test:unit
.PHONY: test-e2e
test-e2e: test-e2e-$(TARGET)
.PHONY: test-e2e-web
test-e2e-web: install build ## Run the web e2e tests
ifdef E2E_GREP
npm run test:e2e:web -- --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
else
npm run test:e2e:web -- --headed --workers='100%'
endif
.PHONY: test-e2e-desktop
test-e2e-desktop: install build ## Run the desktop e2e tests
ifdef E2E_GREP
npm run test:e2e:desktop -- --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
else
npm run test:e2e:desktop -- --workers='100%'
endif
###############################################################################
# CLEAN
.PHONY: clean
clean: ## Delete all artifacts
ifdef POWERSHELL
git clean --force -d -x --exclude=.env* --exclude=**/*.env
else
rm -rf .vite/ build/
rm -rf trace.zip playwright-report/ test-results/
rm -rf public/kcl_wasm_lib_bg.wasm
rm -rf rust/*/bindings/ rust/*/pkg/ rust/target/
rm -rf node_modules/ rust/*/node_modules/
endif
.PHONY: help
help: install
ifdef POWERSHELL
@ powershell -Command "Get-Content $(MAKEFILE_LIST) | Select-String -Pattern '^[^\s]+:.*##\s.*$$' | ForEach-Object { $$line = $$_.Line -split ':.*?##\s+'; Write-Host -NoNewline $$line[0].PadRight(30) -ForegroundColor Cyan; Write-Host $$line[1] }"
else
@ grep -E '^[^[:space:]]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
endif
.DEFAULT_GOAL := help
###############################################################################
# I'm sorry this is so specific to my setup you may as well ignore this.
# This is so you don't have to deal with electron windows popping up constantly.
# It should work for you other Linux users.
lee-electron-test:
Xephyr -br -ac -noreset -screen 1200x500 :2 &
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ npm run tron:test -g "when using the file tree"
killall Xephyr
-:
$\:
):

View File

@ -1,47 +0,0 @@
![Zoo Design Studio](/public/zma-logomark-outlined.png)
# Zoo Design Studio
[zoo.dev/design-studio](https://zoo.dev/design-studio)
A CAD application from the future, brought to you by the [Zoo team](https://zoo.dev).
Design Studio is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
- All artifacts—including parts and assemblies—should be represented as human-readable code. At the end of the day, your CAD project should be "plain text"
- This makes version control—which is a solved problem in software engineering—trivial for CAD
- All GUI (or point-and-click) interactions should be actions performed on this code representation under the hood
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Design Studio
- Everything graphics _has_ to be built for the GPU
- Most CAD applications have had to retrofit support for GPUs, but our geometry engine is made for GPUs (primarily Nvidia's Vulkan), getting the order of magnitude rendering performance boost with it
- Make the resource-intensive pieces of an application auto-scaling
- One of the bottlenecks of today's hardware design tools is that they all rely on the local machine's resources to do the hardest parts, which include geometry rendering and analysis. Our geometry engine parallelizes rendering and just sends video frames back to the app (seriously, inspect source, it's just a `<video>` element), and our API will offload analysis as we build it in
We are excited about what a small team of people could build in a short time with our API. We welcome you to try our API, build your own applications, or contribute to ours!
Design Studio is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
The 3D view in Design Studio is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
## Technology
- UI
- [React](https://react.dev/)
- [Headless UI](https://headlessui.com/)
- [TailwindCSS](https://tailwindcss.com/)
- [XState](https://xstate.js.org/)
- Networking
- WebSockets (via [KittyCAD TS client](https://github.com/KittyCAD/kittycad.ts))
- Code Editor
- [CodeMirror](https://codemirror.net/)
- [Custom WASM LSP Server](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib/src/lsp/kcl)
- Modeling
- [KittyCAD TypeScript client](https://github.com/KittyCAD/kittycad.ts)
## Get Started
We recommend downloading the latest application binary from our [website](https://zoo.dev/design-studio/download). If you don't see your platform or architecture supported there, please file an issue. See the [installation guide](INSTALL.md) for additional instructions.
## Developing
Finally, if you'd like to run a development build or contribute to the project, please visit our [contributor guide](CONTRIBUTING.md) to get started. To contribute to the KittyCAD Language, see the dedicated [readme](rust/kcl-lib/README.md) for KCL.

1
README.md Symbolic link
View File

@ -0,0 +1 @@
Makefile