Skip to content

Commit

Permalink
chore: Update tooling using generator v5 prerelease. (videojs#79)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove Bower support.
  • Loading branch information
misteroneill authored May 19, 2017
1 parent e29593f commit 0b53140
Show file tree
Hide file tree
Showing 21 changed files with 318 additions and 45 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"es3",
["es2015", {"loose": true}]
],
"plugins": ["transform-object-assign"]
}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ node_modules/

# Build-related directories
dist/
build/

docs/api/
test/dist/
13 changes: 0 additions & 13 deletions bower.json

This file was deleted.

3 changes: 3 additions & 0 deletions jsdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["plugins/markdown"]
}
98 changes: 75 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,36 @@
"name": "videojs-playlist",
"version": "3.1.1",
"description": "Playlist plugin for Video.js",
"main": "build/es5/index.js",
"main": "dist/videojs-playlist.cjs.js",
"scripts": {
"build": "sb-build",
"clean": "sb-clean",
"lint": "sb-lint",
"start": "sb-start",
"test": "sb-test",
"watch": "sb-watch",
"prebuild": "npm run clean",
"build": "npm-run-all -p build:*",
"build:js": "npm-run-all build:js:rollup-modules build:js:rollup-umd build:js:bannerize build:js:uglify",
"build:js:bannerize": "bannerize dist/videojs-playlist.js --banner=scripts/banner.ejs",
"build:js:rollup-modules": "rollup -c scripts/modules.rollup.config.js",
"build:js:rollup-umd": "rollup -c scripts/umd.rollup.config.js",
"build:js:uglify": "uglifyjs dist/videojs-playlist.js --comments --mangle --compress --ie8 -o dist/videojs-playlist.min.js",
"build:test": "rollup -c scripts/test.rollup.config.js",
"clean": "rimraf dist test/dist",
"postclean": "mkdirp dist test/dist",
"docs": "npm-run-all docs:*",
"docs:api": "jsdoc src -r -c jsdoc.json -d docs/api",
"docs:toc": "doctoc README.md",
"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\"}' .",
"pretest": "npm-run-all lint build",
"test": "karma start test/karma.conf.js",
"preversion": "npm test",
"postversion": "sb-release",
"version": "node scripts/version.js",
"watch": "npm-run-all -p watch:*",
"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"
"prepush": "npm run lint",
"precommit": "npm run docs && git add README.md"
},
"keywords": [
"playlist",
Expand All @@ -27,35 +45,69 @@
"url": "https://github.com/brightcove/videojs-playlist"
},
"files": [
"CHANGELOG.md",
"CONTRIBUTING.md",
"README.md",
"build/docs",
"build/es5",
"dist/",
"docs/",
"index.html",
"src/"
"scripts/",
"src/",
"test/"
],
"dependencies": {
"global": "^4.3.2",
"video.js": "^5.16.0"
"video.js": "^5.19.2"
},
"devDependencies": {
"husky": "^0.13.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-object-assign": "^6.8.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-es3": "^1.0.1",
"bannerize": "^1.0.2",
"conventional-changelog-cli": "^1.3.1",
"conventional-changelog-videojs": "^3.0.0",
"doctoc": "^1.3.0",
"es5-shim": "^4.5.9",
"husky": "^0.13.3",
"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-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",
"node.extend": "^1.1.5",
"videojs-spellbook": "^4.0.0"
"npm-run-all": "^4.0.2",
"qunitjs": "^1.21.0",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"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-node-resolve": "^3.0.0",
"rollup-watch": "^3.2.2",
"semver": "^5.3.0",
"sinon": "^2.2.0",
"uglify-js": "^3.0.7",
"videojs-standard": "^6.0.0"
},
"generator-videojs-plugin": {
"version": "4.0.1"
"version": "5.0.0-7"
},
"jsnext:main": "src/js/index.js",
"engines": {
"node": ">=4.4.0"
},
"spellbook": {
"css": false,
"ie8": true,
"lang": false
"module": "dist/videojs-playlist.es.js",
"vjsstandard": {
"ignore": [
"dist",
"docs",
"scripts",
"test/dist",
"test/karma.conf.js"
]
}
}
6 changes: 6 additions & 0 deletions scripts/banner.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* <%- pkg.name %>
* @version <%- pkg.version %>
* @copyright <%- date.getFullYear() %> <%- pkg.author %>
* @license <%- pkg.license %>
*/
41 changes: 41 additions & 0 deletions scripts/modules.rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Rollup configuration for packaging the plugin in a module that is consumable
* by either CommonJS (e.g. Node or Browserify) or ECMAScript (e.g. Rollup).
*
* These modules DO NOT include their dependencies as we expect those to be
* handled by the module system.
*/
import babel from 'rollup-plugin-babel';
import json from 'rollup-plugin-json';

