Skip to content

Commit

Permalink
chore: upgrade generator
Browse files Browse the repository at this point in the history
Upgrade generator.
  • Loading branch information
cladera committed Feb 17, 2018
1 parent 5cc8a5c commit b58736d
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 96 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -25,9 +25,6 @@ npm-debug.log*
bower_components/
node_modules/

# Yeoman meta-data
.yo-rc.json

# Build-related directories
dist/
docs/api/
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
lts/*
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -2,8 +2,7 @@ sudo: false
dist: trusty
language: node_js
node_js:
- 'node'
- 'lts/argon'
- 'lts/*'
before_script:

# Check if the current version is equal to the major version for the env.
Expand Down
18 changes: 18 additions & 0 deletions .yo-rc.json
@@ -0,0 +1,18 @@
{
"generator-videojs-plugin": {
"bcov": false,
"scope": "",
"name": "offset",
"description": "VideoJs plugin to virtually \"cut\" an ondemand video",
"author": "Carles Galan Cladera <cgcladera@gmail.com>",
"license": "mit",
"css": false,
"ie8": true,
"docs": true,
"lang": false,
"bower": true,
"ghooks": "test",
"sass": false,
"husky": "test"
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -4,7 +4,7 @@ We welcome contributions from everyone!

## Getting Started

Make sure you have NodeJS 0.10 or higher and npm installed.
Make sure you have Node.js 4.8 or higher and npm installed.

1. Fork this repository and clone your fork
1. Install dependencies: `npm install`
Expand Down
38 changes: 15 additions & 23 deletions README.md
@@ -1,33 +1,25 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [videojs-offset](#videojs-offset)
- [Installation](#installation)
- [Usage](#usage)
- [`<script>` Tag](#script-tag)
- [Browserify](#browserify)
- [RequireJS/AMD](#requirejsamd)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# videojs-offset

[![Build Status](https://travis-ci.org/cladera/videojs-offset.svg?branch=master)](https://travis-ci.org/cladera/videojs-offset)
VideoJs plugin to virtually &#34;cut&#34; an ondemand video

[![npm version](https://badge.fury.io/js/videojs-offset.svg)](https://badge.fury.io/js/videojs-offset)
## Table of Contents

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Installation

```sh
npm install --save videojs-offset
```
- [Installation](#installation)
- [Usage](#usage)
- [`<script>` Tag](#script-tag)
- [Browserify/CommonJS](#browserifycommonjs)
- [RequireJS/AMD](#requirejsamd)
- [License](#license)

The npm installation is preferred, but Bower works, too.
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation

```sh
bower install --save videojs-offset
npm install --save videojs-offset
```

## Usage
Expand All @@ -52,7 +44,7 @@ This is the simplest case. Get the script in whatever way you prefer and include
</script>
```

### Browserify
### Browserify/CommonJS

When using with Browserify, install videojs-offset via npm and `require` the plugin as you would any other module.

Expand Down Expand Up @@ -91,7 +83,7 @@ require(['video.js', 'videojs-offset'], function(videojs) {

## License

MIT. Copyright 2017(c) Carles Galan Cladera &lt;cgcladera@gmail.com&gt;
MIT. Copyright (c) Carles Galan Cladera &lt;cgcladera@gmail.com&gt;


[videojs]: http://videojs.com/
6 changes: 3 additions & 3 deletions index.html
Expand Up @@ -12,11 +12,11 @@
</video>
<ul>
<li><a href="test/">Run unit tests in browser.</a></li>
<li><a href="dist/docs/api/">Read generated api docs.</a></li>
<li><a href="dist/docs/manual/">Read generated manual docs.</a></li>
<li><a href="docs/api/">Read generated docs.</a></li>
</ul>
<script src="node_modules/es5-shim/es5-shim.js"></script>
<script src="node_modules/video.js/dist/video.js"></script>
<script src="dist/browser/videojs-offset.js"></script>
<script src="dist/videojs-offset.js"></script>
<script>
(function(window, videojs) {
var player = window.player = videojs('videojs-offset-player');
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 29 additions & 27 deletions package.json
Expand Up @@ -8,7 +8,7 @@
"node": ">=4.4.0"
},
"generator-videojs-plugin": {
"version": "5.0.0"
"version": "5.2.1"
},
"scripts": {
"prebuild": "npm run clean",
Expand All @@ -27,7 +27,7 @@
"lint": "vjsstandard",
"prestart": "npm run build",
"start": "npm-run-all -p start:server watch",
"start:server": "static -a 0.0.0.0 -p 9999 -H '{\"Cache-Control\": \"no-cache, must-revalidate\"}' .",
"start:server": "node scripts/server.js",
"pretest": "npm-run-all lint build",
"test": "karma start test/karma.conf.js",
"preversion": "npm test",
Expand All @@ -37,9 +37,9 @@
"watch:js-modules": "rollup -c scripts/modules.rollup.config.js -w",
"watch:js-umd": "rollup -c scripts/umd.rollup.config.js -w",
"watch:test": "rollup -c scripts/test.rollup.config.js -w",
"prepublish": "npm run build",
"prepush": "npm run lint",
"precommit": "npm run docs && git add README.md"
"prepublish": "not-in-install && npm run build || in-install",
"prepush": "npm run test",
"precommit": "npm run docs:toc && git add README.md"
},
"keywords": [
"videojs",
Expand All @@ -64,45 +64,47 @@
],
"dependencies": {
"global": "^4.3.2",
"video.js": "^5.19.2"
"video.js": "^5.19.2 || ^6.6.0"
},
"devDependencies": {
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-preset-es2015": "^6.14.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es3": "^1.0.1",
"bannerize": "^1.0.2",
"conventional-changelog-cli": "^1.3.1",
"bannerize": "^1.1.3",
"conventional-changelog-cli": "^1.3.5",
"conventional-changelog-videojs": "^3.0.0",
"doctoc": "^1.3.0",
"es5-shim": "^4.5.9",
"es5-shim": "^4.5.10",
"ghooks": "^1.3.2",
"husky": "^0.13.3",
"husky": "^0.13.4",
"in-publish": "^2.0.0",
"jsdoc": "^3.4.3",
"karma": "~1.3.0",
"karma-chrome-launcher": "^2.1.1",
"karma-detect-browsers": "^2.2.5",
"karma-firefox-launcher": "^1.0.1",
"karma-chrome-launcher": "^2.2.0",
"karma-detect-browsers": "^2.2.6",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-qunit": "^1.2.1",
"karma-safari-launcher": "^1.0.0",
"mkdirp": "^0.5.1",
"node-static": "^0.7.9",
"npm-run-all": "^4.0.2",
"qunitjs": "^1.21.0",
"rimraf": "^2.6.1",
"rollup": "^0.50.0",
"node-static": "^0.7.10",
"npm-run-all": "^4.1.2",
"portscanner": "^2.1.1",
"qunitjs": "^1.23.1",
"rimraf": "^2.6.2",
"rollup": "^0.53.4",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-json": "^2.1.1",
"rollup-plugin-multi-entry": "^2.0.1",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-json": "^2.3.0",
"rollup-plugin-multi-entry": "^2.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-watch": "^3.2.2",
"semver": "^5.3.0",
"sinon": "^2.2.0",
"uglify-js": "^3.0.7",
"semver": "^5.4.1",
"sinon": "^2.4.1",
"uglify-js": "^3.3.5",
"videojs-spellbook": "^2.0.2",
"videojs-standard": "^6.0.0"
"videojs-standard": "^6.0.1"
},
"config": {
"ghooks": {
Expand Down
22 changes: 15 additions & 7 deletions scripts/modules.rollup.config.js
Expand Up @@ -9,9 +9,21 @@ import babel from 'rollup-plugin-babel';
import json from 'rollup-plugin-json';

export default {
moduleName: 'videojsOffset',
entry: 'src/plugin.js',
external: ['video.js'],
name: 'videojsOffset',
input: 'src/plugin.js',
output: [{
file: 'dist/videojs-offset.cjs.js',
format: 'cjs'
}, {
file: 'dist/videojs-offset.es.js',
format: 'es'
}],
external: [
'global',
'global/document',
'global/window',
'video.js'
],
globals: {
'video.js': 'videojs'
},
Expand All @@ -33,9 +45,5 @@ export default {
'transform-object-assign'
]
})
],
targets: [
{dest: 'dist/videojs-offset.cjs.js', format: 'cjs'},
{dest: 'dist/videojs-offset.es.js', format: 'es'}
]
};
34 changes: 34 additions & 0 deletions scripts/server.js
@@ -0,0 +1,34 @@
/* eslint no-console: "off" */

