From e17504f989977318f12b93aa6608aea8e7ad2090 Mon Sep 17 00:00:00 2001 From: Tom Wright Date: Tue, 20 Oct 2026 18:08:33 +0100 Subject: [PATCH] Add explicit TypeScript formatting selectors with pinned Prettier --- .prettierrc.json | 8 ++++++++ AGENTS.md | 6 ++++++ README.md | 6 ++++++ bun.lock | 3 +++ .../022-testing-posture-and-shared-harnesses.md | 12 ++++++++++++ effigy.toml | 2 ++ package.json | 1 + 7 files changed, 38 insertions(+) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..a62919ac --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "useTabs": true, + "tabWidth": 2, + "singleQuote": false, + "semi": true, + "trailingComma": "all", + "printWidth": 100 +} diff --git a/AGENTS.md b/AGENTS.md index 1cff2793..065be0fc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -86,6 +86,8 @@ effigy rust:clippy # denies warnings effigy rust:test # filter {args} to the touched crate/package effigy fmt:rust:check # cargo fmt --all --check; read-only effigy fmt:rust # cargo fmt --all; mutates the workspace +effigy fmt:ts -- ts/src/client/format.ts # format the named TypeScript files +effigy fmt:ts:check -- ts/src/client/format.ts # read-only formatting check effigy test:unit # vitest, filter {args} to the touched code effigy test:components # vitest component config effigy test --plan # when the test shape is what you need to know @@ -97,6 +99,10 @@ Run full `effigy qa` (`validate` + `qa:docs`) on `main` at Queue milestones, not as a per-task default. Format selectors stay out of health, validate, and qa; run `fmt:rust:check` when formatted Rust source changed. +TypeScript formatting uses the pinned local Prettier and `.prettierrc.json`. +Pass the changed TypeScript paths explicitly to `fmt:ts` and `fmt:ts:check`. +These selectors do not include Svelte formatting or run automatically in QA. + `underlay-db` Postgres integration tests need a running Docker runtime and are `#[ignore]`d by default; see `README.md` for the bring-up. diff --git a/README.md b/README.md index 2e93ec9a..588626d1 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,14 @@ effigy rust:build effigy rust:check effigy rust:test effigy test:components +effigy fmt:ts -- ts/src/client/format.ts +effigy fmt:ts:check -- ts/src/client/format.ts ``` +TypeScript formatting uses the local pinned Prettier with `.prettierrc.json`. +Pass explicit changed-file paths; formatting is separate from health, validate +and QA. Svelte formatting is outside these selectors' documented scope. + For shared UI discovery, use the ACME reference apps in `underlay-reference` for retained Underlay workflow shells and helpers. Use Poodle's own preview/docs for primitives and generic composites that no longer belong to diff --git a/bun.lock b/bun.lock index e7564a44..85414a3f 100644 --- a/bun.lock +++ b/bun.lock @@ -23,6 +23,7 @@ "jsdom": "^30.1.1", "lucide-static": "^1.48.0", "lucide-svelte": "^1.0.1", + "prettier": "3.9.9", "svelte": "^5.57.1", "svelte-check": "^4.7.6", "tsx": "^4.23.15", @@ -459,6 +460,8 @@ "postcss": ["postcss@8.5.28", "", { "dependencies": { "nanoid": "^3.3.18", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A=="], + "prettier": ["prettier@3.9.9", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg=="], + "pretty-format": ["pretty-format@27.5.1", "", { "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" } }, "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ=="], "prosemirror-changeset": ["prosemirror-changeset@2.4.4", "", { "dependencies": { "prosemirror-transform": "^1.0.0" } }, "sha512-Gyuz9jYdrAeA9I7AholyOes9KUmv/lEwsC5O9s5xF5VB3EgTPsXMGUxz4+H1B+wKVPdZbvRcg1Cp3x8qX+8ofA=="], diff --git a/docs/knowledge/contracts/022-testing-posture-and-shared-harnesses.md b/docs/knowledge/contracts/022-testing-posture-and-shared-harnesses.md index 1a8d2d28..4477af2a 100644 --- a/docs/knowledge/contracts/022-testing-posture-and-shared-harnesses.md +++ b/docs/knowledge/contracts/022-testing-posture-and-shared-harnesses.md @@ -98,6 +98,18 @@ Rules: - `validate` should represent the normal local merge gate - `qa` may layer docs, lint, audits, or other broader checks +### Underlay repository TypeScript formatting + +Underlay's `fmt:ts` and `fmt:ts:check` selectors invoke the root development +dependency's pinned Prettier with the committed `.prettierrc.json` options. +The first writes formatting; the second checks without writing and returns +nonzero for formatting differences or formatter errors. + +Pass explicit changed TypeScript file paths after `--`. These selectors are +separate from `health`, `validate` and `qa`; adding them does not require a +repository-wide formatting migration. They do not establish Svelte formatting +support or prescribe a consumer application's formatter configuration. + ### API minimum posture Every normal API package should prove at least: diff --git a/effigy.toml b/effigy.toml index 92b9d33f..265bed87 100644 --- a/effigy.toml +++ b/effigy.toml @@ -53,6 +53,8 @@ check = "cd {repo} && bun x svelte-check --tsconfig ./ts/tsconfig.json" "rust:test" = "cd {repo} && cargo test --workspace --all-features" "fmt:rust" = "cd {repo} && cargo fmt --all" "fmt:rust:check" = "cd {repo} && cargo fmt --all --check" +"fmt:ts" = "cd {repo} && ./node_modules/.bin/prettier --write {args}" +"fmt:ts:check" = "cd {repo} && ./node_modules/.bin/prettier --check {args}" "test:unit" = "cd {repo} && bun x vitest run {args}" "test:ui" = "cd {repo} && bun x vitest --ui {args}" "test:components" = "cd {repo} && bun x vitest run -c vitest.component.config.ts {args}" diff --git a/package.json b/package.json index 8248d54a..f885380d 100644 --- a/package.json +++ b/package.json @@ -344,6 +344,7 @@ "bits-ui": "^2.19.3", "lucide-static": "^1.48.0", "lucide-svelte": "^1.0.1", + "prettier": "3.9.9", "svelte": "^5.57.1", "svelte-check": "^4.7.6", "tsx": "^4.23.15",