Skip to content

Commit

Permalink
initial decaf
Browse files Browse the repository at this point in the history
  • Loading branch information
austinhallock committed Jun 11, 2020
1 parent 01c9f77 commit 575454b
Show file tree
Hide file tree
Showing 37 changed files with 2,781 additions and 1,491 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 11
},
Expand Down
40 changes: 0 additions & 40 deletions Gulpfile.js

This file was deleted.

31 changes: 31 additions & 0 deletions Gulpfile.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
import gulp from 'gulp'
import { spawn } from 'child_process'

const paths = {
serverBin: './bin/server.js',
js: [
'./**/*.js',
'!./node_modules/**/*'
]
}

gulp.task('default', 'dev')

gulp.task('dev', 'watch:dev')

gulp.task('watch:dev', gulp.series('dev:server', () => gulp.watch(paths.js, ['dev:server']))
)

let devServer = null
gulp.task('dev:server', function () {
process.on('exit', () => devServer?.kill())
devServer && devServer.kill()
devServer = spawn('js', [paths.serverBin], { stdio: 'inherit' })
return devServer.on('close', function (code) {
if (code === 8) {
return gulp.log('Error detected, waiting for changes')
}
})
})
24 changes: 14 additions & 10 deletions bin/server.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/usr/bin/env nodeimport _ from 'lodash';
/* eslint-disable
no-undef,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
import log from 'loga'
import cluster from 'cluster'
import os from 'os'
import { setup, childSetup, server } from '../'
import config from '../config'
import _ from 'lodash'

import { setup, childSetup, server } from '../index.js'
import config from '../config.js'

if (config.ENV === config.ENVS.PROD) {
const cpus = config.MAX_CPU || os.cpus().length
Expand All @@ -26,9 +22,17 @@ if (config.ENV === config.ENVS.PROD) {
})
}).catch(log.error)
} else {
childSetup().then(() => server.listen(config.PORT, () => log.info('Worker %d, listening on %d', cluster.worker.id, config.PORT)))
childSetup().then(() =>
server.listen(config.PORT, () =>
log.info('Worker %d, listening on %d', cluster.worker.id, config.PORT)
)
)
}
} else {
console.log('Setting up')
setup().then(() => server.listen(config.PORT, () => log.info('Server listening on port %d', config.PORT))).catch(log.error)
setup().then(() =>
server.listen(config.PORT, () =>
log.info('Server listening on port %d', config.PORT)
)
).catch(log.error)
}
2 changes: 1 addition & 1 deletion bin/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
export NODE_ENV=production

./node_modules/coffeescript/bin/coffee ./bin/server.coffee
node ./bin/server.js
2 changes: 1 addition & 1 deletion bulk-decaffeinate.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
jscodeshiftScripts: ['prefer-function-declarations.js'],
// searchDirectory: 'src',
decaffeinateArgs: [
'--use-js-modules', '--use-cs2', '--loose', '--disable-suggestion-comment',
'--use-js-modules', '--use-cs2', '--loose', '--disable-suggestion-comment',
'--use-optional-chaining'
]
}
3 changes: 0 additions & 3 deletions coffeelint.json

This file was deleted.

55 changes: 0 additions & 55 deletions decaffeinate-errors.log

This file was deleted.

122 changes: 0 additions & 122 deletions decaffeinate-results.json

This file was deleted.

29 changes: 0 additions & 29 deletions decaffeinate-successful-files.txt

This file was deleted.

11 changes: 2 additions & 9 deletions graphql/directives.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
/* eslint-disable
no-unused-vars,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
import router from 'exoid-router'
import { Format } from 'backend-shared'
import { defaultFieldResolver } from 'graphql'
import { SchemaDirectiveVisitor } from 'graphql-tools'
let NameCase, SentenceCase

export const nameCase = NameCase = class NameCase extends SchemaDirectiveVisitor {
export const nameCase = class NameCase extends SchemaDirectiveVisitor {
visitFieldDefinition (field) {
const { resolve = defaultFieldResolver } = field
field.resolve = function (...args) {
Expand All @@ -19,7 +12,7 @@ export const nameCase = NameCase = class NameCase extends SchemaDirectiveVisitor
}
}

export const sentenceCase = SentenceCase = class SentenceCase extends SchemaDirectiveVisitor {
export const sentenceCase = class SentenceCase extends SchemaDirectiveVisitor {
visitFieldDefinition (field) {
const { resolve = defaultFieldResolver } = field
field.resolve = function (...args) {
Expand Down
Loading

0 comments on commit 575454b

Please sign in to comment.