-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fix webpack overriding && Add an example with local file dependencies #965
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e50dbd1
FIX webpack overriding && CLEANUP && ADD example
ndelangen 7ccb773
FIX an issue where a test in a package was using async-await
ndelangen 372c634
FIX unneeded require
ndelangen 98eb575
MOVE all babel-dev-dependencies
ndelangen 3f86f6c
FIX republish script so it exits with !0 if babel fails
ndelangen 5cac10b
FIX problem with duplicate package names
ndelangen eb2eb55
CHANGE travis to cache the .cache folder
ndelangen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"presets": ["env", "stage-0", "react"], | ||
"plugins": [ | ||
["transform-runtime", { | ||
"polyfill": false, | ||
"regenerator": true | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ npm-shrinkwrap.json | |
dist | ||
.tern-port | ||
*.DS_Store | ||
.jest | ||
.cache | ||
junit.xml | ||
coverage/ | ||
*.lerna_backup | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { configure } from '@kadira/storybook'; | ||
|
||
function loadStories() { | ||
require('../src/stories'); | ||
} | ||
|
||
configure(loadStories, module); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "test-cra", | ||
"version": "1.0.0", | ||
"private": true, | ||
"devDependencies": { | ||
"@kadira/storybook": "file:../../packages/react-storybook", | ||
"@kadira/storybook-addons": "file:../../packages/addons", | ||
"@kadira/storybook-channel": "file:../../packages/channel", | ||
"@kadira/storybook-ui": "file:../../packages/storybook-ui", | ||
"@kadira/storybook-addon-actions": "file:../../packages/addon-actions", | ||
"@kadira/storybook-channel-postmsg": "file:../../packages/channel-postmessage", | ||
"react-scripts": "0.9.5" | ||
}, | ||
"dependencies": { | ||
"react": "^15.4.2", | ||
"react-dom": "^15.4.2" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject", | ||
"storybook": "start-storybook -p 9009 -s public", | ||
"build-storybook": "build-storybook -s public" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tag above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>React App</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start`. | ||
To create a production bundle, use `npm run build`. | ||
--> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 80px; | ||
} | ||
|
||
.App-header { | ||
background-color: #222; | ||
height: 150px; | ||
padding: 20px; | ||
color: white; | ||
} | ||
|
||
.App-intro { | ||
font-size: large; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { transform: rotate(0deg); } | ||
to { transform: rotate(360deg); } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { Component } from 'react'; | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
|
||
class App extends Component { | ||
render() { | ||
return ( | ||
<div className="App"> | ||
<div className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<h2>Welcome to React</h2> | ||
</div> | ||
<p className="App-intro"> | ||
To get started, edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<App />, div); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
import './index.css'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
|
||
const buttonStyles = { | ||
border: '1px solid #eee', | ||
borderRadius: 3, | ||
backgroundColor: '#FFFFFF', | ||
cursor: 'pointer', | ||
fontSize: 15, | ||
padding: '3px 10px', | ||
margin: 10, | ||
}; | ||
|
||
const Button = ({ children, onClick }) => ( | ||
<button style={buttonStyles} onClick={onClick}> | ||
{children} | ||
</button> | ||
); | ||
|
||
Button.propTypes = { | ||
children: React.PropTypes.string.isRequired, | ||
onClick: React.PropTypes.func, | ||
}; | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import React from 'react'; | ||
|
||
const styles = { | ||
main: { | ||
margin: 15, | ||
maxWidth: 600, | ||
lineHeight: 1.4, | ||
fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif', | ||
}, | ||
|
||
logo: { | ||
width: 200, | ||
}, | ||
|
||
link: { | ||
color: '#1474f3', | ||
textDecoration: 'none', | ||
borderBottom: '1px solid #1474f3', | ||
paddingBottom: 2, | ||
}, | ||
|
||
code: { | ||
fontSize: 15, | ||
fontWeight: 600, | ||
padding: '2px 5px', | ||
border: '1px solid #eae9e9', | ||
borderRadius: 4, | ||
backgroundColor: '#f3f2f2', | ||
color: '#3a3a3a', | ||
}, | ||
|
||
codeBlock: { | ||
backgroundColor: '#f3f2f2', | ||
padding: '1px 10px', | ||
margin: '10px 0', | ||
}, | ||
}; | ||
|
||
const codeBlock = ` | ||
// Add this code to "src/stories/index.js" | ||
|
||
import '../index.css'; | ||
import App from '../App'; | ||
|
||
storiesOf('App', module) | ||
.add('default view', () => ( | ||
<App /> | ||
)) | ||
`; | ||
|
||
export default class Welcome extends React.Component { | ||
showApp(e) { | ||
e.preventDefault(); | ||
if (this.props.showApp) this.props.showApp(); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div style={styles.main}> | ||
<h1>Welcome to STORYBOOK</h1> | ||
<p> | ||
This is a UI component dev environment for your app. | ||
</p> | ||
<p> | ||
We've added some basic stories inside the | ||
{' '} | ||
<code style={styles.code}>src/stories</code> | ||
{' '} | ||
directory. | ||
<br /> | ||
A story is a single state of one or more UI components. You can have as many stories as you want. | ||
<br /> | ||
(Basically a story is like a visual test case.) | ||
</p> | ||
<p> | ||
See these sample | ||
{' '} | ||
<a style={styles.link} href="#" onClick={this.showApp.bind(this)}>stories</a> | ||
{' '} | ||
for a component called | ||
{' '} | ||
<code style={styles.code}>Button</code> | ||
. | ||
</p> | ||
<p> | ||
Just like that, you can add your own components as stories. | ||
<br /> | ||
Here's how to add your <code style={styles.code}>App</code> component as a story. | ||
<div | ||
style={styles.codeBlock} | ||
dangerouslySetInnerHTML={{ __html: `<pre>${codeBlock}</pre>` }} | ||
/> | ||
</p> | ||
<p> | ||
Usually we create stories with smaller UI components in the app.<br /> | ||
Have a look at the | ||
{' '} | ||
<a | ||
style={styles.link} | ||
href="https://getstorybook.io/docs/basics/writing-stories" | ||
target="_blank" | ||
> | ||
Writing Stories | ||
</a> | ||
{' '} | ||
section in our documentation. | ||
</p> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import { storiesOf, action, linkTo } from '@kadira/storybook'; | ||
import Button from './Button'; | ||
import Welcome from './Welcome'; | ||
|
||
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />); | ||
|
||
storiesOf('Button', module) | ||
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>) | ||
.add('with some emoji', () => <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"lerna": "2.0.0-beta.38", | ||
"lerna": "2.0.0-rc.3", | ||
"version": "3.0.0", | ||
"packages": [ | ||
"packages/*", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should we be on
^15.5.4
as the latest version published?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 for some reason
npm-check-updates
is no longer helping me with this 😞