Skip to content

Commit 8b7e3dd

Browse files
committed
migration to Typescript 2.0
1 parent a098bf6 commit 8b7e3dd

17 files changed

+44
-35
lines changed

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,33 @@
88
"long": "3.2.0"
99
},
1010
"devDependencies": {
11+
"@types/bluebird": "3.0.35",
12+
"@types/long": "3.0.31",
13+
"@types/node": "6.0.46",
1114
"chai": "3.5.0",
1215
"chai-as-promised": "5.3.0",
1316
"hazelcast-remote-controller": "^1.0.0",
14-
"istanbul": "0.4.3",
15-
"mocha": "2.5.3",
17+
"istanbul": "0.4.5",
18+
"mocha": "3.1.2",
1619
"mousse": "0.3.1",
17-
"remap-istanbul": "0.6.4",
20+
"remap-istanbul": "0.7.0",
1821
"rimraf": "2.5.4",
1922
"sinon": "1.17.5",
2023
"tslint": "3.14.0",
21-
"typedoc": "0.4.4",
22-
"typescript": "1.8.10",
23-
"typings": "1.3.2",
24+
"typedoc": "0.5.0",
25+
"typescript": "2.0.3",
2426
"winston": "2.2.0"
2527
},
2628
"scripts": {
2729
"clean": "rimraf lib typings *.jar *.log",
28-
"precompile": "typings install",
2930
"compile": "tsc",
3031
"pretest": "./scripts/download-rc.sh",
3132
"test": "mocha --recursive",
3233
"precoverage": "./scripts/download-rc.sh",
3334
"coverage": "rimraf coverage && istanbul cover -x **/codec/**/* --root lib/ --include-all-sources _mocha -- --recursive --reporter spec",
3435
"coverage-all": "rimraf coverage && istanbul cover --root lib/ --include-all-sources _mocha -- --recursive --reporter spec",
3536
"postcoverage": "remap-istanbul -i coverage/coverage.json -o coverage/cobertura-coverage.xml -t cobertura && remap-istanbul -i coverage/coverage.json -o coverage -t html",
36-
"generate-docs": "rimraf docs && typedoc --out docs/ --exclude **/codec/**/* --module commonjs src lib.es6.d.ts typings/index.d.ts --excludeExternals",
37+
"generate-docs": "rimraf docs && typedoc --out docs/ --exclude **/codec/**/* --module commonjs src lib.es6.d.ts --excludeExternals",
3738
"lint": "tslint --project tsconfig.json -t stylish"
3839
},
3940
"repository": {

src/core/EntryView.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as Long from 'long';
12
export class EntryView<K, V> {
23
key: K;
34
value: V;

src/proxy/IRingbuffer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as Long from 'long';
12
import * as Promise from 'bluebird';
23
import {DistributedObject} from '../DistributedObject';
34
import {OverflowPolicy} from '../core/OverflowPolicy';

src/proxy/topic/RawTopicMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {IdentifiedDataSerializable, IdentifiedDataSerializableFactory} from '../../serialization/Serializable';
22
import {DataInput, DataOutput, Data} from '../../serialization/Data';
33
import Address = require('../../Address');
4+
import * as Long from 'long';
45

56
export const RELIABLE_TOPIC_MESSAGE_FACTORY_ID = -18;
67
export const RELIABLE_TOPIC_CLASS_ID = 2;

src/serialization/Data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Promise from 'bluebird';
1+
import * as Long from 'long';
22
export interface Data {
33
/**
44
* Returns serialized representation in a buffer

src/serialization/ObjectData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* tslint:disable:no-bitwise */
2-
import Long = require('long');
2+
import * as Long from 'long';
33
import {DataOutput, Data, DataInput, PositionalDataOutput} from './Data';
44
import {SerializationService} from './SerializationService';
55
import {BitsUtil} from '../BitsUtil';

src/serialization/portable/ClassDefinitionWriter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {FieldDefinition, FieldType, ClassDefinition} from './ClassDefinition';
33
import {PortableContext} from './PortableContext';
44
import {Portable} from '../Serializable';
55
import * as Util from '../../Util';
6+
import * as Long from 'long';
67

78
export class ClassDefinitionWriter implements PortableWriter {
89
private portableContext: PortableContext;

src/serialization/portable/DefaultPortableReader.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import {DataInput} from '../Data';
33
import {ClassDefinition, FieldDefinition, FieldType} from './ClassDefinition';
44
import {BitsUtil} from '../../BitsUtil';
55
import {Portable} from '../Serializable';
6+
import * as Long from 'long';
7+
68
export class DefaultPortableReader implements PortableReader {
79

810
protected serializer: PortableSerializer;

src/serialization/portable/DefaultPortableWriter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import {PositionalDataOutput} from '../Data';
33
import {ClassDefinition, FieldType, FieldDefinition} from './ClassDefinition';
44
import {BitsUtil} from '../../BitsUtil';
55
import {Portable} from '../Serializable';
6+
import * as Long from 'long';
7+
68
export class DefaultPortableWriter {
79
private serializer: PortableSerializer;
810
private output: PositionalDataOutput;

src/serialization/portable/MorphingPortableReader.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {PortableSerializer} from './PortableSerializer';
33
import {DataInput} from '../Data';
44
import {ClassDefinition, FieldType, FieldDefinition} from './ClassDefinition';
55
import {Portable} from '../Serializable';
6+
import * as Long from 'long';
67

78
export class MorphingPortableReader extends DefaultPortableReader {
89
constructor(portableSerializer: PortableSerializer, input: DataInput, classDefinition: ClassDefinition) {

src/serialization/portable/PortableSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {DefaultPortableReader} from './DefaultPortableReader';
66
import {MorphingPortableReader} from './MorphingPortableReader';
77
import {ClassDefinition, FieldType} from './ClassDefinition';
88
import {DefaultPortableWriter} from './DefaultPortableWriter';
9+
import * as Long from 'long';
910

1011
export class PortableSerializer implements Serializer {
1112

test/ClusterServiceTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('ClusterService', function() {
7676
it('should throw with wrong group name', function(done) {
7777
var cfg = new Config.ClientConfig();
7878
cfg.groupConfig.name = 'wrong';
79-
return HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
79+
HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
8080
newClient.shutdown();
8181
done(new Error('Client falsely started with wrong group name'));
8282
}).catch(function (err) {
@@ -87,7 +87,7 @@ describe('ClusterService', function() {
8787
it('should throw with wrong group password', function(done) {
8888
var cfg = new Config.ClientConfig();
8989
cfg.groupConfig.password = 'wrong';
90-
return HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
90+
HazelcastClient.newHazelcastClient(cfg).then(function(newClient) {
9191
newClient.shutdown();
9292
done(new Error('Client falsely started with wrong group password'));
9393
}).catch(function (err) {

test/list/ListProxyTest.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,10 @@ describe("List Proxy", function () {
234234
}
235235
}
236236
};
237-
return listInstance.addItemListener(listener, true).then(function () {
237+
listInstance.addItemListener(listener, true).then(function () {
238238
listInstance.add(1);
239+
}).catch(function (e) {
240+
done(e);
239241
})
240242
});
241243

@@ -250,10 +252,12 @@ describe("List Proxy", function () {
250252
}
251253
}
252254
};
253-
return listInstance.addItemListener(listener, true).then(function () {
255+
listInstance.addItemListener(listener, true).then(function () {
254256
return listInstance.add(1);
255257
}).then(function () {
256258
return listInstance.remove(1);
259+
}).catch(function (e) {
260+
done(e);
257261
})
258262
});
259263

@@ -268,10 +272,12 @@ describe("List Proxy", function () {
268272
}
269273
}
270274
};
271-
return listInstance.addItemListener(listener, false).then(function () {
275+
listInstance.addItemListener(listener, false).then(function () {
272276
return listInstance.add(1);
273277
}).then(function () {
274278
return listInstance.remove(1);
279+
}).catch(function (e) {
280+
done(e);
275281
})
276282
});
277283

test/set/SetProxyTest.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe("Set Proxy", function () {
139139

140140
it("listens for added entry", function (done) {
141141
this.timeout(5000);
142-
return setInstance.addItemListener({
142+
setInstance.addItemListener({
143143
"itemAdded" : function (item) {
144144
if (item == 1) {
145145
done()
@@ -149,12 +149,14 @@ describe("Set Proxy", function () {
149149
}
150150
}).then(function () {
151151
setInstance.add(1);
152-
})
152+
}).catch(function (e) {
153+
done(e);
154+
});
153155
});
154156

155157
it("listens for removed entry", function (done) {
156158
this.timeout(5000);
157-
return setInstance.addItemListener({
159+
setInstance.addItemListener({
158160
"itemRemoved" : function (item) {
159161
if (item == 1) {
160162
done()
@@ -166,7 +168,9 @@ describe("Set Proxy", function () {
166168
return setInstance.add(1);
167169
}).then(function () {
168170
return setInstance.remove(1);
169-
})
171+
}).catch(function (e) {
172+
done(e);
173+
});
170174
});
171175

172176

test/ssl/ClientSslTest.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ configParams.forEach(function (cfg) {
3434
var client;
3535

3636
before(function () {
37-
3837
markEnterprise(this);
3938

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

5150
after(function () {
51+
markEnterprise(this);
52+
5253
client.shutdown();
5354
return Controller.shutdownCluster(cluster.id);
5455
});

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
"target": "es5",
88
"outDir": "lib",
99
"preserveConstEnums": true,
10-
"noLib": true,
10+
"lib": ["es5", "es6"],
1111
"removeComments": true,
1212
"sourceMap": true
1313
},
1414
"include": [
15-
"src/index.ts",
16-
"typings/index.d.ts",
17-
"lib.es6.d.ts"
15+
"src/index.ts"
1816
]
1917
}

typings.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)