Skip to content

Commit

Permalink
Add semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
timkurvers committed Jul 19, 2015
1 parent ec80ba0 commit f64ea30
Show file tree
Hide file tree
Showing 52 changed files with 943 additions and 943 deletions.
40 changes: 20 additions & 20 deletions bundle.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
const browserify = require('browserify')
const gulp = require('gulp')
const gutil = require('gulp-util')
const path = require('path')
const plumber = require('gulp-plumber')
const source = require('vinyl-source-stream')
const browserify = require('browserify');
const gulp = require('gulp');
const gutil = require('gulp-util');
const path = require('path');
const plumber = require('gulp-plumber');
const source = require('vinyl-source-stream');

module.exports = class Bundle {

constructor(src, destination, options = {}) {
this.options = options
this.src = path.resolve(src)
this.options.cache = {}
this.options.fullPaths = true
this.options = options;
this.src = path.resolve(src);
this.options.cache = {};
this.options.fullPaths = true;
this.target = {
name: path.basename(destination),
dir: path.dirname(destination)
}
};
}

get bundler() {
if(!this._bundler) {
this._bundler = browserify(this.src, this.options)
this._bundler.on('dep', this.cache.bind(this))
this._bundler = browserify(this.src, this.options);
this._bundler.on('dep', this.cache.bind(this));
}
return this._bundler
return this._bundler;
}

bundle() {
return this.bundler.bundle()
.on('error', function(error) {
gutil.log(gutil.colors.red("Bundling error:\n"), error.stack)
this.emit('end')
gutil.log(gutil.colors.red("Bundling error:\n"), error.stack);
this.emit('end');
})
.pipe(source(this.target.name))
.pipe(gulp.dest(this.target.dir))
.pipe(gulp.dest(this.target.dir));
}

cache(dependency) {
this.options.cache[dependency.id] = dependency
this.options.cache[dependency.id] = dependency;
}

invalidate(path) {
delete this.options.cache[path]
delete this.options.cache[path];
}

}
};
86 changes: 43 additions & 43 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const Bundle = require('./bundle')
const babel = require('gulp-babel')
const cache = require('gulp-cached')
const cfg = require('configstore')
const concat = require('gulp-concat')
const del = require('del')
const gulp = require('gulp')
const jade = require('gulp-jade')
const mocha = require('gulp-mocha')
const nib = require('nib')
const path = require('path')
const pkg = require('./package.json')
const plumber = require('gulp-plumber')
const remember = require('gulp-remember')
const stylus = require('gulp-stylus')
const Bundle = require('./bundle');
const babel = require('gulp-babel');
const cache = require('gulp-cached');
const cfg = require('configstore');
const concat = require('gulp-concat');
const del = require('del');
const gulp = require('gulp');
const jade = require('gulp-jade');
const mocha = require('gulp-mocha');
const nib = require('nib');
const path = require('path');
const pkg = require('./package.json');
const plumber = require('gulp-plumber');
const remember = require('gulp-remember');
const stylus = require('gulp-stylus');

const config = {
db: new cfg( pkg.name ),
Expand All @@ -21,7 +21,7 @@ const config = {
styles: 'src/**/*.styl',
templates: 'src/**/*.jade',
public: './public'
}
};

const bundles = {
core: new Bundle(
Expand All @@ -34,11 +34,11 @@ const bundles = {
'public/scripts/wowser-ui.js',
{ standalone: 'Wowser.UI' }
)
}
};

gulp.task('reset', function() {
config.db.clear()
return process.stdout.write(`\n> Settings deleted from ${config.db.path}\n`)
config.db.clear();
return process.stdout.write(`\n> Settings deleted from ${config.db.path}\n`);
});

gulp.task('clean', function(cb) {
Expand All @@ -49,28 +49,28 @@ gulp.task('clean', function(cb) {
'public/templates/*',
'public/index.html',
'spec/*'
], cb)
})
], cb);
});

gulp.task('scripts:compile', function() {
return gulp.src(config.scripts)
.pipe(cache('babel'))
.pipe(plumber())
.pipe(babel())
.pipe(gulp.dest('.'))
})
.pipe(gulp.dest('.'));
});

gulp.task('scripts:bundle:core', function() {
return bundles.core.bundle()
})
return bundles.core.bundle();
});

gulp.task('scripts:bundle:ui', function() {
return bundles.ui.bundle()
})
return bundles.ui.bundle();
});

gulp.task('scripts', gulp.series(
'scripts:compile', 'scripts:bundle:core', 'scripts:bundle:ui'
))
));

gulp.task('styles', function() {
return gulp.src(config.styles)
Expand All @@ -83,39 +83,39 @@ gulp.task('styles', function() {
}))
.pipe(remember('stylus'))
.pipe(concat('styles/wowser.css'))
.pipe(gulp.dest(config.public))
})
.pipe(gulp.dest(config.public));
});

gulp.task('templates', function() {
return gulp.src(config.templates)
.pipe(cache('jade'))
.pipe(plumber())
.pipe(jade({ pretty: true }))
.pipe(gulp.dest(config.public))
})
.pipe(gulp.dest(config.public));
});

gulp.task('spec', function() {
return gulp.src(config.specs, { read: false })
.pipe(plumber())
.pipe(mocha())
})
.pipe(mocha());
});

gulp.task('rebuild', gulp.series(
'clean', 'scripts', 'styles', 'templates'
))
));

gulp.task('watch', function() {
gulp.watch(config.scripts, gulp.series('scripts', 'spec'))
.on('change', function(event) {
const jspath = event.path.replace('src/scripts/', '')
bundles.core.invalidate(jspath)
bundles.ui.invalidate(jspath)
})
const jspath = event.path.replace('src/scripts/', '');
bundles.core.invalidate(jspath);
bundles.ui.invalidate(jspath);
});

gulp.watch(config.styles, gulp.series('styles'))
gulp.watch(config.templates, gulp.series('templates'))
})
gulp.watch(config.styles, gulp.series('styles'));
gulp.watch(config.templates, gulp.series('templates'));
});

gulp.task('default', gulp.series(
'rebuild', 'spec', 'watch'
))
));
2 changes: 1 addition & 1 deletion src/scripts/lib/client/auth/challenge-opcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ module.exports = class ChallengeOpcode {
static TRIAL_EXPIRED = 0x11
static BATTLE_NET = 0x12

}
};
Loading

0 comments on commit f64ea30

Please sign in to comment.