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

WIP: Style guide for Styleguidist UI - issue #897 #926

Merged
merged 5 commits into from Apr 10, 2018

Conversation

allison-zhao
Copy link
Contributor

WIP for #897

@styleguidist-bot
Copy link
Collaborator

styleguidist-bot commented Apr 5, 2018

Warnings
⚠️

Changes were made to package.json, but not to package-lock.json.

If you’ve changed any dependencies (added, removed or updated any packages), please run npm install and commit changes in package-lock.json file. Make sure you’re using npm 5+.

Generated by 🚫 dangerJS

@sapegin
Copy link
Member

sapegin commented Apr 5, 2018

Thanks for the pull request! I'll look into failing tests, I didn't expect that ;-£

@sapegin
Copy link
Member

sapegin commented Apr 5, 2018

You can remove defaultExample: true — it will fix errors you see in the browsers console.

@allison-zhao
Copy link
Contributor Author

@sapegin thanks! there was also a React error for getting the same key for an li element so i added Math.random() to the key, let me know if you prefer another way to do it :) Thanks for all the instructions!

Regarding the package-lock warning, I tried removing and npm install again but there's nothing new to commit (I guess it's because I just added a start script and it didn't affect any versioning in package-lock). any idea on what to do here? thanks!

@sapegin
Copy link
Member

sapegin commented Apr 5, 2018

@sapegin thanks! there was also a React error for getting the same key for an li element so i added Math.random() to the key, let me know if you prefer another way to do it :)

Please don't use random keys in React, this is much worse than using indexes as keys (which can be acceptable in rare cases): you're telling React that you have a new object every render, so React has remove a previous element, create and mount a new one, instead of updating an existing one (in case of changed props) or not doing anything at all. This is never what you want ;-) Could you try filepath instead of name?

Regarding the package-lock warning, I tried removing and npm install again but there's nothing new to commit (I guess it's because I just added a start script and it didn't affect any versioning in package-lock).

Ignore that, we need to make the warning more clear ;-) You need to do that if you change any dependencies, which isn't the case here.

@allison-zhao
Copy link
Contributor Author

@sapegin that's really helpful to know - always good to learn best practices in React. Just pushed the change, let me know if you need anything else!

Fix small issues:
* getConfig() with a config object shouldn't try to find a config file
* shouldn't fail when use project has no package.json
* shouldn't have "undefined Style Guide" as a title when use package.json has no name field.
@codecov-io
Copy link

codecov-io commented Apr 5, 2018

Codecov Report

Merging #926 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted Files Coverage Δ
...omponents/ComponentsList/ComponentsListRenderer.js 100% <ø> (ø) ⬆️
scripts/schemas/config.js 87.5% <100%> (ø) ⬆️
styleguide.config.js 100% <100%> (ø)
test/apps/defaults/styleguide.config.js 100% <100%> (ø)
scripts/utils/getUserPackageJson.js 100% <100%> (ø) ⬆️
scripts/config.js 94.11% <100%> (-2.76%) ⬇️

@allison-zhao
Copy link
Contributor Author

@sapegin let me know if there's anything else I can do to get this merged - thanks!

@sapegin sapegin merged commit e089fa3 into styleguidist:master Apr 10, 2018
@sapegin
Copy link
Member

sapegin commented Apr 10, 2018

Thank you, merged 🦄

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.

None yet

4 participants