@taraxvoid/voidflow 0.11.0-next → 0.11.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
@@ -204,14 +204,14 @@ remotes:
204
204
  configs:
205
205
  - lefthook/site.yml
206
206
 
207
- # Site-specific differences override the remote by name, e.g. skip tests that
208
- # need a built dist/ before commit:
209
- pre-commit:
210
- commands:
211
- unit:
212
- run: bun run test:unit -- --exclude 'test/build.test.ts'
213
207
  ```
214
208
 
209
+ Lefthook merges `lefthook.yml`, then remotes, then `lefthook-local.yml`, so a
210
+ site's own `lefthook.yml` can add commands (for example image compression) but
211
+ cannot override ones defined here. Differences go through `package.json`
212
+ scripts: define `test:unit:precommit` (for example excluding tests that need a
213
+ built `dist/`) and the pre-commit unit step runs it instead of `test:unit`.
214
+
215
215
  Install the binary through mise (`lefthook = "<version>"` in `mise.toml`) and
216
216
  set `"prepare": "lefthook install"` so `bun install` wires the hooks. `ref`
217
217
  cannot be a commit SHA; pin a release tag.
@@ -287,7 +287,7 @@ Semver, released with [release-please](https://github.com/googleapis/release-ple
287
287
  | maintenance | `release/N.x` | `0.9.4` | `release-N.x` |
288
288
 
289
289
  release-please keeps a standing release PR open on each channel's branch, updated as commits land.
290
- Merging it bumps `package.json` (and [`CHANGELOG.md`](CHANGELOG.md) on stable), tags `vX.Y.Z` (`vX.Y.Z-next[.N]` on `next`),
290
+ Merging it bumps `package.json` (and [`CHANGELOG.md`](CHANGELOG.md) on stable), tags `vX.Y.Z`,
291
291
  creates the GitHub release and publishes to npm and JSR under the channel's dist-tag. The PR is
292
292
  opened with the org's release-bot GitHub App token (`RELEASE_BOT_CLIENT_ID` /
293
293
  `RELEASE_BOT_APP_PRIVATE_KEY`) so CI runs on it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taraxvoid/voidflow",
3
- "version": "0.11.0-next",
3
+ "version": "0.11.1",
4
4
  "description": "Shared workflows, actions and tooling for @taraxvoid sites",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -0,0 +1,20 @@
1
+ import { chmodSync, mkdtempSync, writeFileSync } from 'node:fs'
2
+ import { tmpdir } from 'node:os'
3
+ import { join } from 'node:path'
4
+
5
+ /**
6
+ * GitHub's ubuntu-24.04 runners disable unprivileged user namespaces via
7
+ * AppArmor, so Chrome aborts at launch ("No usable sandbox!"). Returns a shell
8
+ * wrapper that runs `chrome` with --no-sandbox, for use as CHROME_PATH /
9
+ * PUPPETEER_EXECUTABLE_PATH. Only used in CI, where the browser loads our own
10
+ * static build and nothing untrusted.
11
+ */
12
+ export function noSandboxWrapper(chrome: string): string {
13
+ const dir = mkdtempSync(join(tmpdir(), 'voidflow-chrome-'))
14
+ const wrapper = join(dir, 'chrome-no-sandbox')
15
+ // Single-quote the path for sh; escape any embedded single quotes.
16
+ const quoted = `'${chrome.replaceAll("'", `'\\''`)}'`
17
+ writeFileSync(wrapper, `#!/bin/sh\nexec ${quoted} --no-sandbox "$@"\n`)
18
+ chmodSync(wrapper, 0o755)
19
+ return wrapper
20
+ }
@@ -17,6 +17,7 @@ import { existsSync, readdirSync, statSync } from 'node:fs'
17
17
  import { homedir } from 'node:os'
18
18
  import { join, resolve } from 'node:path'
19
19
  import { parseArgs } from 'node:util'
20
+ import { noSandboxWrapper } from './chrome.ts'
20
21
 
21
22
  const { values } = parseArgs({
22
23
  options: {
@@ -94,9 +95,21 @@ const site = `http://localhost:${server.port}`
94
95
  const chrome = findPlaywrightChromium()
95
96
  const env: Record<string, string | undefined> = { ...process.env }
96
97
  if (chrome) {
97
- env.CHROME_PATH = chrome
98
- env.PUPPETEER_EXECUTABLE_PATH = chrome
99
- console.log(`Using Chromium: ${chrome}`)
98
+ // CI runners (ubuntu-24.04) can't create Chrome's sandbox; see chrome.ts.
99
+ // Set VOIDFLOW_CHROME_SANDBOX=1 to keep the sandbox on.
100
+ const launcher =
101
+ process.platform === 'linux' &&
102
+ process.env.CI &&
103
+ !process.env.VOIDFLOW_CHROME_SANDBOX
104
+ ? noSandboxWrapper(chrome)
105
+ : chrome
106
+ env.CHROME_PATH = launcher
107
+ env.PUPPETEER_EXECUTABLE_PATH = launcher
108
+ console.log(
109
+ launcher === chrome
110
+ ? `Using Chromium: ${chrome}`
111
+ : `Using Chromium: ${chrome} (--no-sandbox for CI)`,
112
+ )
100
113
  } else {
101
114
  console.log('No Playwright Chromium found; relying on system Chrome lookup.')
102
115
  }