fix(build) only require/import the main common file

This commit is contained in:
Matteo Pagliazzi
2016-04-11 19:46:48 +02:00
parent 27a2b9002d
commit 463ba81468
7 changed files with 13 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
import validator from 'validator'; import validator from 'validator';
import i18n from '../../../common/script/i18n'; import i18n from '../i18n';
import { import {
BadRequest, BadRequest,
} from '../libs/errors'; } from '../libs/errors';

View File

@@ -1,5 +1,5 @@
import content from '../content/index'; import content from '../content/index';
import i18n from '../../../common/script/i18n'; import i18n from '../i18n';
import _ from 'lodash'; import _ from 'lodash';
import splitWhitespace from '../libs/splitWhitespace'; import splitWhitespace from '../libs/splitWhitespace';
import { import {

View File

@@ -16,10 +16,11 @@ import {
getUserInfo, getUserInfo,
sendTxn as sendTxnEmail, sendTxn as sendTxnEmail,
} from '../../libs/api-v3/email'; } from '../../libs/api-v3/email';
import { quests as questScrolls } from '../../../../common/script/content';
import common from '../../../../common'; import common from '../../../../common';
import sendPushNotification from '../../libs/api-v3/pushNotifications'; import sendPushNotification from '../../libs/api-v3/pushNotifications';
const questScrolls = common.content.quests;
function canStartQuestAutomatically (group) { function canStartQuestAutomatically (group) {
// If all members are either true (accepted) or false (rejected) return true // If all members are either true (accepted) or false (rejected) return true
// If any member is null/undefined (undecided) return false // If any member is null/undefined (undecided) return false

View File

@@ -1,4 +1,4 @@
import common from '../../../../common/script'; import common from '../../../../common';
export const CustomError = common.errors.CustomError; export const CustomError = common.errors.CustomError;

View File

@@ -2,11 +2,13 @@ import {
NotAuthorized, NotAuthorized,
BadRequest, BadRequest,
} from '../../libs/api-v3/errors'; } from '../../libs/api-v3/errors';
import i18n from '../../../../common/script/i18n'; import common from '../../../../common';
import { import {
model as User, model as User,
} from '../../models/user'; } from '../../models/user';
const i18n = common.i18n;
// Authenticate a request through the x-api-user and x-api key header // Authenticate a request through the x-api-user and x-api key header
// If optional is true, don't error on missing authentication // If optional is true, don't error on missing authentication
export function authWithHeaders (optional = false) { export function authWithHeaders (optional = false) {

View File

@@ -1,9 +1,5 @@
import _ from 'lodash'; import _ from 'lodash';
import moment from 'moment'; import moment from 'moment';
import {
daysSince,
shouldDo,
} from '../../../../common/script/cron';
import common from '../../../../common'; import common from '../../../../common';
import * as Tasks from '../../models/task'; import * as Tasks from '../../models/task';
import Q from 'q'; import Q from 'q';
@@ -11,6 +7,9 @@ import { model as Group } from '../../models/group';
import { model as User } from '../../models/user'; import { model as User } from '../../models/user';
import { preenUserHistory } from '../../libs/api-v3/preening'; import { preenUserHistory } from '../../libs/api-v3/preening';
const daysSince = common.daysSince;
const shouldDo = common.shouldDo;
const scoreTask = common.ops.scoreTask; const scoreTask = common.ops.scoreTask;
let clearBuffs = { let clearBuffs = {

View File

@@ -12,11 +12,12 @@ import { InternalServerError } from '../libs/api-v3/errors';
import * as firebase from '../libs/api-v2/firebase'; import * as firebase from '../libs/api-v2/firebase';
import baseModel from '../libs/api-v3/baseModel'; import baseModel from '../libs/api-v3/baseModel';
import { sendTxn as sendTxnEmail } from '../libs/api-v3/email'; import { sendTxn as sendTxnEmail } from '../libs/api-v3/email';
import { quests as questScrolls } from '../../../common/script/content';
import Q from 'q'; import Q from 'q';
import nconf from 'nconf'; import nconf from 'nconf';
import sendPushNotification from '../libs/api-v3/pushNotifications'; import sendPushNotification from '../libs/api-v3/pushNotifications';
const questScrolls = shared.content.quests;
let Schema = mongoose.Schema; let Schema = mongoose.Schema;
// NOTE once Firebase is enabled any change to groups' members in MongoDB will have to be run through the API // NOTE once Firebase is enabled any change to groups' members in MongoDB will have to be run through the API