mirror of https://github.com/calzoneman/sync.git
Merge pull request #503 from calzoneman/es6
Transpile with babel for ES2015 support
This commit is contained in:
commit
f95f3dc89b
|
@ -11,3 +11,4 @@ node_modules
|
||||||
torlist
|
torlist
|
||||||
www/cache
|
www/cache
|
||||||
google-drive-subtitles
|
google-drive-subtitles
|
||||||
|
lib/
|
||||||
|
|
14
NEWS.md
14
NEWS.md
|
@ -1,3 +1,17 @@
|
||||||
|
2015-09-21
|
||||||
|
==========
|
||||||
|
|
||||||
|
* CyTube is now transpiled with [babel] to allow the use of ES6/ES2015
|
||||||
|
features. All source files have been moved from `lib` to `src`.
|
||||||
|
* Running `npm install` or `npm run postinstall` will prompt you to
|
||||||
|
build from `src` to `lib`.
|
||||||
|
* Running `npm run build-server` will run the build script without any
|
||||||
|
prompts.
|
||||||
|
* After updating with `git pull`, you should run `npm install` or `npm run
|
||||||
|
build-server` in order to rebuild after the changes.
|
||||||
|
|
||||||
|
[babel]: https://babeljs.io/
|
||||||
|
|
||||||
2015-07-25
|
2015-07-25
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
|
1
index.js
1
index.js
|
@ -1,6 +1,7 @@
|
||||||
var Server = require("./lib/server");
|
var Server = require("./lib/server");
|
||||||
var Config = require("./lib/config");
|
var Config = require("./lib/config");
|
||||||
var Logger = require("./lib/logger");
|
var Logger = require("./lib/logger");
|
||||||
|
require("source-map-support").install();
|
||||||
|
|
||||||
Config.load("config.yaml");
|
Config.load("config.yaml");
|
||||||
var sv = Server.init();
|
var sv = Server.init();
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
"license":"MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"babel": "^5.8.23",
|
||||||
"bcrypt": "^0.8.5",
|
"bcrypt": "^0.8.5",
|
||||||
"body-parser": "^1.14.0",
|
"body-parser": "^1.14.0",
|
||||||
"cheerio": "^0.19.0",
|
"cheerio": "^0.19.0",
|
||||||
|
@ -30,11 +31,15 @@
|
||||||
"sanitize-html": "git://github.com/calzoneman/sanitize-html",
|
"sanitize-html": "git://github.com/calzoneman/sanitize-html",
|
||||||
"serve-static": "^1.10.0",
|
"serve-static": "^1.10.0",
|
||||||
"socket.io": "^1.3.7",
|
"socket.io": "^1.3.7",
|
||||||
|
"source-map-support": "^0.3.2",
|
||||||
"status-message-polyfill": "calzoneman/status-message-polyfill",
|
"status-message-polyfill": "calzoneman/status-message-polyfill",
|
||||||
"yamljs": "^0.1.6"
|
"yamljs": "^0.1.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-player": "$npm_node_execpath build-player.js"
|
"build-player": "$npm_node_execpath build-player.js",
|
||||||
|
"build-server": "babel --source-maps --out-dir lib/ src/",
|
||||||
|
"postinstall": "./postinstall.sh",
|
||||||
|
"server-dev": "babel --watch --source-maps --out-dir lib/ src/"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"coffee-script": "^1.9.2"
|
"coffee-script": "^1.9.2"
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
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
|
|
@ -11,7 +11,7 @@ var Config = require("../config");
|
||||||
var db = require("../database");
|
var db = require("../database");
|
||||||
var bodyParser = require("body-parser");
|
var bodyParser = require("body-parser");
|
||||||
var cookieParser = require("cookie-parser");
|
var cookieParser = require("cookie-parser");
|
||||||
var static = require("serve-static");
|
var serveStatic = require("serve-static");
|
||||||
var morgan = require("morgan");
|
var morgan = require("morgan");
|
||||||
var session = require("../session");
|
var session = require("../session");
|
||||||
var csrf = require("./csrf");
|
var csrf = require("./csrf");
|
||||||
|
@ -244,7 +244,7 @@ module.exports = {
|
||||||
require("./account").init(app);
|
require("./account").init(app);
|
||||||
require("./acp").init(app);
|
require("./acp").init(app);
|
||||||
require("../google2vtt").attach(app);
|
require("../google2vtt").attach(app);
|
||||||
app.use(static(path.join(__dirname, "..", "..", "www"), {
|
app.use(serveStatic(path.join(__dirname, "..", "..", "www"), {
|
||||||
maxAge: Config.get("http.max-age") || Config.get("http.cache-ttl")
|
maxAge: Config.get("http.max-age") || Config.get("http.cache-ttl")
|
||||||
}));
|
}));
|
||||||
app.use(function (err, req, res, next) {
|
app.use(function (err, req, res, next) {
|
Loading…
Reference in New Issue