Skip to content

chore: replace mdformat with prettier; bump TS and Python deps#18

Merged
dougborg merged 6 commits into
mainfrom
chore/markdown-prettier-and-deps
Apr 24, 2026
Merged

chore: replace mdformat with prettier; bump TS and Python deps#18
dougborg merged 6 commits into
mainfrom
chore/markdown-prettier-and-deps

Conversation

@dougborg
Copy link
Copy Markdown
Owner

Summary

  • Markdown formatter swap: Replace mdformat (Python) with Prettier (Node) for all .md files. Adds .prettierrc.json (88-char line length, proseWrap: always) and .prettierignore (excludes CHANGELOGs, agent definitions, generated templates, build dirs). Updates .pre-commit-config.yaml and format-markdown poe tasks. Reformats every tracked markdown file under Prettier's style — accounts for most of the diff size.
  • TypeScript deps: Bump semantic-release v24 → v25, @semantic-release/npm v12 → v13, @semantic-release/release-notes-generator v14.0 → v14.1, @types/node v24 → v25, @vitest/coverage-v8 and tsup minor bumps, root prettier ^3.4.2 → ^3.8.3.
  • Python deps: Refresh uv.lock and bump MCP server's prefab-ui constraint from >=0.18,<0.19 to >=0.19,<0.20.
  • Cleanup commit (last): Fix statuspro_mcp_server/pyproject.toml's semantic_release.build_command (was still pip install mdformat... — would have broken the next MCP release) and update agent/contributor docs that still referenced mdformat.

Test plan

  • uv run poe check passes (ruff format/check, ty, yamllint, 192 unit tests)
  • pnpm exec prettier --check '**/*.md' passes against the freshly reformatted tree
  • grep -rn mdformat shows no remaining references outside lockfiles
  • CI green on the PR (build, lint, tests across Python versions)
  • Confirm next MCP semantic-release run uses prettier for the CHANGELOG (will be exercised on the next release)

🤖 Generated with Claude Code

dougborg and others added 4 commits April 22, 2026 10:53
Swaps the markdown toolchain from mdformat + plugins (which transitively
capped markdown-it-py at 3.x) to prettier, which is already used in the
monorepo for generated TS output.

- Drop mdformat, mdformat-gfm, mdformat-tables, mdformat-toc from
  dev deps and [tool.mdformat] config
- Add .prettierrc.json (wrap 88, prose-wrap always, md-only override)
  and .prettierignore (CHANGELOGs, agent/template/skill markdown)
- Swap pre-commit mdformat hook for prettier-markdown
- Update poe format-markdown tasks to call prettier
- Update semantic_release build_command to format CHANGELOG with prettier
- Reformat all markdown to prettier's style (one-time churn)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps via uv lock --upgrade:
- authlib 1.6.11 → 1.7.0
- cachetools 7.0.5 → 7.0.6
- certifi 2026.2.25 → 2026.4.22
- filelock 3.28.0 → 3.29.0
- gitpython 3.1.46 → 3.1.47
- identify 2.6.18 → 2.6.19
- idna 3.11 → 3.12
- markdown-it-py 3.0.0 → 4.0.0 (unblocked by mdformat removal)
- pre-commit 4.5.1 → 4.6.0
- pydantic-settings 2.13.1 → 2.14.0
- uvicorn 0.44.0 → 0.45.0
- prefab-ui 0.18.5 → 0.19.1

MCP server constraint relaxed: prefab-ui >=0.18,<0.19 → >=0.19,<0.20.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…de to v25

- semantic-release 24.2.9 → 25.0.3
- @semantic-release/npm 12.0.2 → 13.1.5
- @types/node 24.12.2 → 25.6.0
- prettier caret 3.4.2 → 3.8.3 (side effect of pnpm update)

