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: remove trailing commas when sanitizing #7007

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

RostiMelk
Copy link
Member

@RostiMelk RostiMelk commented Jun 21, 2024

Description

Remove trailing commas on Journey schema sanitizer as this in will output invalid code that makes Prettier throw in certain cases.

This is a schema that would previously throw:

[{"name":"post","title":"Post","type":"document","fields":[{"name":"title","title":"Title","type":"string"},{"name":"slug","title":"Slug","type":"slug","options":{"source":"title","maxLength":96}},{"name":"author","title":"Author","type":"reference","to":{"type":"author"}},{"name":"mainImage","title":"Main image","type":"image","options":{"hotspot":true}},{"name":"categories","title":"Categories","type":"array","of":[{"type":"reference","to":{"type":"category"}}]},{"name":"publishedAt","title":"Published at","type":"datetime"},{"name":"body","title":"Body","type":"blockContent"}]},{"name":"author","title":"Author","type":"document","fields":[{"name":"name","title":"Name","type":"string"},{"name":"slug","title":"Slug","type":"slug","options":{"source":"name","maxLength":96}},{"name":"image","title":"Image","type":"image","options":{"hotspot":true}},{"name":"bio","title":"Bio","type":"array","of":[{"title":"Block","type":"block","styles":[{"title":"Normal","value":"normal"}],"lists":[]}]}],"preview":{"select":{"title":"name","media":"image"}}},{"name":"category","title":"Category","type":"document","fields":[{"name":"title","title":"Title","type":"string"},{"name":"description","title":"Description","type":"text"}]},{"title":"Block Content","name":"blockContent","type":"array","of":[{"title":"Block","type":"block","styles":[{"title":"Normal","value":"normal"},{"title":"H1","value":"h1"},{"title":"H2","value":"h2"},{"title":"H3","value":"h3"},{"title":"H4","value":"h4"},{"title":"Quote","value":"blockquote"}],"lists":[{"title":"Bullet","value":"bullet"}],"marks":{"decorators":[{"title":"Strong","value":"strong"},{"title":"Emphasis","value":"em"}],"annotations":[{"title":"URL","name":"link","type":"object","fields":[{"title":"URL","name":"href","type":"url"}]}]}},{"type":"image","options":{"hotspot":true}}]}]

What to review

Tbd

Testing

CLI is lacking tests in general, but the plan is to write tests for this journey flow as a follow-up PR very soon.

Notes for release

Tbd

@RostiMelk RostiMelk requested a review from a team as a code owner June 21, 2024 14:12
@RostiMelk RostiMelk requested review from bjoerge and removed request for a team June 21, 2024 14:12
Copy link

vercel bot commented Jun 21, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 2:17pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 2:17pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 2:17pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 2:17pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 2:17pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Jun 21, 2024 2:17pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Jun 21, 2024 2:23 PM (UTC)

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

@binoy14 binoy14 added this pull request to the merge queue Jun 21, 2024
Merged via the queue into next with commit 6b9f910 Jun 21, 2024
44 checks passed
@binoy14 binoy14 deleted the fix/cli/sanitizer-output-double-commas branch June 21, 2024 20:03
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.

None yet

2 participants