Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ export const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(

## Package Manager

This project uses **pnpm** (v9.0.0) as its package manager.
This project uses **pnpm** (v11) as its package manager.

## Available Commands

### Development

- `pnpm dev` - Start the Electron app in development mode
- `pnpm dev:app` - Start with watch mode
- `pnpm dev` - Start Electron/Vite with a debug Rust addon
- `pnpm dev:release` - Start Electron/Vite with a release Rust addon for representative performance
- `pnpm dev:watch` - Start with automatic debug Rust rebuilds
- `pnpm dev:watch:release` - Start with automatic release Rust rebuilds

### Code Quality

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Stable IDs are identity. Names and Unicode values are editable metadata.

### Prerequisites

- [Node.js](https://nodejs.org/) (v18+)
- [pnpm](https://pnpm.io/) (v9+)
- [Node.js](https://nodejs.org/) (v24)
- [pnpm](https://pnpm.io/) (v11)
- [Rust](https://rustup.rs/) (stable)

### Quick Start
Expand All @@ -61,10 +61,11 @@ git clone https://github.com/shift-editor/shift.git
cd shift

pnpm install
pnpm build:native
pnpm dev
```

`pnpm dev` builds the Rust addon in debug mode. Use `pnpm dev:release` for representative performance, or `pnpm dev:watch` / `pnpm dev:watch:release` to rebuild the addon when Rust changes.

### Command-line inspection

The `shift` CLI can inspect `.shift` source packages without modifying them:
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"private": true,
"description": "Shift font editor monorepo",
"scripts": {
"prepare": "git submodule update --init --recursive && pnpm generate:glyph-info",
"prepare": "pnpm generate:glyph-info",
"dev": "pnpm run build:native:debug && pnpm --filter @shift/desktop dev",
"dev:watch": "./scripts/watch.sh",
"build": "turbo run build",
"dev:release": "pnpm run build:native && pnpm --filter @shift/desktop dev",
"dev:watch": "./scripts/watch.sh debug",
"dev:watch:release": "./scripts/watch.sh release",
"build:native": "pnpm --filter shift-bridge run build",
"build:native:debug": "pnpm --filter shift-bridge run build:debug",
"generate:bridge-types": "turbo run generate:bridge-types",
Expand All @@ -19,11 +20,9 @@
"test:unit": "pnpm turbo run test --filter='!shift-bridge'",
"test:integration": "pnpm test:native && cargo test --workspace",
"test:lint": "pnpm --filter @shift/desktop run lint:check",
"test:typecheck": "pnpm typecheck",
"test:perf": "pnpm --filter @shift/desktop exec vitest bench --run",
"test:playwright": "pnpm --filter @shift/desktop test:e2e",
"test:watch": "turbo run test:watch",
"test:ci": "pnpm test:lint && pnpm format:check && pnpm test:typecheck && pnpm test:unit && pnpm test:native && cargo test --workspace && pnpm deadcode:strict",
"test:native": "turbo run test --filter=shift-bridge",
"typecheck": "pnpm run generate:types && turbo run typecheck",
"lint": "turbo run lint",
Expand Down
2 changes: 1 addition & 1 deletion packages/glyph-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest",
"generate": "tsx scripts/generate.ts",
"generate": "git -C ../.. submodule update --init --recursive packages/glyph-info/vendor/GlyphsInfo && tsx scripts/generate.ts",
"repl": "tsx scripts/repl.ts"
},
"dependencies": {
Expand Down
25 changes: 17 additions & 8 deletions scripts/watch.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
#!/bin/bash
set -euo pipefail

pnpm run build:native:debug
PROFILE="${1:-debug}"

case "$PROFILE" in
debug)
BUILD_SCRIPT="build:native:debug"
;;
release)
BUILD_SCRIPT="build:native"
;;
*)
echo "Usage: $0 [debug|release]" >&2
exit 2
;;
esac

pnpm run "$BUILD_SCRIPT"
pnpm --filter @shift/desktop dev &
DESKTOP_PID=$!

Expand All @@ -13,10 +28,4 @@ cleanup() {

trap cleanup EXIT INT TERM

cargo watch \
-w "crates/shift-font/src/" \
-w "crates/shift-bridge/src/" \
-w "crates/shift-font/Cargo.toml" \
-w "crates/shift-bridge/Cargo.toml" \
-w "Cargo.toml" \
-s "pnpm run build:native:debug && touch apps/desktop/src/main/main.ts"
cargo watch --postpone -s "pnpm run $BUILD_SCRIPT && touch apps/desktop/src/main/main.ts"
44 changes: 31 additions & 13 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
"outputs": ["dist/**", "index.js", "index.d.ts", "*.node"],
"inputs": ["src/**", "package.json", "tsconfig.json"]
},
"build:native": {
"inputs": ["crates/*/src/**", "crates/*/Cargo.toml", "Cargo.toml", "Cargo.lock"],
"outputs": [
"crates/shift-bridge/index.js",
"crates/shift-bridge/index.d.ts",
"crates/shift-bridge/*.node"
]
},
"shift-bridge#build": {
"inputs": [
"src/**",
Expand All @@ -35,15 +27,26 @@
],
"outputs": ["src/bridge/generated.ts"]
},
"dev": {
"dependsOn": ["build:native"],
"cache": false,
"persistent": true
"generate": {
"outputs": ["resources/**"]
},
"typecheck": {
"dependsOn": ["^build", "^generate:bridge-types", "generate:bridge-types"],
"outputs": []
},
"@shift/glyph-info#typecheck": {
"dependsOn": ["generate"],
"outputs": []
},
"@shift/desktop#typecheck": {
"dependsOn": [
"^build",
"@shift/glyph-info#generate",
"^generate:bridge-types",
"generate:bridge-types"
],
"outputs": []
},
"lint": {
"outputs": []
},
Expand All @@ -54,8 +57,13 @@
"outputs": [],
"inputs": ["src/**", "*.config.ts"]
},
"@shift/glyph-info#test": {
"dependsOn": ["generate"],
"outputs": [],
"inputs": ["src/**", "*.config.ts"]
},
"@shift/desktop#test": {
"dependsOn": ["^build"],
"dependsOn": ["^build", "@shift/glyph-info#generate"],
"outputs": [],
"inputs": ["src/**", "*.config.ts"]
},
Expand All @@ -68,6 +76,16 @@
"dependsOn": ["^build"],
"cache": false,
"persistent": true
},
"@shift/glyph-info#test:watch": {
"dependsOn": ["generate"],
"cache": false,
"persistent": true
},
"@shift/desktop#test:watch": {
"dependsOn": ["^build", "@shift/glyph-info#generate"],
"cache": false,
"persistent": true
}
},
"globalEnv": ["NODE_ENV"],
Expand Down