Validated with pnpm exec semantic-release --dry-run: all plugins load
cleanly under v25 (bails only on missing GH_TOKEN, which CI supplies).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The mcp server's semantic-release build_command was still installing
mdformat at release time, and several agent/contributor docs still
told users to use mdformat. Update both to match the new toolchain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 22, 2026 22:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes Markdown formatting across the repo by switching from mdformat (Python) to Prettier (Node), while also bumping a set of TypeScript and Python dependencies and updating semantic-release formatting commands to match the new formatter.

Changes:

  • Replace mdformat with Prettier for Markdown formatting (new Prettier config/ignore, updated pre-commit hook + poe tasks, repo-wide markdown reformat).
  • Bump TS tooling deps (semantic-release ecosystem, types/node, vitest/coverage, tsup, prettier).
  • Refresh Python deps/lockfile and update MCP server dependency constraint (prefab-ui).

Reviewed changes

Copilot reviewed 75 out of 80 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
uv.lock Refresh Python lockfile; remove mdformat deps; bump various packages (incl. prefab-ui).
statuspro_public_api_client/docs/testing.md Reformatted under Prettier.
statuspro_public_api_client/docs/guide.md Reformatted under Prettier (contains a small hyphenation typo).
statuspro_public_api_client/docs/cookbook.md Reformatted under Prettier.
statuspro_public_api_client/docs/adr/README.md Reformatted under Prettier.
statuspro_public_api_client/docs/adr/0008-avoid-builder-pattern.md Reformatted under Prettier.
statuspro_public_api_client/docs/adr/0002-openapi-code-generation.md Reformatted under Prettier.
statuspro_public_api_client/docs/adr/0001-transport-layer-resilience.md Reformatted under Prettier.
statuspro_public_api_client/docs/README.md Reformatted under Prettier.
statuspro_mcp_server/pyproject.toml Bump prefab-ui constraint; switch semantic-release build_command to Prettier.
statuspro_mcp_server/docs/examples.md Reformatted under Prettier.
statuspro_mcp_server/docs/docker.md Reformatted under Prettier (incl. JSON/YAML snippets).
statuspro_mcp_server/docs/development.md Reformatted under Prettier; separator normalized to ---.
statuspro_mcp_server/docs/adr/README.md Reformatted under Prettier.
statuspro_mcp_server/docs/adr/0017-automated-tool-documentation.md Reformatted under Prettier.
statuspro_mcp_server/docs/adr/0016-tool-interface-pattern.md Reformatted under Prettier.
statuspro_mcp_server/docs/README.md Reformatted under Prettier.
statuspro_mcp_server/docs/LOGGING.md Reformatted under Prettier (code blocks and examples).
statuspro_mcp_server/README.md Reformatted under Prettier.
statuspro_mcp_server/MCP_CURSOR_SETUP.md Reformatted under Prettier.
pyproject.toml Remove mdformat config/deps; update semantic-release build_command; switch poe markdown tasks to Prettier.
packages/statuspro-client/package.json Bump TS release/tooling dependencies.
packages/statuspro-client/docs/testing.md Reformatted under Prettier (example code quoting/format).
packages/statuspro-client/docs/guide.md Reformatted under Prettier.
packages/statuspro-client/docs/cookbook.md Reformatted under Prettier.
packages/statuspro-client/docs/adr/0002-hey-api-code-generation.md Reformatted under Prettier.
packages/statuspro-client/docs/adr/0001-composable-fetch-wrappers.md Reformatted under Prettier.
packages/statuspro-client/docs/README.md Reformatted under Prettier.
packages/statuspro-client/README.md Reformatted under Prettier.
package.json Bump root Prettier version.
examples/README.md Reformatted under Prettier.
docs/openapi-docs.md Reformatted under Prettier; separator normalized to ---.
docs/index.md Reformatted under Prettier.
docs/adr/README.md Reformatted under Prettier.
docs/adr/0014-github-copilot-custom-agents.md Update mdformat references to Prettier; reformatted.
docs/adr/0013-module-local-documentation.md Reformatted under Prettier.
docs/RELEASE.md Reformatted under Prettier.
docs/PYPI_SETUP.md Reformatted under Prettier.
docs/MONOREPO_SEMANTIC_RELEASE.md Reformatted under Prettier.
docs/CONTRIBUTING.md Update mdformat references to Prettier; reformatted.
docs/CODE_OF_CONDUCT.md Reformatted under Prettier.
README.md Reformatted under Prettier.
CLAUDE.md Reformatted under Prettier.
AGENT_WORKFLOW.md Reformatted under Prettier; separator normalized to ---.
.prettierrc.json Add Prettier config override for Markdown formatting settings.
.prettierignore Add ignore rules (CHANGELOGs, agent files, generated/templates, build dirs).
.pre-commit-config.yaml Replace mdformat hook with Prettier (pnpm) hook for markdown.
.mdformatignore Remove mdformat ignore file (mdformat no longer used).
.github/workflows/README.md Reformatted under Prettier.
.github/pull_request_template.md Reformatted under Prettier.
.github/prompts/update-docs.prompt.md Reformatted under Prettier (now contains broken code fences that need fixing).
.github/prompts/regenerate-client.prompt.md Reformatted under Prettier; separator normalized to ---.
.github/prompts/create-test.prompt.md Reformatted under Prettier; separator normalized to ---.
.github/prompts/create-adr.prompt.md Reformatted under Prettier; mdformat wording updated.
.github/prompts/breakdown-feature.prompt.md Reformatted under Prettier; separator normalized to ---.
.github/instructions/python.instructions.md Reformatted under Prettier; separator normalized to ---.
.github/instructions/python-mcp-server.instructions.md Reformatted under Prettier; separator normalized to ---.
.github/instructions/pytest.instructions.md Reformatted under Prettier; separator normalized to ---.
.github/instructions/markdown.instructions.md Update mdformat references to Prettier; currently has broken fencing that needs fixing.
.github/copilot-instructions.md Update mdformat references to Prettier; reformatted.
.github/agents/guides/shared/VALIDATION_TIERS.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/shared/FILE_ORGANIZATION.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/shared/ARCHITECTURE_QUICK_REF.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/plan/PLANNING_PROCESS.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/plan/ISSUE_TEMPLATES.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/plan/EFFORT_ESTIMATION.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/devops/RELEASE_PROCESS.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/devops/DEPENDENCY_UPDATES.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/devops/CLIENT_REGENERATION.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/devops/CI_DEBUGGING.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/REFACTORING_SUMMARY.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/README.md Reformatted under Prettier; separator normalized to ---.
.github/agents/guides/COPILOT_ARCHITECTURE.md Update mdformat references to Prettier; reformatted.
.github/agents/documentation-writer.agent.md Update mdformat references to Prettier; reformatted.
.devcontainer/README.md Reformatted under Prettier.
.claude/commands/review.md Reformatted under Prettier.
.claude/commands/generate-docs.md Reformatted under Prettier.
.claude/agents/spec-auditor.md Reformatted under Prettier.
.claude/agents/code-modernizer.md Reformatted under Prettier.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

