diff --git a/AGENTS.md b/AGENTS.md index 81f0d7c3a..eb3809ac4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -65,6 +65,8 @@ App dialogs compose the Reka-backed components under `src/components/ui/dialog/` ## Commands +- `bun run dev:portless` — preferred browser development server at `https://open-pencil.localhost`; linked worktrees use `https://.open-pencil.localhost` +- `bun run dev` — direct Vite server at `http://localhost:1420`, used by Playwright, Tauri, and Dev Containers - `bun run check` — type-aware lint + typecheck via oxlint + tsgo + architecture checks (run before committing) - `bun run check:arch` — Steiger architecture lint for project-specific import boundaries - `bun run check:vue` — vue-tsc type-check for app and Vue SDK .vue files @@ -76,6 +78,10 @@ App dialogs compose the Reka-backed components under `src/components/ui/dialog/` - `bun run tauri dev` — desktop app with hot reload - `bun open-pencil --help` — list CLI commands. Common commands include `info`, `tree`, `find`, `node`, `pages`, `variables`, `export`, `import`, `convert`, `lint`, `query`, `selection`, `formats`, `analyze ...`, and `eval` for Figma Plugin API scripting. +## Git worktrees and development servers + +Use `bun run dev:portless` for browser development, especially in worktrees; Portless assigns the main checkout `https://open-pencil.localhost` and each worktree a branch-prefixed URL. Keep `bun run dev` for Playwright, Tauri, and Dev Container flows that require `http://localhost:1420`. + ## Releases & CI ### How to release diff --git a/README.md b/README.md index af82548f5..3989987fc 100644 --- a/README.md +++ b/README.md @@ -253,11 +253,14 @@ See the [roadmap](https://openpencil.dev/development/roadmap) for product direct ```sh bun install -bun run dev # Dev server at localhost:1420 -bun run tauri dev # Desktop app (requires Rust) +bun run dev:portless # Web editor at https://open-pencil.localhost +bun run dev # Direct Vite server at http://localhost:1420 +bun run tauri dev # Desktop app (requires Rust) ``` -Alternatively, open the repository in any [Dev Container](https://containers.dev/)-compatible tool. The container pins Bun, installs the workspace dependencies, and forwards the web editor on port 1420. Start it with `bun run dev` after the container is ready. +The first Portless run creates and trusts a local HTTPS certificate. Linked Git worktrees automatically receive branch-prefixed URLs such as `https://fix-ui.open-pencil.localhost`, so concurrent development servers do not compete for port 1420. Run `bunx portless doctor` if local routing or certificate trust fails. + +Alternatively, open the repository in any [Dev Container](https://containers.dev/)-compatible tool. The container pins Bun, installs the workspace dependencies, and forwards the direct web editor on port 1420. Start it with `bun run dev` after the container is ready. The Dev Container supports the web editor, packages, CLI, and automated checks. Native Tauri development still requires the host setup described below because desktop windows and platform WebView dependencies are not provided in the container. diff --git a/bun.lock b/bun.lock index 20386fdc5..9fcf14f01 100644 --- a/bun.lock +++ b/bun.lock @@ -122,6 +122,7 @@ "oxfmt": "^0.35.0", "oxlint": "1.57.0", "oxlint-tsgolint": "^0.16.0", + "portless": "0.15.5", "publint": "0.3.20", "sherif": "1.12.0", "steiger": "^0.5.13", @@ -257,7 +258,7 @@ }, "packages/harness": { "name": "@open-pencil/harness", - "version": "0.0.0", + "version": "0.14.0", "bin": { "openpencil-harness": "./dist/stdio.mjs", }, @@ -3521,6 +3522,8 @@ "points-on-path": ["points-on-path@0.2.1", "", { "dependencies": { "path-data-parser": "0.1.0", "points-on-curve": "0.2.0" } }, "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g=="], + "portless": ["portless@0.15.5", "", { "os": [ "linux", "win32", "darwin", ], "bin": { "portless": "dist/cli.js" } }, "sha512-zmJu4Q8/fY54oVUT/5NnmF4Ih8wTdCvCf6JCN783dRYl9mXkJBzXSckX2lztGCLIbM70varDjCudAbGKT73XPg=="], + "possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="], "postcss": ["postcss@8.5.26", "", { "dependencies": { "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ=="], diff --git a/package.json b/package.json index 21ba731c8..3492eabc1 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "type": "module", "scripts": { "dev": "vite", + "dev:portless": "portless run vite", "build": "bun run build:packages && bun run lint && vite build", "preview": "vite preview", "storybook": "storybook dev -p 6006", @@ -182,6 +183,7 @@ "oxfmt": "^0.35.0", "oxlint": "1.57.0", "oxlint-tsgolint": "^0.16.0", + "portless": "0.15.5", "publint": "0.3.20", "sherif": "1.12.0", "steiger": "^0.5.13", diff --git a/portless.json b/portless.json new file mode 100644 index 000000000..26ed37b47 --- /dev/null +++ b/portless.json @@ -0,0 +1,3 @@ +{ + "name": "open-pencil" +}