Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typegen): move type new line separator into formatter #6649

Merged
merged 2 commits into from
May 14, 2024

Conversation

sgulseth
Copy link
Member

@sgulseth sgulseth commented May 14, 2024

Description

Prettier were adding a newline, and then we were adding an additional new line to each type. This moves new line into the maybeFormatCode to either rely on prettier adding it, or adding it manually if prettier is not found.

What to review

Testing

We have test that checks a snapshot, these are updated

Notes for release

fixes a bug where typegen would add an additional new line between types.

@sgulseth sgulseth requested a review from stipsan May 14, 2024 10:44
@sgulseth sgulseth requested a review from a team as a code owner May 14, 2024 10:44
Copy link

vercel bot commented May 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 11:17am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 11:17am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 11:17am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 11:17am

stipsan
stipsan previously approved these changes May 14, 2024
@@ -63,7 +63,7 @@ registerBabel()

function maybeFormatCode(code: string, prettierConfig: PrettierOptions | null): Promise<string> {
if (!prettierConfig) {
return Promise.resolve(code)
return Promise.resolve(`${code}\n`) // add an extra new newline, poor mans formatting
Copy link
Member

Choose a reason for hiding this comment

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

😂

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented May 14, 2024

Component Testing Report Updated May 14, 2024 11:19 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 5s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 7s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 20s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 22s 9 0 0

@sgulseth sgulseth enabled auto-merge May 14, 2024 11:21
@sgulseth sgulseth added this pull request to the merge queue May 14, 2024
Merged via the queue into next with commit 77da7ce May 14, 2024
39 checks passed
@sgulseth sgulseth deleted the fix/typegen-prettier-new-line branch May 14, 2024 15:21
ricokahler pushed a commit that referenced this pull request May 14, 2024
* fix(typegen): move type new line separator into formatter

* fix(typegen): remove double linebreak between schema and query types
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.

3 participants