staysfixed 0.3.0 → 0.4.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 (47) hide show
  1. package/README.md +534 -402
  2. package/package.json +8 -3
  3. package/src/cli/index.js +14 -0
  4. package/src/v2/adapters/android-driver.js +1705 -0
  5. package/src/v2/adapters/android.js +1117 -0
  6. package/src/v2/adapters/contract.js +565 -0
  7. package/src/v2/adapters/electron.js +1594 -0
  8. package/src/v2/adapters/http.js +733 -0
  9. package/src/v2/adapters/ios-driver.js +1551 -0
  10. package/src/v2/adapters/ios.js +989 -0
  11. package/src/v2/adapters/isolate.js +739 -0
  12. package/src/v2/adapters/process.js +920 -0
  13. package/src/v2/adapters/source.js +1241 -0
  14. package/src/v2/adapters/web-driver.js +1532 -0
  15. package/src/v2/adapters/web.js +1009 -0
  16. package/src/v2/adapters/windows.js +1329 -0
  17. package/src/v2/browsers.js +1203 -0
  18. package/src/v2/cause.js +364 -0
  19. package/src/v2/check.js +1331 -0
  20. package/src/v2/ci.js +1209 -0
  21. package/src/v2/cli.js +657 -0
  22. package/src/v2/cluster.js +372 -0
  23. package/src/v2/coverage.js +1116 -0
  24. package/src/v2/detect.js +1199 -0
  25. package/src/v2/doctor.js +1690 -0
  26. package/src/v2/escalate.js +679 -0
  27. package/src/v2/init.js +1394 -0
  28. package/src/v2/intent.js +659 -0
  29. package/src/v2/journeys/from-routes.js +498 -0
  30. package/src/v2/journeys/from-suite.js +988 -0
  31. package/src/v2/journeys/index.js +651 -0
  32. package/src/v2/journeys/record.js +516 -0
  33. package/src/v2/mcp/server.js +374 -0
  34. package/src/v2/mcp/tools.js +1571 -0
  35. package/src/v2/normalise.js +783 -0
  36. package/src/v2/observation.js +877 -0
  37. package/src/v2/rank.js +672 -0
  38. package/src/v2/reference.js +1051 -0
  39. package/src/v2/remote.js +911 -0
  40. package/src/v2/run.js +964 -0
  41. package/src/v2/sealed.js +564 -0
  42. package/src/v2/selfcheck.js +564 -0
  43. package/src/v2/ship.js +684 -0
  44. package/src/v2/store.js +703 -0
  45. package/src/v2/types.js +503 -0
  46. package/src/v2/waiver.js +511 -0
  47. package/src/watch/panel.js +73 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "staysfixed",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Prove that what already worked still works after an agent changed the code. Picture checks, guards for fixed bugs, a pre-release walkthrough, and known-good markers — as a CLI and as an MCP server.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,18 +44,23 @@
44
44
  },
45
45
  "scripts": {
46
46
  "typecheck": "tsc -p tsconfig.json",
47
- "test": "node --test --test-concurrency=1 \"test/*.test.js\"",
47
+ "test": "node --input-type=module -e \"try { const b = await import('./src/v2/browsers.js'); const s = await b.surveyBrowsers({ headless: false }); const own = s.found.find((x) => x.usable && !x.everyday); if (own) process.env.STAYSFIXED_CHROME = own.binary;} catch (e) { console.error('Could not pick a browser of our own, so the tests will use whatever they find: ' + e.message);} const { spawnSync } = await import('node:child_process'); process.exitCode = spawnSync(process.execPath, ['--test', '--test-concurrency=1', 'test/*.test.js', 'test/v2/*.test.js'], { stdio: 'inherit' }).status ?? 1;\"",
48
+ "test:in-your-browser": "node --test --test-concurrency=1 \"test/*.test.js\" \"test/v2/*.test.js\"",
48
49
  "test:determinism": "node --test test/determinism.test.js",
50
+ "test:selfcheck": "node src/v2/selfcheck.js",
51
+ "browsers": "node --input-type=module -e \"const m = await import('./src/v2/browsers.js'); process.exitCode = await m.runBrowsersCommand({ bool: (n) => process.argv.slice(1).includes('--' + n) });\" --",
49
52
  "check": "npm run typecheck && npm test",
50
53
  "staysfixed": "node bin/staysfixed.js"
51
54
  },
52
55
  "dependencies": {
53
56
  "pixelmatch": "^7.2.0",
54
- "pngjs": "^7.0.0"
57
+ "pngjs": "^7.0.0",
58
+ "playwright": "^1.62.1"
55
59
  },
56
60
  "devDependencies": {
57
61
  "@types/node": "^24.0.0",
58
62
  "@types/pngjs": "^6.0.5",
63
+ "playwright": "^1.62.1",
59
64
  "typescript": "^5.9.0"
60
65
  }
61
66
  }
package/src/cli/index.js CHANGED
@@ -9,6 +9,8 @@ import path from 'node:path';
9
9
  import { readFileSync } from 'node:fs';
10
10
  import { StaysFixedError, EXIT } from '../core/errors.js';
11
11
  import { setLogLevel } from '../core/log.js';
12
+ import { V2_COMMANDS } from '../v2/cli.js';
13
+ import { SHIP_COMMANDS } from '../v2/ship.js';
12
14
 
13
15
  /** @type {{version?: string}} */
14
16
  const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
@@ -225,6 +227,18 @@ const COMMANDS = {
225
227
  },
226
228
  };
227
229
 
230
+ /*
231
+ * Version 2 takes over `check` and `doctor`.
232
+ *
233
+ * It is a takeover rather than a second set of names because the answer to "did I
234
+ * break anything" should be one command, not two — and because everything version 1
235
+ * did is still reachable from it: `--pictures`, `--guards` and `--watch` behave
236
+ * exactly as they always have. Anyone who installed this yesterday types the same
237
+ * thing tomorrow.
238
+ */
239
+ Object.assign(COMMANDS, V2_COMMANDS);
240
+ Object.assign(COMMANDS, SHIP_COMMANDS);
241
+
228
242
  /**
229
243
  * @param {string[]} argv
230
244
  * @returns {Promise<number>} the exit code