From da7a095e331141272e724e9487f9a38a641ddbf1 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Mon, 27 Jul 2026 14:44:02 +0200 Subject: [PATCH] chore: move knip config into config/ and Prettier config into package.json Continues trimming the repo root so the README is reached with less scrolling. Root files: 19 -> 15 across both passes. - knip.json -> config/knip.json, joining eslint.config.js and the vitest configs. `npm run knip` now passes --config explicitly. Verified by A/B: the run from the new location produces byte-identical findings and the same five configuration hints as from the root, so knip resolves its globs relative to cwd rather than the config file. Those hints are pre-existing, not caused by the move. - .prettierrc -> the "prettier" key in package.json, a config source Prettier reads natively, so editor format-on-save keeps working with no --config flag anywhere. Verified live: `npm run format:check` still passes across src/**, which it could not if the config had been lost (Prettier's defaults are double quotes at 80 columns and would flag nearly every file). .prettierignore deliberately stays at the root: Prettier resolves it relative to cwd, so moving it would require threading --ignore-path through every script and would break editor integration. Everything else in the root is load-bearing: .editorconfig (walks up from the edited file), .nvmrc/.npmrc (read from the project root), tsconfig.json (bare `tsc` discovers it), LICENSE (GitHub license detection), install.sh (its raw URL is the published one-liner in the README and cannot move without breaking every copy in the wild), plus the five documented .md files. Co-Authored-By: Claude Opus 5 (1M context) --- .prettierrc | 8 -------- CLAUDE.md | 4 ++-- knip.json => config/knip.json | 0 package.json | 10 +++++++++- 4 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 .prettierrc rename knip.json => config/knip.json (100%) diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 4ed049da..00000000 --- a/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "singleQuote": true, - "semi": true, - "tabWidth": 2, - "printWidth": 120, - "trailingComma": "es5", - "endOfLine": "lf" -} diff --git a/CLAUDE.md b/CLAUDE.md index c687d520..fd69da62 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -90,7 +90,7 @@ Codeman is a Claude Code session manager with web interface and autonomous Ralph | Continuous typecheck | `tsc --noEmit --watch` | | Watch-mode test | `npm run test:watch -- test/.test.ts` (always pass a file — bare watch includes the browser suites) | | Test coverage | `npm run test:coverage` | -| Dead-code sweep | `npm run knip` (config in `knip.json`) | +| Dead-code sweep | `npm run knip` (config in `config/knip.json`, passed via `--config`) | | Rebuild gesture overlay | `npm run build:gesture` (esbuild `packages/gesture-control/src/codeman/entry.ts` → `src/web/public/gesture/gesture-codeman.js`; commit the result) | | Build the docker agent image | `node scripts/build-agent-image.mjs` (builds `codeman/agent:base` from `docker/agent.Dockerfile`; prerequisite for Docker cases; `--engine`/`--image`/`--no-cache`) | | Gesture playground | `npm run dev` **in** `packages/gesture-control/` (standalone vite demo, fake tabs) | @@ -102,7 +102,7 @@ Codeman is a Claude Code session manager with web interface and autonomous Ralph **CI**: `.github/workflows/ci.yml` (push to master/main + PRs, Node 22) runs two jobs: **(1)** `check:lockfile`, `typecheck`, `lint`, `check:frontend-syntax`, `format:check`, then a **server boot smoke test** (`tsx src/index.ts web --port 3151` must answer `/api/status` within 30s); **(2)** the **unit/integration test suite** via `npm run test:ci` (`config/vitest.ci.config.ts` — excludes the browser-driven `test/mobile/**` suite, `perf-*` benchmarks, and 3 Playwright tests). Tests are tmux-safe in CI: `TmuxManager` no-ops all shell commands under `VITEST` (see Testing). -**Code style**: Prettier (`singleQuote: true`, `printWidth: 120`, `trailingComma: "es5"`). ESLint flat config (`config/eslint.config.js`) allows `no-console`, warns on `@typescript-eslint/no-explicit-any`. Ignores: `app.js`, `scripts/**/*.mjs`, `src/web/public/vendor/**`, `scripts/remotion/**`. +**Code style**: Prettier (`singleQuote: true`, `printWidth: 120`, `trailingComma: "es5"`) — config lives in the **`"prettier"` key of `package.json`**, not a `.prettierrc` (keeps the repo root short; editors read it natively). `.prettierignore` stays at the root because Prettier resolves it relative to cwd. ESLint flat config (`config/eslint.config.js`) allows `no-console`, warns on `@typescript-eslint/no-explicit-any`. Ignores: `app.js`, `scripts/**/*.mjs`, `src/web/public/vendor/**`, `scripts/remotion/**`. **Prettier scope is deliberately narrow.** `npm run format` globs only `src/**/*.ts` and `src/web/public/**`, and `.prettierignore` then exempts most of `src/web/public/*.js` (app.js, styles.css, index.html, and 14 hand-formatted modules) plus `CLAUDE.md`. Those files are hand-formatted by design; `npm run check:public-assets` and `check:frontend-syntax` are what guard them (NUL bytes + JS syntax), not Prettier. Do not "fix" a file by adding it back to Prettier's scope. diff --git a/knip.json b/config/knip.json similarity index 100% rename from knip.json rename to config/knip.json diff --git a/package.json b/package.json index a3e8e483..be7457a6 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,17 @@ "changeset": "changeset", "version-packages": "changeset version && npm install --package-lock-only && node scripts/check-lockfile-sync.mjs", "check:lockfile": "node scripts/check-lockfile-sync.mjs", - "knip": "npx --yes knip@latest", + "knip": "npx --yes knip@latest --config config/knip.json", "release": "changeset publish" }, + "prettier": { + "singleQuote": true, + "semi": true, + "tabWidth": 2, + "printWidth": 120, + "trailingComma": "es5", + "endOfLine": "lf" + }, "workspaces": [ ".", "packages/*"