mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-29 20:24:53 +01:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4468c2ca2f | ||
|
|
ff53552fd3 | ||
|
|
d782ed5d20 | ||
|
|
8b83d8d4e9 | ||
|
|
c7fd6701ae | ||
|
|
5d18640215 | ||
|
|
bde6b7d6ce | ||
|
|
5393c3b6c0 | ||
|
|
84136882d3 | ||
|
|
86c9bddc09 | ||
|
|
81b7eeeb71 | ||
|
|
d971e673af | ||
|
|
603226a084 | ||
|
|
a38f524d62 | ||
|
|
3b0e6e138a | ||
|
|
9c0998c29a | ||
|
|
4ad50b9d30 | ||
|
|
998037e0a1 | ||
|
|
2539655932 | ||
|
|
3d72233d54 | ||
|
|
ab84e88650 | ||
|
|
a4fd687510 | ||
|
|
0d1b5aad7e | ||
|
|
1484f8afe3 | ||
|
|
616574d438 | ||
|
|
33bcb40077 | ||
|
|
6bddef6878 | ||
|
|
fefcb0f4ac | ||
|
|
f6108ddb40 | ||
|
|
4b48b7a5f6 |
2
.bowerrc
2
.bowerrc
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"directory": "website/client/bower_components"
|
||||
"directory": "website/client-old/bower_components"
|
||||
}
|
||||
|
||||
@@ -8,11 +8,12 @@ website/transpiled-babel/
|
||||
|
||||
migrations/*
|
||||
|
||||
# The files in website/client/js should be moved out and browserified
|
||||
website/client/
|
||||
# The files in website/client-old/js should be moved out and browserified
|
||||
website/client-old/
|
||||
|
||||
# Temporarilly disabled. These should be removed when the linting errors are fixed
|
||||
common/script/content/index.js
|
||||
website/common/script/content/index.js
|
||||
website/common/browserify.js
|
||||
|
||||
debug-scripts/*
|
||||
scripts/*
|
||||
@@ -21,8 +22,6 @@ gulpfile.js
|
||||
Gruntfile.js
|
||||
newrelic.js
|
||||
|
||||
test/api-legacy/**/*
|
||||
test/common/simulations/**/*
|
||||
test/content/**/*
|
||||
test/server_side/**/*
|
||||
test/spec/**/*
|
||||
test/client-old/spec/**/*
|
||||
|
||||
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,17 +1,19 @@
|
||||
.DS_Store
|
||||
website/client/gen
|
||||
website/client/common
|
||||
website/client/apidoc
|
||||
website/client-old/gen
|
||||
website/client-old/common
|
||||
website/client-old/apidoc
|
||||
website/client-old/js/habitrpg-shared.js*
|
||||
website/client-old/css/habitrpg-shared.css
|
||||
website/transpiled-babel/
|
||||
common/transpiled-babel/
|
||||
website/common/transpiled-babel/
|
||||
node_modules
|
||||
*.swp
|
||||
.idea*
|
||||
config.json
|
||||
npm-debug.log*
|
||||
lib
|
||||
website/client/bower_components
|
||||
website/client/new-stuff.html
|
||||
website/client-old/bower_components
|
||||
website/client-old/new-stuff.html
|
||||
website/build
|
||||
newrelic_agent.log
|
||||
.bower-tmp
|
||||
@@ -25,12 +27,11 @@ src/*/*.map
|
||||
src/*/*/*.map
|
||||
test/*.js
|
||||
test/*.map
|
||||
website/client/docs
|
||||
website/client-old/docs
|
||||
*.sublime-workspace
|
||||
coverage
|
||||
coverage.html
|
||||
common/dist/scripts/*
|
||||
common/dist/sprites/habitrpg-shared.css
|
||||
|
||||
test/spec/mocks/translations.js
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ node_modules/**
|
||||
.bower-cache/**
|
||||
.bower-tmp/**
|
||||
.bower-registry/**
|
||||
website/client-old/**
|
||||
website/client/**
|
||||
website/views/**
|
||||
website/build/**
|
||||
|
||||
52
Gruntfile.js
52
Gruntfile.js
@@ -28,11 +28,11 @@ module.exports = function(grunt) {
|
||||
report: 'gzip'
|
||||
},
|
||||
files:{
|
||||
"common/dist/sprites/habitrpg-shared.css": [
|
||||
"common/dist/sprites/spritesmith*.css",
|
||||
"common/css/backer.css",
|
||||
"common/css/Mounts.css",
|
||||
"common/css/index.css"
|
||||
"website/client-old/css/habitrpg-shared.css": [
|
||||
"website/assets/sprites/dist/spritesmith*.css",
|
||||
"website/assets/sprites/css/backer.css",
|
||||
"website/assets/sprites/css/Mounts.css",
|
||||
"website/assets/sprites/css/index.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -43,11 +43,11 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
compress: false, // AFTER
|
||||
'include css': true,
|
||||
paths: ['website/client']
|
||||
paths: ['website/client-old']
|
||||
},
|
||||
files: {
|
||||
'website/build/app.css': ['website/client/css/index.styl'],
|
||||
'website/build/static.css': ['website/client/css/static.styl']
|
||||
'website/build/app.css': ['website/client-old/css/index.styl'],
|
||||
'website/build/static.css': ['website/client-old/css/static.styl']
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -55,13 +55,13 @@ module.exports = function(grunt) {
|
||||
copy: {
|
||||
build: {
|
||||
files: [
|
||||
{expand: true, cwd: 'website/client/', src: 'favicon.ico', dest: 'website/build/'},
|
||||
{expand: true, cwd: 'website/client/', src: 'favicon_192x192.png', dest: 'website/build/'},
|
||||
{expand: true, cwd: '', src: 'common/dist/sprites/spritesmith*.png', dest: 'website/build/'},
|
||||
{expand: true, cwd: '', src: 'common/img/sprites/backer-only/*.gif', dest: 'website/build/'},
|
||||
{expand: true, cwd: '', src: 'common/img/sprites/npc_ian.gif', dest: 'website/build/'},
|
||||
{expand: true, cwd: '', src: 'common/img/sprites/quest_*.gif', dest: 'website/build/'},
|
||||
{expand: true, cwd: 'website/client/', src: 'bower_components/bootstrap/dist/fonts/*', dest: 'website/build/'}
|
||||
{expand: true, cwd: 'website/client-old/', src: 'favicon.ico', dest: 'website/build/'},
|
||||
{expand: true, cwd: 'website/client-old/', src: 'favicon_192x192.png', dest: 'website/build/'},
|
||||
{expand: true, cwd: 'website/assets/sprites/dist/', src: 'spritesmith*.png', dest: 'website/build/'},
|
||||
{expand: true, cwd: '', src: 'website/assets/sprites/backer-only/*.gif', dest: 'website/build/'},
|
||||
{expand: true, cwd: '', src: 'website/assets/sprites/npc_ian.gif', dest: 'website/build/'},
|
||||
{expand: true, cwd: '', src: 'website/assets/sprites/quest_*.gif', dest: 'website/build/'},
|
||||
{expand: true, cwd: 'website/client-old/', src: 'bower_components/bootstrap/dist/fonts/*', dest: 'website/build/'}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -77,10 +77,10 @@ module.exports = function(grunt) {
|
||||
'website/build/*.css',
|
||||
'website/build/favicon.ico',
|
||||
'website/build/favicon_192x192.png',
|
||||
'website/build/common/dist/sprites/*.png',
|
||||
'website/build/common/img/sprites/backer-only/*.gif',
|
||||
'website/build/common/img/sprites/npc_ian.gif',
|
||||
'website/build/common/img/sprites/quest_*.gif',
|
||||
'website/build/website/assets/sprites/dist/*.png',
|
||||
'website/build/website/assets/sprites/backer-only/*.gif',
|
||||
'website/build/website/assets/sprites/npc_ian.gif',
|
||||
'website/build/website/assets/sprites/quest_*.gif',
|
||||
'website/build/bower_components/bootstrap/dist/fonts/*'
|
||||
],
|
||||
dest: 'website/build/*.css'
|
||||
@@ -88,9 +88,9 @@ module.exports = function(grunt) {
|
||||
}
|
||||
});
|
||||
|
||||
//Load build files from client/manifest.json
|
||||
grunt.registerTask('loadManifestFiles', 'Load all build files from client/manifest.json', function(){
|
||||
var files = grunt.file.readJSON('./website/client/manifest.json');
|
||||
//Load build files from client-old/manifest.json
|
||||
grunt.registerTask('loadManifestFiles', 'Load all build files from client-old/manifest.json', function(){
|
||||
var files = grunt.file.readJSON('./website/client-old/manifest.json');
|
||||
var uglify = {};
|
||||
var cssmin = {};
|
||||
|
||||
@@ -101,7 +101,7 @@ module.exports = function(grunt) {
|
||||
_.each(files[key].js, function(val){
|
||||
var path = "./";
|
||||
if( val.indexOf('common/') == -1)
|
||||
path = './website/client/';
|
||||
path = './website/client-old/';
|
||||
js.push(path + val);
|
||||
});
|
||||
|
||||
@@ -110,7 +110,7 @@ module.exports = function(grunt) {
|
||||
_.each(files[key].css, function(val){
|
||||
var path = "./";
|
||||
if( val.indexOf('common/') == -1) {
|
||||
path = (val == 'app.css' || val == 'static.css') ? './website/build/' : './website/client/';
|
||||
path = (val == 'app.css' || val == 'static.css') ? './website/build/' : './website/client-old/';
|
||||
}
|
||||
css.push(path + val)
|
||||
});
|
||||
@@ -122,7 +122,7 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.config.set('cssmin.build.files', cssmin);
|
||||
// Rewrite urls to relative path
|
||||
grunt.config.set('cssmin.build.options', {'target': 'website/client/css/whatever-css.css'});
|
||||
grunt.config.set('cssmin.build.options', {'target': 'website/client-old/css/whatever-css.css'});
|
||||
});
|
||||
|
||||
// Register tasks.
|
||||
@@ -133,7 +133,7 @@ module.exports = function(grunt) {
|
||||
grunt.registerTask('test:prepare:translations', function() {
|
||||
var i18n = require('./website/server/libs/i18n'),
|
||||
fs = require('fs');
|
||||
fs.writeFileSync('test/spec/mocks/translations.js',
|
||||
fs.writeFileSync('test/client-old/spec/mocks/translations.js',
|
||||
"if(!window.env) window.env = {};\n" +
|
||||
"window.env.translations = " + JSON.stringify(i18n.translations['en']) + ';');
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"website/client/bower_components",
|
||||
"website/client-old/bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Common
|
||||
|
||||
Shared resources useful for the multiple Habitica repositories, that way all the repositories remain in-sync with common characteristics. Includes things like:
|
||||
|
||||
* Assets - sprites, images, etc
|
||||
* CSS - especially, esp. sprite-sheet mapping
|
||||
* Algorithms - level up algorithm, scoring functions, etc
|
||||
* View helper functions that may come in handy for multiple client MVCs
|
||||
* Item definitions - weapons, armor, pets
|
||||
|
||||
## Compiling spritesheets
|
||||
Because of some wonkiness with Heroku, the spritesheet compilation is not part of the production build process and must be done manually when new images are added by running:
|
||||
|
||||
``` bash
|
||||
npm run sprites
|
||||
```
|
||||
BIN
common/dist/sprites/spritesmith-largeSprites-0.png
vendored
BIN
common/dist/sprites/spritesmith-largeSprites-0.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 483 KiB |
@@ -11,43 +11,43 @@ module.exports = function karmaConfig (config) {
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'website/client/bower_components/jquery/dist/jquery.js',
|
||||
'website/client/bower_components/pnotify/jquery.pnotify.js',
|
||||
'website/client/bower_components/angular/angular.js',
|
||||
'website/client/bower_components/angular-loading-bar/build/loading-bar.min.js',
|
||||
'website/client/bower_components/angular-resource/angular-resource.min.js',
|
||||
'website/client/bower_components/hello/dist/hello.all.min.js',
|
||||
'website/client/bower_components/angular-sanitize/angular-sanitize.js',
|
||||
'website/client/bower_components/bootstrap/dist/js/bootstrap.js',
|
||||
'website/client/bower_components/angular-bootstrap/ui-bootstrap.js',
|
||||
'website/client/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
|
||||
'website/client/bower_components/angular-ui-router/release/angular-ui-router.js',
|
||||
'website/client/bower_components/angular-filter/dist/angular-filter.js',
|
||||
'website/client/bower_components/angular-ui/build/angular-ui.js',
|
||||
'website/client/bower_components/angular-ui-utils/ui-utils.min.js',
|
||||
'website/client/bower_components/Angular-At-Directive/src/at.js',
|
||||
'website/client/bower_components/Angular-At-Directive/src/caret.js',
|
||||
'website/client/bower_components/angular-mocks/angular-mocks.js',
|
||||
'website/client/bower_components/ngInfiniteScroll/build/ng-infinite-scroll.js',
|
||||
'website/client/bower_components/select2/select2.js',
|
||||
'website/client/bower_components/angular-ui-select2/src/select2.js',
|
||||
'website/client/bower_components/habitica-markdown/dist/habitica-markdown.min.js',
|
||||
'common/dist/scripts/habitrpg-shared.js',
|
||||
'website/client-old/bower_components/jquery/dist/jquery.js',
|
||||
'website/client-old/bower_components/pnotify/jquery.pnotify.js',
|
||||
'website/client-old/bower_components/angular/angular.js',
|
||||
'website/client-old/bower_components/angular-loading-bar/build/loading-bar.min.js',
|
||||
'website/client-old/bower_components/angular-resource/angular-resource.min.js',
|
||||
'website/client-old/bower_components/hello/dist/hello.all.min.js',
|
||||
'website/client-old/bower_components/angular-sanitize/angular-sanitize.js',
|
||||
'website/client-old/bower_components/bootstrap/dist/js/bootstrap.js',
|
||||
'website/client-old/bower_components/angular-bootstrap/ui-bootstrap.js',
|
||||
'website/client-old/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
|
||||
'website/client-old/bower_components/angular-ui-router/release/angular-ui-router.js',
|
||||
'website/client-old/bower_components/angular-filter/dist/angular-filter.js',
|
||||
'website/client-old/bower_components/angular-ui/build/angular-ui.js',
|
||||
'website/client-old/bower_components/angular-ui-utils/ui-utils.min.js',
|
||||
'website/client-old/bower_components/Angular-At-Directive/src/at.js',
|
||||
'website/client-old/bower_components/Angular-At-Directive/src/caret.js',
|
||||
'website/client-old/bower_components/angular-mocks/angular-mocks.js',
|
||||
'website/client-old/bower_components/ngInfiniteScroll/build/ng-infinite-scroll.js',
|
||||
'website/client-old/bower_components/select2/select2.js',
|
||||
'website/client-old/bower_components/angular-ui-select2/src/select2.js',
|
||||
'website/client-old/bower_components/habitica-markdown/dist/habitica-markdown.min.js',
|
||||
'website/client-old/js/habitrpg-shared.js',
|
||||
|
||||
'test/spec/mocks/**/*.js',
|
||||
'test/client-old/spec/mocks/**/*.js',
|
||||
|
||||
'website/client/js/env.js',
|
||||
'website/client/js/app.js',
|
||||
'website/client-old/js/env.js',
|
||||
'website/client-old/js/app.js',
|
||||
'common/script/public/config.js',
|
||||
'common/script/public/directives.js',
|
||||
|
||||
'website/client/js/services/**/*.js',
|
||||
'website/client/js/filters/**/*.js',
|
||||
'website/client/js/directives/**/*.js',
|
||||
'website/client/js/controllers/**/*.js',
|
||||
'website/client-old/js/services/**/*.js',
|
||||
'website/client-old/js/filters/**/*.js',
|
||||
'website/client-old/js/directives/**/*.js',
|
||||
'website/client-old/js/controllers/**/*.js',
|
||||
|
||||
'test/spec/specHelper.js',
|
||||
'test/spec/**/*.js',
|
||||
'test/client-old/spec/specHelper.js',
|
||||
'test/client-old/spec/**/*.js',
|
||||
],
|
||||
|
||||
// list of files / patterns to exclude
|
||||
@@ -76,7 +76,7 @@ module.exports = function karmaConfig (config) {
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
preprocessors: {
|
||||
'website/client/js/**/*.js': ['coverage'],
|
||||
'website/client-old/js/**/*.js': ['coverage'],
|
||||
'test/**/*.js': ['babel'],
|
||||
},
|
||||
|
||||
|
||||
3945
npm-shrinkwrap.json
generated
3945
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "habitica",
|
||||
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
||||
"version": "3.41.1",
|
||||
"version": "3.41.4",
|
||||
"main": "./website/server/index.js",
|
||||
"dependencies": {
|
||||
"@slack/client": "3.6.0",
|
||||
@@ -95,7 +95,8 @@
|
||||
"validator": "^4.9.0",
|
||||
"vinyl-buffer": "^1.0.0",
|
||||
"vinyl-source-stream": "^1.1.0",
|
||||
"winston": "^2.1.0"
|
||||
"winston": "^2.1.0",
|
||||
"xml2js": "^0.4.4"
|
||||
},
|
||||
"private": true,
|
||||
"engines": {
|
||||
@@ -116,7 +117,7 @@
|
||||
"test:karma:watch": "karma start",
|
||||
"test:prepare:webdriver": "webdriver-manager update",
|
||||
"test:e2e:webdriver": "webdriver-manager start",
|
||||
"test:e2e": "protractor test/e2e/protractor.conf.js",
|
||||
"test:e2e": "protractor test/client-old/e2e/protractor.conf.js",
|
||||
"test:nodemon": "gulp test:nodemon",
|
||||
"start": "gulp run:dev",
|
||||
"sprites": "gulp sprites:compile",
|
||||
@@ -158,7 +159,6 @@
|
||||
"sinon-chai": "^2.8.0",
|
||||
"superagent-defaults": "^0.1.13",
|
||||
"vinyl-source-stream": "^1.0.0",
|
||||
"vinyl-transform": "^1.0.0",
|
||||
"xml2js": "^0.4.16"
|
||||
"vinyl-transform": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import babel from 'babelify';
|
||||
|
||||
gulp.task('browserify', function () {
|
||||
let bundler = browserify({
|
||||
entries: './common/browserify.js',
|
||||
entries: './website/common/browserify.js',
|
||||
debug: true,
|
||||
transform: [[babel, { compact: false }]],
|
||||
});
|
||||
@@ -23,9 +23,9 @@ gulp.task('browserify', function () {
|
||||
this.emit('end');
|
||||
})
|
||||
.pipe(sourcemaps.write('./'))
|
||||
.pipe(gulp.dest('./common/dist/scripts/'));
|
||||
.pipe(gulp.dest('./website/client-old/js/'));
|
||||
});
|
||||
|
||||
gulp.task('browserify:watch', () => {
|
||||
gulp.watch('./common/script/**/*.js', ['browserify']);
|
||||
gulp.watch('./website/common/script/**/*.js', ['browserify']);
|
||||
});
|
||||
|
||||
@@ -18,9 +18,9 @@ gulp.task('build:src', () => {
|
||||
});
|
||||
|
||||
gulp.task('build:common', () => {
|
||||
return gulp.src('common/script/**/*.js')
|
||||
return gulp.src('website/common/script/**/*.js')
|
||||
.pipe(babel())
|
||||
.pipe(gulp.dest('common/transpiled-babel/'));
|
||||
.pipe(gulp.dest('website/common/transpiled-babel/'));
|
||||
});
|
||||
|
||||
gulp.task('build:server', ['build:src', 'build:common']);
|
||||
@@ -30,7 +30,7 @@ gulp.task('build:dev', ['browserify', 'prepare:staticNewStuff'], (done) => {
|
||||
});
|
||||
|
||||
gulp.task('build:dev:watch', ['build:dev'], () => {
|
||||
gulp.watch(['website/client/**/*.styl', 'common/script/*']);
|
||||
gulp.watch(['website/client-old/**/*.styl', 'website/common/script/*']);
|
||||
});
|
||||
|
||||
gulp.task('build:prod', ['browserify', 'build:server', 'prepare:staticNewStuff'], (done) => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import {writeFileSync} from 'fs';
|
||||
|
||||
gulp.task('prepare:staticNewStuff', () => {
|
||||
writeFileSync(
|
||||
'./website/client/new-stuff.html',
|
||||
'./website/client-old/new-stuff.html',
|
||||
jade.compileFile('./website/views/shared/new-stuff.jade')()
|
||||
);
|
||||
});
|
||||
|
||||
@@ -10,17 +10,17 @@ import {each} from 'lodash';
|
||||
|
||||
// https://github.com/Ensighten/grunt-spritesmith/issues/67#issuecomment-34786248
|
||||
const MAX_SPRITESHEET_SIZE = 1024 * 1024 * 3;
|
||||
const DIST_PATH = 'common/dist/sprites/';
|
||||
const DIST_PATH = 'website/assets/sprites/dist/';
|
||||
|
||||
gulp.task('sprites:compile', ['sprites:clean', 'sprites:main', 'sprites:largeSprites', 'sprites:checkCompiledDimensions']);
|
||||
|
||||
gulp.task('sprites:main', () => {
|
||||
let mainSrc = sync('common/img/sprites/spritesmith/**/*.png');
|
||||
let mainSrc = sync('website/assets/sprites/spritesmith/**/*.png');
|
||||
return createSpritesStream('main', mainSrc);
|
||||
});
|
||||
|
||||
gulp.task('sprites:largeSprites', () => {
|
||||
let largeSrc = sync('common/img/sprites/spritesmith_large/**/*.png');
|
||||
let largeSrc = sync('website/assets/sprites/spritesmith_large/**/*.png');
|
||||
return createSpritesStream('largeSprites', largeSrc);
|
||||
});
|
||||
|
||||
@@ -65,7 +65,7 @@ function createSpritesStream(name, src) {
|
||||
cssName: `spritesmith-${name}-${index}.css`,
|
||||
algorithm: 'binary-tree',
|
||||
padding: 1,
|
||||
cssTemplate: 'common/css/css.template.handlebars',
|
||||
cssTemplate: 'website/assets/sprites/css/css.template.handlebars',
|
||||
cssVarMap: cssVarMap
|
||||
}));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ gulp.task('nodemon', () => {
|
||||
nodemon({
|
||||
script: pkg.main,
|
||||
ignore: [
|
||||
'website/client/*',
|
||||
'website/client-old/*',
|
||||
'website/views/*',
|
||||
'common/dist/script/content/*',
|
||||
]
|
||||
|
||||
@@ -10,7 +10,7 @@ const SLACK_CONFIG = {
|
||||
emoji: 'transifex'
|
||||
}
|
||||
|
||||
const LOCALES = './common/locales/';
|
||||
const LOCALES = './website/common/locales/';
|
||||
const ENGLISH_LOCALE = `${LOCALES}en/`;
|
||||
const ALL_LANGUAGES = getArrayOfLanguages();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-v3-integration.helper';
|
||||
import i18n from '../../../../../common/script/i18n';
|
||||
import i18n from '../../../../../website/common/script/i18n';
|
||||
|
||||
describe('GET /content', () => {
|
||||
it('returns content (and does not require authentication)', async () => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-v3-integration.helper';
|
||||
import { v4 as generateUUID } from 'uuid';
|
||||
import common from '../../../../../common';
|
||||
import common from '../../../../../website/common';
|
||||
|
||||
describe('GET /groups/:groupId/members', () => {
|
||||
let user;
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-v3-integration.helper';
|
||||
import { v4 as generateUUID } from 'uuid';
|
||||
import common from '../../../../../common';
|
||||
import common from '../../../../../website/common';
|
||||
|
||||
describe('GET /members/:memberId', () => {
|
||||
let user;
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
sleep,
|
||||
} from '../../../../helpers/api-v3-integration.helper';
|
||||
import { v4 as generateUUID } from 'uuid';
|
||||
import { quests as questScrolls } from '../../../../../common/script/content';
|
||||
import { quests as questScrolls } from '../../../../../website/common/script/content';
|
||||
|
||||
describe('POST /groups/:groupId/quests/invite/:questKey', () => {
|
||||
let questingGroup;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import common from '../../../../../common';
|
||||
import common from '../../../../../website/common';
|
||||
|
||||
describe('GET /user', () => {
|
||||
let user;
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
generateDaily,
|
||||
generateReward,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import common from '../../../../../common';
|
||||
import common from '../../../../../website/common';
|
||||
import { v4 as generateUUID } from 'uuid';
|
||||
|
||||
describe('GET /user/anonymized', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import shared from '../../../../../common/script';
|
||||
import shared from '../../../../../website/common/script';
|
||||
|
||||
let content = shared.content;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import shared from '../../../../../common/script';
|
||||
import shared from '../../../../../website/common/script';
|
||||
|
||||
let content = shared.content;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import shared from '../../../../../common/script';
|
||||
import shared from '../../../../../website/common/script';
|
||||
|
||||
let content = shared.content;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import shared from '../../../../../common/script';
|
||||
import shared from '../../../../../website/common/script';
|
||||
|
||||
let content = shared.content;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import content from '../../../../../common/script/content';
|
||||
import content from '../../../../../website/common/script/content';
|
||||
|
||||
describe('POST /user/feed/:pet/:food', () => {
|
||||
let user;
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import content from '../../../../../common/script/content/index';
|
||||
import content from '../../../../../website/common/script/content/index';
|
||||
|
||||
describe('POST /user/open-mystery-item', () => {
|
||||
let user;
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
import content from '../../../../../common/script/content';
|
||||
import content from '../../../../../website/common/script/content';
|
||||
|
||||
describe('POST /user/sell/:type/:key', () => {
|
||||
let user;
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
getProperty,
|
||||
} from '../../../../../helpers/api-integration/v3';
|
||||
import passport from 'passport';
|
||||
|
||||
@@ -44,6 +45,15 @@ describe('POST /user/auth/social', () => {
|
||||
expect(response.newUser).to.be.true;
|
||||
});
|
||||
|
||||
it('enrolls a new user in an A/B test', async () => {
|
||||
await api.post(endpoint, {
|
||||
authResponse: {access_token: randomAccessToken}, // eslint-disable-line camelcase
|
||||
network,
|
||||
});
|
||||
|
||||
await expect(getProperty('users', user._id, '_ABtest')).to.eventually.be.a('string');
|
||||
});
|
||||
|
||||
it('logs an existing user in', async () => {
|
||||
await user.update({ 'auth.facebook.id': facebookId });
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { recoverCron, cron } from '../../../../../website/server/libs/cron';
|
||||
import { model as User } from '../../../../../website/server/models/user';
|
||||
import * as Tasks from '../../../../../website/server/models/task';
|
||||
import { clone } from 'lodash';
|
||||
import common from '../../../../../common';
|
||||
import common from '../../../../../website/common';
|
||||
|
||||
// const scoreTask = common.ops.scoreTask;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
getTasks,
|
||||
syncableAttrs,
|
||||
} from '../../../../../website/server/libs/taskManager';
|
||||
import i18n from '../../../../../common/script/i18n';
|
||||
import i18n from '../../../../../website/common/script/i18n';
|
||||
import {
|
||||
generateUser,
|
||||
generateGroup,
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
generateReq,
|
||||
generateNext,
|
||||
} from '../../../../helpers/api-unit.helper';
|
||||
import i18n from '../../../../../common/script/i18n';
|
||||
import i18n from '../../../../../website/common/script/i18n';
|
||||
import { ensureAdmin, ensureSudo } from '../../../../../website/server/middlewares/ensureAccessRight';
|
||||
import { NotAuthorized } from '../../../../../website/server/libs/errors';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
getUserLanguage,
|
||||
attachTranslateFunction,
|
||||
} from '../../../../../website/server/middlewares/language';
|
||||
import common from '../../../../../common';
|
||||
import common from '../../../../../website/common';
|
||||
import Bluebird from 'bluebird';
|
||||
import { model as User } from '../../../../../website/server/models/user';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { model as Challenge } from '../../../../../website/server/models/challen
|
||||
import { model as Group } from '../../../../../website/server/models/group';
|
||||
import { model as User } from '../../../../../website/server/models/user';
|
||||
import * as Tasks from '../../../../../website/server/models/task';
|
||||
import common from '../../../../../common/';
|
||||
import common from '../../../../../website/common/';
|
||||
import { each, find } from 'lodash';
|
||||
|
||||
describe('Challenge Model', () => {
|
||||
@@ -210,7 +210,7 @@ describe('Challenge Model', () => {
|
||||
let updatedLeader = await User.findOne({_id: leader._id});
|
||||
let updatedUserTask = await Tasks.Task.findById(updatedLeader.tasksOrder.todos[0]);
|
||||
|
||||
expect(updatedUserTask.checklist).to.deep.equal([]);
|
||||
expect(updatedUserTask.checklist.toObject()).to.deep.equal([]);
|
||||
});
|
||||
|
||||
it('updates daily specific field to challenge and challenge members', async () => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { sleep } from '../../../../helpers/api-unit.helper';
|
||||
import { model as Group } from '../../../../../website/server/models/group';
|
||||
import { model as User } from '../../../../../website/server/models/user';
|
||||
import { quests as questScrolls } from '../../../../../common/script/content';
|
||||
import { quests as questScrolls } from '../../../../../website/common/script/content';
|
||||
import * as email from '../../../../../website/server/libs/email';
|
||||
import validator from 'validator';
|
||||
import { TAVERN_ID } from '../../../../../common/script/';
|
||||
import { TAVERN_ID } from '../../../../../website/common/script/';
|
||||
|
||||
describe('Group Model', () => {
|
||||
let party, questLeader, participatingMember, nonParticipatingMember, undecidedMember;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { model as User } from '../../../../../website/server/models/user';
|
||||
import common from '../../../../../common';
|
||||
import common from '../../../../../website/common';
|
||||
|
||||
describe('User Model', () => {
|
||||
it('keeps user._tmp when calling .toJSON', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import fs from 'fs';
|
||||
import { resetHabiticaDB } from '../helpers/api-integration/mongo';
|
||||
import { resetHabiticaDB } from '../../helpers/api-integration/mongo';
|
||||
|
||||
before(async () => {
|
||||
await resetHabiticaDB();
|
||||
2
test/client-old/spec/mocks/translations.js
Normal file
2
test/client-old/spec/mocks/translations.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable camelcase */
|
||||
let count = require('../../common/script/count');
|
||||
let count = require('../../website/common/script/count');
|
||||
|
||||
describe('count', () => {
|
||||
describe('beastMasterProgress', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import autoAllocate from '../../../common/script/fns/autoAllocate';
|
||||
import autoAllocate from '../../../website/common/script/fns/autoAllocate';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import crit from '../../../common/script/fns/crit';
|
||||
import crit from '../../../website/common/script/fns/crit';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import handleTwoHanded from '../../../common/script/fns/handleTwoHanded';
|
||||
import content from '../../../common/script/content/index';
|
||||
import i18n from '../../../common/script/i18n';
|
||||
import handleTwoHanded from '../../../website/common/script/fns/handleTwoHanded';
|
||||
import content from '../../../website/common/script/content/index';
|
||||
import i18n from '../../../website/common/script/i18n';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import predictableRandom from '../../../common/script/fns/predictableRandom';
|
||||
import predictableRandom from '../../../website/common/script/fns/predictableRandom';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import randomDrop from '../../../common/script/fns/randomDrop';
|
||||
import randomDrop from '../../../website/common/script/fns/randomDrop';
|
||||
import {
|
||||
generateUser,
|
||||
generateTodo,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import randomVal from '../../../common/script/fns/randomVal';
|
||||
import randomVal from '../../../website/common/script/fns/randomVal';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import statsComputed from '../../../common/script/libs/statsComputed';
|
||||
import statsComputed from '../../../website/common/script/libs/statsComputed';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ultimateGear from '../../../common/script/fns/ultimateGear';
|
||||
import ultimateGear from '../../../website/common/script/fns/ultimateGear';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import updateStats from '../../../common/script/fns/updateStats';
|
||||
import updateStats from '../../../website/common/script/fns/updateStats';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import appliedTags from '../../../common/script/libs/appliedTags';
|
||||
import appliedTags from '../../../website/common/script/libs/appliedTags';
|
||||
|
||||
describe('appliedTags', () => {
|
||||
it('returns the tasks', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import gold from '../../../common/script/libs/gold';
|
||||
import gold from '../../../website/common/script/libs/gold';
|
||||
|
||||
describe('gold', () => {
|
||||
it('is 0', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import noTags from '../../../common/script/libs/noTags';
|
||||
import noTags from '../../../website/common/script/libs/noTags';
|
||||
|
||||
describe('noTags', () => {
|
||||
it('returns true for no tags', () => {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user