-
Notifications
You must be signed in to change notification settings - Fork 0
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
replace create-react-app with create-react-library #78
Conversation
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
=======================================
+ Coverage 93.71% 96% +2.28%
=======================================
Files 24 23 -1
Lines 207 200 -7
Branches 15 14 -1
=======================================
- Hits 194 192 -2
+ Misses 12 8 -4
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
src/.eslintrc
Outdated
@@ -0,0 +1,5 @@ | |||
{ |
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.
Why do we have two files of .eslintrc
?
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.
Good question, this was there when I copied the files over. I’ll remove it
} | ||
|
||
return discourseEndpoint; | ||
return process.env.DISCOURSE_ENDPOINT || "http://localhost:3000"; |
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 we built passing an environment variable I guess right?
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.
Yeah, we need to check how to make this work. If there's more work to do when integrating with the disputes app I'll create a ticket for it
This looks great, couple questions but nothing blocker.
|
Nice work 👌 |
"eslint-plugin-flowtype": "~3.8.1", | ||
"eslint-plugin-import": "^2.13.0", | ||
"eslint-plugin-node": "^7.0.1", | ||
"eslint-plugin-promise": "^4.0.0", |
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.
BTW, having these plugins from eslint but not in the configuration sounds like we are not actually using it.
Are you positive about their usage? I just see in the config flow and react
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.
Let’s talk about this, by default this usess standard js and I would like to use something like that
🎉 This PR is included in version 1.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What: replace create-react-app with create-react-library
Why: work related to debtcollective/disputes#14
How: created a project with create-react-library and moved the files over the header repo once everything was working
Notes
create-react-library
create-react-library is better oriented to create React component libraries than create-react-app. It is based on Rollup which now seems to be the default for creating components (vs webpack which is more oriented to applications).
The build process now works correctly, managing
peerDependencies
correctly, you can see it working in theexample
folder.pretty-quick
pretty-quick doesn't have integration with ESLint (prettier/pretty-quick#22). The problem was that pretty-quick had a different output than the eslint command, and it wasn't using the eslint configuration, which is not what we want.
Prettier has prettier-eslint, we are using through prettier-eslint-cli instead of pretty-quick. This runs prettier and ESLint in one pass.
Let's use this setup in other projects and tweak it as we need it.
gh-pages
We are deploying the example to Github pages https://debtcollective.github.io/header/. This should be done by the CI every time we merge to master.