getobsrv 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,18 +52,18 @@ a 1366×768 laptop / budget Android?" without the GUI. Build first
52
52
 
53
53
  ```bash
54
54
  # One PNG at a preset's true raster density (+ metadata JSON on stdout):
55
- node bin/obsrv.js snap http://localhost:5173 --preset laptop-768 --out shot.png
55
+ npx -y getobsrv snap http://localhost:5173 --preset laptop-768 --out shot.png
56
56
 
57
57
  # A matrix of screens, cheap-panel simulation, full-page capture:
58
- node bin/obsrv.js snap http://localhost:5173 --matrix laptop-768,android-65,1080p-24 --out shots/
59
- node bin/obsrv.js snap http://localhost:5173 --preset laptop-768 --profile budget-tn --out tn.png
60
- node bin/obsrv.js snap http://localhost:5173 --preset laptop-768 --full-page --out full.png
58
+ npx -y getobsrv snap http://localhost:5173 --matrix laptop-768,android-65,1080p-24 --out shots/
59
+ npx -y getobsrv snap http://localhost:5173 --preset laptop-768 --profile budget-tn --out tn.png
60
+ npx -y getobsrv snap http://localhost:5173 --preset laptop-768 --full-page --out full.png
61
61
 
62
62
  # Machine-readable 1x-vs-2x comparison (ink coverage, row ratios, band deltas):
63
- node bin/obsrv.js diff http://localhost:5173 --preset laptop-768 --out-dir diffout
63
+ npx -y getobsrv diff http://localhost:5173 --preset laptop-768 --out-dir diffout
64
64
  ```
65
65
 
66
- `node bin/obsrv.js --help` lists every preset, profile and flag. Diff findings
66
+ `npx -y getobsrv --help` (or `node bin/obsrv.js --help` in a checkout) lists every preset, profile and flag. Diff findings
67
67
  are informational (exit 0); CI thresholds are the caller's job. A ready-made
68
68
  Claude Code skill that wraps the loop (snap matrix → read the PNGs → diff →
69
69
  fix → re-snap) lives at [skills/obsrv-screens/SKILL.md](skills/obsrv-screens/SKILL.md).
@@ -77,7 +77,7 @@ raster density — the PNG comes back as an inline image up to 1.5 MiB),
77
77
  (every preset and panel profile, no render). Build first, then register:
78
78
 
79
79
  ```bash
80
- claude mcp add --scope user obsrv -- node /Users/opeyemiajagbe/Documents/Projects/Obsrv/bin/obsrv-mcp.js
80
+ claude mcp add --scope user obsrv -- npx -y getobsrv mcp
81
81
  ```
82
82
 
83
83
  ## Develop
package/bin/obsrv.js CHANGED
@@ -12,6 +12,14 @@ const { existsSync, mkdtempSync, rmSync } = require('node:fs')
12
12
  const { tmpdir } = require('node:os')
13
13
  const { join } = require('node:path')
14
14
 
15
+ // `obsrv mcp` serves the MCP server (plain node, no Electron) so one npx
16
+ // invocation covers both: `npx -y getobsrv mcp`.
17
+ if (process.argv[2] === 'mcp') {
18
+ process.argv.splice(2, 1)
19
+ require('./obsrv-mcp.js')
20
+ return
21
+ }
22
+
15
23
  const cliEntry = join(__dirname, '..', 'out', 'main', 'cli.js')
16
24
  if (!existsSync(cliEntry)) {
17
25
  console.error('obsrv: out/main/cli.js is missing — run `npm run build` in the Obsrv repo first')
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "getobsrv",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "See your site the way 1x screens see it",
5
5
  "main": "./out/main/index.js",
6
6
  "bin": {
7
7
  "obsrv": "./bin/obsrv.js",
8
+ "getobsrv": "./bin/obsrv.js",
8
9
  "obsrv-mcp": "./bin/obsrv-mcp.js"
9
10
  },
10
11
  "author": "Opeyemi Ajagbe <auto-report@hydrogenpay.com>",
@@ -15,30 +15,33 @@ where thin fonts, 0.5px hairlines, and low-contrast grey text actually break.
15
15
 
16
16
  ## Commands
17
17
 
18
- Prerequisite: `npm run build` must have been run in the Obsrv repo (the CLI
19
- runs the built `out/`). If a snap fails with "out/main/cli.js is missing", run
20
- `npm run build` in `/Users/opeyemiajagbe/Documents/Projects/Obsrv` first.
18
+ Prerequisite: none when using `npx -y getobsrv` (npm downloads everything,
19
+ including Electron, on first run). In a local Obsrv checkout, run
20
+ `npm install && npm run build` there first.
21
21
 
22
22
  ```bash
23
- OBSRV=/Users/opeyemiajagbe/Documents/Projects/Obsrv/bin/obsrv.js
23
+ # Installed anywhere via npm (first run downloads Electron):
24
+ OBSRV="npx -y getobsrv"
25
+ # Or, in a local Obsrv checkout (faster, no download):
26
+ # OBSRV="node /path/to/Obsrv/bin/obsrv.js"
24
27
 
25
28
  # One screen, one PNG (+ JSON metadata on stdout, humans on stderr):
26
- node $OBSRV snap http://localhost:5173 --preset laptop-768 --out shots/laptop.png
29
+ $OBSRV snap http://localhost:5173 --preset laptop-768 --out shots/laptop.png
27
30
 
28
31
  # The recommended matrix — small laptop, budget phone, 1080p desktop:
29
- node $OBSRV snap http://localhost:5173 --matrix laptop-768,android-65,1080p-24 --out shots/
32
+ $OBSRV snap http://localhost:5173 --matrix laptop-768,android-65,1080p-24 --out shots/
30
33
 
31
34
  # Worst realistic panel (cheap TN) on the small laptop:
32
- node $OBSRV snap http://localhost:5173 --preset laptop-768 --profile budget-tn --out shots/laptop-tn.png
35
+ $OBSRV snap http://localhost:5173 --preset laptop-768 --profile budget-tn --out shots/laptop-tn.png
33
36
 
34
37
  # Whole page, not just the first viewport (device px cap 4096, warns if clamped):
35
- node $OBSRV snap http://localhost:5173 --preset laptop-768 --full-page --out shots/full.png
38
+ $OBSRV snap http://localhost:5173 --preset laptop-768 --full-page --out shots/full.png
36
39
 
37
40
  # Numbers instead of eyeballs: 1x target vs a 2x-reference downsample, JSON to stdout:
38
- node $OBSRV diff http://localhost:5173 --preset laptop-768 --out-dir shots/diff
41
+ $OBSRV diff http://localhost:5173 --preset laptop-768 --out-dir shots/diff
39
42
  ```
40
43
 
41
- `node $OBSRV --help` lists every preset (`1080p-24`, `laptop-768`,
44
+ `$OBSRV --help` lists every preset (`1080p-24`, `laptop-768`,
42
45
  `android-65`, `iphone-61`, …), profile (`reference`, `office-ips`,
43
46
  `budget-tn`, `old-laptop`), and flag (`--width/--height/--dsf`, `--wait`,
44
47
  `--timeout`).