From a7492f018b0dbe33910a54b29f9ca2cbdfc40df7 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Mon, 27 Nov 2017 23:10:32 +0100 Subject: [PATCH 1/8] add appveyor config --- appveyor.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..0f3a5941 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,19 @@ +environment: + matrix: + - nodejs_version: '9' + - nodejs_version: '8' + - nodejs_version: '6' +install: + - ps: Install-Product node $env:nodejs_version + - set CI=true + - npm install --global npm@latest + - set PATH=%APPDATA%\npm;%PATH% + - npm install +matrix: + fast_finish: true +build: off +shallow_clone: true +test_script: + - node --version + - npm --version + - npm test From 83183c8a72ff962b5cb26560881548496b646a9a Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Mon, 27 Nov 2017 23:18:26 +0100 Subject: [PATCH 2/8] remove node 9 for now --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0f3a5941..dd8881b2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,5 @@ environment: matrix: - - nodejs_version: '9' - nodejs_version: '8' - nodejs_version: '6' install: From 2657a9b0168deb22d7a2da6f39cd70db3f8f831c Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Mon, 27 Nov 2017 23:30:51 +0100 Subject: [PATCH 3/8] use cross-platform paths --- scripts/add-banner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/add-banner.js b/scripts/add-banner.js index 46358e6e..d04aaa20 100755 --- a/scripts/add-banner.js +++ b/scripts/add-banner.js @@ -6,6 +6,7 @@ */ var fs = require('fs'); +var path = require('path'); var moment = require('moment'); var banner = require('add-banner'); @@ -27,7 +28,7 @@ process.argv.forEach(function (fpath, index, array) { if (fpath.endsWith(CSS)) { // CSS result = banner(infile, { - banner: 'scripts/banner.css', + banner: path.resolve('scripts', 'banner.css'), pkg: pjson }); fs.writeFile(fpath, result); @@ -35,7 +36,7 @@ process.argv.forEach(function (fpath, index, array) { } else if (fpath.endsWith(JS)) { // javascript result = banner(infile, { - banner: 'scripts/banner.ejs', + banner: path.resolve('scripts', 'banner.ejs'), pkg: pjson, moment: moment }); From 56b8b88dd602832de2508af90484ebc8f93d9d5c Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Mon, 27 Nov 2017 23:42:22 +0100 Subject: [PATCH 4/8] enable cache --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index dd8881b2..fa8b49a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,3 +16,5 @@ test_script: - node --version - npm --version - npm test +cache: + - '%APPDATA%\npm-cache' From 0360b850bf3f0ecae91598e288aeedf0a92eafb0 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Mon, 27 Nov 2017 23:59:10 +0100 Subject: [PATCH 5/8] use glob --- package.json | 2 +- scripts/add-banner.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 80715992..a916816f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "build:css:sass": "node-sass --include-path src/css src/css/videojs.record.scss dist/css/videojs.record.css", "build:css:comb": "csscomb dist/css/videojs.record.css", "build:css:compress": "cleancss -o dist/css/videojs.record.min.css dist/css/videojs.record.css", - "build:css:banner": "node scripts/add-banner.js dist/css/videojs.record*.css", + "build:css:banner": "node scripts/add-banner.js 'dist/css/videojs.record*.css'", "build:js": "npm-run-all build:js:babel build:js:browserify build:js:version build:js:collapse build:js:uglify build:js:banner build:js:plugins build:js:language", "build:js:babel": "babel src/js --out-dir es5", "build:js:version": "node scripts/update-version.js", diff --git a/scripts/add-banner.js b/scripts/add-banner.js index d04aaa20..b542199a 100755 --- a/scripts/add-banner.js +++ b/scripts/add-banner.js @@ -7,6 +7,7 @@ var fs = require('fs'); var path = require('path'); +var glob = require('glob') var moment = require('moment'); var banner = require('add-banner'); @@ -16,14 +17,15 @@ var infile, fpath, result; var pjson = JSON.parse(fs.readFileSync('package.json', 'utf8')); // check command-line arguments -if (process.argv.length < 3) { +if (process.argv.length != 3) { console.error("Error: no input file(s) specified"); process.exit(); } // process multiple files -process.argv.forEach(function (fpath, index, array) { - if (index > 1) { +glob(process.argv[2], function (er, files) { + files.forEach(function(fpath) { + infile = fs.readFileSync(fpath, 'utf8'); if (fpath.endsWith(CSS)) { // CSS @@ -32,7 +34,7 @@ process.argv.forEach(function (fpath, index, array) { pkg: pjson }); fs.writeFile(fpath, result); - + } else if (fpath.endsWith(JS)) { // javascript result = banner(infile, { @@ -43,7 +45,9 @@ process.argv.forEach(function (fpath, index, array) { fs.writeFile(fpath, result); } console.info('Added banner to ' + fpath); - } + }); }); + + From d821b42743b87d0f28eecd8a7a8fa9f229d364c4 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Tue, 28 Nov 2017 00:12:06 +0100 Subject: [PATCH 6/8] use path --- scripts/add-banner.js | 4 ---- scripts/build-plugins.js | 12 ++++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/add-banner.js b/scripts/add-banner.js index b542199a..30a72120 100755 --- a/scripts/add-banner.js +++ b/scripts/add-banner.js @@ -47,7 +47,3 @@ glob(process.argv[2], function (er, files) { console.info('Added banner to ' + fpath); }); }); - - - - diff --git a/scripts/build-plugins.js b/scripts/build-plugins.js index e0277ad7..7a759dc3 100644 --- a/scripts/build-plugins.js +++ b/scripts/build-plugins.js @@ -21,8 +21,8 @@ var collapse = require('bundle-collapser/plugin'); var color = require('colour'); var mkdirp = require('mkdirp'); -var pluginsDestDir = 'dist/plugins/'; -var bannerPath = 'scripts/banner.ejs'; +var pluginsDestDir = path.join('dist', 'plugins'); +var bannerPath = path.join('scripts', 'banner.ejs'); var fileName, dirName, pluginName, minifiedName, pluginDestPath, pluginDestPathMinified, browserify_opts, pjson, bundler; @@ -34,12 +34,12 @@ mkdirp(pluginsDestDir, function(err) { console.log(color.green('OK') + ': Build ' + files.length + ' plugins'); files.forEach(function(pluginPath) { - fileName = pluginPath.substr(pluginPath.lastIndexOf('/') + 1); - dirName = pluginPath.split(fileName)[0]; + fileName = path.basename(pluginPath); + dirName = path.dirname(pluginPath); pluginName = fileName.replace('-plugin.js', ''); minifiedName = fileName.replace('-plugin.js', '.min.js'); - pluginDestPath = pluginsDestDir + 'videojs.record.' + pluginName + '.js'; - pluginDestPathMinified = pluginsDestDir + 'videojs.record.' + minifiedName; + pluginDestPath = path.join(pluginsDestDir, 'videojs.record.' + pluginName + '.js'); + pluginDestPathMinified = path.join(pluginsDestDir, 'videojs.record.' + minifiedName); browserify_opts = { standalone: pluginName, plugin: [ From 2afc72d2018198dc600c98aef63c0b1849232bd2 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Tue, 28 Nov 2017 00:17:22 +0100 Subject: [PATCH 7/8] use path --- scripts/update-version.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/update-version.js b/scripts/update-version.js index 5d14947e..430e7d90 100644 --- a/scripts/update-version.js +++ b/scripts/update-version.js @@ -6,6 +6,7 @@ */ var fs = require('fs'); +var path = require('path'); var replace = require('replace'); var pjson = JSON.parse(fs.readFileSync('package.json', 'utf8')); var version = pjson.version; @@ -13,6 +14,6 @@ var version = pjson.version; replace({ regex: "Record.VERSION = 'dev';", replacement: "Record.VERSION = '" + version + "';", - paths: ['./dist/videojs.record.js'], + paths: [path.resolve('dist', 'videojs.record.js')], silent: true }); From 15f748fff0e4474129e5bd1be792aee99f0991ba Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Tue, 28 Nov 2017 00:22:04 +0100 Subject: [PATCH 8/8] update changelog --- CHANGES.md | 6 ++++++ scripts/update-version.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 4d261004..aa468663 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ videojs-record changelog ======================== +2.0.3 - unreleased +------------------ + +- Fix Windows build (#186) + + 2.0.2 - 2017/11/15 ------------------ diff --git a/scripts/update-version.js b/scripts/update-version.js index 430e7d90..a1ec243c 100644 --- a/scripts/update-version.js +++ b/scripts/update-version.js @@ -7,6 +7,7 @@ var fs = require('fs'); var path = require('path'); +var color = require('colour'); var replace = require('replace'); var pjson = JSON.parse(fs.readFileSync('package.json', 'utf8')); var version = pjson.version; @@ -17,3 +18,5 @@ replace({ paths: [path.resolve('dist', 'videojs.record.js')], silent: true }); + +console.log(color.green('OK') + ': Version updated to ' + version);