-
Notifications
You must be signed in to change notification settings - Fork 180
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
(complib) Add dev server for component docs #555
Conversation
e9911b8
to
25d564e
Compare
protocol-designer/.flowconfig
Outdated
@@ -1,4 +1,7 @@ | |||
[ignore] | |||
# ignore .json files in node_modules because some modules have malformed JSON | |||
# in test fixtures (https://github.com/facebook/flow/issues/2364) | |||
.*/node_modules/.*\.json |
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.
So I noticed flow typechecking in PD failed in CI for some reason (which was super weird because I didn't touch PD) and realized:
- This is the same problem I mentioned in (app) Kickoff robot discovery on app launch #547
- It was caused by installing
react-styleguidist
Some Googling led me to facebook/flow#2364. Turns out, react-styleguidist
has a dependency called findup
that has some empty json
files in its test fixtures (which are not npm ignored). So what happens is:
- The flow server starts and tries to parse the JSON
- These files were coincidentally ignored in app and complib, but not pd
- Why is flow parsing node_modules in separate projects?
- Saw this behavior in app and pd
- Willing to bet it's because
@opentrons/components
is symlinked in
- Flow chokes on empty (i.e. malformed) JSON
To work around this, I added an ignore rule for JSON in node_modules. We should keep an eye on this in case it messes with @opentrons/components
which is either inside or outside node_modules depending how symlinks are being followed.
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.
Ugh, yup, pretty sure ignoring JSON under node_modules
broke the Windows build. Removing "Ready for Review" until this is fixed
25d564e
to
117b299
Compare
Codecov Report
@@ Coverage Diff @@
## v3a #555 +/- ##
=======================================
Coverage 71.07% 71.07%
=======================================
Files 156 157 +1
Lines 5318 5318
Branches 89 89
=======================================
Hits 3780 3780
Misses 1508 1508
Partials 30 30
Continue to review full report at Codecov.
|
117b299
to
95d6055
Compare
95d6055
to
be78129
Compare
On Windows (cygwin) after
Not sure if it's my environment, but I did |
be78129
to
13ad2c3
Compare
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.
works on Linux. Looks good! Any clues about why it fails on Windows?
Do you have any thoughts about deploying v3a/develop/master to S3 so design team can see it more easily without noodling around on the command line?
@IanLondon I think that's the logical next step. I know Netlify has some great features for deploying static sites automatically based on branch names |
Weird, I am getting linting errors in |
Given the weird issues we've been seeing here, I'm going to call this PR blocked by #576 because it really seems like lockfiles are misbehaving (missing dependency installs, etc) |
13ad2c3
to
208796e
Compare
With the latest version that uses yarn, I am able to run the dev server on Windows without problems! |
overview
This PR adds a live-reloading documentation + playground dev server to the components library. Uses react-styleguidist. To use it:
cd components make install make dev
To keep this PR a little smaller, I've only added documentation for Buttons and Icons, and intend to follow up with the rest in separate PRs.
Fixes #546
changelog
review requests
Try this out on your own machine! It's pretty cool. This PR also required refactoring of the Button components as discussed in #546, but I think they ended up in a better place, anyway. Just please make sure I didn't break the app or PD