Skip to content

Commit 88596ae

Browse files
committed
Merge branch 'master' into kmclb-add-traces-sampler-option
2 parents 992b591 + 4f75e8f commit 88596ae

File tree

32 files changed

+92
-35
lines changed

32 files changed

+92
-35
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"scripts": {
4-
"build": "lerna run --stream --concurrency 1 --sort build",
4+
"build": "node ./scripts/verify-packages-versions.js && lerna run --stream --concurrency 1 --sort build",
55
"build:es5": "lerna run --stream --concurrency 1 --sort build:es5",
66
"build:esm": "lerna run --stream --concurrency 1 --sort build:esm",
77
"build:watch": "lerna run build:watch --stream --no-sort --concurrency 9999",
@@ -61,7 +61,7 @@
6161
"size-limit": "^4.5.5",
6262
"ts-jest": "^24.0.2",
6363
"typedoc": "^0.18.0",
64-
"typescript": "3.9.7"
64+
"typescript": "3.7.5"
6565
},
6666
"resolutions": {
6767
"**/agent-base": "5"

packages/angular/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import { createErrorHandler } from '@sentry/angular';
6464
export class AppModule {}
6565
```
6666

67-
Additionally, `createErrorHandler` accepts a set of options that allows you to configure its behaviour. For more details
67+
Additionally, `createErrorHandler` accepts a set of options that allows you to configure its behavior. For more details
6868
see `ErrorHandlerOptions` interface in `src/errorhandler.ts`.
6969

7070
### Tracing

packages/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"npm-run-all": "^4.1.2",
3232
"prettier": "1.17.0",
3333
"rimraf": "^2.6.3",
34-
"typescript": "3.9.7"
34+
"typescript": "3.7.5"
3535
},
3636
"scripts": {
3737
"build": "run-p build:es5 build:esm",

packages/angular/src/errorhandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ErrorHandler as AngularErrorHandler, Injectable } from '@angular/core';
33
import * as Sentry from '@sentry/browser';
44

55
/**
6-
* Options used to configure the behaviour of the Angular ErrorHandler.
6+
* Options used to configure the behavior of the Angular ErrorHandler.
77
*/
88
export interface ErrorHandlerOptions {
99
logErrors?: boolean;

packages/apm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"rollup-plugin-node-resolve": "^4.2.3",
3838
"rollup-plugin-terser": "^4.0.4",
3939
"rollup-plugin-typescript2": "^0.21.0",
40-
"typescript": "3.9.7"
40+
"typescript": "3.7.5"
4141
},
4242
"scripts": {
4343
"build": "run-p build:es5 build:esm build:bundle",

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"rollup-plugin-terser": "^4.0.4",
5252
"rollup-plugin-typescript2": "^0.21.0",
5353
"sinon": "^7.3.2",
54-
"typescript": "3.9.7",
54+
"typescript": "3.7.5",
5555
"webpack": "^4.30.0"
5656
},
5757
"scripts": {

packages/browser/src/tracekit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const chrome = /^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|addre
4646
// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
4747
// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
4848
// We need this specific case for now because we want no other regex to match.
49-
const gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i;
49+
const gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i;
5050
const winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
5151
const geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
5252
const chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/;

packages/browser/test/unit/transports/fetch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let transport: Transports.BaseTransport;
1818

1919
describe('FetchTransport', () => {
2020
beforeEach(() => {
21-
fetch = stub(window, 'fetch');
21+
fetch = (stub(window, 'fetch') as unknown) as SinonStub;
2222
transport = new Transports.FetchTransport({ dsn: testDsn });
2323
});
2424

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"npm-run-all": "^4.1.2",
3030
"prettier": "1.17.0",
3131
"rimraf": "^2.6.3",
32-
"typescript": "3.9.7"
32+
"typescript": "3.7.5"
3333
},
3434
"scripts": {
3535
"build": "run-p build:es5 build:esm",

packages/ember/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"loader.js": "^4.7.0",
7676
"npm-run-all": "^4.1.5",
7777
"qunit-dom": "^1.2.0",
78-
"typescript": "3.9.7"
78+
"typescript": "3.7.5"
7979
},
8080
"engines": {
8181
"node": "10.* || >= 12"

packages/eslint-config-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"devDependencies": {
3636
"eslint": "7.6.0",
37-
"typescript": "3.9.7"
37+
"typescript": "3.7.5"
3838
},
3939
"scripts": {
4040
"link:yarn": "yarn link",

packages/eslint-plugin-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"devDependencies": {
2525
"mocha": "^6.2.0",
2626
"prettier": "1.17.0",
27-
"typescript": "3.9.7"
27+
"typescript": "3.7.5"
2828
},
2929
"scripts": {
3030
"link:yarn": "yarn link",

packages/gatsby/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"prettier": "1.17.0",
4343
"react": "^16.13.1",
4444
"rimraf": "^2.6.3",
45-
"typescript": "3.9.7"
45+
"typescript": "3.7.5"
4646
},
4747
"scripts": {
4848
"build": "run-p build:es5 build:esm",

packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"npm-run-all": "^4.1.2",
2828
"prettier": "1.17.0",
2929
"rimraf": "^2.6.3",
30-
"typescript": "3.9.7"
30+
"typescript": "3.7.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

packages/hub/src/hub.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { Scope } from './scope';
2626
/**
2727
* API compatibility version of this hub.
2828
*
29-
* WARNING: This number should only be incresed when the global interface
29+
* WARNING: This number should only be increased when the global interface
3030
* changes and new methods are introduced.
3131
*
3232
* @hidden

packages/integrations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"rollup-plugin-node-resolve": "^4.2.3",
3535
"rollup-plugin-terser": "^4.0.4",
3636
"rollup-plugin-typescript2": "^0.21.0",
37-
"typescript": "3.9.7"
37+
"typescript": "3.7.5"
3838
},
3939
"scripts": {
4040
"build": "run-p build:es5 build:esm build:bundle",

packages/minimal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"npm-run-all": "^4.1.2",
2828
"prettier": "1.17.0",
2929
"rimraf": "^2.6.3",
30-
"typescript": "3.9.7"
30+
"typescript": "3.7.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

packages/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"npm-run-all": "^4.1.2",
3939
"prettier": "1.17.0",
4040
"rimraf": "^2.6.3",
41-
"typescript": "3.9.7"
41+
"typescript": "3.7.5"
4242
},
4343
"scripts": {
4444
"build": "run-p build:es5 build:esm",

packages/node/src/backend.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export class NodeBackend extends BaseBackend<NodeOptions> {
7474
// This handles when someone does: `throw "something awesome";`
7575
// We use synthesized Error here so we can extract a (rough) stack trace.
7676
ex = (hint && hint.syntheticException) || new Error(exception as string);
77+
(ex as Error).message = exception;
7778
}
7879
mechanism.synthetic = true;
7980
}

packages/node/test/index.test.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('SentryNode', () => {
102102
});
103103

104104
test('capture an exception', done => {
105-
expect.assertions(5);
105+
expect.assertions(6);
106106
getCurrentHub().bindClient(
107107
new NodeClient({
108108
beforeSend: (event: Event) => {
@@ -111,6 +111,7 @@ describe('SentryNode', () => {
111111
expect(event.exception!.values![0]).not.toBeUndefined();
112112
expect(event.exception!.values![0].stacktrace!).not.toBeUndefined();
113113
expect(event.exception!.values![0].stacktrace!.frames![2]).not.toBeUndefined();
114+
expect(event.exception!.values![0].value).toEqual('test');
114115
done();
115116
return null;
116117
},
@@ -127,6 +128,33 @@ describe('SentryNode', () => {
127128
}
128129
});
129130

131+
test('capture a string exception', done => {
132+
expect.assertions(6);
133+
getCurrentHub().bindClient(
134+
new NodeClient({
135+
beforeSend: (event: Event) => {
136+
expect(event.tags).toEqual({ test: '1' });
137+
expect(event.exception).not.toBeUndefined();
138+
expect(event.exception!.values![0]).not.toBeUndefined();
139+
expect(event.exception!.values![0].stacktrace!).not.toBeUndefined();
140+
expect(event.exception!.values![0].stacktrace!.frames![2]).not.toBeUndefined();
141+
expect(event.exception!.values![0].value).toEqual('test string exception');
142+
done();
143+
return null;
144+
},
145+
dsn,
146+
}),
147+
);
148+
configureScope((scope: Scope) => {
149+
scope.setTag('test', '1');
150+
});
151+
try {
152+
throw 'test string exception';
153+
} catch (e) {
154+
captureException(e);
155+
}
156+
});
157+
130158
test('capture an exception no pre/post context', done => {
131159
expect.assertions(10);
132160
getCurrentHub().bindClient(

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"react-test-renderer": "^16.13.1",
5656
"redux": "^4.0.5",
5757
"rimraf": "^2.6.3",
58-
"typescript": "3.9.7"
58+
"typescript": "3.7.5"
5959
},
6060
"scripts": {
6161
"build": "run-p build:es5 build:esm",

packages/tracing/.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*
22
!/dist/**/*
3+
!/build/**/*
34
!/esm/**/*
45
*.tsbuildinfo

packages/tracing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"rollup-plugin-node-resolve": "^4.2.3",
4040
"rollup-plugin-terser": "^4.0.4",
4141
"rollup-plugin-typescript2": "^0.21.0",
42-
"typescript": "3.9.7"
42+
"typescript": "3.7.5"
4343
},
4444
"scripts": {
4545
"build": "run-p build:es5 build:esm build:bundle",

packages/tracing/src/browser/browsertracing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export interface BrowserTracingOptions extends RequestInstrumentationOptions {
6363

6464
/**
6565
* beforeNavigate is called before a pageload/navigation transaction is created and allows for users
66-
* to set custom transaction context. Default behaviour is to return `window.location.pathname`.
66+
* to set custom transaction context. Default behavior is to return `window.location.pathname`.
6767
*
6868
* If undefined is returned, a pageload/navigation transaction will not be created.
6969
*/
@@ -203,7 +203,7 @@ export class BrowserTracing implements Integration {
203203
logger.log(`[Tracing] starting ${ctx.op} idleTransaction on scope`);
204204
const idleTransaction = startIdleTransaction(hub, ctx, idleTimeout, true);
205205
idleTransaction.registerBeforeFinishCallback((transaction, endTimestamp) => {
206-
this._metrics.addPerformanceEntires(transaction);
206+
this._metrics.addPerformanceEntries(transaction);
207207
adjustTransactionDuration(secToMs(maxTransactionDuration), transaction, endTimestamp);
208208
});
209209

packages/tracing/src/browser/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class MetricsInstrumentation {
2626
}
2727

2828
/** Add performance related spans to a transaction */
29-
public addPerformanceEntires(transaction: Transaction): void {
29+
public addPerformanceEntries(transaction: Transaction): void {
3030
if (!global || !global.performance || !global.performance.getEntries) {
3131
// Gatekeeper if performance API not available
3232
return;

packages/tracing/src/browser/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export function defaultRoutingInstrumentation<T extends TransactionType>(
3030
/**
3131
* This early return is there to account for some cases where navigation transaction
3232
* starts right after long running pageload. We make sure that if `from` is undefined
33-
* and that a valid `startingURL` exists, we don't uncessarily create a navigation transaction.
33+
* and that a valid `startingURL` exists, we don't unnecessarily create a navigation transaction.
3434
*
35-
* This was hard to duplicate, but this behaviour stopped as soon as this fix
35+
* This was hard to duplicate, but this behavior stopped as soon as this fix
3636
* was applied. This issue might also only be caused in certain development environments
3737
* where the usage of a hot module reloader is causing errors.
3838
*/

packages/tracing/src/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class Transaction extends SpanClass {
7373

7474
if (this.sampled !== true) {
7575
// At this point if `sampled !== true` we want to discard the transaction.
76-
logger.log('Discarding transaction because its trace was not chosen to be sampled.');
76+
logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');
7777
return undefined;
7878
}
7979

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"eslint": "7.6.0",
2121
"npm-run-all": "^4.1.2",
2222
"prettier": "1.17.0",
23-
"typescript": "3.9.7"
23+
"typescript": "3.7.5"
2424
},
2525
"scripts": {
2626
"build": "run-p build:es5 build:esm",

packages/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"peerDependencies": {
1818
"tslint": "5.16.0",
19-
"typescript": "3.9.7"
19+
"typescript": "3.7.5"
2020
},
2121
"scripts": {
2222
"link:yarn": "yarn link",

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"npm-run-all": "^4.1.2",
2828
"prettier": "1.17.0",
2929
"rimraf": "^2.6.3",
30-
"typescript": "3.9.7"
30+
"typescript": "3.7.5"
3131
},
3232
"scripts": {
3333
"build": "run-p build:es5 build:esm",

scripts/verify-packages-versions.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const pkg = require('../package.json');
2+
3+
const TYPESCRIPT_VERSION = '3.7.5';
4+
5+
if (pkg.devDependencies.typescript !== TYPESCRIPT_VERSION) {
6+
console.error(`
7+
[INCORRECT PACKAGE VERSION]: Expected TypeScript v${TYPESCRIPT_VERSION}, got v${pkg.devDependencies.typescript}
8+
9+
Starting version 3.9, TypeScript emits module exports using \`Object.defineProperty\`,
10+
with \`configurable: false\`, instead of \`exports.thing = module.thing;\` as it always used to do.
11+
This means, that any object mutation after the initial compilation are impossible and makes
12+
the package slightly less open for modifications, and prevent users from experimenting with it,
13+
and from implementing some of their scenarios.
14+
15+
If you REALLY know what you are doing, and you REALLY want to use a different version of TypeScript,
16+
modify \`TYPESCRIPT_VERSION\` constant at the top of this file.
17+
18+
change: https://github.com/getsentry/sentry-javascript/pull/2848
19+
ref: https://github.com/getsentry/sentry-javascript/issues/2845
20+
ref: https://twitter.com/wesleytodd/status/1297974661574262784
21+
22+
"Never upgrade a TypeScript version without a major package bump. Just don't." — Kamil
23+
`);
24+
process.exit(1);
25+
}
26+
27+
process.exit(0);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17930,10 +17930,10 @@ typescript-memoize@^1.0.0-alpha.3:
1793017930
dependencies:
1793117931
core-js "2.4.1"
1793217932

17933-
typescript@3.9.7:
17934-
version "3.9.7"
17935-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
17936-
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
17933+
typescript@3.7.5:
17934+
version "3.7.5"
17935+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
17936+
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
1793717937

1793817938
ua-parser-js@^0.7.18:
1793917939
version "0.7.21"

0 commit comments

Comments
 (0)