Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(docs): regexp for component examples selection #124

Merged
merged 3 commits into from
Aug 23, 2018

Conversation

kuzhelov
Copy link
Contributor

@kuzhelov kuzhelov commented Aug 23, 2018

Problem was discovered when on the page of Layout component examples for ItemLayout were presented. This was caused by the fact that used regexp was too lose to filter out false positive matches.

Previously

  • note that ItemLayout examples are presented on Layout page

image

@kuzhelov kuzhelov added 🧰 bug Something isn't working 🚀 ready for review 🧰 fix Introduces fix for broken behavior. and removed 🧰 bug Something isn't working labels Aug 23, 2018
@codecov
Copy link

codecov bot commented Aug 23, 2018

Codecov Report

Merging #124 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #124   +/-   ##
=======================================
  Coverage   88.35%   88.35%           
=======================================
  Files          47       47           
  Lines         773      773           
  Branches      109      100    -9     
=======================================
  Hits          683      683           
  Misses         87       87           
  Partials        3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2419f8f...c18ff01. Read the comment docs.

@@ -33,7 +33,9 @@ export default class ComponentExamples extends React.Component<IComponentExample
const allPaths = exampleContext.keys()

// rule #1
const indexPath = _.find(allPaths, path => new RegExp(`${displayName}/index.tsx$`).test(path))
const indexPath = _.find(allPaths, path =>
new RegExp(`([/]|^)${displayName}[/]index[.]tsx$`).test(path),
Copy link
Member

Choose a reason for hiding this comment

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

I would vote for \. and similar to be cleaner than [.]

Copy link
Contributor

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Good catch! Thanks for the fix!

@kuzhelov kuzhelov merged commit e1692aa into master Aug 23, 2018
@kuzhelov kuzhelov deleted the fix/regex-for-fetching-component-examples branch August 29, 2018 21:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧰 fix Introduces fix for broken behavior. ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants