Skip to content

migration to Typescript 2.0 #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,33 @@
"long": "3.2.0"
},
"devDependencies": {
"@types/bluebird": "3.0.35",
"@types/long": "3.0.31",
"@types/node": "6.0.46",
"chai": "3.5.0",
"chai-as-promised": "5.3.0",
"hazelcast-remote-controller": "^1.0.0",
"istanbul": "0.4.3",
"mocha": "2.5.3",
"istanbul": "0.4.5",
"mocha": "3.1.2",
"mousse": "0.3.1",
"remap-istanbul": "0.6.4",
"remap-istanbul": "0.7.0",
"rimraf": "2.5.4",
"sinon": "1.17.5",
"tslint": "3.14.0",
"typedoc": "0.4.4",
"typescript": "1.8.10",
"typings": "1.3.2",
"typedoc": "0.5.0",
"typescript": "2.0.3",
"winston": "2.2.0"
},
"scripts": {
"clean": "rimraf lib typings *.jar *.log",
"precompile": "typings install",
"compile": "tsc",
"pretest": "./scripts/download-rc.sh",
"test": "mocha --recursive",
"precoverage": "./scripts/download-rc.sh",
"coverage": "rimraf coverage && istanbul cover -x **/codec/**/* --root lib/ --include-all-sources _mocha -- --recursive --reporter spec",
"coverage-all": "rimraf coverage && istanbul cover --root lib/ --include-all-sources _mocha -- --recursive --reporter spec",
"postcoverage": "remap-istanbul -i coverage/coverage.json -o coverage/cobertura-coverage.xml -t cobertura && remap-istanbul -i coverage/coverage.json -o coverage -t html",
"generate-docs": "rimraf docs && typedoc --out docs/ --exclude **/codec/**/* --module commonjs src lib.es6.d.ts typings/index.d.ts --excludeExternals",
"generate-docs": "rimraf docs && typedoc --out docs/ --exclude **/codec/**/* --module commonjs src lib.es6.d.ts --excludeExternals",
"lint": "tslint --project tsconfig.json -t stylish"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions src/core/EntryView.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as Long from 'long';
export class EntryView<K, V> {
key: K;
value: V;
Expand Down
1 change: 1 addition & 0 deletions src/proxy/IRingbuffer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as Long from 'long';
import * as Promise from 'bluebird';
import {DistributedObject} from '../DistributedObject';
import {OverflowPolicy} from '../core/OverflowPolicy';
Expand Down
1 change: 1 addition & 0 deletions src/proxy/topic/RawTopicMessage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {IdentifiedDataSerializable, IdentifiedDataSerializableFactory} from '../../serialization/Serializable';
import {DataInput, DataOutput, Data} from '../../serialization/Data';
import Address = require('../../Address');
import * as Long from 'long';

export const RELIABLE_TOPIC_MESSAGE_FACTORY_ID = -18;
export const RELIABLE_TOPIC_CLASS_ID = 2;
Expand Down
2 changes: 1 addition & 1 deletion src/serialization/Data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Promise from 'bluebird';
import * as Long from 'long';
export interface Data {
/**
* Returns serialized representation in a buffer
Expand Down
2 changes: 1 addition & 1 deletion src/serialization/ObjectData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable:no-bitwise */
import Long = require('long');
import * as Long from 'long';
import {DataOutput, Data, DataInput, PositionalDataOutput} from './Data';
import {SerializationService} from './SerializationService';
import {BitsUtil} from '../BitsUtil';
Expand Down
1 change: 1 addition & 0 deletions src/serialization/portable/ClassDefinitionWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {FieldDefinition, FieldType, ClassDefinition} from './ClassDefinition';
import {PortableContext} from './PortableContext';
import {Portable} from '../Serializable';
import * as Util from '../../Util';
import * as Long from 'long';

export class ClassDefinitionWriter implements PortableWriter {
private portableContext: PortableContext;
Expand Down
2 changes: 2 additions & 0 deletions src/serialization/portable/DefaultPortableReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {DataInput} from '../Data';
import {ClassDefinition, FieldDefinition, FieldType} from './ClassDefinition';
import {BitsUtil} from '../../BitsUtil';
import {Portable} from '../Serializable';
import * as Long from 'long';

export class DefaultPortableReader implements PortableReader {

protected serializer: PortableSerializer;
Expand Down
2 changes: 2 additions & 0 deletions src/serialization/portable/DefaultPortableWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {PositionalDataOutput} from '../Data';
import {ClassDefinition, FieldType, FieldDefinition} from './ClassDefinition';
import {BitsUtil} from '../../BitsUtil';
import {Portable} from '../Serializable';
import * as Long from 'long';

export class DefaultPortableWriter {
private serializer: PortableSerializer;
private output: PositionalDataOutput;
Expand Down
1 change: 1 addition & 0 deletions src/serialization/portable/MorphingPortableReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {PortableSerializer} from './PortableSerializer';
import {DataInput} from '../Data';
import {ClassDefinition, FieldType, FieldDefinition} from './ClassDefinition';
import {Portable} from '../Serializable';
import * as Long from 'long';

export class MorphingPortableReader extends DefaultPortableReader {
constructor(portableSerializer: PortableSerializer, input: DataInput, classDefinition: ClassDefinition) {
Expand Down
1 change: 1 addition & 0 deletions src/serialization/portable/PortableSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {DefaultPortableReader} from './DefaultPortableReader';
import {MorphingPortableReader} from './MorphingPortableReader';
import {ClassDefinition, FieldType} from './ClassDefinition';
import {DefaultPortableWriter} from './DefaultPortableWriter';
import * as Long from 'long';

export class PortableSerializer implements Serializer {

Expand Down
4 changes: 2 additions & 2 deletions test/ClusterServiceTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('ClusterService', function() {
it('should throw with wrong group name', function(done) {
var cfg = new Config.ClientConfig();
cfg.groupConfig.name = 'wrong';
return HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
newClient.shutdown();
done(new Error('Client falsely started with wrong group name'));
}).catch(function (err) {
Expand All @@ -87,7 +87,7 @@ describe('ClusterService', function() {
it('should throw with wrong group password', function(done) {
var cfg = new Config.ClientConfig();
cfg.groupConfig.password = 'wrong';
return HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
newClient.shutdown();
done(new Error('Client falsely started with wrong group password'));
}).catch(function (err) {
Expand Down
12 changes: 9 additions & 3 deletions test/list/ListProxyTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ describe("List Proxy", function () {
}
}
};
return listInstance.addItemListener(listener, true).then(function () {
listInstance.addItemListener(listener, true).then(function () {
listInstance.add(1);
}).catch(function (e) {
done(e);
})
});

Expand All @@ -250,10 +252,12 @@ describe("List Proxy", function () {
}
}
};
return listInstance.addItemListener(listener, true).then(function () {
listInstance.addItemListener(listener, true).then(function () {
return listInstance.add(1);
}).then(function () {
return listInstance.remove(1);
}).catch(function (e) {
done(e);
})
});

Expand All @@ -268,10 +272,12 @@ describe("List Proxy", function () {
}
}
};
return listInstance.addItemListener(listener, false).then(function () {
listInstance.addItemListener(listener, false).then(function () {
return listInstance.add(1);
}).then(function () {
return listInstance.remove(1);
}).catch(function (e) {
done(e);
})
});

Expand Down
12 changes: 8 additions & 4 deletions test/set/SetProxyTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe("Set Proxy", function () {

it("listens for added entry", function (done) {
this.timeout(5000);
return setInstance.addItemListener({
setInstance.addItemListener({
"itemAdded" : function (item) {
if (item == 1) {
done()
Expand All @@ -149,12 +149,14 @@ describe("Set Proxy", function () {
}
}).then(function () {
setInstance.add(1);
})
}).catch(function (e) {
done(e);
});
});

it("listens for removed entry", function (done) {
this.timeout(5000);
return setInstance.addItemListener({
setInstance.addItemListener({
"itemRemoved" : function (item) {
if (item == 1) {
done()
Expand All @@ -166,7 +168,9 @@ describe("Set Proxy", function () {
return setInstance.add(1);
}).then(function () {
return setInstance.remove(1);
})
}).catch(function (e) {
done(e);
});
});


Expand Down
3 changes: 2 additions & 1 deletion test/ssl/ClientSslTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ configParams.forEach(function (cfg) {
var client;

before(function () {

markEnterprise(this);

this.timeout(10000);
Expand All @@ -49,6 +48,8 @@ configParams.forEach(function (cfg) {
});

after(function () {
markEnterprise(this);

client.shutdown();
return Controller.shutdownCluster(cluster.id);
});
Expand Down
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
"target": "es5",
"outDir": "lib",
"preserveConstEnums": true,
"noLib": true,
"lib": ["es5", "es6"],
"removeComments": true,
"sourceMap": true
},
"include": [
"src/index.ts",
"typings/index.d.ts",
"lib.es6.d.ts"
"src/index.ts"
]
}
11 changes: 0 additions & 11 deletions typings.json

This file was deleted.