remove usage of babel, replace import with require

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-12-27 14:11:07 +01:00
parent 5b83042ef8
commit 600d748236
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
12 changed files with 45 additions and 79 deletions

View File

@ -1,11 +0,0 @@
{
"env": {
"test": {
"plugins": [ "istanbul" ]
}
},
"presets": [
["@babel/env", { "targets": {"node": "current"} }]
],
"plugins": ["@babel/plugin-transform-async-to-generator"]
}

View File

@ -1,5 +1,4 @@
const gulp = require('gulp')
const babel = require('gulp-babel')
const clean = require('gulp-clean')
const mocha = require('gulp-mocha')
const print = require('gulp-print').default
@ -10,7 +9,6 @@ gulp.task('devel', () => {
nodemon({
script: 'src/server.js',
presets: ['env', 'stage-2'],
exec: 'babel-node'
})
.on('restart', () => { console.log('>> node restart') })
})
@ -21,24 +19,16 @@ gulp.task('clean', () =>
gulp.task('test', () =>
gulp.src('test/**/*.js', {read: false})
.pipe(mocha({
reporter: 'list',
require: '@babel/register',
}))
.pipe(mocha({reporter: 'list'}))
)
gulp.task('testw', () =>
gulp.src('test/**/*.js', {read: false})
.pipe(mocha({
reporter: 'list',
require: '@babel/register',
watch: true,
}))
.pipe(mocha({reporter: 'list', watch: true}))
)
gulp.task('build', ['clean', 'test'], () =>
gulp.src('src/**/*.js')
.pipe(babel())
.pipe(print())
.pipe(gulp.dest('dist/'))
)

View File

@ -18,22 +18,15 @@
"lokijs": "^1.5.5"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/node": "^7.0.0",
"@babel/plugin-transform-async-to-generator": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-istanbul": "^5.1.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"gulp": "^3.9.1",
"gulp-babel": "^8.0.0-beta.2",
"gulp-clean": "^0.4.0",
"gulp-exec": "^3.0.2",
"gulp-mocha": "^6.0.0",
"gulp-nodemon": "^2.2.1",
"gulp-print": "^5.0.0",
"gulp-run-command": "^0.0.9",
"mocha": "^5.2.0",
"nodemon": "^1.18.4",
"nyc": "^13.1.0",
@ -53,12 +46,6 @@
"push": "gulp push",
"release": "release"
},
"mocha": [
"@babel/register"
],
"require": [
"@babel/register"
],
"keywords": [
"github",
"comments",

View File

@ -1,10 +1,10 @@
import log from 'loglevel'
import Koa from 'koa'
import JSON from 'koa-json'
import Logger from 'koa-logger'
import JsonError from 'koa-json-error'
import JoiRouter from 'koa-joi-router'
import BodyParser from 'koa-bodyparser'
const log = require('loglevel')
const Koa = require('koa')
const JSON = require('koa-json')
const Logger = require('koa-logger')
const JsonError = require('koa-json-error')
const JoiRouter = require('koa-joi-router')
const BodyParser = require('koa-bodyparser')
const App = (ghc) => {
const app = new Koa()

View File

@ -1,7 +1,7 @@
import log from 'loglevel'
import Joi from 'joi'
import Loki from 'lokijs'
import schema from './schema'
const log = require('loglevel')
const Joi = require('joi')
const Loki = require('lokijs')
const schema = require('./schema')
class Builds {
constructor(path, interval) {

View File

@ -1,6 +1,6 @@
import log from 'loglevel'
import Handlebars from 'handlebars'
import template from './template'
const log = require('loglevel')
const Handlebars = require('handlebars')
const template = require('./template')
/* in theory the jenkins build comment should be the first one */
const PER_PAGE = 100

View File

@ -1,4 +1,4 @@
import Joi from 'joi'
const Joi = require('joi')
const schema = Joi.object().keys({
id: Joi.alternatives().try(Joi.number().positive(), Joi.string()).required(),

View File

@ -1,10 +1,10 @@
import log from 'loglevel'
import Logger from 'koa-logger'
import Octokit from '@octokit/rest'
const log = require('loglevel')
const Logger = require('koa-logger')
const Octokit = require('@octokit/rest')
import App from './app'
import Builds from './builds'
import Comments from './comments'
const App = require('./app')
const Builds = require('./builds')
const Comments = require('./comments')
/* DEFAULTS */
const LOG_LEVEL = process.env.LOG_LEVEL || 'INFO'

View File

@ -1,11 +1,11 @@
import { expect } from 'chai'
import sinon from 'sinon'
import request from 'supertest'
const expect = require('chai').expect
const sinon = require('sinon')
const request = require('supertest')
import sample from './sample'
import App from '../src/app'
import Builds from '../src/builds'
import Comments from '../src/comments'
const sample = require('./sample')
const App = require('../src/app')
const Builds = require('../src/builds')
const Comments = require('../src/comments')
let ghc, app

View File

@ -1,9 +1,9 @@
import { expect } from 'chai'
import sinon from 'sinon'
const expect = require('chai').expect
const sinon = require('sinon')
import sample from './sample'
import Builds from '../src/builds'
import Comments from '../src/comments'
const sample = require('./sample')
const Builds = require('../src/builds')
const Comments = require('../src/comments')
let comments, client, builds

View File

@ -1,9 +1,9 @@
import { expect } from 'chai'
import sinon from 'sinon'
import Joi from 'joi'
const expect = require('chai').expect
const sinon = require('sinon')
const Joi = require('joi')
import sample from './sample'
import Schema from '../src/schema'
const sample = require('./sample')
const Schema = require('../src/schema')
let build

View File

@ -1,7 +1,7 @@
import log from 'loglevel'
import chai from 'chai'
import sinonChai from 'sinon-chai'
import chaiAsPromised from 'chai-as-promised'
const log = require('loglevel')
const chai = require('chai')
const sinonChai = require('sinon-chai')
const chaiAsPromised = require('chai-as-promised')
/* limit amount of console noise for tests */
log.setDefaultLevel(log.levels.WARN)