Skip to content

Commit d804f40

Browse files
committed
Update to generator 2.0-prerelease
1 parent ea41dfc commit d804f40

21 files changed

+409
-220
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ node_modules/
3030

3131
# Build-related directories
3232
dist/
33-
dist-test/
3433
docs/api/
3534
es5/
35+
test/dist/

.npmignore

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
!dist/
2-
!dist-test/
3-
!docs/
4-
!es5/
1+
# Intentionally left blank, so that npm does not ignore anything by default,
2+
# but relies on the package.json "files" array to explicitly define what ends
3+
# up in the package.

CONTRIBUTING.md

+29
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
11
# CONTRIBUTING
2+
3+
We welcome contributions from everyone!
4+
5+
## Getting Started
6+
7+
Make sure you have NodeJS 0.10 or higher and npm installed.
8+
9+
1. Fork this repository and clone your fork
10+
1. Install dependencies: `npm install`
11+
1. Run a development server: `npm start`
12+
13+
### Making Changes
14+
15+
Refer to the [video.js plugin standards][standards] for more detail on best practices and tooling for video.js plugin authorship.
16+
17+
When you've made your changes, push your commit(s) to your fork and issue a pull request against the original repository.
18+
19+
### Running Tests
20+
21+
Testing is a crucial part of any software project. For all but the most trivial changes (typos, etc) test cases are expected. Tests are run in actual browsers using [Karma][karma].
22+
23+
- In all available and supported browsers: `npm test`
24+
- In a specific browser: `npm run test:chrome`, `npm run test:firefox`, etc.
25+
- While development server is running (`npm start`), navigate to [`http://localhost:9999/test/`][local]
26+
27+
28+
[karma]: http://karma-runner.github.io/
29+
[local]: http://localhost:9999/test/
30+
[standards]: https://github.com/videojs/generator-videojs-plugin/docs/standards.md

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2015 Brightcove, Inc.
1+
Copyright 2016 Brightcove, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