const http = require('http');
const portscanner = require('portscanner');
const nodeStatic = require('node-static');

const files = new nodeStatic.Server(process.cwd(), {cache: false});

const server = http.createServer((request, response) => {
response.setHeader('Cache-Control', 'no-cache,must-revalidate');

request.addListener('end', () => {
files.serve(request, response, (err) => {
if (err) {
response.writeHead(err.status, err.headers);
response.end('Not Found');
}

console.log([
(new Date()).toISOString(),
`[${response.statusCode}]`,
request.url
].join(' '));
});
}).resume();
});

portscanner.findAPortNotInUse(9999, 10999).then((port) => {
server.listen(port, '0.0.0.0');
console.log(`serving "." at http://0.0.0.0:${port}`);
}).catch((err) => {
console.log('could not find an open port: ', err);
process.exit(1);
});
10 changes: 6 additions & 4 deletions scripts/test.rollup.config.js
Expand Up @@ -10,10 +10,12 @@ import multiEntry from 'rollup-plugin-multi-entry';
import resolve from 'rollup-plugin-node-resolve';

export default {
moduleName: 'videojsOffsetTests',
entry: 'test/**/*.test.js',
dest: 'test/dist/bundle.js',
format: 'iife',
name: 'videojsOffsetTests',
input: 'test/**/*.test.js',
output: {
file: 'test/dist/bundle.js',
format: 'iife'
},
external: [
'qunit',
'qunitjs',
Expand Down

0 comments on commit b58736d

Please sign in to comment.