Skip to content

Fix suggested tool JSON formatting for Prettier compliance#446

Merged
vuillaut merged 5 commits into
mainfrom
prettify-suggested-tools
Jun 8, 2026
Merged

Fix suggested tool JSON formatting for Prettier compliance#446
vuillaut merged 5 commits into
mainfrom
prettify-suggested-tools

Conversation

@vuillaut
Copy link
Copy Markdown
Contributor

@vuillaut vuillaut commented Jun 8, 2026

Summary

This PR fixes issue #445 where JSON copied from the "Suggest a new tool" form was not always Prettier-compliant when saved to a file.

What changed

  • Extracted JSON generation into a reusable utility.
  • Updated clipboard export to format JSON using Prettier (parser: json) before copying.
  • Kept preview generation based on the same shared JSON builder.
  • Added regression tests to verify:
    • output ends with trailing newline
    • output is Prettier-compliant
    • output preserves JSON content
  • Added a web test script to run the new test file.

Validation

  • npm --prefix web test
  • npm --prefix web run build

Closes #445.

vuillaut added 5 commits June 8, 2026 15:14
- format clipboard JSON with prettier parser=json

- extract and reuse JSON builder utility

- add regression tests for newline and formatting compliance

- closes #445
Mitigates intermittent npm ci lockfile errors for @emnapi entries on GitHub runners.
@vuillaut vuillaut merged commit e44cfda into main Jun 8, 2026
6 checks passed
@vuillaut vuillaut deleted the prettify-suggested-tools branch June 8, 2026 13: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.

[BUG] - the JSON from the "Suggest a new tool" is not prettified

1 participant