Skip to content

Fixed a bug where you couldn't use requirejs with a minified build #56

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
Sep 23, 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
12 changes: 6 additions & 6 deletions dist/exceptionless.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,20 @@ export declare class Configuration implements IConfigurationSettings {
settings: Object;
storage: IStorageProvider;
queue: IEventQueue;
private _apiKey;
private _serverUrl;
private _heartbeatServerUrl;
private _updateSettingsWhenIdleInterval;
private _dataExclusions;
private _userAgentBotPatterns;
private _plugins;
private _handlers;
constructor(configSettings?: IConfigurationSettings);
private _apiKey;
apiKey: string;
isValid: boolean;
private _serverUrl;
serverUrl: string;
private _heartbeatServerUrl;
heartbeatServerUrl: string;
private _updateSettingsWhenIdleInterval;
updateSettingsWhenIdleInterval: number;
private _dataExclusions;
private _userAgentBotPatterns;
dataExclusions: string[];
addDataExclusions(...exclusions: string[]): void;
userAgentBotPatterns: string[];
Expand Down
12 changes: 6 additions & 6 deletions dist/exceptionless.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/exceptionless.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/exceptionless.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/exceptionless.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/exceptionless.node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/exceptionless.node.js.map

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var fs = require("fs");
var pkg = require('./package.json');
var gulp = require('gulp');
var replace = require('gulp-replace');
Expand Down Expand Up @@ -28,10 +29,10 @@ gulp.task('exceptionless.umd', ['typescript', 'typescript.integrations'], functi
.pipe(umd({
exports: 'exports',
globalName: 'exceptionless',
namespace: 'exceptionless'
namespace: 'exceptionless',
deps: ['TraceKit'],
template: fs.readFileSync('./umd.template.jst', 'utf8')
}))
.pipe(replace("define(factory);", "define('exceptionless', factory);"))
.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}'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/temp'));
});
Expand Down Expand Up @@ -91,8 +92,8 @@ gulp.task('watch', ['build'], function () {
gulp.task('lint', function () {
var tslint = require('gulp-tslint');
return gulp.src(['src/**/*.ts', '!src/typings/**/*.ts'])
.pipe(tslint())
.pipe(tslint.report('verbose'));
.pipe(tslint({ formatter: 'verbose' }))
.pipe(tslint.report());
});

gulp.task('build', ['clean', 'lint', 'exceptionless', 'exceptionless.node']);
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@
},
"devDependencies": {
"chai": "3.5.0",
"del": "2.2.0",
"es5-shim": "4.5.8",
"es6-shim": "0.35.0",
"del": "2.2.1",
"es5-shim": "4.5.9",
"es6-shim": "0.35.1",
"gulp": "3.9.1",
"gulp-concat": "2.6.0",
"gulp-exec": "2.1.2",
"gulp-mocha": "2.2.0",
"gulp-replace": "0.5.4",
"gulp-sourcemaps": "1.6.0",
"gulp-tslint": "5.0.0",
"gulp-uglify": "1.5.3",
"gulp-tslint": "6.0.1",
"gulp-uglify": "1.5.4",
"gulp-wrap-umd": "0.2.1",
"rimraf": "2.5.2",
"source-map-support": "0.4.0",
"mock-fs": "3.9.0",
"rimraf": "2.5.3",
"source-map-support": "0.4.2",
"mock-fs": "3.11.0",
"tracekit": "0.4.3",
"tslint": "3.8.1",
"tslint": "3.13.0",
"tsproject": "1.2.1",
"typescript": "1.8.10",
"typescript-formatter": "2.1.0"
"typescript-formatter": "2.2.1"
},
"dependencies": {
"stack-trace": "0.0.9"
Expand Down
84 changes: 42 additions & 42 deletions src/configuration/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,48 @@ export class Configuration implements IConfigurationSettings {

public queue: IEventQueue;

/**
* The API key that will be used when sending events to the server.
* @type {string}
* @private
*/
private _apiKey: string;

/**
* The server url that all events will be sent to.
* @type {string}
* @private
*/
private _serverUrl: string = 'https://collector.exceptionless.io';

/**
* The heartbeat server url that all heartbeats will be sent to.
* @type {string}
* @private
*/
private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';

/**
* How often the client should check for updated server settings when idle. The default is every 2 minutes.
* @type {number}
* @private
*/
private _updateSettingsWhenIdleInterval: number = 120000;

/**
* A list of exclusion patterns.
* @type {Array}
* @private
*/
private _dataExclusions: string[] = [];

/**
* A list of user agent patterns.
* @type {Array}
* @private
*/
private _userAgentBotPatterns: string[] = [];

/**
* The list of plugins that will be used in this configuration.
* @type {Array}
Expand Down Expand Up @@ -122,13 +164,6 @@ export class Configuration implements IConfigurationSettings {
EventPluginManager.addDefaultPlugins(this);
}

/**
* The API key that will be used when sending events to the server.
* @type {string}
* @private
*/
private _apiKey: string;

/**
* The API key that will be used when sending events to the server.
* @returns {string}
Expand All @@ -155,13 +190,6 @@ export class Configuration implements IConfigurationSettings {
return !!this.apiKey && this.apiKey.length >= 10;
}

/**
* The server url that all events will be sent to.
* @type {string}
* @private
*/
private _serverUrl: string = 'https://collector.exceptionless.io';

/**
* The server url that all events will be sent to.
* @returns {string}
Expand All @@ -183,13 +211,6 @@ export class Configuration implements IConfigurationSettings {
}
}

/**
* The heartbeat server url that all heartbeats will be sent to.
* @type {string}
* @private
*/
private _heartbeatServerUrl: string = 'https://heartbeat.exceptionless.io';

/**
* The heartbeat server url that all heartbeats will be sent to.
* @returns {string}
Expand All @@ -210,13 +231,6 @@ export class Configuration implements IConfigurationSettings {
}
}

/**
* How often the client should check for updated server settings when idle. The default is every 2 minutes.
* @type {number}
* @private
*/
private _updateSettingsWhenIdleInterval: number = 120000;

/**
* How often the client should check for updated server settings when idle. The default is every 2 minutes.
* @returns {number}
Expand Down Expand Up @@ -245,20 +259,6 @@ export class Configuration implements IConfigurationSettings {
this.changed();
}

/**
* A list of exclusion patterns.
* @type {Array}
* @private
*/
private _dataExclusions: string[] = [];

/**
* A list of user agent patterns.
* @type {Array}
* @private
*/
private _userAgentBotPatterns: string[] = [];

/**
* A list of exclusion patterns that will automatically remove any data that
* matches them from any data submitted to the server.
Expand Down
35 changes: 35 additions & 0 deletions umd.template.jst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<%
var stdDeps = ['require', 'exports', 'module'];

var amdDeps = stdDeps.concat(_.pluck(deps, 'amdName'));
var cjsDeps = _.without(_.pluck(deps, 'cjsName'), stdDeps);
cjsDeps = cjsDeps ? stdDeps.concat(_.map(cjsDeps, function(dep) { return "require('" + dep + "')" })) : stdDeps;

var depNames = deps ? stdDeps.concat(_.pluck(deps, 'paramName')) : stdDeps;
var globalDeps = deps ? stdDeps.concat(_.map(deps, function(dep) { return 'root.' + dep.globalName })) : stdDeps;

%>
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define('<%= namespace %>', <%= amdDeps ? JSON.stringify(amdDeps) + ', ' : '[], ' %>factory);
} else if (typeof exports === 'object') {
module.exports = factory(<%= cjsDeps.join(', ') %>);
} else {
root.<%= namespace %> = factory(<%= globalDeps.join(', ') %>);
}
}(this, function(<%= depNames.join(', ') %>) {
if (!require) {
require = function(name) {
return (typeof window !== "undefined" ? window : global)[name];
}
}
if (!exports) {
var exports = {};
}
<% if (exports) { %>
<%= contents %>
return <%= exports %>;
<% } else { %>
return <%= contents %>;
<% } %>
}));