Skip to content

Conversation

@verkholantsev
Copy link

Current implementation of getExampleFilename() works in different way on Linux (case sensitive filesystem) and OS X (case insensitive filesystem). This pull request fixes this issue.

@codecov-io
Copy link

codecov-io commented Jun 9, 2017

Codecov Report

Merging #482 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #482      +/-   ##
==========================================
+ Coverage   94.35%   94.39%   +0.04%     
==========================================
  Files          96       96              
  Lines        1258     1285      +27     
  Branches      273      279       +6     
==========================================
+ Hits         1187     1213      +26     
- Misses         68       69       +1     
  Partials        3        3
Impacted Files Coverage Δ
scripts/schemas/config.js 97.14% <100%> (-0.54%) ⬇️

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 26a45bf...41ec558. Read the comment docs.

@sapegin
Copy link
Member

sapegin commented Jun 9, 2017

Thanks for the pull request @verkholantsev! We already have an PR for that — #440 but I’m not sure if @dotcs is going to finish it. Please take a look at the comments there because your implementation has similar issues that I mentioned in the review ;-)

@verkholantsev
Copy link
Author

@sapegin Just added commit that uses _.memoize to create cache for fs.readdirSync(). Are there any more issues, that I didn't noticed it #440?

@sapegin
Copy link
Member

sapegin commented Jun 9, 2017

I think we should clean the cache on code updates otherwise it won’t work when you add new files when Styleguidist is running. But better to test it to make sure how exactly it works ;-)

@verkholantsev
Copy link
Author

@sapegin You are right, this implementation of cache breaks files watching in live server mode.

What way of implementation do you think is the best? Function console.trace() shows me two consumers of getExampleFilename():

  1. loaders/styleguide-loader;
  2. loaders/props-loader.

I've got an idea, but I think it is quite dirty:

  1. Create module that exposes memoized readdirSync and method to reset the cache;
  2. Import this method to that two loaders and reset the cache they are executed.

In this case there will no need to pass some parameters to getExampleFilename() from loaders, but it will create spaghetti-like dependency.

@sapegin
Copy link
Member

sapegin commented Jun 9, 2017

It should be enough to reset cache just in styleguide-loader I think.

@verkholantsev
Copy link
Author

My experiments are failed, I'm closing this PR.

sapegin added a commit that referenced this pull request Jun 24, 2017
sapegin added a commit that referenced this pull request Jun 28, 2017
## New features

### Copy pathline to clipboard button

![](http://wow.sapegin.me/3t2u3S0P0L2T/Image%202017-06-28%20at%204.17.16%20PM.png)

(#485, #471 by @SaraVieira)

### Easier way to override style guide React components

New config option `styleguideComponents` to override React components used to render a style guide.

```javascript
module.exports = {
	styleguideComponents: {
		Logo: path.join(__dirname, 'styleguide/components/Logo'),
		StyleGuideRenderer: path.join(__dirname, 'styleguide/components/StyleGuide'),
	},
};
```

(#504)

### Customizable logging

New `logger` option:

```javascript
module.exports = {
	logger: {
    // One of: info, debug, warn
    // Suppress messages
		info: () => {},
    // Override display function
		warn: message => console.warn(`NOOOOOO: ${message}`),
	},
};
```

(#472, #510)

## Bug fixes

* Allow `devServer.watchConfig` to be configured, this also means Vagrant is now supported (#515, #516 by @esphen)
* Default `getExampleFilename` should be case-insensitive (#423, #460, #440, #482)
* Allow dynamic JSS styles
* Isolate search placeholder styles (#509, #491 by @n1313)
@verkholantsev verkholantsev deleted the make_example_filename_case_insensitive branch March 29, 2018 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants