Remove Storybook (#4397)
This commit is contained in:
		
				
					committed by
					
						
						Eugen Rochko
					
				
			
			
				
	
			
			
			
						parent
						
							f2233c3e25
						
					
				
				
					commit
					aa803153e2
				
			@@ -4,7 +4,6 @@ public/system
 | 
			
		||||
public/assets
 | 
			
		||||
public/packs
 | 
			
		||||
node_modules
 | 
			
		||||
storybook
 | 
			
		||||
neo4j
 | 
			
		||||
vendor/bundle
 | 
			
		||||
.DS_Store
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,6 @@ node_modules/
 | 
			
		||||
public/assets/
 | 
			
		||||
public/system/
 | 
			
		||||
spec/
 | 
			
		||||
storybook/
 | 
			
		||||
tmp/
 | 
			
		||||
.vagrant/
 | 
			
		||||
vendor/bundle/
 | 
			
		||||
 
 | 
			
		||||
@@ -2,4 +2,3 @@ node_modules/
 | 
			
		||||
.cache/
 | 
			
		||||
docs/
 | 
			
		||||
spec/
 | 
			
		||||
storybook/
 | 
			
		||||
 
 | 
			
		||||
@@ -7,9 +7,8 @@
 | 
			
		||||
    "build:production": "cross-env RAILS_ENV=production ./bin/webpack",
 | 
			
		||||
    "manage:translations": "node ./config/webpack/translationRunner.js",
 | 
			
		||||
    "start": "node ./streaming/index.js",
 | 
			
		||||
    "storybook": "cross-env NODE_ENV=test start-storybook -s ./public -p 9001 -c storybook",
 | 
			
		||||
    "test": "npm run test:lint && npm run test:mocha",
 | 
			
		||||
    "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ storybook/ streaming/",
 | 
			
		||||
    "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ streaming/",
 | 
			
		||||
    "test:mocha": "cross-env NODE_ENV=test mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/*.test.js",
 | 
			
		||||
    "postinstall": "npm rebuild node-sass"
 | 
			
		||||
  },
 | 
			
		||||
@@ -120,8 +119,6 @@
 | 
			
		||||
    "websocket.js": "^0.1.12"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@storybook/addon-actions": "^3.1.8",
 | 
			
		||||
    "@storybook/react": "^3.1.8",
 | 
			
		||||
    "babel-eslint": "^7.2.3",
 | 
			
		||||
    "chai": "^4.1.0",
 | 
			
		||||
    "chai-enzyme": "^0.8.0",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +0,0 @@
 | 
			
		||||
import { configure } from '@storybook/react';
 | 
			
		||||
import { addLocaleData } from 'react-intl';
 | 
			
		||||
import en from 'react-intl/locale-data/en';
 | 
			
		||||
import '../app/javascript/styles/application.scss';
 | 
			
		||||
import './storybook.scss';
 | 
			
		||||
 | 
			
		||||
addLocaleData(en);
 | 
			
		||||
 | 
			
		||||
let req = require.context('./stories/', true, /.story.js$/);
 | 
			
		||||
 | 
			
		||||
