Browse Source

Remove Storybook (#4397)

Yamagishi Kazutoshi 1 year ago
parent
commit
aa803153e2

+ 0
- 1
.dockerignore View File

@@ -4,7 +4,6 @@ public/system
4 4
 public/assets
5 5
 public/packs
6 6
 node_modules
7
-storybook
8 7
 neo4j
9 8
 vendor/bundle
10 9
 .DS_Store

+ 0
- 1
.nanoignore View File

@@ -14,7 +14,6 @@ node_modules/
14 14
 public/assets/
15 15
 public/system/
16 16
 spec/
17
-storybook/
18 17
 tmp/
19 18
 .vagrant/
20 19
 vendor/bundle/

+ 0
- 1
.slugignore View File

@@ -2,4 +2,3 @@ node_modules/
2 2
 .cache/
3 3
 docs/
4 4
 spec/
5
-storybook/

+ 1
- 4
package.json View File

@@ -7,9 +7,8 @@
7 7
     "build:production": "cross-env RAILS_ENV=production ./bin/webpack",
8 8
     "manage:translations": "node ./config/webpack/translationRunner.js",
9 9
     "start": "node ./streaming/index.js",
10
-    "storybook": "cross-env NODE_ENV=test start-storybook -s ./public -p 9001 -c storybook",
11 10
     "test": "npm run test:lint && npm run test:mocha",
12
-    "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ storybook/ streaming/",
11
+    "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ streaming/",
13 12
     "test:mocha": "cross-env NODE_ENV=test mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/*.test.js",
14 13
     "postinstall": "npm rebuild node-sass"
15 14
   },
@@ -120,8 +119,6 @@
120 119
     "websocket.js": "^0.1.12"
121 120
   },
