From c07cf7c13a743a65f47b85232d8ce0dab2e49efe Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sun, 7 Jan 2018 15:42:08 -0800 Subject: [PATCH] Remove confirmation prompt from postinstall --- NEWS.md | 15 + build-player.js => bin/build-player.js | 4 +- package.json | 6 +- postinstall.sh | 22 +- www/js/player.js | 1796 ------------------------ 5 files changed, 27 insertions(+), 1816 deletions(-) rename build-player.js => bin/build-player.js (92%) mode change 100644 => 100755 delete mode 100644 www/js/player.js diff --git a/NEWS.md b/NEWS.md index a4d5e64a..2c2a8970 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,18 @@ +2018-01-07 +========== + +**Build changes:** When the `babel` dependency was first added to transpile ES6 +code to ES5, an interactive prompt was added to the `postinstall` script before +transpilation, in case the user had made local modifications to the files in +`lib` which previously would have been detected as a git conflict when pulling. + +It has now been sufficiently long that this is no longer needed, so I've removed +it. As always, users wishing to make local modifications (or forks) should edit +the code in `src/` and run `npm run build-server` to regenerate `lib/`. + +This commit also removes the bundled `www/js/player.js` file in favor of having +`postinstall` generate it from the sources in `player/`. + 2017-12-24 ========== diff --git a/build-player.js b/bin/build-player.js old mode 100644 new mode 100755 similarity index 92% rename from build-player.js rename to bin/build-player.js index e062b2dc..f44238ef --- a/build-player.js +++ b/bin/build-player.js @@ -1,4 +1,6 @@ -var coffee = require('coffee-script'); +#!/usr/bin/env node + +var coffee = require('coffeescript'); var fs = require('fs'); var path = require('path'); diff --git a/package.json b/package.json index 00f1eea6..5e4a39c8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.51.18", + "version": "3.52.0", "repository": { "url": "http://github.com/calzoneman/sync" }, @@ -46,7 +46,7 @@ "yamljs": "^0.2.8" }, "scripts": { - "build-player": "$npm_node_execpath build-player.js", + "build-player": "./bin/build-player.js", "build-server": "babel -D --source-maps --loose es6.destructuring,es6.forOf --out-dir lib/ src/", "flow": "flow", "postinstall": "./postinstall.sh", @@ -63,7 +63,7 @@ "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-flow-strip-types": "^6.22.0", "babel-preset-env": "^1.5.2", - "coffee-script": "^1.9.2", + "coffeescript": "^1.9.2", "flow-bin": "^0.43.0", "mocha": "^3.2.0", "sinon": "^2.3.2" diff --git a/postinstall.sh b/postinstall.sh index bdc0bfe4..b42a8f1c 100755 --- a/postinstall.sh +++ b/postinstall.sh @@ -1,19 +1,9 @@ #!/bin/sh -if test "$BUILD_OVERRIDE" = "Y"; then - echo "Running $npm_package_scripts_build_server" - $npm_package_scripts_build_server - exit $? -fi +set -e -echo "In order to run the server, the source files in src/ must be transpiled to lib/. This will overwrite any changes you have made to the files in lib/." -echo -n "Do you want to build now? [y/N]? " -read answer -echo - -if test "$answer" = "y" || test "$answer" = "Y"; then - echo "Running $npm_package_scripts_build_server" - $npm_package_scripts_build_server -else - echo "Skipping build step. You can build at a later time by running \`npm run build-server\`." -fi +echo "Building from src/ to lib/" +$npm_package_scripts_build_server +echo "Building from player/ to www/js/player.js" +$npm_package_scripts_build_player +echo "Done" diff --git a/www/js/player.js b/www/js/player.js deleted file mode 100644 index eae4a16b..00000000 --- a/www/js/player.js +++ /dev/null @@ -1,1796 +0,0 @@ -(function() { - var CUSTOM_EMBED_WARNING, CustomEmbedPlayer, DEFAULT_ERROR, DailymotionPlayer, EmbedPlayer, FilePlayer, GoogleDrivePlayer, GoogleDriveYouTubePlayer, HLSPlayer, ImgurPlayer, LivestreamPlayer, Player, PlayerJSPlayer, RTMPPlayer, SmashcastPlayer, SoundCloudPlayer, StreamablePlayer, TYPE_MAP, TwitchPlayer, UstreamPlayer, VideoJSPlayer, VimeoPlayer, YouTubePlayer, codecToMimeType, genParam, getSourceLabel, sortSources, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - - window.Player = Player = (function() { - function Player(data) { - if (!(this instanceof Player)) { - return new Player(data); - } - this.setMediaProperties(data); - this.paused = false; - } - - Player.prototype.load = function(data) { - return this.setMediaProperties(data); - }; - - Player.prototype.setMediaProperties = function(data) { - this.mediaId = data.id; - this.mediaType = data.type; - return this.mediaLength = data.seconds; - }; - - Player.prototype.play = function() { - return this.paused = false; - }; - - Player.prototype.pause = function() { - return this.paused = true; - }; - - Player.prototype.seekTo = function(time) {}; - - Player.prototype.setVolume = function(volume) {}; - - Player.prototype.getTime = function(cb) { - return cb(0); - }; - - Player.prototype.isPaused = function(cb) { - return cb(this.paused); - }; - - Player.prototype.getVolume = function(cb) { - return cb(VOLUME); - }; - - Player.prototype.destroy = function() {}; - - return Player; - - })(); - - window.VimeoPlayer = VimeoPlayer = (function(superClass) { - extend(VimeoPlayer, superClass); - - function VimeoPlayer(data) { - if (!(this instanceof VimeoPlayer)) { - return new VimeoPlayer(data); - } - this.load(data); - } - - VimeoPlayer.prototype.load = function(data) { - this.setMediaProperties(data); - return waitUntilDefined(window, 'Vimeo', (function(_this) { - return function() { - var video; - video = $('