Skip to content

Avoid Blueprint schema formatting changes by build - #1685

Merged
brandonpayton merged 1 commit into
trunkfrom
avoid-schema-formatting-differences-after-build
Aug 12, 2024
Merged

Avoid Blueprint schema formatting changes by build#1685
brandonpayton merged 1 commit into
trunkfrom
avoid-schema-formatting-differences-after-build

Conversation

@brandonpayton

Copy link
Copy Markdown
Member

Motivation for the change, related issues

Every time we run npm run build, the Blueprint schema shows up as changed due to whitespace changes:

% git status
On branch trunk
Your branch is up to date with 'origin/trunk'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   packages/playground/blueprints/public/blueprint-schema.json

I guess this is because the generated schema is later auto-formatted by pre-commit hook here.

Implementation details

To avoid this, I updated the schema generator to format the JSON with our Prettier config as I guess the Nx-based formatter does. Now, after running npm run build there is no more distracting, undesired change to Blueprint schema.

Testing Instructions (or ideally a Blueprint)

  • Run npm run build
  • Observe there is no changed blueprint-schema.json file
@brandonpayton brandonpayton added [Type] Bug An existing feature does not function as intended [Type] Developer Experience labels Aug 12, 2024
@brandonpayton
brandonpayton requested a review from a team August 12, 2024 21:42
@brandonpayton brandonpayton self-assigned this Aug 12, 2024
@brandonpayton
brandonpayton merged commit 910513c into trunk Aug 12, 2024
@brandonpayton
brandonpayton deleted the avoid-schema-formatting-differences-after-build branch August 12, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended [Type] Developer Experience

1 participant