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(utils): always match exclusion root dirs as complete folder paths #7864

Merged
merged 4 commits into from Aug 1, 2022

Conversation

Josh-Cena
Copy link
Collaborator

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Issue surfaced in #7862

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

@Josh-Cena Josh-Cena added the pr: bug fix This PR fixes a bug in a past release. label Aug 1, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 1, 2022
@netlify
Copy link

netlify bot commented Aug 1, 2022

[V2]

Name Link
🔨 Latest commit b1ec1b9
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62e77936e360c000098aae4f
😎 Deploy Preview https://deploy-preview-7864--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 84 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 77 🟢 100 🟢 100 🟢 100 🟢 90 Report

@@ -68,7 +69,7 @@ export function createAbsoluteFilePathMatcher(

function getRelativeFilePath(absoluteFilePath: string) {
const rootFolder = rootFolders.find((folderPath) =>
absoluteFilePath.startsWith(folderPath),
absoluteFilePath.startsWith(addTrailingSlash(folderPath)),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm unsure between addTrailingSlash and addTrailingPathSeparator. Tentatively went with addTrailingSlash; no one reported the bug before anyway so it won't be a regression

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, never mind: Windows tests tell me that addTrailingPathSeparator is the right one...

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

Size Change: 0 B

Total Size: 812 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 52.8 kB
website/build/assets/css/styles.********.css 110 kB
website/build/assets/js/main.********.js 609 kB
website/build/index.html 40.7 kB

compressed-size-action

Comment on lines +72 to +74
[addSuffix(folderPath, '/'), addSuffix(folderPath, '\\')].some((p) =>
absoluteFilePath.startsWith(p),
),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hacky but this will work for everyone. Remember that a single config may be used to build sites on both Windows and Unix, so we need to cater to 2×2 = 4 cases. I would merge like this.

@Josh-Cena Josh-Cena merged commit 40827c6 into main Aug 1, 2022
@Josh-Cena Josh-Cena deleted the jc/fix-matcher branch August 1, 2022 07:23
This was referenced Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants