Permalink
Browse files

package: build with babel for ES2015 support

* Rename lib/ -> src/
* Add `postinstall` npm target for compiling src files to lib
* Add `build-watch` npm target for development with babel --watch
* Add `lib/` to .gitignore
* Add `source-map-support` module for babel-generated sourcemaps
  • Loading branch information...
1 parent d042619 commit 0109a87e55aae132411ca017e4aa6b00a6aa773e @calzoneman committed Sep 21, 2015
Showing with 9 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 index.js
  3. +5 −1 package.json
  4. 0 {lib → src}/account.js
  5. 0 {lib → src}/acp.js
  6. 0 {lib → src}/asyncqueue.js
  7. 0 {lib → src}/bgtask.js
  8. 0 {lib → src}/channel/accesscontrol.js
  9. 0 {lib → src}/channel/channel.js
  10. 0 {lib → src}/channel/chat.js
  11. 0 {lib → src}/channel/customization.js
  12. 0 {lib → src}/channel/drink.js
  13. 0 {lib → src}/channel/emotes.js
  14. 0 {lib → src}/channel/filters.js
  15. 0 {lib → src}/channel/kickban.js
  16. 0 {lib → src}/channel/library.js
  17. 0 {lib → src}/channel/mediarefresher.js
  18. 0 {lib → src}/channel/module.js
  19. 0 {lib → src}/channel/opts.js
  20. 0 {lib → src}/channel/permissions.js
  21. 0 {lib → src}/channel/playlist.js
  22. 0 {lib → src}/channel/poll.js
  23. 0 {lib → src}/channel/ranks.js
  24. 0 {lib → src}/channel/voteskip.js
  25. 0 {lib → src}/config.js
  26. 0 {lib → src}/counters.js
  27. 0 {lib → src}/customembed.js
  28. 0 {lib → src}/database.js
  29. 0 {lib → src}/database/accounts.js
  30. 0 {lib → src}/database/channels.js
  31. 0 {lib → src}/database/tables.js
  32. 0 {lib → src}/database/update.js
  33. 0 {lib → src}/emitter.js
  34. 0 {lib → src}/ffmpeg.js
  35. 0 {lib → src}/flags.js
  36. 0 {lib → src}/get-info.js
  37. 0 {lib → src}/google2vtt.js
  38. 0 {lib → src}/io/ioserver.js
  39. 0 {lib → src}/logger.js
  40. 0 {lib → src}/media.js
  41. 0 {lib → src}/poll.js
  42. 0 {lib → src}/server.js
  43. 0 {lib → src}/session.js
  44. 0 {lib → src}/setuid.js
  45. 0 {lib → src}/tor.js
  46. 0 {lib → src}/ullist.js
  47. 0 {lib → src}/user.js
  48. 0 {lib → src}/utilities.js
  49. 0 {lib → src}/web/account.js
  50. 0 {lib → src}/web/acp.js
  51. 0 {lib → src}/web/auth.js
  52. 0 {lib → src}/web/csrf.js
  53. 0 {lib → src}/web/jade.js
  54. +2 −2 {lib → src}/web/webserver.js
  55. 0 {lib → src}/xss.js
View
@@ -11,3 +11,4 @@ node_modules
torlist
www/cache
google-drive-subtitles
+lib/
View
@@ -1,6 +1,7 @@
var Server = require("./lib/server");
var Config = require("./lib/config");
var Logger = require("./lib/logger");
+require("source-map-support").install();
Config.load("config.yaml");
var sv = Server.init();
View
@@ -6,8 +6,9 @@
"repository": {
"url": "http://github.com/calzoneman/sync"
},
- "license":"MIT",
+ "license": "MIT",
"dependencies": {
+ "babel": "^5.8.23",
"bcrypt": "^0.8.5",
"body-parser": "^1.14.0",
"cheerio": "^0.19.0",
@@ -30,10 +31,13 @@
"sanitize-html": "git://github.com/calzoneman/sanitize-html",
"serve-static": "^1.10.0",
"socket.io": "^1.3.7",
+ "source-map-support": "^0.3.2",
"status-message-polyfill": "calzoneman/status-message-polyfill",
"yamljs": "^0.1.6"
},
"scripts": {
+ "postinstall": "babel --source-maps --out-dir lib/ src/",
+ "build-watch": "babel --watch --source-maps --out-dir lib/ src/",
"build-player": "$npm_node_execpath build-player.js"
},
"devDependencies": {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -11,7 +11,7 @@ var Config = require("../config");
var db = require("../database");
var bodyParser = require("body-parser");
var cookieParser = require("cookie-parser");
-var static = require("serve-static");
+var serveStatic = require("serve-static");
var morgan = require("morgan");
var session = require("../session");
var csrf = require("./csrf");
@@ -244,7 +244,7 @@ module.exports = {
require("./account").init(app);
require("./acp").init(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")
}));
app.use(function (err, req, res, next) {
File renamed without changes.

0 comments on commit 0109a87

Please sign in to comment.