.github/prompts/update-docs.prompt.md:196

  • This prompt has stray triple-backtick fences around the “Success Criteria” section (one opens at the blank line before the header, and another appears at the end). That will render a large portion of the prompt as a code block (and leaves an extra fence), making the prompt hard to read/copy. Remove the unintended code fences so only the intended example blocks are fenced.

Success Criteria

  • All affected documentation updated
  • Docstrings added for public APIs
  • Code examples tested and working
  • Links verified (no broken links)
  • Formatting correct (uv run poe format)
  • Docs build successfully
  • Navigation updated if needed
  • Migration guide for breaking changes
  • Screenshots updated if UI changed
  • Version numbers current

</details>

Comment on lines 139 to 164
````markdown
```python
from statuspro_public_api_client import StatusProClient

async with StatusProClient() as client:
response = await get_products.asyncio_detailed(client=client)
print(f"Found {len(response.parsed.data)} products")
```
````

````

## Blockquotes

```markdown
> This is a quoted section.
> It can span multiple lines.
````

## Horizontal Rules

```markdown
---
```

````

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several Markdown code fences in this file are mismatched/broken (e.g., a stray opening at the end of the “Code Examples” section, and code blocks opened with ```markdown but closed with). This will break rendering of the instructions from that point onward. Please fix the fencing so each block uses matching backtick counts and remove the stray fence.

