chore: move OpenWork into pnpm workspace

This commit is contained in:
Benjamin Shafii
2026-01-20 21:00:57 -08:00
parent 546af7773d
commit 32e1f84b0f
202 changed files with 266 additions and 121 deletions

View File

@@ -20,6 +20,9 @@ git -C vendor/opencode pull --ff-only
pnpm tauri dev # Desktop development
pnpm tauri ios dev # iOS development
pnpm tauri android dev # Android development
# Or run directly in the desktop package:
pnpm -C packages/desktop tauri dev
```
## OpenCode Integration

View File

@@ -7,12 +7,12 @@ description: PRD authoring conventions for OpenWork
All new PRDs for OpenWork must live at:
- `vendor/openwork/pr/<prd-name>.md`
- `packages/desktop/pr/<prd-name>.md`
Examples:
- `vendor/openwork/pr/onboarding-1.0.md`
- `vendor/openwork/pr/folder-workspaces-jit.md`
- `packages/desktop/pr/onboarding-1.0.md`
- `packages/desktop/pr/ui-dark-radix.md`
## Why

View File

@@ -23,16 +23,16 @@ git status
### 2) Bump version everywhere
- `package.json` (`version`)
- `src-tauri/tauri.conf.json` (`version`)
- `src-tauri/Cargo.toml` (`version`)
- `packages/desktop/package.json` (`version`)
- `packages/desktop/src-tauri/tauri.conf.json` (`version`)
- `packages/desktop/src-tauri/Cargo.toml` (`version`)
### 3) Validate builds
```bash
pnpm typecheck
pnpm build:web
cargo check --manifest-path src-tauri/Cargo.toml
cargo check --manifest-path packages/desktop/src-tauri/Cargo.toml
```
### 4) Build DMG
@@ -43,7 +43,7 @@ pnpm tauri build --bundles dmg
Expected output (Apple Silicon example):
- `src-tauri/target/release/bundle/dmg/OpenWork_<version>_aarch64.dmg`
- `packages/desktop/src-tauri/target/release/bundle/dmg/OpenWork_<version>_aarch64.dmg`
### 5) Commit + tag
@@ -61,7 +61,7 @@ gh release create vX.Y.Z \
--title "OpenWork vX.Y.Z" \
--notes "<summary>"
gh release upload vX.Y.Z "src-tauri/target/release/bundle/dmg/<DMG_NAME>.dmg" --clobber
gh release upload vX.Y.Z "packages/desktop/src-tauri/target/release/bundle/dmg/<DMG_NAME>.dmg" --clobber
```
## Helper

View File

@@ -1,4 +1,5 @@
import { readFile } from "fs/promises";
import path from "node:path";
import { loadEnv } from "./load-env";
import { run } from "./client";
@@ -6,7 +7,9 @@ async function main() {
await loadEnv();
await run("gh", ["auth", "status"], { allowFailure: false });
const pkgRaw = await readFile("package.json", "utf8");
const desktopPackage = path.join(process.cwd(), "packages", "desktop", "package.json");
const rootPackage = path.join(process.cwd(), "package.json");
const pkgRaw = await readFile(desktopPackage, "utf8").catch(() => readFile(rootPackage, "utf8"));
const pkg = JSON.parse(pkgRaw) as { name?: string; version?: string };
console.log(
@@ -18,7 +21,7 @@ async function main() {
next: [
"pnpm typecheck",
"pnpm build:web",
"cargo check --manifest-path src-tauri/Cargo.toml",
"cargo check --manifest-path packages/desktop/src-tauri/Cargo.toml",
"pnpm tauri build --bundles dmg",
"gh release upload vX.Y.Z <dmg> --clobber",
],

View File

@@ -27,16 +27,16 @@ git status
### 2) Bump version everywhere
- `package.json` (`version`)
- `src-tauri/tauri.conf.json` (`version`)
- `src-tauri/Cargo.toml` (`version`)
- `packages/desktop/package.json` (`version`)
- `packages/desktop/src-tauri/tauri.conf.json` (`version`)
- `packages/desktop/src-tauri/Cargo.toml` (`version`)
### 3) Validate builds
```bash
pnpm typecheck
pnpm build:web
cargo check --manifest-path src-tauri/Cargo.toml
cargo check --manifest-path packages/desktop/src-tauri/Cargo.toml
```
### 4) Build DMG
@@ -47,7 +47,7 @@ pnpm tauri build --bundles dmg
This should produce something like:
- `src-tauri/target/release/bundle/dmg/OpenWork_<version>_aarch64.dmg`
- `packages/desktop/src-tauri/target/release/bundle/dmg/OpenWork_<version>_aarch64.dmg`
### 5) Verify “unsigned” state
@@ -57,7 +57,7 @@ Quick checks:
```bash
# mount the dmg read-only
hdiutil attach -nobrowse -readonly "src-tauri/target/release/bundle/dmg/<DMG_NAME>.dmg"
hdiutil attach -nobrowse -readonly "packages/desktop/src-tauri/target/release/bundle/dmg/<DMG_NAME>.dmg"
# verify signature details (expect ad-hoc or not notarized)
codesign -dv --verbose=4 "/Volumes/<VOLUME>/<APP>.app"
@@ -85,7 +85,7 @@ gh release create vX.Y.Z \
--title "OpenWork vX.Y.Z" \
--notes "<human summary>"
gh release upload vX.Y.Z "src-tauri/target/release/bundle/dmg/<DMG_NAME>.dmg" --clobber
gh release upload vX.Y.Z "packages/desktop/src-tauri/target/release/bundle/dmg/<DMG_NAME>.dmg" --clobber
```
## Local helper scripts

View File

@@ -34,23 +34,25 @@ pnpm tauri android build
## Project Structure
```
vendor/openwork/
src-tauri/
src/
main.rs # Rust entry point
lib.rs # Tauri commands and state
Cargo.toml # Rust dependencies
tauri.conf.json # Tauri configuration
capabilities/ # Permission capabilities
src/
App.tsx # SolidJS root component
index.tsx # Entry point
components/ # UI components
stores/ # Solid stores for state
lib/ # Utilities and OpenCode bridge
index.html # HTML template
package.json # Frontend dependencies
vite.config.ts # Vite configuration
openwork/
packages/
desktop/
src-tauri/
src/
main.rs # Rust entry point
lib.rs # Tauri commands and state
Cargo.toml # Rust dependencies
tauri.conf.json # Tauri configuration
capabilities/ # Permission capabilities
src/
App.tsx # SolidJS root component
index.tsx # Entry point
components/ # UI components
stores/ # Solid stores for state
lib/ # Utilities and OpenCode bridge
index.html # HTML template
package.json # Frontend dependencies
vite.config.ts # Vite configuration
```
@@ -89,7 +91,7 @@ serde_json = "1"
## Tauri Commands (Rust -> JS)
```rust
// src-tauri/src/lib.rs
// packages/desktop/src-tauri/src/lib.rs
use tauri::Manager;
#[tauri::command]