Skip to content

Commit

Permalink
Merge pull request #7 from saurabhnemade/storybook-migration
Browse files Browse the repository at this point in the history
Storybook migration
  • Loading branch information
saurabhnemade authored Oct 24, 2018
2 parents a7f0dda + b14eb88 commit 6da7c60
Show file tree
Hide file tree
Showing 35 changed files with 17,545 additions and 596 deletions.
9 changes: 7 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"presets": ["react-app","env"],
"plugins": ["transform-class-properties"]
"presets": [
["env", {
"modules": false
}],
"stage-0",
"react"
]
}
5 changes: 5 additions & 0 deletions .bettercodehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
component_depth: 1
languages:
- javascript
exclude:
- /rollup.config.js
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
43 changes: 18 additions & 25 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
{
"extends": "airbnb",
"parser": "babel-eslint",
"globals": {
"window": true
"extends": [
"standard",
"standard-react"
],
"env": {
"es6": true
},
"rules": {
# We use _ to define private variables and methods in clases
"no-underscore-dangle": 0,
# This seems to be buggy we don't want eslint to check this
"import/no-extraneous-dependencies": 0,
# This is a depricated rule. So we turned off it.
"react/require-extension": 0,
# We can write JSX in anyfile we want.
"react/jsx-filename-extension": 0,
# We don't like this rule.
"arrow-body-style": 0,
# We don't like this rule. We write arrow functions only when we needed.
"prefer-arrow-callback": 0,
# We don't need to write function names always.
"func-names": 0,
# propTypes can be object
"react/forbid-prop-types": 0,
# allow stateles function
"react/prefer-stateless-function": 0,
"react/no-string-refs": 0,
"no-prototype-builtins": 0,
"no-console": 0
"plugins": [
"react"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
// don't force es6 functions to include space before paren
"space-before-function-paren": 0,

// allow specifying true explicitly for boolean props
"react/jsx-boolean-value": 0
}
}
24 changes: 21 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules
*.log
.idea

# builds
build
dist
package-lock.json
storybook-static
.rpt2_cache

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
2 changes: 0 additions & 2 deletions .npmignore

This file was deleted.

1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

11 changes: 0 additions & 11 deletions .scripts/get_gh_pages_url.js

This file was deleted.

34 changes: 0 additions & 34 deletions .scripts/mocha_runner.js

This file was deleted.

16 changes: 0 additions & 16 deletions .scripts/prepublish.sh

This file was deleted.

47 changes: 0 additions & 47 deletions .scripts/publish_storybook.sh

This file was deleted.

1 change: 0 additions & 1 deletion .scripts/user/prepublish.sh

This file was deleted.

1 change: 0 additions & 1 deletion .scripts/user/pretest.js

This file was deleted.

3 changes: 3 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '@storybook/addon-options/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
22 changes: 9 additions & 13 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
// IMPORTANT
// ---------
// This is an auto generated file with React CDK.
// Do not modify this file.

import { configure } from '@kadira/storybook';
import { setDefaults } from '@storybook/addon-info';

setDefaults({
import { addDecorator, configure } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';

setOptions({
name: 'React Twitter Embed',
url: '#',
showStoriesPanel: true,
showAddonPanel: true,
header: false, // Toggles display of header with component name and description
inline: false, // Displays info inline vs click button to view
source: true,
});

function loadStories() {
require('../src/stories');
}
configure(() => require('../src/stories'), module);

configure(loadStories, module);
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: node_js
node_js:
- 8

after_success:
- npm install -g rollup
- npm install
- npm run build-storybook

deploy:
- provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
skip_cleanup: true
on:
branch: master
- provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
local_dir: storybook-static
on:
branch: master

notifications:
email:
recipients:
- [email protected]
on_success: always
on_failure: always
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

We welcome your help to make this component better. This document will help to streamline the contributing process and save everyone's precious time.

PR's are always welcome.

## Development Setup

This component has been setup with [React CDK](https://github.com/kadirahq/react-cdk). Refer [React CDK documentation](https://github.com/kadirahq/react-cdk)) to get started with the development.
> npm install
> npm run storybook
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@

# React Twitter Embed Component

[![NPM](https://img.shields.io/npm/v/react-twitter-embed.svg)](https://www.npmjs.com/package/react-twitter-embed) [![Storybook](https://github.com/storybooks/press/blob/master/badges/storybook.svg)](https://saurabhnemade.github.io/react-twitter-embed/) [![Build Status](https://travis-ci.org/saurabhnemade/react-twitter-embed.svg?branch=storybook-migration)](https://travis-ci.org/saurabhnemade/react-twitter-embed) [![Known Vulnerabilities](https://snyk.io/test/github/saurabhnemade/react-twitter-embed/badge.svg)](https://snyk.io/test/github/saurabhnemade/react-twitter-embed) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/saurabhnemade/react-twitter-embed/master/LICENSE)


React Twitter Embed Component

Simplest way to add Twitter Widgets to your react project.

**Demo and Examples :** https://saurabhnemade.github.io/react-twitter-embed/
## Demo and Examples
https://saurabhnemade.github.io/react-twitter-embed/

**Installation:**

npm install --save react-twitter-embed
## Install

**Sample Example:**
```bash
npm install --save react-twitter-embed
```

*Import in your view:*

import { TwitterTimelineEmbed, TwitterShareButton, TwitterFollowButton, TwitterHashtagButton, TwitterMentionButton, TwitterTweetEmbed, TwitterMomentShare, TwitterDMButton, TwitterVideoEmbed, TwitterOnAirButton } from 'react-twitter-embed';
## Usage

```jsx
import { TwitterTimelineEmbed, TwitterShareButton, TwitterFollowButton, TwitterHashtagButton, TwitterMentionButton, TwitterTweetEmbed, TwitterMomentShare, TwitterDMButton, TwitterVideoEmbed, TwitterOnAirButton } from 'react-twitter-embed';
```

**Adding Timeline:**

Expand Down Expand Up @@ -84,9 +91,10 @@ Simplest way to add Twitter Widgets to your react project.

https://developer.twitter.com/en/docs/twitter-for-websites/javascript-api/overview

**LICENSE**:

MIT License
## License

MIT © [saurabhnemade](https://github.com/saurabhnemade)

Copyright (c) 2018

Expand All @@ -106,4 +114,5 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.

Loading

0 comments on commit 6da7c60

Please sign in to comment.