Copilot uses AI. Check for mistakes.
Comment thread pyproject.toml
Comment on lines 378 to 382
remove_dist = false
commit_author = "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
commit_message = "chore(release): client v{version}"
build_command = "pip install mdformat mdformat-gfm mdformat-tables mdformat-toc && mdformat docs/CHANGELOG.md --wrap 88"
build_command = "pnpm exec prettier --write docs/CHANGELOG.md"
major_on_zero = false
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semantic_release.build_command now runs pnpm exec prettier .... In .github/workflows/release.yml, the Python release jobs install uv but do not set up Node/pnpm, so this command is likely to fail during release (and block publishing). Either ensure the release workflow installs Node + pnpm before running python-semantic-release, or switch build_command to a formatter available in the release environment.

Copilot uses AI. Check for mistakes.
Comment on lines 83 to 87
remove_dist = false
commit_author = "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
commit_message = "chore(release): mcp v{version}"
build_command = "pip install mdformat mdformat-gfm mdformat-tables mdformat-toc && mdformat CHANGELOG.md --wrap 88"
build_command = "pnpm exec prettier --write CHANGELOG.md"
major_on_zero = false
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semantic_release.build_command now runs pnpm exec prettier --write CHANGELOG.md. The release workflow (.github/workflows/release.yml) doesn’t install Node/pnpm in the MCP release job, so this is likely to fail at release time and block publishing. Please add Node + pnpm setup to the release job (or use a build_command that only depends on the Python environment).

