Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 8 (WIP) #9946

Merged
merged 25 commits into from Mar 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
29d1098
start upgrade to node 8
paglias Jan 21, 2018
3e65bc4
upgrade travis
paglias Jan 21, 2018
8b8931f
improve travis
paglias Jan 21, 2018
3c96944
Merge branch 'develop' into node8
paglias Jan 21, 2018
eb403a8
Merge branch 'develop' of github.com:HabitRPG/habitrpg into node8
paglias Feb 4, 2018
5314030
Remove bluebird, babel (except for modules) from server (WIP) (#9947)
paglias Feb 4, 2018
97060d6
Merge branch 'develop' into node8
paglias Feb 4, 2018
2d0adca
remove plugin for transform-object-rest-spread since it is supported …
paglias Feb 6, 2018
55ed83b
Merge branch 'develop' into node8
paglias Feb 7, 2018
78b1245
babel: correct syntax rest spread
paglias Feb 7, 2018
129bd4c
Merge branch 'develop' into node8
paglias Feb 8, 2018
107966d
Merge branch 'develop' into node8
paglias Feb 9, 2018
94287a8
Merge branch 'develop' into node8
paglias Feb 16, 2018
a2aaa72
remove bluebird
paglias Feb 16, 2018
e674898
Merge branch 'develop' into node8
paglias Feb 17, 2018
dc7e8b1
update migrations archive readme
paglias Feb 17, 2018
3ddf11b
Merge branch 'develop' into node8
paglias Feb 17, 2018
1388145
fix package-lock.json
paglias Feb 17, 2018
9d55281
fix typo
paglias Feb 17, 2018
f7317ae
Merge branch 'develop' into node8
paglias Feb 23, 2018
fdbd63c
add package-loc
paglias Feb 24, 2018
e460bd1
Merge branch 'develop' into node8
paglias Feb 24, 2018
df5a1fa
Merge branch 'develop' into node8
paglias Feb 27, 2018
68ec9a5
Merge branch 'develop' into node8
paglias Mar 15, 2018
390117d
Merge branch 'develop' into node8
paglias Mar 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions .babelrc
@@ -1,10 +1,6 @@
{
"presets": ["es2015"],
"plugins": [
"transform-object-rest-spread",
["transform-async-to-module-method", {
"module": "bluebird",
"method": "coroutine"
}]
"transform-es2015-modules-commonjs",
"syntax-object-rest-spread",
]
}
1 change: 1 addition & 0 deletions .nodemonignore
Expand Up @@ -4,6 +4,7 @@ node_modules/**
.bower-registry/**
website/client-old/**
website/client/**
website/client/store/**
website/views/**
website/build/**
dist/**
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
6
8
4 changes: 1 addition & 3 deletions .travis.yml
@@ -1,15 +1,13 @@
language: node_js
node_js:
- '6'
- '8'
services:
- mongodb
cache:
directories:
- 'node_modules'
addons:
chrome: stable
before_install:
- npm install -g npm@5
before_script:
- npm run test:build
- cp config.json.example config.json
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM node:boron
FROM node:8

# Upgrade NPM to v5 (Yarn is needed because of this bug https://github.com/npm/npm/issues/16807)
# The used solution is suggested here https://github.com/npm/npm/issues/16807#issuecomment-313591975
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-Production
@@ -1,4 +1,4 @@
FROM node:boron
FROM node:8

ENV ADMIN_EMAIL admin@habitica.com
ENV AMAZON_PAYMENTS_CLIENT_ID amzn1.application-oa2-client.68ed9e6904ef438fbc1bf86bf494056e
Expand Down
3 changes: 1 addition & 2 deletions gulp/taskHelper.js
Expand Up @@ -2,7 +2,6 @@ import { exec } from 'child_process';
import psTree from 'ps-tree';
import nconf from 'nconf';
import net from 'net';
import Bluebird from 'bluebird';
import { post } from 'superagent';
import { sync as glob } from 'glob';
import Mocha from 'mocha';
Expand Down Expand Up @@ -45,7 +44,7 @@ export function kill (proc) {
* before failing.
*/
export function awaitPort (port, max = 60) {
return new Bluebird((rej, res) => {
return new Promise((rej, res) => {
let socket;
let timeout;
let interval;
Expand Down
1 change: 0 additions & 1 deletion migrations/archive/2016/20160529_fix_challenges.js
Expand Up @@ -16,7 +16,6 @@
const authorName = 'Blade';
const authorUuid = '75f270e8-c5db-4722-a5e6-a83f1b23f76b';

global.Promise = require('bluebird');
const MongoClient = require('mongodb').MongoClient;
const TaskQueue = require('cwait').TaskQueue;
const logger = require('./utils/logger');
Expand Down
Expand Up @@ -11,7 +11,6 @@
* pm'ed each user asking if they would like their tasks reset to the previous day
***************************************/

global.Promise = require('bluebird');
const MongoClient = require('mongodb').MongoClient;
const TaskQueue = require('cwait').TaskQueue;
const logger = require('./utils/logger');
Expand Down
Expand Up @@ -12,7 +12,6 @@
* from an object to a number, hence this migration.
***************************************/

global.Promise = require('bluebird');
const TaskQueue = require('cwait').TaskQueue;
const logger = require('./utils/logger');
const Timer = require('./utils/timer');
Expand Down
Expand Up @@ -9,7 +9,6 @@
* and transfers a group's progress to it
***************************************/

global.Promise = require('bluebird');
const TaskQueue = require('cwait').TaskQueue;
const logger = require('./utils/logger');
const Timer = require('./utils/timer');
Expand Down
1 change: 0 additions & 1 deletion migrations/archive/2016/20160615_fix_bad_emails.js
Expand Up @@ -12,7 +12,6 @@
* <userid>@example.com
***************************************/

global.Promise = require('bluebird');
const TaskQueue = require('cwait').TaskQueue;
const logger = require('./utils/logger');
const Timer = require('./utils/timer');
Expand Down
Expand Up @@ -9,7 +9,6 @@
* they support a type and options and label
* ***************************************/

global.Promise = require('bluebird');
const TaskQueue = require('cwait').TaskQueue;
const logger = require('./utils/logger');
const Timer = require('./utils/timer');
Expand Down
Expand Up @@ -12,7 +12,6 @@
* message into the chat for affected parties.
***************************************/

global.Promise = require('bluebird');
const uuid = require('uuid');
const TaskQueue = require('cwait').TaskQueue;
const logger = require('./utils/logger');
Expand Down
4 changes: 3 additions & 1 deletion migrations/archive/README.md
@@ -1,4 +1,6 @@
If you need to use a migration from this folder, move it to /migrations.

Note that /migrations files (excluding /archive) are linted, so to pass test you'll have to make sure
that the file is written correctly.
that the file is written correctly.

They might also be using some old deps that we don't use anymore like Bluebird, mongoskin, ...
6 changes: 2 additions & 4 deletions migrations/challenges/sync-all-challenges.js
@@ -1,5 +1,3 @@
import Bluebird from 'Bluebird';

import { model as Challenges } from '../../website/server/models/challenge';
import { model as User } from '../../website/server/models/user';

Expand All @@ -17,10 +15,10 @@ async function syncChallengeToMembers (challenges) {
promises.push(user.save());
});

return Bluebird.all(promises);
return Promise.all(promises);
});

return await Bluebird.all(challengSyncPromises);
return await Promise.all(challengSyncPromises);
}

async function syncChallenges (lastChallengeDate) {
Expand Down
4 changes: 1 addition & 3 deletions migrations/groups/create-group.js
@@ -1,5 +1,3 @@
import Bluebird from 'bluebird';

import { model as Group } from '../../website/server/models/group';
import { model as User } from '../../website/server/models/user';

Expand All @@ -16,7 +14,7 @@ async function createGroup (name, privacy, type, leaderId) {
group.leader = user._id;
user.guilds.push(group._id);

return Bluebird.all([group.save(), user.save()]);
return Promise.all([group.save(), user.save()]);
}

module.exports = async function groupCreator () {
Expand Down
3 changes: 1 addition & 2 deletions migrations/groups/habitrpg-jackalopes.js
Expand Up @@ -3,7 +3,6 @@
/*
* This migration will find users with unlimited subscriptions who are also eligible for Jackalope mounts, and award them
*/
import Bluebird from 'bluebird';

import { model as Group } from '../../website/server/models/group';
import { model as User } from '../../website/server/models/user';
Expand Down Expand Up @@ -38,7 +37,7 @@ async function handOutJackalopes () {

cursor.on('close', async () => {
console.log('done');
return await Bluebird.all(promises);
return await Promise.all(promises);
});
}

Expand Down
4 changes: 1 addition & 3 deletions migrations/groups/update-groups-with-group-plans.js
Expand Up @@ -9,8 +9,6 @@ let authorUuid = ''; // ... own data is done
* subscription to all members
*/

import Bluebird from 'bluebird';

import { model as Group } from '../../website/server/models/group';
import * as payments from '../../website/server/libs/payments';

Expand All @@ -28,7 +26,7 @@ async function updateGroupsWithGroupPlans () {
});

cursor.on('close', async () => {
return await Bluebird.all(promises);
return await Promise.all(promises);
});
}

Expand Down
4 changes: 2 additions & 2 deletions migrations/migration-runner.js
@@ -1,14 +1,14 @@
require('babel-register');
require('babel-polyfill');

// This file must use ES5, everything required can be in ES6

function setUpServer () {
const nconf = require('nconf'); // eslint-disable-line global-require, no-unused-vars
const mongoose = require('mongoose'); // eslint-disable-line global-require, no-unused-vars
const Bluebird = require('bluebird'); // eslint-disable-line global-require, no-unused-vars
const setupNconf = require('../website/server/libs/setupNconf'); // eslint-disable-line global-require

setupNconf();

// We require src/server and npt src/index because
// 1. nconf is already setup
// 2. we don't need clustering
Expand Down
3 changes: 1 addition & 2 deletions migrations/s3-upload.js
@@ -1,4 +1,3 @@
let Bluebird = require('bluebird');
let request = require('superagent');
let last = require('lodash/last');
let AWS = require('aws-sdk');
Expand Down Expand Up @@ -74,7 +73,7 @@ function uploadToS3 (start, end, filesUrls) {
});
console.log(promises.length);

return Bluebird.all(promises)
return Promise.all(promises)
.then(() => {
currentIndex += 50;
uploadToS3(currentIndex, currentIndex + 50, filesUrls);
Expand Down