mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Add babel task and move to src directory
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,6 +26,6 @@ website/public/docs
|
|||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
coverage
|
coverage
|
||||||
coverage.html
|
coverage.html
|
||||||
common/dist/scripts/habitrpg-shared.js
|
common/dist/scripts/*
|
||||||
|
|
||||||
test/spec/mocks/translations.js
|
test/spec/mocks/translations.js
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ api = module.exports
|
|||||||
|
|
||||||
_ = require 'lodash'
|
_ = require 'lodash'
|
||||||
moment = require 'moment'
|
moment = require 'moment'
|
||||||
t = require './helpers/translator'
|
|
||||||
|
DIST_LOCATION = '../../dist/scripts/content'
|
||||||
|
|
||||||
|
t = require "#{DIST_LOCATION}/helpers/translator"
|
||||||
|
|
||||||
|
|
||||||
require('babel/register')
|
require('babel/register')
|
||||||
|
|
||||||
@@ -16,9 +20,9 @@ require('babel/register')
|
|||||||
classes = ['warrior', 'rogue', 'healer', 'wizard']
|
classes = ['warrior', 'rogue', 'healer', 'wizard']
|
||||||
gearTypes = [ 'weapon', 'armor', 'head', 'shield', 'body', 'back', 'headAccessory', 'eyewear']
|
gearTypes = [ 'weapon', 'armor', 'head', 'shield', 'body', 'back', 'headAccessory', 'eyewear']
|
||||||
|
|
||||||
events = require('./events')
|
events = require("#{DIST_LOCATION}/events")
|
||||||
|
|
||||||
api.mystery = require('./mystery-sets')
|
api.mystery = require("#{DIST_LOCATION}/mystery-sets")
|
||||||
|
|
||||||
api.itemList =
|
api.itemList =
|
||||||
'weapon': {localeKey: 'weapon', isEquipment: true}
|
'weapon': {localeKey: 'weapon', isEquipment: true}
|
||||||
@@ -547,9 +551,9 @@ api.classes = classes
|
|||||||
|
|
||||||
api.gearTypes = gearTypes
|
api.gearTypes = gearTypes
|
||||||
|
|
||||||
api.spells = require('./spells/index')
|
api.spells = require("#{DIST_LOCATION}/spells/index")
|
||||||
|
|
||||||
api.cardTypes = require('./card-types')
|
api.cardTypes = require("#{DIST_LOCATION}/card-types")
|
||||||
|
|
||||||
# Intercept all spells to reduce user.stats.mp after casting the spell
|
# Intercept all spells to reduce user.stats.mp after casting the spell
|
||||||
_.each api.spells, (spellClass) ->
|
_.each api.spells, (spellClass) ->
|
||||||
@@ -569,7 +573,7 @@ api.special = api.spells.special
|
|||||||
---------------------------------------------------------------
|
---------------------------------------------------------------
|
||||||
###
|
###
|
||||||
|
|
||||||
eggs = require('./eggs/index')
|
eggs = require("#{DIST_LOCATION}/eggs/index")
|
||||||
|
|
||||||
api.dropEggs = eggs.dropEggs
|
api.dropEggs = eggs.dropEggs
|
||||||
|
|
||||||
@@ -628,7 +632,7 @@ api.specialMounts =
|
|||||||
'Orca-Base': 'orca'
|
'Orca-Base': 'orca'
|
||||||
'Gryphon-RoyalPurple': 'royalPurpleGryphon'
|
'Gryphon-RoyalPurple': 'royalPurpleGryphon'
|
||||||
|
|
||||||
api.timeTravelStable = require('./time-traveler-stable')
|
api.timeTravelStable = require("#{DIST_LOCATION}/time-traveler-stable")
|
||||||
|
|
||||||
api.hatchingPotions =
|
api.hatchingPotions =
|
||||||
Base: value: 2, text: t('hatchingPotionBase')
|
Base: value: 2, text: t('hatchingPotionBase')
|
||||||
@@ -1794,4 +1798,4 @@ api.userDefaults =
|
|||||||
{name: t('defaultTag3')}
|
{name: t('defaultTag3')}
|
||||||
]
|
]
|
||||||
|
|
||||||
api.faq = require './faq'
|
api.faq = require "#{DIST_LOCATION}/faq"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('coffee-script');
|
require('coffee-script');
|
||||||
var i18n = require('../../i18n.coffee');
|
var i18n = require(__dirname + '/../../../../script/i18n.coffee');
|
||||||
|
|
||||||
var t = function(string, vars) {
|
var t = function(string, vars) {
|
||||||
var func = function(lang) {
|
var func = function(lang) {
|
||||||
@@ -100,6 +100,7 @@
|
|||||||
"deep-diff": "~0.1.4",
|
"deep-diff": "~0.1.4",
|
||||||
"event-stream": "^3.2.2",
|
"event-stream": "^3.2.2",
|
||||||
"expect.js": "~0.2.0",
|
"expect.js": "~0.2.0",
|
||||||
|
"gulp-babel": "^5.2.1",
|
||||||
"istanbul": "^0.3.14",
|
"istanbul": "^0.3.14",
|
||||||
"karma": "~0.10.2",
|
"karma": "~0.10.2",
|
||||||
"karma-chai-plugins": "~0.1.0",
|
"karma-chai-plugins": "~0.1.0",
|
||||||
|
|||||||
16
tasks/gulp-babelify.js
Normal file
16
tasks/gulp-babelify.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import gulp from 'gulp';
|
||||||
|
import babel from 'gulp-babel';
|
||||||
|
|
||||||
|
const ES2015_SOURCE = 'common/script/src/**/*.js';
|
||||||
|
const ES2015_DIST = 'common/dist/scripts/';
|
||||||
|
|
||||||
|
gulp.task('babel:common', () => {
|
||||||
|
return gulp.src(ES2015_SOURCE)
|
||||||
|
.pipe(babel())
|
||||||
|
.pipe(gulp.dest(ES2015_DIST));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('babel:common:watch', () => {
|
||||||
|
gulp.watch([ES2015_SOURCE], ['babel:common']);
|
||||||
|
});
|
||||||
|
|
||||||
Reference in New Issue
Block a user