Skip to content

Commit 619bfb0

Browse files
authoredSep 23, 2016
Fixed a bug where you couldn't use requirejs with a minified build
2 parents b45a092 + 51cc650 commit 619bfb0

11 files changed

+112
-76
lines changed
 

‎dist/exceptionless.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,20 @@ export declare class Configuration implements IConfigurationSettings {
208208
settings: Object;
209209
storage: IStorageProvider;
210210
queue: IEventQueue;
211+
private _apiKey;
212+
private _serverUrl;
213+
private _heartbeatServerUrl;
214+
private _updateSettingsWhenIdleInterval;
215+
private _dataExclusions;
216+
private _userAgentBotPatterns;
211217
private _plugins;
212218
private _handlers;
213219
constructor(configSettings?: IConfigurationSettings);
214-
private _apiKey;
215220
apiKey: string;
216221
isValid: boolean;
217-
private _serverUrl;
218222
serverUrl: string;
219-
private _heartbeatServerUrl;
220223
heartbeatServerUrl: string;
221-
private _updateSettingsWhenIdleInterval;
222224
updateSettingsWhenIdleInterval: number;
223-
private _dataExclusions;
224-
private _userAgentBotPatterns;
225225
dataExclusions: string[];
226226
addDataExclusions(...exclusions: string[]): void;
227227
userAgentBotPatterns: string[];

‎dist/exceptionless.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/exceptionless.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/exceptionless.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/exceptionless.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/exceptionless.node.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/exceptionless.node.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎gulpfile.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var fs = require("fs");
12
var pkg = require('./package.json');
23
var gulp = require('gulp');
34
var replace = require('gulp-replace');
@@ -28,10 +29,10 @@ gulp.task('exceptionless.umd', ['typescript', 'typescript.integrations'], functi
2829
.pipe(umd({
2930
exports: 'exports',
3031
globalName: 'exceptionless',
31-
namespace: 'exceptionless'
32+
namespace: 'exceptionless',
33+
deps: ['TraceKit'],
34+
template: fs.readFileSync('./umd.template.jst', 'utf8')
3235
}))
33-
.pipe(replace("define(factory);", "define('exceptionless', factory);"))
34-
.pipe(replace('}(this, function(require, exports, module) {', '}(this, function(require, exports, module) {\nif (!require) {\n\trequire = function(name) {\n\t\treturn (typeof window !== "undefined" ? window : global)[name];\n\t}\n}\nif (!exports) {\n\tvar exports = {};\n}'))
3536
.pipe(sourcemaps.write('.'))
3637
.pipe(gulp.dest('dist/temp'));
3738
});
@@ -91,8 +92,8 @@ gulp.task('watch', ['build'], function () {
9192
gulp.task('lint', function () {
9293
var tslint = require('gulp-tslint');
9394
return gulp.src(['src/**/*.ts', '!src/typings/**/*.ts'])
94-
.pipe(tslint())
95-
.pipe(tslint.report('verbose'));
95+
.pipe(tslint({ formatter: 'verbose' }))
96+
.pipe(tslint.report());
9697
});
9798

9899
gulp.task('build', ['clean', 'lint', 'exceptionless', 'exceptionless.node']);

‎package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,26 @@
2828
},
2929
"devDependencies": {
3030
"chai": "3.5.0",
31-
"del": "2.2.0",
32-
"es5-shim": "4.5.8",
33-
"es6-shim": "0.35.0",
31+
"del": "2.2.1",
32+
"es5-shim": "4.5.9",
33+
"es6-shim": "0.35.1",
3434
"gulp": "3.9.1",
3535
"gulp-concat": "2.6.0",
3636
"gulp-exec": "2.1.2",
3737
"gulp-mocha": "2.2.0",
3838
"gulp-replace": "0.5.4",
3939
"gulp-sourcemaps": "1.6.0",
40-
"gulp-tslint": "5.0.0",
41-
"gulp-uglify": "1.5.3",
40+
"gulp-tslint": "6.0.1",
41+
"gulp-uglify": "1.5.4",
4242
"gulp-wrap-umd": "0.2.1",
43-
"rimraf": "2.5.2",
44-
"source-map-support": "0.4.0",
45-
"mock-fs": "3.9.0",
43+
"rimraf": "2.5.3",
44+
"source-map-support": "0.4.2",
45+
"mock-fs": "3.11.0",
4646
"tracekit": "0.4.3",
47-
"tslint": "3.8.1",
47+
"tslint": "3.13.0",
4848
"tsproject": "1.2.1",
4949
"typescript": "1.8.10",
50-
"typescript-formatter": "2.1.0"
50+
"typescript-formatter": "2.2.1"
5151
},
5252
"dependencies": {
5353
"stack-trace": "0.0.9"

‎src/configuration/Configuration.ts

+42-42
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,48 @@ export class Configuration implements IConfigurationSettings {
8080

8181
public queue: IEventQueue;
8282

83+
/**
84+
* The API key that will be used when sending events to the server.
85+
* @type {string}
86+
* @private
87+
*/
88+
private _apiKey: string;
89+
90+
/**
91+
* The server url that all events will be sent to.
92+
* @type {string}
93+
* @private
94+
*/
95+
private _serverUrl: string = 'https://collector.exceptionless.io';
96+
97+
/**
98+
* The heartbeat server url that all heartbeats will be sent to.
99+
* @type {string}
100+
* @private
101+
*/
102+
private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';
103+
104+
/**
105+
* How often the client should check for updated server settings when idle. The default is every 2 minutes.
106+
* @type {number}
107+
* @private
108+
*/
109+
private _updateSettingsWhenIdleInterval: number = 120000;
110+
111+
/**
112+
* A list of exclusion patterns.
113+
* @type {Array}
114+
* @private
115+
*/
116+
private _dataExclusions: string[] = [];
117+
118+
/**
119+
* A list of user agent patterns.
120+
* @type {Array}
121+
* @private
122+
*/
123+
private _userAgentBotPatterns: string[] = [];
124+
83125
/**
84126
* The list of plugins that will be used in this configuration.
85127
* @type {Array}
@@ -122,13 +164,6 @@ export class Configuration implements IConfigurationSettings {
122164
EventPluginManager.addDefaultPlugins(this);
123165
}
124166

125-
/**
126-
* The API key that will be used when sending events to the server.
127-
* @type {string}
128-
* @private
129-
*/
130-
private _apiKey: string;
131-
132167
/**
133168
* The API key that will be used when sending events to the server.
134169
* @returns {string}
@@ -155,13 +190,6 @@ export class Configuration implements IConfigurationSettings {
155190
return !!this.apiKey && this.apiKey.length >= 10;
156191
}
157192

158-
/**
159-
* The server url that all events will be sent to.
160-
* @type {string}
161-
* @private
162-
*/
163-
private _serverUrl: string = 'https://collector.exceptionless.io';
164-
165193
/**
166194
* The server url that all events will be sent to.
167195
* @returns {string}
@@ -183,13 +211,6 @@ export class Configuration implements IConfigurationSettings {
183211
}
184212
}
185213

186-
/**
187-
* The heartbeat server url that all heartbeats will be sent to.
188-
* @type {string}
189-
* @private
190-
*/
191-
private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';
192-
193214
/**
194215
* The heartbeat server url that all heartbeats will be sent to.
195216
* @returns {string}
@@ -210,13 +231,6 @@ export class Configuration implements IConfigurationSettings {
210231
}
211232
}
212233

213-
/**
214-
* How often the client should check for updated server settings when idle. The default is every 2 minutes.
215-
* @type {number}
216-
* @private
217-
*/
218-
private _updateSettingsWhenIdleInterval: number = 120000;
219-
220234
/**
221235
* How often the client should check for updated server settings when idle. The default is every 2 minutes.
222236
* @returns {number}
@@ -245,20 +259,6 @@ export class Configuration implements IConfigurationSettings {
245259
this.changed();
246260
}
247261

248-
/**
249-
* A list of exclusion patterns.
250-
* @type {Array}
251-
* @private
252-
*/
253-
private _dataExclusions: string[] = [];
254-
255-
/**
256-
* A list of user agent patterns.
257-
* @type {Array}
258-
* @private
259-
*/
260-
private _userAgentBotPatterns: string[] = [];
261-
262262
/**
263263
* A list of exclusion patterns that will automatically remove any data that
264264
* matches them from any data submitted to the server.

‎umd.template.jst

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<%
2+
var stdDeps = ['require', 'exports', 'module'];
3+
4+
var amdDeps = stdDeps.concat(_.pluck(deps, 'amdName'));
5+
var cjsDeps = _.without(_.pluck(deps, 'cjsName'), stdDeps);
6+
cjsDeps = cjsDeps ? stdDeps.concat(_.map(cjsDeps, function(dep) { return "require('" + dep + "')" })) : stdDeps;
7+
8+
var depNames = deps ? stdDeps.concat(_.pluck(deps, 'paramName')) : stdDeps;
9+
var globalDeps = deps ? stdDeps.concat(_.map(deps, function(dep) { return 'root.' + dep.globalName })) : stdDeps;
10+
11+
%>
12+
(function(root, factory) {
13+
if (typeof define === 'function' && define.amd) {
14+
define('<%= namespace %>', <%= amdDeps ? JSON.stringify(amdDeps) + ', ' : '[], ' %>factory);
15+
} else if (typeof exports === 'object') {
16+
module.exports = factory(<%= cjsDeps.join(', ') %>);
17+
} else {
18+
root.<%= namespace %> = factory(<%= globalDeps.join(', ') %>);
19+
}
20+
}(this, function(<%= depNames.join(', ') %>) {
21+
if (!require) {
22+
require = function(name) {
23+
return (typeof window !== "undefined" ? window : global)[name];
24+
}
25+
}
26+
if (!exports) {
27+
var exports = {};
28+
}
29+
<% if (exports) { %>
30+
<%= contents %>
31+
return <%= exports %>;
32+
<% } else { %>
33+
return <%= contents %>;
34+
<% } %>
35+
}));

0 commit comments

Comments
 (0)
Please sign in to comment.