This repository was archived by the owner on Jan 10, 2024. It is now read-only.
fix fallback block for *.md files - #230
Merged
Merged
Conversation
jaked
requested review from
Wattenberger,
idan and
mattrothenberg
as code owners
December 6, 2022 00:10
jaked
commented
Dec 6, 2022
Comment on lines
3
to
14
| import { AppContext } from "context"; | ||
| import { | ||
| BlocksQueryMeta, | ||
| checkAccess, | ||
| createBranchAndPR, | ||
| CreateBranchParams, | ||
| CreateBranchResponse, | ||
| getBlocksFromRepo, | ||
| getBlocksRepos, | ||
| getBranches, | ||
| getFileContent, | ||
| getFolderContent, |
Contributor
Author
There was a problem hiding this comment.
I organized imports, sorry for noise
mattrothenberg
approved these changes
Dec 6, 2022
Wattenberger
reviewed
Dec 6, 2022
| )?.blocks ?? []; | ||
| blocksRepos | ||
| .find((b) => b.owner === "githubnext" && b.repo === "blocks-examples") | ||
| // TODO(jaked) remove when use-case-block is removed from blocks-examples |
Contributor
There was a problem hiding this comment.
we should be good here, now that githubnext/blocks-examples#70 is merged & pushed!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Right now
*.mdfiles without a specific default block set in metadata fall back to the use case block rather than the Markdown block. The rules for choosing the fallback block are currently:blocks-exampleblock that matches the path but doesn't include*inmatchesblocks-exampleblock that matches the pathThe Markdown block matches
["*.md", "*.markdown", "*"]and the use case block matches["*.md", "*.markdown"], so the use case block is preferred by the first rule.@Wattenberger and I discussed and decided to
blocks-examplesblocks-exampleblock that matches the path but doesn't include*inmatchesblocks-exampleblock that matches the path but doesn't use*to match itblocks-exampleblock that matches the path(Without the new rule,
*.mdfiles would fall back to the code block since it's sorted ahead of the Markdown block.)This change is part 2 of that, and I also filtered out the use case block pending part 1.