Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Update to use generator v5 tooling. #51

Merged
merged 2 commits into from
Aug 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _Note_: This meaning of an "overlay" is distinct from that of a modal dialog, wh
Once you've added the plugin script to your page, you can use it with any video:

```html
<script src="videojs-overlay"></script>
<script src="path/to/videojs-overlay.js"></script>
<script>
videojs(document.querySelector('video')).overlay();
</script>
Expand Down
14 changes: 0 additions & 14 deletions bower.json

This file was deleted.

10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<head>
<meta charset="utf-8">
<title>videojs-overlay Demo</title>
<link href="/node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="/dist/videojs-overlay.css" rel="stylesheet">
<link href="node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="dist/videojs-overlay.css" rel="stylesheet">
</head>
<body>
<video id="videojs-overlay-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-overlay.js"></script>
<script src="node_modules/video.js/dist/video.js"></script>
<script src="dist/videojs-overlay.js"></script>
<script>
(function(window, videojs) {
var player = window.player = videojs('videojs-overlay-player');
Expand Down
107 changes: 55 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"author": "Brightcove, Inc.",
"license": "Apache-2.0",
"version": "1.1.4",
"main": "es5/plugin.js",
"main": "dist/videojs-overlay.cjs.js",
"module": "dist/videojs-overlay.es.js",
"keywords": [
"videojs",
"videojs-plugin"
Expand All @@ -13,16 +14,10 @@
"type": "git",
"url": "https://github.com/brightcove/videojs-overlay.git"
},
"browserify-shim": {
"qunit": "global:QUnit",
"sinon": "global:sinon",
"video.js": "global:videojs"
},
"vjsstandard": {
"ignore": [
"dist",
"docs",
"es5",
"test/dist",
"test/karma.conf.js"
]
Expand All @@ -33,59 +28,66 @@
"build:css": "npm-run-all build:css:sass build:css:bannerize",
"build:css:bannerize": "bannerize dist/videojs-overlay.css --banner=scripts/banner.ejs",
"build:css:sass": "node-sass src/plugin.scss dist/videojs-overlay.css --output-style=compressed --linefeed=lf",
"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-overlay.js --banner=scripts/banner.ejs",
"build:js:browserify": "browserify . -s videojs-overlay -g browserify-shim -t browserify-versionify -o dist/videojs-overlay.js",
"build:js:uglify": "uglifyjs dist/videojs-overlay.js --comments --mangle --compress -o dist/videojs-overlay.min.js",
"build:test": "babel-node scripts/build-test.js",
"build:test:browserify": "browserify `find test -name '*.test.js'` -t babelify -o dist-test/videojs-overlay.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-overlay.js --comments --mangle --compress -o dist/videojs-overlay.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",
"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:css": "npm-run-all build:css:sass watch:css:sass",
"watch:css:sass": "node-sass src/plugin.scss dist/videojs-overlay.css --output-style=compressed --linefeed=lf --watch src/**/*.scss",
"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"
},
"dependencies": {
"tsmlj": "^1.0.0",
"video.js": "^5.6.0",
"global": "^4.3.0"
"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",
"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",
"glob": "^6.0.3",
"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",
"conventional-changelog-cli": "^1.3.1",
"conventional-changelog-videojs": "^3.0.0",
"husky": "^0.13.3",
"karma": "^1.7.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-sass": "^3.4.2",
"npm-run-all": "^1.5.1",
"qunitjs": "^1.21.0",
"rimraf": "^2.5.1",
"sinon": "~1.14.0",
"uglify-js": "^2.6.1",
"videojs-standard": "^4.0.0"
"node-sass": "^4.5.3",
"node-static": "^0.7.9",
"npm-run-all": "^4.0.2",
"qunitjs": "^2.3.2",
"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"
},
"style": "dist/videojs-overlay.css",
"videojs-plugin": {
Expand All @@ -94,13 +96,14 @@
},
"files": [
"CONTRIBUTING.md",
"bower.json",
"dist/",
"docs/",
"es5/",
"index.html",
"scripts/",
"src/",
"test/"
]
],
"generator-videojs-plugin": {
"version": "5.0.1"
}
}
17 changes: 0 additions & 17 deletions scripts/build-test.js

This file was deleted.

45 changes: 45 additions & 0 deletions scripts/modules.rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* 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: 'videojsOverlay',
entry: 'src/plugin.js',
external: [
'global',
'global/document',
'global/window',
'video.js'
],
globals: {
'video.js': 'videojs'
},
legacy: true,
plugins: [
json(),
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
['es2015', {
loose: true,
modules: false
}]
],
plugins: [
'external-helpers',
'transform-object-assign'
]
})
],
targets: [
{dest: 'dist/videojs-overlay.cjs.js', format: 'cjs'},
{dest: 'dist/videojs-overlay.es.js', format: 'es'}
]
};
33 changes: 0 additions & 33 deletions scripts/postversion.js

This file was deleted.

Loading