122 121
   "devDependencies": {
123
-    "@storybook/addon-actions": "^3.1.8",
124
-    "@storybook/react": "^3.1.8",
125 122
     "babel-eslint": "^7.2.3",
126 123
     "chai": "^4.1.0",
127 124
     "chai-enzyme": "^0.8.0",

+ 0
- 15
storybook/config.js View File

@@ -1,15 +0,0 @@
1
-import { configure } from '@storybook/react';
2
-import { addLocaleData } from 'react-intl';
3
-import en from 'react-intl/locale-data/en';
4
-import '../app/javascript/styles/application.scss';
5
-import './storybook.scss';
6
-
7
-addLocaleData(en);
8
-
9
-let req = require.context('./stories/', true, /.story.js$/);
10
-
11
-function loadStories () {
12
-  req.keys().forEach((filename) => req(filename));
13
-}
14
-
15
-configure(loadStories, module);

+ 0
- 24
storybook/initial_state.js View File

@@ -1,24 +0,0 @@
1
-export default {
2
-  meta: {
3
-    admin: 1,
4
-    domain: 'example.com',
5
-    me: 2,
6
-  },
7
-  accounts: {
8
-    1: {
9
-      acct: 'admin',
10
-      avatar: '/avatars/original/missing.png',
11
-      id: 1,
12
-      url: 'https://example.com/@admin',
13
-    },
14
-    2: {
15
-      acct: 'user',
16
-      avatar: '/avatars/original/missing.png',
17
-      id: 1,
18
-      url: 'https://example.com/@user',
19
-    },
20
-  },
21
-  media_attachments: {
22
-    accept_content_types: [],
23
-  },
24
-};

+ 0
- 18
storybook/stories/autosuggest_textarea.story.js View File

@@ -1,18 +0,0 @@
1
-import React from 'react';
2
-import { List } from 'immutable';
3
-import { storiesOf } from '@storybook/react';
4
-import { action } from '@storybook/addon-actions';
5
-import AutosuggestTextarea from 'mastodon/components/autosuggest_textarea';
6
-
7
-const props = {
8
-  onChange: action('changed'),
9
-  onPaste: action('pasted'),
10
-  onSuggestionSelected: action('suggestionsSelected'),
11
-  onSuggestionsClearRequested: action('suggestionsClearRequested'),
12
-  onSuggestionsFetchRequested: action('suggestionsFetchRequested'),
13
-  suggestions: List([]),
14
-};
15
-
16
-storiesOf('AutosuggestTextarea', module)
17
-  .add('default state', () => <AutosuggestTextarea value='' {...props} />)
18
-  .add('with text', () => <AutosuggestTextarea value='Hello' {...props} />);

+ 0
- 18
storybook/stories/button.story.js View File

@@ -1,18 +0,0 @@
1
-import React from 'react';
2
-import { storiesOf } from '@storybook/react';
3
-import { action } from '@storybook/addon-actions';
4
-import Button from 'mastodon/components/button';
5
-
6
-storiesOf('Button', module)
7
-  .add('default state', () => (
8
-    <Button text='submit' onClick={action('clicked')} />
9
-  ))
10
-  .add('secondary', () => (
11
-    <Button secondary text='submit' onClick={action('clicked')} />
12
-  ))
13
-  .add('disabled', () => (
14
-    <Button disabled text='submit' onClick={action('clicked')} />
15
-  ))
16
-  .add('block', () => (
17
-    <Button block text='submit' onClick={action('clicked')} />
18
-  ));

+ 0
- 21
storybook/stories/character_counter.story.js View File

@@ -1,21 +0,0 @@
1
-import React from 'react';
2
-import { storiesOf } from '@storybook/react';
3
-import CharacterCounter from 'mastodon/features/compose/components/character_counter';
4
-
5
-storiesOf('CharacterCounter', module)
6
-  .add('no text', () => {
7
-    const text = '';
8
-    return <CharacterCounter text={text} max={500} />;
9
-  })
10
-  .add('a few strings text', () => {
11
-    const text = '0123456789';
12
-    return <CharacterCounter text={text} max={500} />;
13
-  })
14
-  .add('the same text', () => {
15
-    const text = '01234567890123456789';
16
-    return <CharacterCounter text={text} max={20} />;
17
-  })
18
-  .add('over text', () => {
19
-    const text = '01234567890123456789012345678901234567890123456789';
20
-    return <CharacterCounter text={text} max={10} />;
21
-  });

+ 0
- 12
storybook/stories/loading_indicator.story.js View File

@@ -1,12 +0,0 @@
1
-import React from 'react';
2
-import { IntlProvider } from 'react-intl';
3
-import { storiesOf } from '@storybook/react';
4
-import en from 'mastodon/locales/en.json';
5
-import LoadingIndicator from 'mastodon/components/loading_indicator';
6
-
7
-storiesOf('LoadingIndicator', module)
8
-  .add('default state', () => (
9
-    <IntlProvider locale='en' messages={en}>
10
-      <LoadingIndicator />
11
-    </IntlProvider>
12
-  ));

+ 0
- 24
storybook/stories/onboarding_modal.story.js View File

@@ -1,24 +0,0 @@
1
-import React from 'react';
2
-import { Provider } from 'react-redux';
3
-import { IntlProvider } from 'react-intl';
4
-import { storiesOf } from '@storybook/react';
5
-import { action } from '@storybook/addon-actions';
6
-import en from 'mastodon/locales/en.json';
7
-import configureStore from 'mastodon/store/configureStore';
8
-import { hydrateStore } from 'mastodon/actions/store';
9
-import OnboadingModal from 'mastodon/features/ui/components/onboarding_modal';
10
-import initialState from '../initial_state';
11
-
12
-const store = configureStore();
13
-store.dispatch(hydrateStore(initialState));
14
-
15
-storiesOf('OnboadingModal', module)
16
-  .add('default state', () => (
17
-    <IntlProvider locale='en' messages={en}>
18
-      <Provider store={store}>
19
-        <div style={{ position: 'absolute' }}>
20
-          <OnboadingModal onClose={action('close')} />
21
-        </div>
22
-      </Provider>
23
-    </IntlProvider>
24
-  ));

+ 0
- 3
storybook/storybook.scss View File

@@ -1,3 +0,0 @@
1
-#root {
2
-  padding: 4rem;
3
-}

+ 0
- 21
storybook/webpack.config.js View File

@@ -1,21 +0,0 @@
1
-const path = require('path');
2
-
3
-module.exports = {
4
-  module: {
5
-    rules: [
6
-      {
7
-        test: /\.(jpg|jpeg|png|gif|svg|eot|ttf|woff|woff2)$/i,
8
-        loader: 'url-loader',
9
-      },
10
-      {
11
-        test: /.scss$/,
12
-        loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
13
-      },
14
-    ],
15
-  },
16
-  resolve: {
17
-    alias: {
18
-      mastodon: path.resolve(__dirname, '..', 'app', 'javascript', 'mastodon'),
19
-    },
20
-  },
21
-};

+ 64
- 829
yarn.lock
File diff suppressed because it is too large
View File