@stacksjs/defaults 0.75.302 → 0.75.307

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.
@@ -28,7 +28,7 @@ The driver finds a browser at runtime in this order, and falls through to the ne
28
28
  won't launch:
29
29
 
30
30
  1. `$BROWSE_BROWSER` (explicit override — set to an absolute browser path)
31
- 2. PATH: `chromium`, `google-chrome`, `brave-browser`, `microsoft-edge`, …
31
+ 2. PATH: `google-chrome-stable`, `google-chrome`, `chromium`, `chromium-browser`, `brave-browser`, `microsoft-edge`, …
32
32
  3. macOS app bundles (Google Chrome, Chromium, Brave, Edge)
33
33
  4. A Chromium binary already cached on disk (e.g. under `~/Library/Caches/ms-playwright`) —
34
34
  the **binary only** is borrowed; Playwright is never imported.
@@ -121,6 +121,10 @@ bun storage/framework/defaults/ai/skills/stacks-browse/scripts/browse.ts scenari
121
121
  Steps run in order within one isolated browser page, preserving reactive STX state and SPA navigation. Supported actions are `click`, `fill`, `focus`, `press`, `wait`, `evaluate`, and `assert`. Each step is a JSON object passed through a repeatable `--step` flag. Click and focus steps may include `text` to select the matching control from their CSS selector. They scroll matched controls into view before interacting, including controls inside horizontal overflow regions. Evaluate steps run a JavaScript expression in the isolated page and return its serialized value, which is useful for inspecting STX signals and DevTools state between interactions. The command reports every completed step, the final URL and page text, console messages, console exceptions, failed requests, and an optional screenshot. It exits nonzero when the scenario assertion, evaluation, browser console, or network fails.
122
122
  On a failed step, execution stops and the report retains its number and error,
123
123
  the completed steps, final page state and requested screenshot.
124
+ If final page or screenshot collection fails, the report keeps the completed
125
+ steps and available console/network observations, sets the missing result to
126
+ `null`, and records its phase and error in `collectionErrors`. The command still
127
+ exits nonzero. A missing capture does not qualify an older raster as evidence.
124
128
  Use `{"action":"assert","selector":"...","absent":true}` to verify that an element is missing or hidden after an interaction.
125
129
  Use `{"action":"assert","selector":"button","text":"Save","focused":true}` to verify keyboard focus and focus restoration.
126
130
  `press` sends native virtual key codes for Enter, Escape, Tab, the arrow keys,
@@ -45,7 +45,9 @@ function collectCandidates(): string[] {
45
45
  if (process.env.BROWSE_BROWSER)
46
46
  add(process.env.BROWSE_BROWSER)
47
47
 
48
- for (const bin of ['chromium', 'chromium-browser', 'google-chrome-stable', 'google-chrome', 'brave-browser', 'microsoft-edge', 'chrome'])
48
+ // Some distribution Chromium launchers answer --version but cannot open a
49
+ // DevTools target. Prefer an installed Chrome before spending their bounds.
50
+ for (const bin of ['google-chrome-stable', 'google-chrome', 'chromium', 'chromium-browser', 'brave-browser', 'microsoft-edge', 'chrome'])
49
51
  add(which(bin))
50
52
 
51
53
  for (const p of [
@@ -1001,8 +1003,11 @@ async function main() {
1001
1003
  await Bun.sleep(step.settle ?? 250)
1002
1004
  }
1003
1005
 
1004
- const finalState = await cdp.send('Runtime.evaluate', {
1005
- expression: `({
1006
+ const collectionErrors: { phase: string, error: string }[] = []
1007
+ let finalState: unknown = null
1008
+ try {
1009
+ const collected = await cdp.send('Runtime.evaluate', {
1010
+ expression: `({
1006
1011
  url: location.href,
1007
1012
  title: document.title,
1008
1013
  focusHistory: window.__browseFocusHistory || [],
@@ -1016,26 +1021,38 @@ async function main() {
1016
1021
  } : null,
1017
1022
  bodyText: (document.body.innerText || '').replace(/\\s+/g, ' ').trim().slice(0, 500),
1018
1023
  })`,
1019
- returnByValue: true,
1020
- })
1024
+ returnByValue: true,
1025
+ })
1026
+ finalState = collected.result?.value ?? null
1027
+ }
1028
+ catch (error) {
1029
+ collectionErrors.push({ phase: 'final-state', error: error instanceof Error ? error.message : String(error) })
1030
+ }
1021
1031
  let screenshot: string | null = null
1022
1032
  if (typeof flags.out === 'string') {
1023
- screenshot = flags.out
1024
- mkdirSync(screenshot.split('/').slice(0, -1).join('/') || '.', { recursive: true })
1025
- await Bun.write(screenshot, await captureScreenshot(cdp, { full: !!flags.full }))
1033
+ try {
1034
+ const output = flags.out
1035
+ mkdirSync(output.split('/').slice(0, -1).join('/') || '.', { recursive: true })
1036
+ await Bun.write(output, await captureScreenshot(cdp, { full: !!flags.full }))
1037
+ screenshot = output
1038
+ }
1039
+ catch (error) {
1040
+ collectionErrors.push({ phase: 'screenshot', error: error instanceof Error ? error.message : String(error) })
1041
+ }
1026
1042
  }
1027
1043
  const failedRequests = state.responses.filter(response => response.status >= 400)
1028
1044
  console.log(JSON.stringify({
1029
1045
  url,
1030
1046
  viewport: `${viewport.w}x${viewport.h}`,
1031
1047
  steps: results,
1032
- final: finalState.result?.value,
1048
+ final: finalState,
1033
1049
  screenshot,
1050
+ collectionErrors,
1034
1051
  consoleMessages: state.console,
1035
1052
  consoleErrors: state.consoleErrors,
1036
1053
  failedRequests,
1037
1054
  }, null, 2))
1038
- if (scenarioFailed || state.consoleErrors.length || failedRequests.length)
1055
+ if (scenarioFailed || collectionErrors.length || state.consoleErrors.length || failedRequests.length)
1039
1056
  process.exitCode = 1
1040
1057
  state.dispose()
1041
1058
  cdp.close()
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.302",
5
+ "version": "0.75.307",
6
6
  "description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.302",
5
+ "version": "0.75.307",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -45,9 +45,9 @@
45
45
  "dependencies": {
46
46
  "@iconify-json/f7": "^1.2.2",
47
47
  "@iconify-json/hugeicons": "^1.2.35",
48
- "@stacksjs/mobile": "0.75.302",
49
- "@stacksjs/sanitizer": "0.2.687",
50
- "@stacksjs/stx": "0.2.687",
48
+ "@stacksjs/mobile": "0.75.307",
49
+ "@stacksjs/sanitizer": "0.2.691",
50
+ "@stacksjs/stx": "0.2.691",
51
51
  "@xterm/addon-fit": "^0.11.0",
52
52
  "@xterm/xterm": "^6.0.0",
53
53
  "ts-qr-codes": "^0.1.8"