Windows checkouts: .gitattributes keeps text files LF (CRLF skills broke gen-adapters); findInstalled builds macOS/Linux paths with posix join; CONTRIBUTING Windows setup and desktop build

This commit is contained in:
CRTkafa 2026-10-21 22:26:30 +08:00
parent 0ac3cd02b0
commit 46f3e56c09
3 changed files with 25 additions and 6 deletions

13
.gitattributes vendored Normal file
View file

@ -0,0 +1,13 @@
* text=auto eol=lf
*.png binary
*.jpg binary
*.ico binary
*.icns binary
*.ttf binary
*.woff2 binary
*.mp4 binary
*.bat text eol=crlf
*.cmd text eol=crlf
# kept byte-for-byte as published upstream (CRLF)
cli/data/play-data-safety-form.csv -text
**/icons/LICENSE.txt -text

View file

@ -13,6 +13,12 @@ bun run ci # full gate before pushing: every check and test (ad
bun run test:browser # only by hand: the suites that start Chrome / Chromium (tests/browser/*.browser.ts)
```
**Windows.** `.gitattributes` keeps every text file LF in the working tree (with `core.autocrlf=true` the skills
came out CRLF and `bun tools/gen-adapters.ts` failed with "no frontmatter"). On a checkout made before that file
existed, run `git rm -r --cached -q . && git reset --hard` once on a clean tree. The desktop app builds with
`cd apps/desktop && bun run sidecar && bunx tauri build` (Rust via rustup; WiX and NSIS are downloaded by Tauri) into
`src-tauri/target/release/bundle/nsis/*-setup.exe` and `bundle/msi/*.msi`.
**Browser tests run only by hand.** The suites that launch a browser (console fill / flow / session / persist, web
capture, glyphs and ligatures, local fonts, feature-graphic fit, site overflow) live in `tests/browser/` as
`*.browser.ts`, which `bun test`, `ci`, `ci:quick` and the Forgejo workflows never pick up. Run `bun run test:browser`

View file

@ -9,7 +9,7 @@
// tests/desktop-dist.test.ts.
import { existsSync, readdirSync } from 'node:fs';
import { homedir } from 'node:os';
import { join } from 'node:path';
import { join, posix } from 'node:path';
export const BUNDLE_ID = 'dev.storebound.desktop';
export const PAGE = 'https://storebound.dev/#download';
@ -101,9 +101,9 @@ export function findInstalled(platform: NodeJS.Platform, env: Record<string, str
// the release acceptance matrix drives the install prompt on a machine that has the app: act as if it had none
if (env.STOREBOUND_DESKTOP_APP === 'none') return null;
if (platform === 'darwin') {
for (const dir of ['/Applications', join(home, 'Applications')]) {
const app = join(dir, 'storebound.app');
if (exists(join(app, 'Contents/MacOS/storebound-desktop'))) return { path: app, how: 'bundle' };
for (const dir of ['/Applications', posix.join(home, 'Applications')]) {
const app = posix.join(dir, 'storebound.app');
if (exists(posix.join(app, 'Contents/MacOS/storebound-desktop'))) return { path: app, how: 'bundle' };
}
return null;
}
@ -118,9 +118,9 @@ export function findInstalled(platform: NodeJS.Platform, env: Record<string, str
}
if (exists('/usr/bin/storebound-desktop')) return { path: '/usr/bin/storebound-desktop', how: 'deb' };
// an AppImage is wherever its owner put it: look in the usual folders (storebound_0.1.0_amd64.AppImage, renamed ones)
for (const dir of [join(home, 'Applications'), join(home, '.local/bin'), join(home, 'Downloads')]) {
for (const dir of [posix.join(home, 'Applications'), posix.join(home, '.local/bin'), posix.join(home, 'Downloads')]) {
const name = list(dir).filter(n => /^storebound(?:[-_][A-Za-z0-9._-]*)?\.AppImage$/i.test(n)).sort().at(-1);
if (name) return { path: join(dir, name), how: 'appimage' };
if (name) return { path: posix.join(dir, name), how: 'appimage' };
}
return null;
}