Summary #
One commit: the lint rules move from regexes in bash to ast-grep, Biome formats and lints the code, npm gives way to pnpm, and a test that broke just check on main gets a full snapshot.
+package.json # pins @ast-grep/cli and @biomejs/biome (just install)
+pnpm-workspace.yaml # the workspace: the lint tools and the Daemon
+app/pnpm-workspace.yaml, gallery/pnpm-workspace.yaml # projects of their own, nodeLinker: hoisted
+sgconfig.yml # .ts files read as TSX
+lint/rules/*.yml # the 6 rules of scripts/lint.sh, one file each
+lint/tests/*-test.yml # good and bad samples for each rule
+biome.json # 160 columns, recommended rules minus useTemplate
scripts/lint.sh # biome ci, ast-grep test, ast-grep scan, the geist check
justfile # pnpm everywhere, + fmt
scripts/deploy.sh # pnpm install for the App's copy, pnpm deploy --prod for the Daemon
just lint
biome ci format, lint rules, order of imports
ast-grep test each rule still finds its bad samples
ast-grep scan the rules of DESIGN.md and ui/
geist check App and gallery pin the same fonts
- Rules now match code, not lines: a
<Text>withclasson its next line no longer slips through. - Biome is off for
ui/icons.ts(copied from lucide),ui/theme.jsonand assets.useTemplateis off (the code joins strings with+), anduseNodejsImportProtocolis off in the App,uiand the gallery (NSH'sfs/promisesandosare not Node's). - Biome's findings fixed: 2 unused imports, a comma operator in
ListRows,!inReviewDiff, and a test regex whose.matched any character.
pnpm #
- The workspace holds the lint tools (root
package.json) and the Daemon.pnpm deploy --prodstages the Daemon's program forjust deploy, with"files": ["src"]. - The App and the gallery stay out of it. pnpm links packages to a store outside the app's folder, and
nsh buildrefuses a font there ("is outside the app's directory"). So each is a pnpm project of its own, withnodeLinker: hoisted: plain folders, and the build works. - The
.npmrcfiles'legacy-peer-depsbecomesautoInstallPeers: false.allowBuildslets only ast-grep run its install script. - On Linux,
supportedArchitectures: { libc: [current, musl] }andpublicHoistPatterninstall Biome's static musl build at the top ofnode_modules, so CI needs no extra step.
Evidence #
just linton macOS:lint: ok.- In an x86 NixOS container, as CI runs it (
nix-shell -p nodejs_22 pnpm just ripgrep bash ast-grep, pnpm 12.9.0):pnpm install --frozen-lockfile,just lint(lint: ok), the Daemon's type check, and the App's and the gallery's installs all pass. just deploy's steps by hand:pnpm deploy --prodgives a Daemon whose modules load, and the App's copy installs and builds withnsh build.daemon/test/deploy.test.tspasses with a fakepnpm.- Every rule fires on a file with one violation of each, and the rules' samples pass:
app/zz.tsx:1:1: error[screens-no-nsh-base]
app/zz.tsx:2:17: error[screens-no-text-style]
app/zz.tsx:3:11: error[screens-no-badge]
app/zz.tsx:4:17: error[loader-spins]
app/zz.tsx:5:12: error[page-title]
app/zz.tsx:5:12: error[window-widths]
test result: ok. 6 passed; 0 failed;
just test: Daemon 38, App 25, gallery 15 pass.just checkpasses. Onmainit failed onapp/test/Chat.test.tsx:137, a snapshot withoutsubscriptions: the test now starts fromEMPTY_SNAPSHOT, as the others do.
Merge Danger #
Door: two-way
Blast Radius: CI
- CI gets ast-grep from nixpkgs: the npm builds for Linux need a loader that NixOS has not, the musl one included. nixpkgs-unstable has the same 0.51.3. Biome comes from npm in its static musl build, at the pinned version. pnpm comes from nixpkgs (12.9.0).
just deploynow needs pnpm on the PATH, and says so when it is missing.- Biome reformats 35 files, so open branches conflict. Rebase, then run
just fmt.