Copilot uses AI. Check for mistakes.
Comment thread .prettierrc.json
Comment on lines +4 to +8
"files": "*.md",
"options": {
"printWidth": 88,
"proseWrap": "always"
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.prettierrc.json override uses "files": "*.md", which only matches Markdown files in the repo root. Markdown under subdirectories (e.g., docs/**) won't get the intended printWidth: 88 / proseWrap: always settings. Update the override glob to include nested paths (e.g., **/*.md, or add both patterns) so formatting is consistent across the tree.

Copilot uses AI. Check for mistakes.
Comment on lines +109 to +110
To fetch a single page, pass `page=` explicitly — that disables auto- pagination for the
call:
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unintended space in the hyphenated term auto- pagination, which reads as a typo and can be confusing. Please change it to auto-pagination (or rewrite without a hyphen) so the documentation renders correctly.

Copilot uses AI. Check for mistakes.
`uv run poe format-check` now invokes `pnpm exec prettier` for the
markdown step, but the CI test job, the Copilot setup-steps job, and
the devcontainer onCreate script only had the Python toolchain
installed. Add pnpm + Node setup (CI) and corepack enable +
`pnpm install --frozen-lockfile` (devcontainer) so prettier is
available wherever format-check runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The release workflow's test job runs `uv run poe ci`, which now
invokes prettier through pnpm via `format-check`. Without pnpm setup
the next release would fail at the test gate. Mirror the pnpm setup
already added to ci.yml.

Also collapse the three-entry CHANGELOG list in the prettier
pre-commit hook into `(^|.+/)CHANGELOG\.md$` so it stays correct as
new packages are added (e.g. `statuspro_mcp_server/CHANGELOG.md` was
covered only incidentally by partial-string matching).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@dougborg dougborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review: chore: replace mdformat with prettier; bump TS and Python deps

What this changes

Toolchain swap from mdformat (Python) to Prettier (Node) for all .md files, plus routine TypeScript and Python dependency bumps. Diff size is dominated by the bulk markdown reformat under Prettier's style.

6-Dimensional Analysis

Correctness

  • .prettierignore exclusions are conservative and complete (CHANGELOGs, agent definitions, MCP templates, .claude/skills/, build dirs).
  • Both semantic_release.build_command entries are now consistent — root pyproject.toml formats docs/CHANGELOG.md, MCP pyproject.toml formats CHANGELOG.md (correct because python-semantic-release runs from the MCP directory).
  • pnpm install --frozen-lockfile will succeed — pnpm-lock.yaml was updated in the same commit as package.json bumps.

Design

  • Prettier replaces mdformat across the whole stack: pre-commit hook, poe tasks, semantic-release build commands, CI.
  • Adding pnpm to the Python CI job is a tradeoff (extra setup time × 3 matrix jobs) but preserves the unified format-check task across local dev and CI. Acceptable since the project is already a Python+TS monorepo standardizing on pnpm.

Readability

  • Pre-commit exclude regex tightened to (^|.+/)CHANGELOG\.md$ rather than three explicit paths, so it stays correct as new packages are added.
  • ADR 0014 wording updated from "mdformat exclusion" to "Prettier exclusion".

Performance

  • cache: pnpm configured on actions/setup-node@v6, so subsequent CI runs reuse the pnpm store.
  • corepack enable in devcontainer's oncreate.sh runs in the prebuild phase, not on every container start.

Testing

  • uv run poe check passes locally (192 unit tests, format-check, lint, typecheck).
  • CI re-runs after each fix push.
  • Release pipeline's CHANGELOG formatting will be exercised on the next release — covered by pnpm setup added to release.yml after self-review caught the gap.

Security

  • No new secrets, no auth surfaces touched. Dep bumps land within their declared major versions (TS) or minor range (Python). pnpm install --frozen-lockfile enforces lockfile integrity in CI.

Findings

BLOCKING (resolved before requesting merge)

Missing pnpm setup in release.yml test job — fixed in 3893e0e. The release workflow's test job runs uv run poe ci which expands to ["format-check", "lint", "test-coverage", "docs-build"]. Without pnpm, the first push to main would have failed at the format-check gate, blocking all releases. Now mirrors the pnpm setup added to ci.yml in 9aa65f6.

SUGGESTION (addressed in this PR)

Pre-commit CHANGELOG exclude regex listed three explicit paths — fixed in 3893e0e. statuspro_mcp_server/CHANGELOG.md was matching only by partial-string coincidence. Replaced with (^|.+/)CHANGELOG\.md$ to match .prettierignore's **/CHANGELOG.md semantics.

SUGGESTION (deferred — out of scope)

Stale mypy references across docs/agent files — tracked in #19. The project migrated to ty but ~15 docs/instruction files still reference mypy, including VALIDATION_TIERS.md, copilot-instructions.md, agent definitions, and devcontainer README. Not introduced by this PR; touching it here would scope-creep beyond the markdown formatter swap.

NITPICK (skipped)

  • Devcontainer Node version is "lts" while CI pins "20". Both satisfy package.json's engines.node: ">=20.19.0", so functionally fine. Not changing here.
  • corepack enable in oncreate.sh doesn't pre-check corepack availability. The python:3.13 base image + Node feature reliably ships corepack, and set -e ensures any failure surfaces loudly.

What looks good

  • Complete mdformat removal. No residual references in shell scripts, TOML, YAML, or CI workflows.
  • MCP semantic-release build_command bug caught and fixed before release. Without commit 137bf08, the next MCP release would have failed at pip install mdformat.
  • CI consistency. Three workflows (ci.yml, copilot-setup-steps.yml, release.yml) and the devcontainer all install pnpm the same way, so prettier is available wherever format-check or pre-commit hooks run.
  • pnpm install --frozen-lockfile everywhere. Fails fast if the lockfile drifts, rather than silently resolving fresh deps.

Verdict

Comment / self-review only. Once CI is green on the latest push, ready to merge.

@dougborg dougborg merged commit 4c0058b into main Apr 24, 2026
10 checks passed
@dougborg dougborg deleted the chore/markdown-prettier-and-deps branch April 24, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants