-
Notifications
You must be signed in to change notification settings - Fork 36
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
Full refactor #1
Conversation
…nJS exports and imports
…pguidist dev environment
…les for dev and normal mode
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.
Awesome job, thanks!
Just a few comment.
@@ -1,3 +1,3 @@ | |||
{ |
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.
We don't need this file.
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.
I agree the source doesn't need it but we have to keep it to run our tests ;)
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.
Aha, we need it for the tests. Thanks @cef62 :)
Just remove stage-0
.
@@ -1,2 +1,6 @@ | |||
dist |
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.
This should be:
.opt-out
.opt-in
.snapguidist
node_modules
npm-debug.log
"react-styleguidist": "^4.4.1", | ||
"webpack": "^1.14.0" | ||
"babel-core": "6.20.0", | ||
"babel-loader": "6.2.10", |
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.
We don't need babel-core
and babel-loader
.
const path = require('path') | ||
const snapguidist = require(path.join(__dirname, '..', 'src', 'index')) | ||
|
||
|
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.
Unnecessary new line.
"babel-jest": "18.0.0", | ||
"babel-preset-es2015": "6.18.0", | ||
"babel-preset-react": "6.16.0", | ||
"babel-preset-stage-0": "6.16.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.
We don't need babel-preset-stage-0
.
}, | ||
"peerDependencies": { | ||
"react-styleguidist": "^4.4.1" | ||
"react": ">15", |
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.
This should be:
"react": ">=15",
include: srcFolder, | ||
loader: 'babel', | ||
query: { | ||
presets: [ |
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.
This should be:
presets: [
'es2015',
'react',
],
} | ||
) | ||
|
||
// TODO: should be avoided to add style.css as last item in `entry`? |
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.
// TODO: please remove TODOS :)
|
||
|
||
module.exports = snapguidist({ | ||
title: 'Snapguidist Development Example', |
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.
I'd try to keep the name consistent, what do you think about:
[dev] Snapguidist Styleguide
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.
I like that ;)
@@ -16,8 +16,8 @@ class SnapguidistPlaygroundRenderer extends Component { | |||
} | |||
|
|||
SnapguidistPlaygroundRenderer.propTypes = { | |||
code: PropTypes.string.isRequired, | |||
evalInContext: PropTypes.func.isRequired, | |||
// code: PropTypes.string.isRequired, |
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.
Not sure about this comments, should we remove the propTypes
?
Completely rewritten implementation of the library to benefit of the new
react-styleguidist
API to configure the undelyingexpress
server.Also the setup is reduced to a single action: just process the project
styleguide.config.js
module tosnapguidist
: