diff --git a/common/script/content/index.coffee b/common/script/content/index.coffee deleted file mode 100644 index 041f0e4f0b..0000000000 --- a/common/script/content/index.coffee +++ /dev/null @@ -1,114 +0,0 @@ -api = module.exports - -### - --------------------------------------------------------------- - Gear (Weapons, Armor, Head, Shield) - Item definitions: {index, text, notes, value, str, def, int, per, classes, type} - --------------------------------------------------------------- -### - -classes = require('../../dist/scripts/content/classes') - -events = require('../../dist/scripts/content/events') - -api.mystery = require('../../dist/scripts/content/mystery-sets') - -api.itemList = require('../../dist/scripts/content/item-list') - -gear = require('../../dist/scripts/content/gear/index') - -### - The gear is exported as a tree (defined above), and a flat list (eg, {weapon_healer_1: .., shield_special_0: ...}) since - they are needed in different forms at different points in the app -### -api.gear = - tree: gear.tree - flat: gear.flat - -### - Time Traveler Store, mystery sets need their items mapped in -### - -api.timeTravelerStore = require('../../dist/scripts/content/time-traveler-store') - -### - --------------------------------------------------------------- - Unique Rewards: Potion and Armoire - --------------------------------------------------------------- -### - -api.potion = require('../../dist/scripts/content/health-potion') - -api.armoire = require('../../dist/scripts/content/armoire') - -### - --------------------------------------------------------------- - Classes - --------------------------------------------------------------- -### - -api.classes = classes - -### - --------------------------------------------------------------- - Gear Types - --------------------------------------------------------------- -### - -api.gearTypes = gear.gearTypes - -api.spells = require('../../dist/scripts/content/spells/index') - -api.cardTypes = require('../../dist/scripts/content/card-types') - -api.special = api.spells.special - -### - --------------------------------------------------------------- - Drops - --------------------------------------------------------------- -### - -eggs = require('../../dist/scripts/content/eggs/index') - -api.dropEggs = eggs.dropEggs - -api.questEggs = eggs.questEggs - -api.eggs = eggs.allEggs - -pets_mounts = require('../../dist/scripts/content/pets-mounts/index') - -api.specialPets = pets_mounts.specialPets - -api.specialMounts = pets_mounts.specialMounts - -api.timeTravelStable = require('../../dist/scripts/content/time-traveler-stable') - -api.hatchingPotions = require('../../dist/scripts/content/hatching-potions') - -api.pets = pets_mounts.dropPets - -api.questPets = pets_mounts.questPets - -api.mounts = pets_mounts.dropMounts - -api.questMounts = pets_mounts.questMounts - -api.food = require('../../dist/scripts/content/food/index') - -quests = require('../../dist/scripts/content/quests/index') - -api.userCanOwnQuestCategories = quests.canOwnCategories - -api.quests = quests.allQuests - -api.questsByLevel = quests.byLevel - -api.backgrounds = require('../../dist/scripts/content/backgrounds') - -api.subscriptionBlocks = require('../../dist/scripts/content/subscription-blocks') - -api.userDefaults = require('../../dist/scripts/content/user-defaults') - -api.faq = require('../../dist/scripts/content/faq') diff --git a/common/script/count.js b/common/script/count.js index de2bbf1227..7cd464342d 100644 --- a/common/script/count.js +++ b/common/script/count.js @@ -1,8 +1,7 @@ 'use strict'; -require('coffee-script'); var _ = require('lodash'); -var content = require('./content/index.coffee'); +var content = require('../dist/scripts/content/index'); var DROP_ANIMALS = _.keys(content.pets); diff --git a/common/script/index.coffee b/common/script/index.coffee index d59b5a9828..cc4b7053d4 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -1,6 +1,6 @@ moment = require('moment') _ = require('lodash') -content = require('./content/index.coffee') +content = require('../dist/scripts/content/index') i18n = require('./i18n.coffee') api = module.exports = {} diff --git a/common/script/src/content/index.js b/common/script/src/content/index.js new file mode 100644 index 0000000000..1d0a72babe --- /dev/null +++ b/common/script/src/content/index.js @@ -0,0 +1,100 @@ +import classes from './classes'; +import mysterySets from './mystery-sets'; +import itemList from './item-list'; +import { + tree as gearTree, + flat as gearFlat, + gearTypes, +} from './gear/index'; +import timeTravelerStore from './time-traveler-store'; +import potion from './health-potion'; +import armoire from './armoire'; +import spells from './spells/index'; +import {special} from './spells/index'; +import cardTypes from './card-types'; +import { + dropEggs, + questEggs, + allEggs, +} from './eggs/index'; +import { + dropPets, + questPets, + dropMounts, + questMounts, + specialPets, + specialMounts, +} from './pets-mounts/index'; +import timeTravelStable from './time-traveler-stable'; +import hatchingPotions from './hatching-potions'; +import food from './food/index'; +import { + all as allQuests, + canOwnCategories as userCanOwnQuestCategories, + byLevel as questsByLevel +} from './quests/index'; +import backgrounds from './backgrounds'; +import subscriptionBlocks from './subscription-blocks'; +import userDefaults from './user-defaults'; +import faq from './faq'; + +export default { + // Constants + classes: classes, + gearTypes: gearTypes, + mystery: mysterySets, + itemList: itemList, + userCanOwnQuestCategories: userCanOwnQuestCategories, + + // Gear + gear: { + tree: gearTree, + flat: gearFlat + }, + + // Time Traveler Store + timeTravelerStore: timeTravelerStore, + timeTravelStable: timeTravelStable, + + // Non-Gear Static Rewards + potion: potion, + armoire: armoire, + + // Spells + spells: spells, + cardTypes: cardTypes, + special: special, + + // Item Drops + hatchingPotions: hatchingPotions, + food: food, + + // Eggs + dropEggs: dropEggs, + questEggs: questEggs, + eggs: allEggs, + + // Pets And Mounts + pets: dropPets, + questPets: questPets, + mounts: dropMounts, + questMounts: questMounts, + specialPets: specialPets, + specialMounts: specialMounts, + + // Quests + quests: allQuests, + questsByLevel: questsByLevel, + + // Backgrounds + backgrounds: backgrounds, + + // Subscription Blocks + subscriptionBlocks: subscriptionBlocks, + + // Default User Tasks + userDefaults: userDefaults, + + // Frequently Asked Questions + faq: faq, +}; diff --git a/test/common/user.fns.buy.test.js b/test/common/user.fns.buy.test.js index c79d5ea828..bcfe333d27 100644 --- a/test/common/user.fns.buy.test.js +++ b/test/common/user.fns.buy.test.js @@ -6,7 +6,6 @@ var _ = require('lodash'); require('coffee-script'); var shared = require('../../common/script/index.coffee'); -var Content = require('../../common/script/content/index.coffee'); describe('user.fns.buy', function() { var user; @@ -63,8 +62,8 @@ describe('user.fns.buy', function() { var fullArmoire = {} - _(Content.gearTypes).each(function(type) { - _(Content.gear.tree[type].armoire).each(function(gearObject, gearName) { + _(shared.content.gearTypes).each(function(type) { + _(shared.content.gear.tree[type].armoire).each(function(gearObject, gearName) { armoireKey = gearObject.key; fullArmoire[armoireKey] = true; }); @@ -118,7 +117,7 @@ describe('user.fns.buy', function() { }); it('gives food', function() { - var honey = Content.food.Honey; + var honey = shared.content.food.Honey; user.fns.randomVal.returns(honey); user.fns.predictableRandom.returns(YIELD_FOOD); @@ -148,7 +147,7 @@ describe('user.fns.buy', function() { context('gear awards', function() { beforeEach(function() { - var shield = Content.gear.tree.shield.armoire.gladiatorShield; + var shield = shared.content.gear.tree.shield.armoire.gladiatorShield; user.fns.randomVal.returns(shield); });