Skip to content

Commit fef2637

Browse files
committed
Improved development and deployment process
1 parent 4911c7e commit fef2637

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+525
-3788
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015", "react"],
3+
"plugins": ["transform-object-rest-spread"]
4+
}

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trim_trailing_whitespace = true
1313
[*.md]
1414
trim_trailing_whitespace = false
1515

16-
[{package.json}]
16+
[{package.json,.travis.yml}]
1717
# The indent size used in the `package.json` file cannot be changed
1818
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
1919
indent_size = 2

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1+
node_modules
12
dist
2-
**/*.json

.eslintrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"commonjs": true,
6+
"es6": true,
7+
"jest": true,
8+
"jasmine": true
9+
},
10+
"extends": "eslint:recommended",
11+
"parserOptions": {
12+
"ecmaFeatures": {
13+
"experimentalObjectRestSpread": true,
14+
"jsx": true
15+
},
16+
"sourceType": "module"
17+
},
18+
"plugins": [
19+
"react"
20+
],
21+
"rules": {
22+
"quotes": [
23+
"error",
24+
"single"
25+
],
26+
"react/jsx-uses-react": "error",
27+
"react/jsx-uses-vars": "error"
28+
}
29+
}

.gitignore

100644100755
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.DS_Store
21
node_modules
3-
.grunt
4-
demo/dist
5-
npm-debug.log
2+
npm-debug.log
3+
.DS_Store
4+
dist

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: node_js
2+
script:
3+
- npm run install:demo
4+
- npm run build:demo
5+
- npm run lint
6+
- npm test
7+
deploy:
8+
provider: npm
9+
10+
api_key:
11+
secure: AuzrPiUT3uzn5xbGNEQyKp3OZUtleFXM7dHmucoqDt3idfZxbxIaJ1R1Gw5NYMocBFQ3NC3SgbyIxDM9u7tbI4W3qXwYZWgF6nb10PAmPyPbGp+gZAr/X6a++c8BSDyqQINp5iHS10oL6tbWMxmCQsXweGySMyprxW2rccDvXob6eCAK6TK2ZJBfSdanAUh57FxIkSylFFnLt19n0C+qHHdEsLMSfquDgVomDMi/6EEskdeD9vxh9XpEog/UWp8uYdY9D5FslNB9AgDDoHHd3mhei9EhXinGtZiMTMB1RPoCKfDwd+iBuvu8LeTRi81GTXHzqLqBs/IIsM31Cn0CcKxdyktuaRmShtueCx0eJ/qWZ5Rq5ZCGEkMC7dG73FbC7IqLLhF/eOb8PNq1gWjXt8OOXrlJpyc4WCyeF9Z3NARPHCDaJcpmXhHb/ML2NnfPN9AGpMBVq1i50g32q9pFFnlU7w7FruhFMiVIuaStaF/6nxMLcV+alasD5zUiukdktnNGROgvj0yFFCb6dkXyhsVS3kqAdr++arNv1viIGWOxW1Wi+hbLyzc8ySbR/XX0Vngo2VUNGy7rwkwjC9Ui612JF7fbX/k5D9+MYOiqwHDjvQD/a4PILfgOUFJ3bpLUMdijD9eK4s+InoNM89GVY+HjCukAafC3fnUMIPPK6Zg=
12+
skip_cleanup: true
13+
on:
14+
tags: true
15+
repo: mderrick/react-html5video
16+
after_deploy:
17+
- npm run deploy:demo
18+
env:
19+
global:
20+
- secure: 0vVutNGKCFrTr0XOx06DEhoSuVBb+tkSo6EJUKswiwbyEHA3Na5uJZHv1fi2WB48dKkH1eyNOdiKGhVUt1v2Z8Vsb3FskUw17X/TU3iaKTWsZleuH1UCJJQCCvxogXOthz/nV5ITJ9X+S87ybErRq24aSEgs+ibN44EC+Glxzs7kbsawtPBLA7rzTFRyOWRa8441xhMOE4UUq6GzG9fQ4+hlQiLwi2xnOqSQsPRdLP9cV65Kz9FC2GsJ3GUBFtWu8Ub+GLWl7f7hvXonU/8yF+jueZyRq8cWSQRBTGF4CCzFvGTpVy5kmGvMxdSaDyvhu8hih3iuGVONoRR2cYihdyUFckvLvazVBSbGVyLDfuGLDhqilHsw+IE/e1AbqjkF75JKnKBnHWBZU7plPMadkI3HSEv/uJtyB0xdDfiUuXp0/ecKiDQNkn7RroRfewQ8WWIntA7K2u5KJzXoV6qiDB2ifMxE8Ms982okH+QVkbpBKHWpIsndq2NyN0aXW1kor2ZmLLN0rgWF0cGuE2BrswdKs2yXIFHAu4MoHqb/JuNzEuMkgAX1J+0Q6ah3Oto9pY0H1qj8eM55QKwGddERQnrFQCK5B05P2rGuUZ0OC/V490YJxJ/vLjtqZxnWFZURG6IRpIUTM1wE5muWqzgGsEVqW0p8Lzq8hDs7c/waku8=

Gruntfile.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
A customizeable HTML5 Video that uses the familiar HTML5 video markup but with custom and configurable controls with i18n and a11y.
44

5+
[![Build Status](https://travis-ci.org/mderrick/react-html5video.svg?branch=master)](https://travis-ci.org/mderrick/react-html5video)
56
[![npm version](https://img.shields.io/npm/v/react-html5video.svg?style=flat-square)](https://www.npmjs.com/package/react-html5video)
67
[![npm downloads](https://img.shields.io/npm/dm/react-html5video.svg?style=flat-square)](https://www.npmjs.com/package/react-html5video)
78

@@ -11,35 +12,11 @@ View the [demo](http://mderrick.github.io/react-html5video/).
1112

1213
## Install
1314

14-
`npm install react-html5video --save` or `bower install react-html5video --save`
15-
16-
Include `dist/ReactHtml5Video.css` if you do not want to build your own CSS. Alternatively require `src/assets/video.css` if you want to compile the CSS yourself with [css-loaders](https://github.com/webpack/css-loader) and [url-loaders](https://github.com/webpack/url-loader) etc. See the demo [Webpack config](https://github.com/mderrick/react-html5video/blob/master/demo/webpack.config.js) as an example.
15+
`npm install react-html5video --save`
1716

1817
### Peer Dependencies
1918

20-
This component uses ES2015 and needs to be transpiled using something like [babel-loader](https://github.com/babel/babel-loader). You will also need to either [polyfill](https://babeljs.io/docs/usage/polyfill/) or use [babel-runtime](https://www.npmjs.com/package/babel-runtime). It depends on:
21-
- `react@>=0.14.x`
22-
- `lodash.throttle@latest`.
23-
24-
### UMD
25-
26-
Alternatively if using the UMD module it is already transpiled to ES5 and `lodash.throttle` is included. You can find this build in the `dist` directory:
27-
28-
```js
29-
// Includes lodash.throttle and is transpiled already. No ES2015 polyfill is required.
30-
var Video = require('react-html5video/dist/ReactHtml5Video');
31-
```
32-
33-
```js
34-
// Exports to this global
35-
var Video = window.ReactHtml5Video.default;
36-
```
37-
38-
```js
39-
// Requires es6 transpiling, an es6 polyfill/babel-runtime and all peer dependencies installed
40-
import { default as Video, Controls, Play, Mute, Seek, Fullscreen, Time, Overlay } from 'react-html5video';
41-
```
42-
19+
- `react@>=0.15.x`
4320

4421
## Usage
4522

@@ -49,6 +26,7 @@ Use normal HTML5 `<video>` markup with all the standard [html attributes](https:
4926

5027
```js
5128
import Video from 'react-html5video';
29+
import 'react-html5video/dist/styles.css';
5230
render() {
5331
return (
5432
<Video controls autoPlay loop muted
@@ -64,10 +42,12 @@ render() {
6442

6543
### Advanced Usage
6644

67-
You can configure, customize and modify the controls by adding, removing and shuffling them as you desire. You can create your very own custom children components and controls that can interact with the video. All children components will receive [these props](#props-and-methods). Obviously you can still call methods and set properties on the HTML5 DOM element directly if you have access to it with `refs`:
45+
You can configure, customize and modify the controls by adding, removing and shuffling them as you desire. You can create your very own custom children components and controls that can interact with the video. All children components will receive [these props](#props-and-methods). Obviously you can still call methods and set properties on the HTML5 DOM element directly if you have access to it with `refs`:
6846

6947
```js
7048
import { default as Video, Controls, Play, Mute, Seek, Fullscreen, Time, Overlay } from 'react-html5video';
49+
import 'react-html5video/dist/styles.css';
50+
7151
render() {
7252
return (
7353
<Video controls autoPlay loop muted poster="http://sourceposter.jpg">
@@ -141,17 +121,14 @@ All children components receive the following methods via props:
141121

142122
### Dev Setup
143123

144-
To run a server with hot module replacement:
124+
To run a development server with HMR:
145125

146126
```bash
147-
$ npm install
148-
$ cd demo
149-
$ npm install
150-
$ npm run dev-server
127+
$ npm i
128+
$ npm run i:demo
129+
$ npm start
151130
```
152131

153-
Open [http://localhost:8082](http://localhost:8082). You can now modify the files in both `src` and `demo/src`.
154-
155132
### Issues
156133

157134
Feel free to raise and solve any existing issues as desired. Where possible please do try and replicate any bugs you may have using the [react-html5video jsfiddle](https://jsfiddle.net/mderrick/7s9a311q/1/) and include them in your ticket.

0 commit comments

Comments
 (0)