Update dev dependencies

Set idea language to ES6
Run tests against dist
This commit is contained in:
Nicolas Dextraze 2019-11-01 11:30:06 -07:00
parent 732b691e40
commit bbf25ee8b5
23 changed files with 5906 additions and 7570 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="JavaScriptSettings"> <component name="JavaScriptSettings">
<option name="languageLevel" value="ES5" /> <option name="languageLevel" value="ES6" />
</component> </component>
</project> </project>

13391
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -51,10 +51,11 @@
"uuid": "^3.0.1" "uuid": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/long": "^3.0.31", "@types/long": "^3.0.32",
"@types/node": "^6.0.47", "@types/node": "^12.12.5",
"jsdoc": "^3.5.5", "jsdoc": "^3.6.3",
"nodeunit": "^0.11.1", "nodeunit": "^0.11.3",
"webpack": "^3.3.0" "webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
} }
} }

View File

@ -1,5 +1,5 @@
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
var Long = require('long'); var Long = require('long');
var ANY_VERSION = Long.fromNumber(client.expectedVersion.any); var ANY_VERSION = Long.fromNumber(client.expectedVersion.any);
@ -63,7 +63,7 @@ module.exports = {
test.expect(2); test.expect(2);
const largeData = Buffer.alloc(3 * 1024 *1024, " "); const largeData = Buffer.alloc(3 * 1024 *1024, " ");
const event = client.createJsonEventData(uuid.v4(), {a: largeData.toString()}, null, 'largePayloadEvent'); const event = client.createJsonEventData(uuid.v4(), {a: largeData.toString()}, null, 'largePayloadEvent');
this.conn.appendToStream(this.testStreamName, ANY_VERSION, event) this.conn.appendToStream(this.testStreamName, ANY_VERSION, event)
.then(function(result) { .then(function(result) {
test.areEqual("result.nextExpectedVersion", result.nextExpectedVersion, Long.fromNumber(0)); test.areEqual("result.nextExpectedVersion", result.nextExpectedVersion, Long.fromNumber(0));

View File

@ -1,4 +1,4 @@
var client = require('../../src/client'); var client = require('../../lib/dist');
var uuid = require('uuid'); var uuid = require('uuid');
var settings = { var settings = {

View File

@ -1,4 +1,4 @@
var client = require('../../src/client'); var client = require('../../lib/dist');
var uuid = require('uuid'); var uuid = require('uuid');
var settings = { var settings = {

View File

@ -1,6 +1,6 @@
var util = require('util'); var util = require('util');
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../../src/client'); var client = require('../../lib/dist');
var FileLogger = require('../../src/common/log/fileLogger'); var FileLogger = require('../../src/common/log/fileLogger');
var NoopLogger = require('../../src/common/log/noopLogger'); var NoopLogger = require('../../src/common/log/noopLogger');

View File

@ -1,4 +1,4 @@
var client = require('../src/client.js'); var client = require('../lib/dist');
var GossipSeed = require('../src/gossipSeed'); var GossipSeed = require('../src/gossipSeed');
var testBase = require('./common/base_test'); var testBase = require('./common/base_test');
@ -97,4 +97,4 @@ if (withSsl) {
} }
} }
testBase.init(module.exports, false); testBase.init(module.exports, false);

View File

@ -1,5 +1,5 @@
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
var Long = require('long'); var Long = require('long');
module.exports = { module.exports = {
@ -102,4 +102,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,4 +1,4 @@
var client = require('../src/client'); var client = require('../lib/dist');
const Long = require('long'); const Long = require('long');
const EMPTY_VERSION = Long.fromNumber(client.expectedVersion.emptyStream); const EMPTY_VERSION = Long.fromNumber(client.expectedVersion.emptyStream);

View File

@ -1,6 +1,6 @@
var util = require('util'); var util = require('util');
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
const adminCredentials = new client.UserCredentials("admin", "changeit"); const adminCredentials = new client.UserCredentials("admin", "changeit");
function createRandomEvent() { function createRandomEvent() {
@ -78,4 +78,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,4 +1,4 @@
const client = require('../src/client'); const client = require('../lib/dist');
const userCredentials = new client.UserCredentials('admin', 'changeit'); const userCredentials = new client.UserCredentials('admin', 'changeit');
const log = new client.NoopLogger(); const log = new client.NoopLogger();
@ -44,4 +44,4 @@ module.exports = {
.catch(test.done); .catch(test.done);
} }
//TODO: other tests //TODO: other tests
}; };

View File

@ -1,6 +1,6 @@
var util = require('util'); var util = require('util');
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
const numberOfStreams = 20; const numberOfStreams = 20;
const maxBatch = 10; const maxBatch = 10;
@ -72,4 +72,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,6 +1,6 @@
var util = require('util'); var util = require('util');
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
const numberOfStreams = 20; const numberOfStreams = 20;
const maxBatch = 10; const maxBatch = 10;
@ -73,4 +73,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,5 +1,5 @@
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
var Long = require('long'); var Long = require('long');
var NOSTREAM_VERSION = Long.fromNumber(client.expectedVersion.noStream); var NOSTREAM_VERSION = Long.fromNumber(client.expectedVersion.noStream);
@ -142,4 +142,4 @@ module.exports = {
}, },
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,5 +1,5 @@
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
var Long = require('long'); var Long = require('long');
const streamSize = 100; const streamSize = 100;
@ -109,4 +109,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,5 +1,5 @@
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
var Long = require('long'); var Long = require('long');
const streamSize = 100; const streamSize = 100;
@ -108,4 +108,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,6 +1,6 @@
var util = require('util'); var util = require('util');
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
const allCredentials = new client.UserCredentials("admin", "changeit"); const allCredentials = new client.UserCredentials("admin", "changeit");
function createRandomEvent() { function createRandomEvent() {
@ -180,4 +180,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,5 +1,5 @@
const uuid = require('uuid'); const uuid = require('uuid');
const client = require('../src/client'); const client = require('../lib/dist');
const allCredentials = new client.UserCredentials("admin", "changeit"); const allCredentials = new client.UserCredentials("admin", "changeit");
function delay(ms) { function delay(ms) {
@ -69,4 +69,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,5 +1,5 @@
var uuid = require('uuid'); var uuid = require('uuid');
var client = require('../src/client'); var client = require('../lib/dist');
var Long = require('long'); var Long = require('long');
function createRandomEvent() { function createRandomEvent() {
@ -134,4 +134,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,5 +1,5 @@
const uuid = require('uuid'); const uuid = require('uuid');
const client = require('../src/client'); const client = require('../lib/dist');
const Long = require('long'); const Long = require('long');
function delay(ms) { function delay(ms) {
@ -70,4 +70,4 @@ module.exports = {
} }
}; };
require('./common/base_test').init(module.exports); require('./common/base_test').init(module.exports);

View File

@ -1,6 +1,6 @@
var uuid = require('uuid'); var uuid = require('uuid');
var Long = require('long'); var Long = require('long');
var client = require('../src/client'); var client = require('../lib/dist');
var ANY_VERSION = Long.fromNumber(client.expectedVersion.any); var ANY_VERSION = Long.fromNumber(client.expectedVersion.any);
var NOSTREAM_VERSION = Long.fromNumber(client.expectedVersion.noStream); var NOSTREAM_VERSION = Long.fromNumber(client.expectedVersion.noStream);

View File

@ -1,8 +1,10 @@
module.exports = { module.exports = {
mode: "none",
entry: "./src/client.js", entry: "./src/client.js",
target: "node", target: "node",
output: { output: {
filename: "./lib/dist.js", path: process.env.PWD + "/lib",
filename: "dist.js",
libraryTarget: "commonjs2" libraryTarget: "commonjs2"
}, },
externals: [ externals: [
@ -11,4 +13,4 @@ module.exports = {
"../messages/clientMessage": "../src/messages/clientMessage" "../messages/clientMessage": "../src/messages/clientMessage"
} }
] ]
}; };