function loadStories () {
 | 
			
		||||
  req.keys().forEach((filename) => req(filename));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
configure(loadStories, module);
 | 
			
		||||
@@ -1,24 +0,0 @@
 | 
			
		||||
export default {
 | 
			
		||||
  meta: {
 | 
			
		||||
    admin: 1,
 | 
			
		||||
    domain: 'example.com',
 | 
			
		||||
    me: 2,
 | 
			
		||||
  },
 | 
			
		||||
  accounts: {
 | 
			
		||||
    1: {
 | 
			
		||||
      acct: 'admin',
 | 
			
		||||
      avatar: '/avatars/original/missing.png',
 | 
			
		||||
      id: 1,
 | 
			
		||||
      url: 'https://example.com/@admin',
 | 
			
		||||
    },
 | 
			
		||||
    2: {
 | 
			
		||||
      acct: 'user',
 | 
			
		||||
      avatar: '/avatars/original/missing.png',
 | 
			
		||||
      id: 1,
 | 
			
		||||
      url: 'https://example.com/@user',
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  media_attachments: {
 | 
			
		||||
    accept_content_types: [],
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
@@ -1,18 +0,0 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { List } from 'immutable';
 | 
			
		||||
import { storiesOf } from '@storybook/react';
 | 
			
		||||
import { action } from '@storybook/addon-actions';
 | 
			
		||||
import AutosuggestTextarea from 'mastodon/components/autosuggest_textarea';
 | 
			
		||||
 | 
			
		||||
const props = {
 | 
			
		||||
  onChange: action('changed'),
 | 
			
		||||
  onPaste: action('pasted'),
 | 
			
		||||
  onSuggestionSelected: action('suggestionsSelected'),
 | 
			
		||||
  onSuggestionsClearRequested: action('suggestionsClearRequested'),
 | 
			
		||||
  onSuggestionsFetchRequested: action('suggestionsFetchRequested'),
 | 
			
		||||
  suggestions: List([]),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
storiesOf('AutosuggestTextarea', module)
 | 
			
		||||
  .add('default state', () => <AutosuggestTextarea value='' {...props} />)
 | 
			
		||||
  .add('with text', () => <AutosuggestTextarea value='Hello' {...props} />);
 | 
			
		||||
@@ -1,18 +0,0 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { storiesOf } from '@storybook/react';
 | 
			
		||||
import { action } from '@storybook/addon-actions';
 | 
			
		||||
import Button from 'mastodon/components/button';
 | 
			
		||||
 | 
			
		||||
storiesOf('Button', module)
 | 
			
		||||
  .add('default state', () => (
 | 
			
		||||
    <Button text='submit' onClick={action('clicked')} />
 | 
			
		||||
  ))
 | 
			
		||||
  .add('secondary', () => (
 | 
			
		||||
    <Button secondary text='submit' onClick={action('clicked')} />
 | 
			
		||||
  ))
 | 
			
		||||
  .add('disabled', () => (
 | 
			
		||||
    <Button disabled text='submit' onClick={action('clicked')} />
 | 
			
		||||
  ))
 | 
			
		||||
  .add('block', () => (
 | 
			
		||||
    <Button block text='submit' onClick={action('clicked')} />
 | 
			
		||||
  ));
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { storiesOf } from '@storybook/react';
 | 
			
		||||
import CharacterCounter from 'mastodon/features/compose/components/character_counter';
 | 
			
		||||
 | 
			
		||||
storiesOf('CharacterCounter', module)
 | 
			
		||||
  .add('no text', () => {
 | 
			
		||||
    const text = '';
 | 
			
		||||
    return <CharacterCounter text={text} max={500} />;
 | 
			
		||||
  })
 | 
			
		||||
  .add('a few strings text', () => {
 | 
			
		||||
    const text = '0123456789';
 | 
			
		||||
    return <CharacterCounter text={text} max={500} />;
 | 
			
		||||
  })
 | 
			
		||||
  .add('the same text', () => {
 | 
			
		||||
    const text = '01234567890123456789';
 | 
			
		||||
    return <CharacterCounter text={text} max={20} />;
 | 
			
		||||
  })
 | 
			
		||||
  .add('over text', () => {
 | 
			
		||||
    const text = '01234567890123456789012345678901234567890123456789';
 | 
			
		||||
    return <CharacterCounter text={text} max={10} />;
 | 
			
		||||
  });
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { IntlProvider } from 'react-intl';
 | 
			
		||||
import { storiesOf } from '@storybook/react';
 | 
			
		||||
import en from 'mastodon/locales/en.json';
 | 
			
		||||
import LoadingIndicator from 'mastodon/components/loading_indicator';
 | 
			
		||||
 | 
			
		||||
storiesOf('LoadingIndicator', module)
 | 
			
		||||
  .add('default state', () => (
 | 
			
		||||
    <IntlProvider locale='en' messages={en}>
 | 
			
		||||
      <LoadingIndicator />
 | 
			
		||||
    </IntlProvider>
 | 
			
		||||
  ));
 | 
			
		||||
@@ -1,24 +0,0 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { Provider } from 'react-redux';
 | 
			
		||||
import { IntlProvider } from 'react-intl';
 | 
			
		||||
import { storiesOf } from '@storybook/react';
 | 
			
		||||
import { action } from '@storybook/addon-actions';
 | 
			
		||||
import en from 'mastodon/locales/en.json';
 | 
			
		||||
import configureStore from 'mastodon/store/configureStore';
 | 
			
		||||
import { hydrateStore } from 'mastodon/actions/store';
 | 
			
		||||
import OnboadingModal from 'mastodon/features/ui/components/onboarding_modal';
 | 
			
		||||
import initialState from '../initial_state';
 | 
			
		||||
 | 
			
		||||
const store = configureStore();
 | 
			
		||||
store.dispatch(hydrateStore(initialState));
 | 
			
		||||
 | 
			
		||||
storiesOf('OnboadingModal', module)
 | 
			
		||||
  .add('default state', () => (
 | 
			
		||||
    <IntlProvider locale='en' messages={en}>
 | 
			
		||||
      <Provider store={store}>
 | 
			
		||||
        <div style={{ position: 'absolute' }}>
 | 
			
		||||
          <OnboadingModal onClose={action('close')} />
 | 
			
		||||
        </div>
 | 
			
		||||
      </Provider>
 | 
			
		||||
    </IntlProvider>
 | 
			
		||||
  ));
 | 
			
		||||
@@ -1,3 +0,0 @@
 | 
			
		||||
#root {
 | 
			
		||||
  padding: 4rem;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
const path = require('path');
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
  module: {
 | 
			
		||||
    rules: [
 | 
			
		||||
      {
 | 
			
		||||
        test: /\.(jpg|jpeg|png|gif|svg|eot|ttf|woff|woff2)$/i,
 | 
			
		||||
        loader: 'url-loader',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        test: /.scss$/,
 | 
			
		||||
        loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
 | 
			
		||||
      },
 | 
			
		||||
    ],
 | 
			
		||||
  },
 | 
			
		||||
  resolve: {
 | 
			
		||||
    alias: {
 | 
			
		||||
      mastodon: path.resolve(__dirname, '..', 'app', 'javascript', 'mastodon'),
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user