Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs: point the PM2 Vite example at vite/bin/vite.js instead of the .bin shim (#3914)

[._.]/ Adam Eivyc79f7b34eb92
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index bf3fa2062a..82c0df52ad 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -64,3 +64,4 @@
- `client/src/utils/cityChronotype.js` now exports only `computeChronotypeEnergy`. Its six internal pieces — the two range constants, the neutral-modifier sentinel, and the `parseHour` / `computeEnergy` / `energyModifiers` steps — were exported purely so the unit tests could reach them, but the utils barrel re-exports every module flat, so generic names like `parseHour` and `computeEnergy` sat in the shared namespace waiting to collide with a future module. The tests now drive every one of those behaviors through the public entry point (an unparseable or out-of-range peak window yields the neutral no-op; the `:30` half-hour still lands the peak center at 11.25), plus one assertion that the module's export list stays a single name.
- An AI generate or refine started in the Story Builder now survives clicking another step on the left rail. The step panel is keyed by the active step, so navigating away unmounted it — which tore down the SSE progress stream and threw away the completion handlers, leaving the run to finish on the server with no phase updates, no success or failure toast, and a stale view until a manual refresh. Each run's stream, phase and handlers now live in a provider mounted above the rail (`client/src/hooks/useStoryStepRuns.jsx`), one slot per step id, so runs on different steps can be in flight at once and the panel picks its own run back up — including which character a refine targets — when the user navigates back to it.
- `docs/SELF_UPDATE.md` now documents that `update.sh` / `update.ps1` check out `main` before pulling, stashing a dirty working tree first so the checkout can proceed. The doc described only the `git pull --rebase --autostash`, so anyone running an in-app or CLI update from a feature branch or a detached HEAD was surprised to find their checkout moved to `main` with their work parked in `git stash` — the scripts print the restore commands on completion, but nothing said so up front.
+- The Vite dev server example in `docs/PM2.md` no longer tells you to point PM2 at `node_modules/.bin/vite`. PM2 resolves a relative `script` against its own working directory rather than the app's `cwd`, and the `.bin` entry itself varies by platform and package manager (symlink, `.cmd`/`.ps1` wrapper, generated shell script), none of which the Node interpreter launches uniformly — so a config copy-pasted from the doc crashed on startup. Both the standalone snippet and the complete monorepo example now use the absolute `path.join(__dirname, 'client', 'node_modules', 'vite', 'bin', 'vite.js')` form that PortOS's own `portos-ui` app has always used, with a note explaining why.
diff --git a/docs/PM2.md b/docs/PM2.md
index deb5846b20..88b804d708 100644
--- a/docs/PM2.md
+++ b/docs/PM2.md
@@ -136,10 +136,12 @@ See `PORTS.md` for the full port allocation guide.
### Vite Dev Server (React/Vue UI)
```javascript
+const path = require('path');
+
{
name: 'myapp-client',
- script: 'node_modules/.bin/vite',
- cwd: `${__dirname}/client`,
+ script: path.join(__dirname, 'client', 'node_modules', 'vite', 'bin', 'vite.js'),
+ cwd: path.join(__dirname, 'client'),
args: '--host 0.0.0.0 --port 5571',
env: {
NODE_ENV: 'development'
@@ -148,6 +150,12 @@ See `PORTS.md` for the full port allocation guide.
}
```
+Point `script` at `vite/bin/vite.js` rather than the `node_modules/.bin/vite`
+shim. PM2 resolves `script` relative to its own working directory, not `cwd`,
+and the `.bin` entry is a symlink (a `.cmd` shim on Windows) that PM2 cannot
+launch with the Node interpreter. The absolute `path.join` form is what
+PortOS's own `portos-ui` app uses in `ecosystem.config.cjs`.
+
### Background Daemon
```javascript
@@ -237,6 +245,8 @@ pm2 logs myapp-server
Here's a complete ecosystem file for a typical monorepo:
```javascript
+const path = require('path');
+
module.exports = {
apps: [
{
@@ -254,8 +264,8 @@ module.exports = {
},
{
name: 'myapp-client',
- script: 'node_modules/.bin/vite',
- cwd: `${__dirname}/client`,
+ script: path.join(__dirname, 'client', 'node_modules', 'vite', 'bin', 'vite.js'),
+ cwd: path.join(__dirname, 'client'),
args: '--host 0.0.0.0 --port 5571',
env: {
NODE_ENV: 'development'