Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
chore: Update tooling using generator v5 prerelease. (#6)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove Bower support.
  • Loading branch information
misteroneill committed May 19, 2017
1 parent 71ff194 commit f2d587b
Show file tree
Hide file tree
Showing 17 changed files with 244 additions and 371 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"]
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ node_modules/
# Build-related directories
dist/
docs/api/
es5/
test/dist/
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ node_js:
- 'node'
- 'lts/argon'
before_script:
# check if the current version is equal to the version for the env

# Check if the current version is equal to the major version for the env.
- 'export IS_INSTALLED="$(npm list video.js | grep "video.js@$VJS")"'
# we have to add semi colons to the end of each line in the if
# as travis runs this all on one line

# We have to add semicolons to the end of each line in the if as Travis runs
# this all on one line.
- 'if [ -z "$IS_INSTALLED" ]; then
echo "INSTALLING video.js@>=$VJS.0.0-RC.0 <$(($VJS+1)).0.0";
npm i "video.js@>=$VJS.0.0-RC.0 <\$(($VJS+1)).0.0";
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Make sure you have NodeJS 0.10 or higher and npm installed.

### Making Changes

Refer to the [video.js plugin standards][standards] for more detail on best practices and tooling for video.js plugin authorship.
Refer to the [video.js plugin conventions][conventions] for more detail on best practices and tooling for video.js plugin authorship.

When you've made your changes, push your commit(s) to your fork and issue a pull request against the original repository.

Expand All @@ -27,4 +27,4 @@ Testing is a crucial part of any software project. For all but the most trivial

[karma]: http://karma-runner.github.io/
[local]: http://localhost:9999/test/
[standards]: https://github.com/videojs/generator-videojs-plugin/docs/standards.md
[conventions]: https://github.com/videojs/generator-videojs-plugin/blob/master/docs/conventions.md
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ For purposes of this plugin, a **long touch** is defined as a single touch which
npm install --save videojs-contextmenu
```

The npm installation is preferred, but Bower works, too.

```sh
bower install --save videojs-contextmenu
```

## Usage

The plugin is invoked as a method of a video.js `Player` object:
Expand Down
13 changes: 0 additions & 13 deletions bower.json

This file was deleted.

13 changes: 9 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@
<head>
<meta charset="utf-8">
<title>videojs-contextmenu Demo</title>
<link href="/node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="node_modules/video.js/dist/video-js.css" rel="stylesheet">

</head>
<body>
<video id="videojs-contextmenu-player" class="video-js vjs-default-skin" controls>
<source src="//vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
<source src="//vjs.zencdn.net/v/oceans.webm" type='video/webm'>
</video>
<ul>
<li><a href="/test/">Run unit tests in browser.</a></li>
<li><a href="test/">Run unit tests in browser.</a></li>

</ul>
<script src="/node_modules/video.js/dist/video.js"></script>
<script src="/dist/videojs-contextmenu.js"></script>
<script src="node_modules/es5-shim/es5-shim.js"></script>
<script src="node_modules/video.js/dist/video.js"></script>
<script src="dist/videojs-contextmenu.js"></script>
<script>
(function(window, videojs) {
var player = window.player = videojs('videojs-contextmenu-player');

player.contextmenu();

player.on('vjs-contextmenu', function(e) {
videojs.log('context menu event!', e);
});

}(window, window.videojs));
</script>
</body>
Expand Down
119 changes: 54 additions & 65 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,108 +2,97 @@
"name": "videojs-contextmenu",
"version": "1.2.2",
"description": "A cross-device context menu implementation for video.js players.",
"main": "es5/plugin.js",
"main": "dist/videojs-contextmenu.cjs.js",
"scripts": {
"prebuild": "npm run clean",
"build": "npm-run-all -p build:*",
"build:js": "npm-run-all build:js:babel build:js:browserify build:js:bannerize build:js:uglify",
"build:js:babel": "babel src -d es5",
"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-contextmenu.js --banner=scripts/banner.ejs",
"build:js:browserify": "browserify . -s videojs-contextmenu -o dist/videojs-contextmenu.js",
"build:js:uglify": "uglifyjs dist/videojs-contextmenu.js --comments --mangle --compress -o dist/videojs-contextmenu.min.js",
"build:test": "babel-node scripts/build-test.js",
"change": "chg add",
"clean": "rimraf dist test/dist es5 && mkdirp dist test/dist es5",
"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-contextmenu.js --comments --mangle --compress --ie8 -o dist/videojs-contextmenu.min.js",
"build:test": "rollup -c scripts/test.rollup.config.js",
"clean": "rimraf dist test/dist",
"postclean": "mkdirp dist test/dist",
"lint": "vjsstandard",
"start": "babel-node scripts/server.js",
"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",
"test:chrome": "npm run pretest && karma start test/karma.conf.js --browsers Chrome",
"test:firefox": "npm run pretest && karma start test/karma.conf.js --browsers Firefox",
"test:ie": "npm run pretest && karma start test/karma.conf.js --browsers IE",
"test:safari": "npm run pretest && karma start test/karma.conf.js --browsers Safari",
"preversion": "npm test",
"version": "babel-node scripts/version.js",
"postversion": "babel-node scripts/postversion.js",
"prepublish": "npm run build"
"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"
},
"keywords": [
"videojs",
"videojs-plugin"
],
"author": "Brightcove, Inc.",
"license": "Apache-2.0",
"browserify": {
"transform": [
"browserify-shim",
"browserify-versionify"
]
},
"browserify-shim": {
"qunit": "global:QUnit",
"sinon": "global:sinon",
"video.js": "global:videojs"
},
"style": "dist/videojs-contextmenu.css",
"videojs-plugin": {
"style": "dist/videojs-contextmenu.css",
"script": "dist/videojs-contextmenu.min.js"
"module": "dist/videojs-contextmenu.es.js",
"generator-videojs-plugin": {
"version": "5.0.0-7"
},
"vjsstandard": {
"ignore": [
"dist",
"docs",
"es5",
"scripts",
"test/dist",
"test/karma.conf.js"
]
},
"files": [
"CONTRIBUTING.md",
"bower.json",
"dist/",
"docs/",
"es5/",
"index.html",
"scripts/",
"src/",
"test/"
],
"dependencies": {
"video.js": "^5.10.1"
"global": "^4.3.2",
"video.js": "^5.19.2"
},
"devDependencies": {
"babel": "^5.8.35",
"babelify": "^6.4.0",
"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",
"bluebird": "^3.2.2",
"browserify": "^12.0.2",
"browserify-shim": "^3.8.12",
"browserify-versionify": "^1.0.6",
"budo": "^8.0.4",
"chg": "^0.3.2",
"ghooks": "^1.1.1",
"glob": "^6.0.3",
"global": "^4.3.0",
"karma": "^0.13.19",
"karma-chrome-launcher": "^0.2.2",
"karma-detect-browsers": "^2.0.2",
"karma-firefox-launcher": "^0.1.7",
"karma-ie-launcher": "^0.2.0",
"karma-qunit": "^0.1.9",
"karma-safari-launcher": "^0.1.1",
"lodash": "^4.11.2",
"conventional-changelog-cli": "^1.3.1",
"conventional-changelog-videojs": "^3.0.0",
"es5-shim": "^4.5.9",
"husky": "^0.13.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",
"npm-run-all": "^1.5.1",
"node-static": "^0.7.9",
"npm-run-all": "^4.0.2",
"qunitjs": "^1.21.0",
"rimraf": "^2.5.1",
"sinon": "~1.14.0",
"uglify-js": "^2.6.1",
"videojs-standard": "^4.0.0"
},
"config": {
"ghooks": {
"pre-push": "npm run lint"
}
"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"
}
}
}
15 changes: 0 additions & 15 deletions scripts/build-test.js

This file was deleted.

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: 'videojsContextmenu',
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-contextmenu.cjs.js', format: 'cjs'},
{dest: 'dist/videojs-contextmenu.es.js', format: 'es'}
]
};
33 changes: 0 additions & 33 deletions scripts/postversion.js

This file was deleted.

Loading

0 comments on commit f2d587b

Please sign in to comment.