export default {
moduleName: 'videojsPlaylist',
entry: 'src/plugin.js',
external: ['video.js'],
globals: {
'video.js': 'videojs'
},
legacy: true,
plugins: [
json(),
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
'es3',
['es2015', {
loose: true,
modules: false
}]
],
plugins: [
'external-helpers',
'transform-object-assign'
]
})
],
targets: [
{dest: 'dist/videojs-playlist.cjs.js', format: 'cjs'},
{dest: 'dist/videojs-playlist.es.js', format: 'es'}
]
};
58 changes: 58 additions & 0 deletions scripts/test.rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Rollup configuration for packaging the plugin in a test bundle.
*
* This includes all dependencies for both the plugin and its tests.
*/
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import multiEntry from 'rollup-plugin-multi-entry';
import resolve from 'rollup-plugin-node-resolve';

export default {
moduleName: 'videojsPlaylistTests',
entry: 'test/**/*.test.js',
dest: 'test/dist/bundle.js',
format: 'iife',
external: [
'qunit',
'qunitjs',
'sinon',
'video.js'
],
globals: {
'qunit': 'QUnit',
'qunitjs': 'QUnit',
'sinon': 'sinon',
'video.js': 'videojs'
},
legacy: true,
plugins: [
multiEntry({
exports: false
}),
resolve({
browser: true,
main: true,
jsnext: true
}),
commonjs({
sourceMap: false
}),
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
'es3',
['es2015', {
loose: true,
modules: false
}]
],
plugins: [
'external-helpers',
'transform-object-assign'
]
})
]
};
48 changes: 48 additions & 0 deletions scripts/umd.rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Rollup configuration for packaging the plugin in a module that is consumable
* as the `src` of a `script` tag or via AMD or similar client-side loading.
*
* This module DOES include its dependencies.
*/
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import resolve from 'rollup-plugin-node-resolve';

export default {
moduleName: 'videojsPlaylist',
entry: 'src/plugin.js',
dest: 'dist/videojs-playlist.js',
format: 'umd',
external: ['video.js'],
globals: {
'video.js': 'videojs'
},
legacy: true,
plugins: [
resolve({
browser: true,
main: true,
jsnext: true
}),
json(),
commonjs({
sourceMap: false
}),
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
'es3',
['es2015', {
loose: true,
modules: false
}]
],
plugins: [
'external-helpers',
'transform-object-assign'
]
})
]
};
10 changes: 10 additions & 0 deletions scripts/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const execSync = require('child_process').execSync;
const path = require('path');
const semver = require('semver');
const pkg = require('../package.json');

if (!semver.prerelease(pkg.version)) {
process.chdir(path.resolve(__dirname, '..'));
execSync('conventional-changelog -p videojs -i CHANGELOG.md -s');
execSync('git add CHANGELOG.md');
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/auto-advance.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import window from 'global/window';
import QUnit from 'qunit';
import * as autoadvance from '../src/js/auto-advance.js';
import * as autoadvance from '../src/auto-advance.js';
import playerProxyMaker from './player-proxy-maker.js';

QUnit.module('auto-advance');
Expand Down
18 changes: 18 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>videojs-playlist Unit Tests</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
<link rel="stylesheet" href="../node_modules/video.js/dist/video-js.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="../node_modules/es5-shim/es5-shim.js"></script>
<script src="../node_modules/sinon/pkg/sinon.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/video.js/dist/video.js"></script>
<script src="../test/dist/bundle.js"></script>
</body>
</html>
Loading

0 comments on commit 0b53140

Please sign in to comment.