Pulse/package.json
rcourtman 3a24d9694f Route mock toggle npm scripts through toggle-mock.sh
The mock:on and mock:off scripts used GNU 'sed -i' syntax, which fails on
the default macOS BSD sed. The '||' fallback then appended a fresh
PULSE_MOCK_MODE line on every invocation, so a local .env accumulated three
contradictory entries.

They also targeted the repo-root .env, which hot-dev.sh does not consult
when choosing the data directory. hot-dev.sh reads the canonical flag from
tmp/dev-config/.env, written authoritatively by toggle-mock.sh. The npm
wrappers were therefore a no-op that corrupted .env as a side effect, while
leaving the operator believing mock mode had switched.

Point them at toggle-mock.sh, which handles BSD sed, writes the canonical
file, syncs the runtime env and restarts the managed runtime. Add
mock:status and mock:edit; the hot-dev startup banner already advertised
'npm run mock:edit', which did not exist.

Extend the deployment-installability contract to cover the mock wrappers
alongside the existing repo-root dev entry rules, and add a regression test
asserting the wrappers delegate rather than rewriting the flag inline, and
that every mock command named in the hot-dev banner exists.
2026-08-04 00:30:28 +01:00

47 lines
1.9 KiB
JSON

{
"name": "pulse",
"version": "1.0.0",
"description": "<div align=\"center\"> <img src=\"docs/images/pulse-logo.svg\" alt=\"Pulse Logo\" width=\"120\" /> <h1>Pulse</h1> <p><strong>Real-time monitoring for Proxmox, Docker, and Kubernetes infrastructure.</strong></p>",
"main": "index.js",
"directories": {
"doc": "docs",
"test": "tests"
},
"scripts": {
"dev": "./scripts/hot-dev-bg.sh start --takeover",
"dev:lab": "PULSE_DEV_LAB_AGENTS=true ./scripts/hot-dev-bg.sh start --takeover",
"dev:status": "./scripts/hot-dev-bg.sh status",
"dev:status:lab": "PULSE_DEV_LAB_AGENTS=true ./scripts/hot-dev-bg.sh status",
"dev:logs": "./scripts/hot-dev-bg.sh logs",
"dev:stop": "./scripts/hot-dev-bg.sh stop",
"dev:restart": "./scripts/hot-dev-bg.sh restart --takeover",
"dev:restart:lab": "PULSE_DEV_LAB_AGENTS=true ./scripts/hot-dev-bg.sh restart --takeover",
"dev:backend-restart": "./scripts/hot-dev-bg.sh backend-restart",
"dev:verify": "./scripts/hot-dev-bg.sh verify --takeover",
"dev:verify:lab": "PULSE_DEV_LAB_AGENTS=true ./scripts/hot-dev-bg.sh verify --takeover",
"dev:foreground": "./scripts/hot-dev.sh",
"dev:foreground:lab": "PULSE_DEV_LAB_AGENTS=true ./scripts/hot-dev.sh",
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky",
"mock:on": "./scripts/toggle-mock.sh on",
"mock:off": "./scripts/toggle-mock.sh off",
"mock:status": "./scripts/toggle-mock.sh status",
"mock:edit": "./scripts/toggle-mock.sh edit"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rcourtman/Pulse.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",
"bugs": {
"url": "https://github.com/rcourtman/Pulse/issues"
},
"homepage": "https://github.com/rcourtman/Pulse#readme",
"devDependencies": {
"@playwright/test": "1.56.1",
"husky": "^9.1.7"
}
}