facebook / docusaurus Public
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(content-docs): warn when files are not tracked #6937
Conversation
|
@Josh-Cena there are some changes here related to devcontainer configuration. Please let me know if you would like me to detach them from this PR. |
|
|
Lighthouse ran on https://deploy-preview-6937--docusaurus-2.netlify.app/ |
|
BTW, it's great that we have people developing with dev containers/vscode jest extensions, etc. I've personally never figured out how that worked so I just have it disabled |
| @@ -31,8 +36,16 @@ export async function getFileLastUpdate( | |||
| if (err instanceof GitNotFoundError && !showedGitRequirementError) { | |||
| logger.warn('Sorry, the docs plugin last update options require Git.'); | |||
| showedGitRequirementError = true; | |||
| } else if ( | |||
| err instanceof FileNotTrackedError && | |||
| !showedFileNotTrackedError | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not 100% sure to understand the goal of this condition here
the 1st time you print a custom message, and the next times you fallback to the else branch that shows the raw FileNotTrackedError ? That looks a bit weird to me.
Can you add a test to cover the intended behavior please? (like having 2 untracked git files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW not convinced that using global variables is the solution, but we can keep this for now
When building for i18n, those variables are not "reset" so a warning for the first i18n locale might not be shown for the 2nd i18n locale anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, logic mistake there
I think i18n is fine, since there's no "context" in this error about which file is not tracked. Before this error was silently swallowed anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't believe I left this pass.
If you guys haven't started to fix it yet, I can do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you can go ahead!
Refs cardano-foundation/developer-portal#557
Refs #6593