Set up gulpp

This commit is contained in:
Will Franzen 2015-02-22 10:27:46 -06:00
parent ab24877359
commit 423305a19d
9 changed files with 33 additions and 11 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/node_modules
/test/npm-debug.log
/test/server
/dist/

19
gulpfile.js Normal file
View File

@ -0,0 +1,19 @@
var gulp = require('gulp');
var babel = require('gulp-babel');
var options = {
experimental: true // Dat ES7 goodness
};
gulp.task('compile', function() {
gulp
.src('lib/*.js')
.pipe(babel(options))
.pipe(gulp.dest('build/'));
});
gulp.task('watch', function() {
gulp.watch('lib/*.js', ['compile']);
});
gulp.task('default', ['compile']);

View File

@ -2,7 +2,7 @@
"name": "minecraft-protocol",
"version": "0.12.3",
"description": "Parse and serialize minecraft packets, plus authentication and encryption.",
"main": "index.js",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "git://github.com/andrewrk/node-minecraft-protocol.git"
@ -26,11 +26,13 @@
"node": ">=0.8.16"
},
"devDependencies": {
"mocha": "~1.8.2",
"batch": "~0.3.1",
"gulp": "^3.8.11",
"gulp-babel": "^4.0.0",
"mkdirp": "~0.3.4",
"mocha": "~1.8.2",
"rimraf": "~2.1.1",
"zfill": "0.0.1",
"batch": "~0.3.1"
"zfill": "0.0.1"
},
"dependencies": {
"node-rsa": "^0.1.53",

View File

@ -4,10 +4,10 @@ var EventEmitter = require('events').EventEmitter
, crypto = require('crypto')
, bufferEqual = require('buffer-equal')
, superagent = require('superagent')
, protocol = require('./lib/protocol')
, Client = require('./lib/client')
, Server = require('./lib/server')
, Yggdrasil = require('./lib/yggdrasil.js')
, protocol = require('./protocol')
, Client = require('./client')
, Server = require('./server')
, Yggdrasil = require('./yggdrasil.js')
, getSession = Yggdrasil.getSession
, validateSession = Yggdrasil.validateSession
, joinServer = Yggdrasil.joinServer
@ -20,7 +20,7 @@ try {
} catch(e) {
console.log("You are using a pure-javascript implementation of RSA.");
console.log("Your performance might be subpar. Please consider installing URSA");
ursa = require("./rsa-wrap");
ursa = require("../rsa-wrap");
}
module.exports = {
@ -28,7 +28,7 @@ module.exports = {
createServer: createServer,
Client: Client,
Server: Server,
ping: require('./lib/ping'),
ping: require('./ping'),
protocol: protocol,
yggdrasil: Yggdrasil,
};
@ -337,7 +337,7 @@ function createClient(options) {
}
}
}
function onLogin(packet) {
client.state = states.PLAY;
client.uuid = packet.uuid;