Skip to content

Commit 66db6db

Browse files
committed
Cleaned up the build a bit :)
1 parent cd34b85 commit 66db6db

File tree

8 files changed

+45
-46
lines changed

8 files changed

+45
-46
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ src/exceptionless.js
1010
src/exceptionless-spec.js
1111
src/exceptionless-spec.js.map
1212
/src/dist
13+
/src/typings

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ environment:
66
install:
77
- ps: Install-Product node $env:nodejs_version
88
- cd src
9+
- npm install -g tsd
910
- npm install -g gulp
1011
- npm install -g bower
1112
- npm install
13+
- tsd reinstall -s
1214
- bower install
1315

1416
build_script:

src/bower.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"bower_components"
99
],
1010
"dependencies": {
11-
"stacktrace-js": "~0.6.4",
12-
"DefinitelyTyped": "*"
11+
"stacktrace-js": "~0.6.4"
1312
}
1413
}

src/exceptionless-spec.ts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
/// <reference path="bower_components/DefinitelyTyped/jasmine/jasmine.d.ts" />
1+
/// <reference path="typings/tsd.d.ts" />
22
/// <reference path="exceptionless.ts" />
33

4+
//import { Configuration, ExceptionlessClient } from 'Exceptionless';
45
module Exceptionless {
5-
describe('ExceptionlessClient', function () {
6-
it('disable the client with null api key', function () {
6+
describe('ExceptionlessClient', () => {
7+
it('disable the client with null api key', () => {
78
var client = new ExceptionlessClient(null);
89
expect(client.config).not.toBe(null);
910
expect(client.config.apiKey).toBe(null);
1011
expect(client.config.enabled).toBe(false);
1112
});
1213

13-
it('should set the api key and enabled to true', function () {
14+
it('should set the api key and enabled to true', () => {
1415
var client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
1516
expect(client.config).not.toBe(null);
1617
expect(client.config.apiKey).toBe('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
1718
expect(client.config.enabled).toBe(true);
1819
});
1920

20-
it('apply client configuration', function () {
21+
it('apply client configuration', () => {
2122
var client = new ExceptionlessClient(null);
2223
expect(client.config).not.toBe(null);
2324
expect(client.config.apiKey).toBe(null);
@@ -29,45 +30,45 @@ module Exceptionless {
2930
});
3031
});
3132

32-
describe('EventQueue', function () {
33-
it('should enqueue event', function () {
33+
describe('EventQueue', () => {
34+
it('should enqueue event', () => {
3435
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
3536
});
3637

37-
it('should process queue', function () {
38+
it('should process queue', () => {
3839
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
3940
});
4041

41-
it('should suspend processing', function () {
42+
it('should suspend processing', () => {
4243
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
4344
});
4445
});
4546

46-
describe('SubmissionClient', function () {
47-
it('should submit events', function () {
47+
describe('SubmissionClient', () => {
48+
it('should submit events', () => {
4849
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
4950
});
5051

51-
it('should submit user description', function () {
52+
it('should submit user description', () => {
5253
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
5354
});
5455

55-
it('should get project settings', function () {
56+
it('should get project settings', () => {
5657
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
5758
});
5859
});
5960

60-
describe('Storage', function () {
61-
it('should save events', function () {
62-
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
63-
});
61+
describe('Storage', () => {
62+
it('should save events', () => {
63+
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
64+
});
6465

65-
it('should get saved events', function () {
66-
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
67-
});
66+
it('should get saved events', () => {
67+
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
68+
});
6869

69-
it('should clear all events', function () {
70-
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
70+
it('should clear all events', () => {
71+
var config = new Configuration('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
72+
});
7173
});
72-
});
7374
}

src/exceptionless.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference path="bower_components/DefinitelyTyped/es6-promise/es6-promise.d.ts" />
21

32
// TODO: We'll need a poly fill for promises.
43
module Exceptionless {
@@ -95,7 +94,6 @@ module Exceptionless {
9594
return;
9695
}
9796

98-
var key = this.queuePath() + '-' + + new Date().toJSON() + '-' + Math.floor(Math.random() * 9007199254740992);
9997
return this._config.storage.save(key, event);
10098
}
10199

@@ -114,7 +112,6 @@ module Exceptionless {
114112

115113
try {
116114
var events = this._config.storage.get(this.queuePath(), this._config.submissionBatchSize);
117-
this._config.submissionClient.submitEvents(events, this._config)
118115
.then<any>((response:SubmissionResponse) => {
119116
if (response.success) {
120117
this._config.log.info('Sent ' + events.length + ' events to "' + this._config.serverUrl + '".');
@@ -170,7 +167,6 @@ module Exceptionless {
170167
durationInMinutes = 5;
171168
}
172169

173-
this._config.log.info('Suspending processing for: ' + durationInMinutes + 'minutes.');
174170
this._suspendProcessingUntil = new Date(new Date().getTime() + (durationInMinutes * 60000));
175171
//_queueTimer.Change(duration.Value, _processQueueInterval);
176172

@@ -213,34 +209,26 @@ module Exceptionless {
213209
}
214210

215211
export interface ISubmissionClient {
216-
submitEvents(events:ExceptionlessEvent[], config:Configuration): Promise<SubmissionResponse>;
217-
submitUserDescription(referenceId:string, description:UserDescription, config:Configuration): Promise<SubmissionResponse>;
218212
getSettings(config:Configuration): Promise<SettingsResponse>;
219213
}
220214

221215
export class SubmissionClient implements ISubmissionClient {
222-
public submitEvents(events:ExceptionlessEvent[], config:Configuration): Promise<SubmissionResponse> {
223-
var url = config.serverUrl + '/events?access_token=' + encodeURIComponent(config.apiKey);
224216
return this.sendRequest('POST', url, JSON.stringify(events)).then(
225217
xhr => { return new SubmissionResponse(xhr.status, this.getResponseMessage(xhr)); },
226218
xhr => { return new SubmissionResponse(xhr.status || 500, this.getResponseMessage(xhr)); }
227219
);
228220
}
229221

230-
public submitUserDescription(referenceId:string, description:UserDescription, config:Configuration): Promise<SubmissionResponse> {
231-
var url = config.serverUrl + '/events/by-ref/' + encodeURIComponent(referenceId) + '/user-description?access_token=' + encodeURIComponent(config.apiKey);
232222
return this.sendRequest('POST', url, JSON.stringify(description)).then(
233223
xhr => { return new SubmissionResponse(xhr.status, this.getResponseMessage(xhr)); },
234224
xhr => { return new SubmissionResponse(xhr.status || 500, this.getResponseMessage(xhr)); }
235225
);
236226
}
237227

238228
public getSettings(config:Configuration): Promise<SettingsResponse> {
239-
var url = config.serverUrl + '/projects/config?access_token=' + encodeURIComponent(config.apiKey);
240229
return this.sendRequest('GET', url).then(
241230
xhr => {
242231
if (xhr.status !== 200) {
243-
return new SettingsResponse(false, null, -1, null, 'Unable to retrieve configuration settings: ' + this.getResponseMessage(xhr));
244232
}
245233

246234
var settings = JSON.parse(xhr.responseText);

src/gulpfile.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@ var ts = require('gulp-typescript');
99

1010
var tsProject = ts.createProject({
1111
declarationFiles: true,
12-
noExternalResolve: true,
1312
removeComments: true,
1413
sortOutput: true,
15-
target: 'ES5'
14+
target: 'ES6'
1615
});
1716

1817
gulp.task('clean', function (cb) {
1918
rimraf('./dist', cb);
2019
});
2120

2221
gulp.task('scripts', function() {
23-
var files = [
24-
'bower_components/DefinitelyTyped/es6-promise/es6-promise.d.ts',
25-
'bower_components/DefinitelyTyped/jasmine/jasmine.d.ts',
26-
'exceptionless.ts'
27-
]
22+
var files = ['exceptionless.ts'];
2823
var tsResult = gulp.src(files)
2924
.pipe(sourcemaps.init())
3025
.pipe(ts(tsProject));

src/karma.conf.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ module.exports = function (config) {
88
files: [
99
'bower_components/es5-shim/es5-shim.js',
1010
'bower_components/es6-shim/es6-shim.js',
11-
'bower_components/DefinitelyTyped/es6-promise/es6-promise.d.ts',
12-
'bower_components/DefinitelyTyped/jasmine/jasmine.d.ts',
1311
'**/*.ts'
1412
],
1513
exclude: [],

src/tsd.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "v4",
3+
"repo": "borisyankov/DefinitelyTyped",
4+
"ref": "master",
5+
"path": "typings",
6+
"bundle": "typings/tsd.d.ts",
7+
"installed": {
8+
"jasmine/jasmine.d.ts": {
9+
"commit": "d5f92f93bdb49f332fa662ff1d0cc8700f02e4dc"
10+
},
11+
"es6-promise/es6-promise.d.ts": {
12+
"commit": "d5f92f93bdb49f332fa662ff1d0cc8700f02e4dc"
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)