bower.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "videojs-overlay",
3-
"version": "0.1.1",
43
"author": "Brightcove, Inc.",
54
"license": "Apache-2.0",
65
"main": [

package.json

+46-25
Original file line numberDiff line numberDiff line change
@@ -22,55 +22,58 @@
2222
"vjsstandard": {
2323
"ignore": [
2424
"dist",
25-
"dist-test",
2625
"docs",
2726
"es5",
28-
"test/karma",
29-
"scripts"
27+
"test/dist",
28+
"test/karma.conf.js"
3029
]
3130
},
3231
"scripts": {
3332
"prebuild": "npm run clean",
3433
"build": "npm-run-all -p build:*",
35-
"build:css": "npm-run-all mkdirs build:css:sass build:css:bannerize",
34+
"build:css": "npm-run-all build:css:sass build:css:bannerize",
3635
"build:css:bannerize": "bannerize dist/videojs-overlay.css --banner=scripts/banner.ejs",
37-
"build:css:sass": "node-sass --output-style=compressed --linefeed=lf src/plugin.scss -o dist && mv dist/plugin.css dist/videojs-overlay.css",
38-
"build:js": "npm-run-all mkdirs build:js:babel build:js:browserify build:js:bannerize build:js:uglify",
36+
"build:css:sass": "node-sass src/plugin.scss dist/videojs-overlay.css --output-style=compressed --linefeed=lf",
37+
"build:js": "npm-run-all build:js:babel build:js:browserify build:js:bannerize build:js:uglify",
3938
"build:js:babel": "babel src -d es5",
4039
"build:js:bannerize": "bannerize dist/videojs-overlay.js --banner=scripts/banner.ejs",
4140
"build:js:browserify": "browserify . -s videojs-overlay -o dist/videojs-overlay.js",
4241
"build:js:uglify": "uglifyjs dist/videojs-overlay.js --comments --mangle --compress -o dist/videojs-overlay.min.js",
43-
"build:test": "npm-run-all mkdirs build:test:browserify",
42+
"build:test": "babel-node scripts/build-test.js",
4443
"build:test:browserify": "browserify `find test -name '*.test.js'` -t babelify -o dist-test/videojs-overlay.js",
45-
"clean": "rm -rf dist dist-test es5",
44+
"change": "chg add",
45+
"clean": "rimraf dist test/dist es5 && mkdirp dist test/dist es5",
4646
"lint": "vjsstandard",
47-
"mkdirs": "mkdir -p dist dist-test es5",
4847
"prestart": "npm-run-all build",
49-
"start": "npm-run-all -p start:* watch:*",
48+
"start": "babel-node scripts/server.js",
5049
"start:serve": "static -a 0.0.0.0 -p 9999",
51-
"pretest": "npm-run-all lint build:test",
52-
"test": "karma start test/karma/detected.js",
53-
"test:chrome": "npm run pretest && karma start test/karma/chrome.js",
54-
"test:firefox": "npm run pretest && karma start test/karma/firefox.js",
55-
"test:ie": "npm run pretest && karma start test/karma/ie.js",
56-
"test:safari": "npm run pretest && karma start test/karma/safari.js",
57-
"preversion": "./scripts/npm-preversion-for-bower.sh",
58-
"version": "./scripts/npm-version-for-bower.sh",
59-
"postversion": "./scripts/npm-postversion-for-bower.sh",
50+
"pretest": "npm-run-all lint build",
51+
"test": "karma start test/karma.conf.js",
52+
"test:chrome": "npm run pretest && karma start test/karma.conf.js --browsers Chrome",
53+
"test:firefox": "npm run pretest && karma start test/karma.conf.js --browsers Firefox",
54+
"test:ie": "npm run pretest && karma start test/karma.conf.js --browsers IE",
55+
"test:safari": "npm run pretest && karma start test/karma.conf.js --browsers Safari",
56+
"preversion": "npm test",
57+
"version": "babel-node scripts/version.js",
58+
"postversion": "babel-node scripts/postversion.js",
6059
"watch": "npm run mkdirs && npm-run-all -p watch:*",
6160
"watch:css": "node-sass --output-style=nested --linefeed=lf src/plugin.scss -o dist -w src && mv dist/plugin.css dist/videojs-overlay.css",
6261
"watch:js": "watchify src/plugin.js -t babelify -v -o dist/videojs-overlay.js",
63-
"watch:test": "watchify `find test -name '*.test.js'` -t babelify -o dist-test/videojs-overlay.js"
62+
"watch:test": "watchify `find test -name '*.test.js'` -t babelify -o dist-test/videojs-overlay.js",
63+
"prepublish": "npm run build"
6464
},
6565
"dependencies": {
66-
"video.js": "^5.0.0"
66+
"video.js": "^5.6.0"
6767
},
6868
"devDependencies": {
6969
"babel": "^5.8.0",
7070
"babelify": "^6.0.0",
7171
"bannerize": "^1.0.0",
72-
"browserify": "^11.0.0",
72+
"browserify": "^12.0.0",
7373
"browserify-shim": "^3.0.0",
74+
"budo": "^8.0.0",
75+
"chg": "^0.3.2",
76+
"glob": "^6.0.3",
7477
"global": "^4.3.0",
7578
"grunt-contrib-clean": "^0.4",
7679
"grunt-contrib-compress": "~0.6.1",
@@ -91,14 +94,32 @@
9194
"karma-safari-launcher": "^0.1.0",
9295
"load-grunt-tasks": "~0.3.0",
9396
"lodash-compat": "^3.10.0",
97+
"mkdirp": "^0.5.1",
9498
"node-sass": "^3.4.0",
9599
"node-static": "^0.7.0",
96-
"npm-run-all": "~1.2.0",
100+
"npm-run-all": "^1.2.0",
97101
"qunitjs": "^1.0.0",
102+
"rimraf": "^2.5.1",
98103
"sinon": "^1.0.0",
99104
"uglify-js": "^2.5.0",
100105
"video.js": "^4.5",
101106
"videojs-standard": "^4.0.0",
102107
"watchify": "^3.6.0"
103-
}
104-
}
108+
},
109+
"style": "dist/videojs-overlay.css",
110+
"videojs-plugin": {
111+
"style": "dist/videojs-overlay.css",
112+
"script": "dist/videojs-overlay.min.js"
113+
},
114+
"files": [
115+
"CONTRIBUTING.md",
116+
"bower.json",
117+
"dist/",
118+
"docs/",
119+
"es5/",
120+
"index.html",
121+
"scripts/",
122+
"src/",
123+
"test/"
124+
]
125+
}

scripts/build-test.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import browserify from 'browserify';
2+
import fs from 'fs';
3+
import glob from 'glob';
4+
5+
/* eslint no-console: 0 */
6+
7+
glob('test/**/*.test.js', (err, files) => {
8+
if (err) {
9+
throw err;
10+
}
11+
browserify(files)
12+
.transform('babelify')
13+
.bundle()
14+
.pipe(fs.createWriteStream('test/dist/bundle.js'));
15+
});

scripts/npm-postversion-for-bower.sh

-16
This file was deleted.

scripts/npm-preversion-for-bower.sh

-17
This file was deleted.

scripts/npm-version-for-bower.sh

-24
This file was deleted.

scripts/postversion.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {exec} from 'child_process';
2+
import fs from 'fs';
3+
import path from 'path';
4+
5+
/* eslint no-console: 0 */
6+
7+
/**
8+
* Determines whether or not the project has the Bower setup by checking for
9+
* the presence of a bower.json file.
10+
*
11+
* @return {Boolean}
12+
*/
13+
const hasBower = () => {
14+
try {
15+
fs.statSync(path.join(__dirname, '../bower.json'));
16+
return true;
17+
} catch (x) {
18+
return false;
19+
}
20+
};
21+
22+
// If the project supports Bower, roll HEAD back one commit to avoid having
23+
// the tagged commit - with `dist/` - in the main history.
24+
if (hasBower()) {
25+
exec('git reset --hard HEAD~1', (err, stdout, stderr) => {
26+
if (err) {
27+
process.stdout.write(err.stack);
28+
process.exit(err.status || 1);
29+
} else {
30+
process.stdout.write(stdout);
31+
}
32+
});
33+
}

0 commit comments

Comments
 (0)