create-pmos 0.14.0 → 0.16.0

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.
Files changed (39) hide show
  1. package/README.md +57 -0
  2. package/package.json +1 -1
  3. package/payload/KIT-VERSION +2 -2
  4. package/workspace/README.md +44 -12
  5. package/workspace/design-parity.js +358 -0
  6. package/workspace/lib/console-state.js +48 -1
  7. package/workspace/lib/engine/workflow-state.js +13 -3
  8. package/workspace/lib/find-browser.js +60 -0
  9. package/workspace/lib/focus.js +967 -0
  10. package/workspace/lib/four-panel.js +345 -0
  11. package/workspace/lib/git-info.js +28 -1
  12. package/workspace/lib/handoff.js +280 -0
  13. package/workspace/lib/layout.js +68 -46
  14. package/workspace/lib/mobile-nav.js +157 -0
  15. package/workspace/lib/profiles.js +285 -0
  16. package/workspace/lib/repo-scan.js +469 -0
  17. package/workspace/package-lock.json +29 -2
  18. package/workspace/package.json +14 -4
  19. package/workspace/public/index.html +79 -279
  20. package/workspace/public/pm/app.js +242 -0
  21. package/workspace/public/pm/data.js +877 -0
  22. package/workspace/public/pm/dom.js +116 -0
  23. package/workspace/public/pm/fixture.js +979 -0
  24. package/workspace/public/pm/mobile.css +200 -0
  25. package/workspace/public/pm/mobile.js +403 -0
  26. package/workspace/public/pm/modes.js +1076 -0
  27. package/workspace/public/pm/panel-detail.js +648 -0
  28. package/workspace/public/pm/panel-initiatives.js +426 -0
  29. package/workspace/public/pm/panel-repos.js +460 -0
  30. package/workspace/public/pm/panel-tabs.js +487 -0
  31. package/workspace/public/pm/state.js +164 -0
  32. package/workspace/public/pm/tab-doc.js +279 -0
  33. package/workspace/public/pm/tab-task.js +83 -0
  34. package/workspace/public/pm/tab-term.js +560 -0
  35. package/workspace/public/pm/tokens.css +73 -0
  36. package/workspace/public/vendor/ibm-plex-mono-500.woff2 +0 -0
  37. package/workspace/server.js +1072 -31
  38. package/workspace/public/app.js +0 -3450
  39. package/workspace/public/styles.css +0 -1444
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+ /* find-browser — locate a Chrome/Chromium this machine already has.
3
+ *
4
+ * WHY THIS EXISTS AS A MODULE. Three suites need a browser (ui-test, pm-shell-test, design-parity)
5
+ * and each had its own candidate list. Two of them listed only system paths — /usr/bin/chromium and
6
+ * the two macOS bundles — and so found nothing on a machine whose browser is the Playwright-managed
7
+ * one under a browsers root. What happens then is the part worth naming: the suite prints
8
+ * "no Chrome/Chromium — skipped" and exits 0. **A skip is indistinguishable from a pass in a CI
9
+ * summary**, which is how the browser assertions came to be believed without ever having run. The
10
+ * explainer for this surface found the same thing from the other end: ui-test.js is the only suite
11
+ * that measures real geometry, and it does not run in CI.
12
+ *
13
+ * So discovery is one function, it knows about the Playwright layout, and the callers report a skip
14
+ * as its own outcome rather than as success.
15
+ *
16
+ * NO DOWNLOAD, EVER. This finds a browser; it never fetches one. PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD is
17
+ * the environment's own stance and this module agrees with it: a local PM tool must not pull 150 MB
18
+ * off the network because a test ran.
19
+ */
20
+ const fs = require('fs');
21
+ const path = require('path');
22
+
23
+ // A Playwright browsers root holds versioned directories — chromium-1194, chromium_headless_shell-1194
24
+ // — each with the executable at a platform-specific path inside. Enumerated rather than hard-coded,
25
+ // because the version suffix changes with every Playwright bump and a pinned one silently stops
26
+ // matching (which is the same skip-looks-like-pass failure, arriving later).
27
+ function playwrightCandidates() {
28
+ const roots = [process.env.PLAYWRIGHT_BROWSERS_PATH, '/opt/pw-browsers',
29
+ path.join(process.env.HOME || '', '.cache', 'ms-playwright')].filter(Boolean);
30
+ const out = [];
31
+ for (const root of roots) {
32
+ let entries = [];
33
+ try { entries = fs.readdirSync(root); } catch { continue; }
34
+ for (const dir of entries.sort().reverse()) { // newest version first
35
+ if (!/^chromium/.test(dir)) continue;
36
+ out.push(
37
+ path.join(root, dir, 'chrome-linux', 'chrome'),
38
+ path.join(root, dir, 'chrome-linux', 'headless_shell'),
39
+ path.join(root, dir, 'chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium'),
40
+ path.join(root, dir, 'chrome-win', 'chrome.exe'),
41
+ );
42
+ }
43
+ }
44
+ return out;
45
+ }
46
+
47
+ function findBrowser() {
48
+ const cands = [
49
+ process.env.PMOS_CHROME,
50
+ process.env.PMOS_CHROMIUM,
51
+ ...playwrightCandidates(),
52
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
53
+ '/Applications/Chromium.app/Contents/MacOS/Chromium',
54
+ '/usr/bin/google-chrome', '/usr/bin/chromium', '/usr/bin/chromium-browser',
55
+ 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
56
+ ].filter(Boolean);
57
+ return cands.find((c) => { try { fs.accessSync(c, fs.constants.X_OK); return true; } catch { return false; } });
58
+ }
59
+
60
+ module.exports = { findBrowser, playwrightCandidates };