-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace storybook with react-cosmos (#609)
* Replace storybook with react-cosmos. Mostly working. * Replace storybook with react-cosmos. Mostly working. * yarn build: both serve and cosmos. Remove broken stories. * yarn build-cosmos: clean build before build. Obey NODE_ENV production or development settings. * cosmos.webpack.js: use root serving path for standalone local dev but under /sb for prod. * cosmos.webpack.js: more testing to put output under /sb in prod. * Remove debug logging * Remove HtmlPlugin from React Cosmos webpack config per random advice on internet. * Testing cosmos build locations. * Testing cosmos build locations 2.
- Loading branch information
1 parent
907b209
commit 77c71ab
Showing
74 changed files
with
1,745 additions
and
10,749 deletions.
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,10 @@ | ||
{ | ||
"hot": "true", | ||
"watchDirs": ["src"], | ||
"hostname": "0.0.0.0", | ||
"port": "8080", | ||
"publicUrl": "./", | ||
"webpack": { | ||
"configPath": ".cosmos.webpack.js" | ||
} | ||
} |
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,43 @@ | ||
const HtmlWebpackPlugin = require('html-webpack-plugin') | ||
const path = require('path') | ||
|
||
|
||
module.exports = { | ||
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', | ||
devServer: { | ||
publicPath: '/cosmos/', | ||
contentBase: path.join(__dirname, 'docs'), | ||
compress: true, | ||
port: 8000, | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, 'docs'), | ||
publicPath: '/cosmos/', | ||
filename: 'index.html', | ||
}, | ||
plugins: [new HtmlWebpackPlugin()], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.jsx$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: ['@babel/preset-react'], | ||
}, | ||
}, | ||
}, | ||
{ | ||
test: /\.svg$/i, | ||
use: ['@svgr/webpack'], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.jsx', '.svg'], | ||
}, | ||
optimization: { | ||
minimize: false | ||
}, | ||
} |
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 |
---|---|---|
|
@@ -13,3 +13,5 @@ | |
|
||
cypress/videos | ||
cypress/screenshots | ||
|
||
storybook-static |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1, shrink-to-fit=no" | ||
/> | ||
<title>React Cosmos</title> | ||
<link rel="icon" href="/sb/_cosmos.ico" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script src="/sb/_playground.js"></script> | ||
</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
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
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
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 React from 'react' | ||
import Loader from './Loader' | ||
|
||
|
||
export default ( | ||
<Loader/> | ||
) |
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,11 @@ | ||
import React from 'react' | ||
import {render} from '@testing-library/react' | ||
import Loader from './Loader' | ||
|
||
|
||
describe('Loader', () => { | ||
it('renders', () => { | ||
const {container} = render(<Loader/>) | ||
expect(container.firstChild).toHaveClass('progress-bar') | ||
}) | ||
}) |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import {TooltipIconButton} from './Buttons' | ||
import ShareIcon from '../assets/icons/Share.svg' | ||
|
||
|
||
export default ( | ||
<TooltipIconButton title={'Hello World'} icon={<ShareIcon/>} onClick={() => console.log('clicked')}/> | ||
) |
Oops, something went wrong.