Fix code snippets in the CMS guides - #14570
Draft
ArmandPhilippot wants to merge 6 commits into
Draft
ArmandPhilippot wants to merge 6 commits into
ArmandPhilippot wants to merge 6 commits into
Conversation
|
Preview deployment ✅ Deployment complete!
|
Contributor
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Still in draft. I need to double check the lines highlighting.
Description (required)
Fixes and formats some code snippets in the CMS guides.
In
apostrophecms.mdx:contentdoesn't exist, so I assume this should bemain. And the<h3>tag wasn't closed.In
builderio.mdx:Binding element 'slug' implicitly has an 'any' type.). The easier fix seems to not destructure the props and explicitly typepostasany.In
buttercms.mdx:responseandresponse.datacan beundefined, so we need to use optional chaining when accessingresponse.data.data.shopitem. Same in the next code snippet.In
cloudcannon.mdx:entrycan beundefined, so we need to handle that case.In
cosmic.mdx:post.metadata.tagsis implicitlyany.aspectRatiodoesn't exist on theImagecomponent. Not sure when this was removed, the related PRs are from 2023: https://github.com/search?q=repo%3Awithastro%2Fastro+aspectRatio&type=pullrequestsIn
drupal.mdx:jsona/lib/JsonaTypesimports (cannot find module). Not sure what the right fix here.In
ghost.mdx:postsisconst posts: void | PostsOrPages, we need to use conditional chainingIn
keystatic.mdx:render()must be imported; this was the old way.tsxand were missing atitle. (usingtsxseems to work once rendered, but not in the code editor)In
kontent-ai.mdx:getStaticPaths()function and<article />were not closed properly.<article />was not closed properly.In
preprcms.mdx:postis implicitlyany.queriesfolder was insrcnotsrc/libearlier.contentis implicitlyany.In
statamic.mdx:postis implicitlyany.pageandlocalecome from nowhere. I think we can replace them with hardcoded strings to explain what they are: some might not be familiar with GraphL and something starting with "my..." would be clearer for them.postbeing implicitlyanyIn
storyblok.mdx:blok,story, andpostare implicitlyany.storyis implicitlyany.In
strapi.mdx:Property 'image' does not exist on type 'Article'; we need to add theimageproperty to theArticleinterface.MyMarkdownComponent.In
tina-cms.mdx:tinadirectory is not a "dotfile": https://tina.io/docs/tina-folder/overviewIn
umbraco.mdx:articleis implicitlyany.article.properties(doesn't exist on type never); we need an explicit type forarticles.In
wordpress.mdx:postis implicitlyanyin several places.I haven't updated the PayloadCMS guide because this seems outdated...
References