Remove coffeescript dependency from website

This commit is contained in:
Blade Barringer
2015-11-11 08:43:36 -06:00
parent 774a42d67e
commit 9408effb4e
6 changed files with 7 additions and 19 deletions

View File

@@ -1,5 +1,3 @@
/* @see ./routes.coffee for routing*/
var url = require('url'); var url = require('url');
var ipn = require('paypal-ipn'); var ipn = require('paypal-ipn');
var _ = require('lodash'); var _ = require('lodash');
@@ -66,10 +64,6 @@ var findTask = function(req, res) {
--------------- ---------------
*/ */
/**
This is called form deprecated.coffee's score function, and the req.headers are setup properly to handle the login
Export it also so we can call it from deprecated.coffee
*/
api.score = function(req, res, next) { api.score = function(req, res, next) {
var id = req.params.id, var id = req.params.id,
direction = req.params.direction, direction = req.params.direction,
@@ -546,7 +540,7 @@ api.sessionPartyInvite = function(req,res,next){
} }
/** /**
* All other user.ops which can easily be mapped to habitrpg-shared/index.coffee, not requiring custom API-wrapping * All other user.ops which can easily be mapped to common/script/index.js, not requiring custom API-wrapping
*/ */
_.each(shared.wrap({}).ops, function(op,k){ _.each(shared.wrap({}).ops, function(op,k){
if (!api[k]) { if (!api[k]) {

View File

@@ -1,4 +1,3 @@
/* @see ./routes.coffee for routing*/
var _ = require('lodash'); var _ = require('lodash');
var shared = require('../../../../common'); var shared = require('../../../../common');
var nconf = require('nconf'); var nconf = require('nconf');

View File

@@ -2,7 +2,6 @@
// payment plan definitions, instead you have to create it via their REST SDK and keep it updated the same way. So this // payment plan definitions, instead you have to create it via their REST SDK and keep it updated the same way. So this
// file will be used once for initing your billing plan (then you get the resultant plan.id to store in config.json), // file will be used once for initing your billing plan (then you get the resultant plan.id to store in config.json),
// and once for any time you need to edit the plan thereafter // and once for any time you need to edit the plan thereafter
require('coffee-script');
var path = require('path'); var path = require('path');
var nconf = require('nconf'); var nconf = require('nconf');
_ = require('lodash'); _ = require('lodash');

View File

@@ -1,4 +1,3 @@
require('coffee-script');
require('./i18n'); require('./i18n');
var _ = require('lodash'); var _ = require('lodash');

View File

@@ -2,13 +2,11 @@
---------- /api/v2 API ------------ ---------- /api/v2 API ------------
see https://github.com/wordnik/swagger-node-express see https://github.com/wordnik/swagger-node-express
Every url added to router is prefaced by /api/v2 Every url added to router is prefaced by /api/v2
Note: Many user-route ops exist in ../../common/script/index.coffee#user.ops, so that they can (1) be called both Note: Many user-route ops exist in ../../common/script/index.js#user.ops, so that they can (1) be called both
client and server. client and server.
v1 user. Requires x-api-user (user id) and x-api-key (api key) headers, Test with: v1 user. Requires x-api-user (user id) and x-api-key (api key) headers, Test with:
$ mocha test/user.mocha.coffee
*/ */
require('coffee-script');
var user = require("../../controllers/api-v2/user"); var user = require("../../controllers/api-v2/user");
var groups = require("../../controllers/api-v2/groups"); var groups = require("../../controllers/api-v2/groups");
var members = require("../../controllers/api-v2/members"); var members = require("../../controllers/api-v2/members");
@@ -295,7 +293,7 @@ module.exports = function(swagger, v2) {
spec: { spec: {
method: 'POST', method: 'POST',
description: "Casts a spell on a target.", description: "Casts a spell on a target.",
parameters: [path('spell', "The key of the spell to cast (see ../../common#content/index.coffee)", 'string'), query('targetType', "The type of object you're targeting", 'string', ['party', 'self', 'user', 'task']), query('targetId', "The ID of the object you're targeting", 'string')] parameters: [path('spell', "The key of the spell to cast (see ../../common#content/index.js)", 'string'), query('targetType', "The type of object you're targeting", 'string', ['party', 'self', 'user', 'task']), query('targetId', "The ID of the object you're targeting", 'string')]
}, },
action: user.cast action: user.cast
}, },

View File

@@ -20,7 +20,6 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
}); });
} else { } else {
require('coffee-script'); // remove this once we've fully converted over
var express = require("express"); var express = require("express");
var http = require("http"); var http = require("http");
var path = require("path"); var path = require("path");