Compare commits
50 Commits
jtran/plus
...
absolutely
Author | SHA1 | Date | |
---|---|---|---|
3df618c88e | |||
3a224a0bc8 | |||
3f7c34853f | |||
9a5c659520 | |||
279ea4c17a | |||
de007ccf42 | |||
4c43279b2a | |||
0042afb7ef | |||
b70f78c41e | |||
4d94bb1c22 | |||
03a281a7e5 | |||
e74b52e8c9 | |||
d9883e9059 | |||
e5cb099c32 | |||
4497d282d2 | |||
662ad9b679 | |||
01ef730c9b | |||
bfe6b09c05 | |||
a1107ac6ec | |||
6b312af3a2 | |||
d3c35673c7 | |||
14892a6cfd | |||
81636a9d42 | |||
46f18f9cbc | |||
619e8ac41d | |||
92543c041c | |||
3aa5db46de | |||
15326f06a1 | |||
2cb9979abe | |||
2ce2b33eed | |||
5ae475eadd | |||
6b1dc30906 | |||
a5190f67b4 | |||
aa03807c23 | |||
0630ab77aa | |||
04e85e1d91 | |||
6b268c4084 | |||
fefe66aa91 | |||
c7df0f0266 | |||
95b6b9a026 | |||
a66a0824a2 | |||
bee1362d37 | |||
42b56c2472 | |||
16ef6801e5 | |||
5adcfd7a19 | |||
9c1fff9c96 | |||
8bf72fee8e | |||
776613b676 | |||
e2bee4d901 | |||
31abafd902 |
197
Makefile
197
Makefile
@ -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
|
||||
-:
|
||||
$\:
|
||||
):
|
||||
|
47
README.md
47
README.md
@ -1,47 +0,0 @@
|
||||

|
||||
|
||||
# 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.
|
Reference in New Issue
Block a user