Skip to content

Commit 4b2082b

Browse files
authored
Merge branch 'master' into abhi-invoke-client
2 parents bedbdc9 + 880efb2 commit 4b2082b

File tree

45 files changed

+1214
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1214
-40
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,14 @@ module.exports = {
3131
'jsdoc/require-jsdoc': 'off',
3232
},
3333
},
34+
{
35+
files: ["scenarios/**"],
36+
parserOptions: {
37+
sourceType: "module",
38+
},
39+
rules: {
40+
"no-console": "off",
41+
},
42+
},
3443
],
3544
};

.github/workflows/build.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,9 @@ jobs:
231231
with:
232232
path: ${{ env.CACHED_BUILD_PATHS }}
233233
key: ${{ env.BUILD_CACHE_KEY }}
234-
- name: Check changed files
235-
id: changed-files-specific
236-
uses: tj-actions/[email protected]
237-
with:
238-
files: .*packages\/ember($|/.*)
239-
# Only run ember tests if the files above have changed
240234
- name: Run Ember tests
241-
if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push'
242235
run: yarn test --scope=@sentry/ember
243236
- name: Compute test coverage
244-
if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push'
245237
uses: codecov/codecov-action@v1
246238

247239
job_artifacts:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ coverage/
1111
scratch/
1212
*.pyc
1313
*.tsbuildinfo
14+
scenarios/*/dist/
1415

1516
# logs
1617
yarn-error.log

.size-limit.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ module.exports = [
1717
import: '{ init }',
1818
limit: '100 KB',
1919
},
20+
{
21+
name: '@sentry/nextjs Client - Webpack',
22+
path: 'packages/nextjs/esm/index.client.js',
23+
import: '{ init }',
24+
limit: '100 KB',
25+
},
2026
{
2127
name: '@sentry/browser + @sentry/tracing - CDN Bundle (gzipped)',
2228
path: 'packages/tracing/build/bundle.tracing.min.js',

packages/ember/config/ember-try.js

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,47 @@
33
const getChannelURL = require('ember-source-channel-url');
44
const { embroiderSafe } = require('@embroider/test-setup');
55

6+
/**
7+
* Pick which versions of ember against which to test based on whether the tests are running locally, as part of a PR,
8+
* or when merging to `master` or creating a release.
9+
*
10+
* @returns The versions which should be tested, along with their respective config
11+
*/
612
module.exports = async function() {
7-
return {
8-
useYarn: true,
9-
scenarios: [
10-
{
11-
name: 'ember-lts-3.20',
12-
npm: {
13-
devDependencies: {
14-
'ember-source': '~3.20.0',
15-
},
13+
// whenever and wherever we test, we want to at least test against the latest version of ember
14+
let scenarios = [
15+
{
16+
name: 'ember-release',
17+
npm: {
18+
devDependencies: {
19+
'ember-source': await getChannelURL('release'),
1620
},
1721
},
22+
},
23+
];
24+
25+
// in CI we add a few more tests - LTS and embroider (which is an ember compiler)
26+
if (process.env.GITHUB_ACTIONS) {
27+
scenarios = scenarios.concat([
1828
{
19-
name: 'ember-release',
29+
name: 'ember-lts-3.20',
2030
npm: {
2131
devDependencies: {
22-
'ember-source': await getChannelURL('release'),
32+
'ember-source': '~3.24.0',
2333
},
2434
},
2535
},
36+
embroiderSafe(),
37+
]);
38+
}
39+
40+
// finally, just to be extra thorough when merging to master and releasing, we add the beta channel and ember
41+
// "classic" (a legacy version which was last current in late 2019)
42+
if (
43+
process.env.GITHUB_EVENT_NAME === 'push' &&
44+
(process.env.GITHUB_HEAD_REF === 'master' || process.env.GITHUB_HEAD_REF.startsWith('release'))
45+
) {
46+
scenarios = scenarios.concat([
2647
{
2748
name: 'ember-beta',
2849
npm: {
@@ -32,7 +53,6 @@ module.exports = async function() {
3253
},
3354
allowedToFail: true,
3455
},
35-
embroiderSafe(),
3656
{
3757
name: 'ember-classic',
3858
env: {
@@ -48,6 +68,11 @@ module.exports = async function() {
4868
},
4969
},
5070
},
51-
],
71+
]);
72+
}
73+
74+
return {
75+
useYarn: true,
76+
scenarios,
5277
};
5378
};

packages/ember/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626
"prepublishOnly": "ember ts:precompile",
2727
"postpublish": "ember ts:clean",
2828
"start": "ember serve",
29-
"test": "node ./scripts/run_tests.js",
30-
"test:ember": "ember test",
31-
"test:ember-compatibility": "ember try:each"
29+
"test": "ember try:each",
30+
"test:all": "node ./scripts/run-CI-tests.js"
3231
},
3332
"dependencies": {
3433
"@embroider/macros": "~0.47.2",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*eslint-env node*/
2+
const { spawnSync } = require('child_process');
3+
4+
console.log('Mimicking the CI environment in order to run tests against multiple versions of Ember');
5+
6+
const result = spawnSync('yarn test', {
7+
shell: true,
8+
stdio: 'inherit',
9+
env: {
10+
...process.env,
11+
GITHUB_ACTIONS: true,
12+
GITHUB_EVENT_NAME: 'push',
13+
GITHUB_HEAD_REF: 'master',
14+
},
15+
});
16+
17+
process.exit(result.status);

packages/ember/scripts/run_tests.js

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

packages/eslint-config-sdk/src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ module.exports = {
186186
ecmaVersion: 2018,
187187
},
188188
},
189+
{
190+
// Configuration for jsx and tsx files
191+
files: ['*.tsx', '*.jsx', '*.test.tsx', '*.test.jsx'],
192+
parserOptions: {
193+
jsx: true,
194+
},
195+
},
189196
],
190197

191198
rules: {

packages/tracing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"build:dev": "run-s build:es5 build:esm",
4646
"build:es5": "tsc -p tsconfig.build.json",
4747
"build:esm": "tsc -p tsconfig.esm.json",
48-
"build:watch": "run-p build:es5:watch build:esm:watch",
48+
"build:watch": "run-p build:es5:watch build:esm:watch build:bundle:watch",
4949
"build:bundle:watch": "rollup --config --watch",
5050
"build:dev:watch": "run-p build:es5:watch build:esm:watch",
5151
"build:es5:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { init, captureException } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
});
6+
7+
captureException(new Error("error here!"));
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-capture-exception",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { init, captureMessage } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
});
6+
7+
captureMessage("this is a message");
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-capture-message",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { init } from "@sentry/browser";
2+
3+
class CustomIntegration {
4+
static id = 'CustomIntegration';
5+
6+
name = CustomIntegration.id;
7+
options = undefined;
8+
9+
constructor(options) {
10+
this.options = options;
11+
}
12+
13+
setupOnce(addGlobalEventProcessor, getCurrentHub) {
14+
addGlobalEventProcessor(event => event);
15+
const hub = getCurrentHub();
16+
hub.captureMessage(options.name);
17+
}
18+
}
19+
20+
init({
21+
dsn: "https://[email protected]/0000000",
22+
integrations: [new CustomIntegration()],
23+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-custom-integration",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { init, Transports } from "@sentry/browser";
2+
3+
class CustomTransport extends Transports.BaseTransport {
4+
constructor(options) {
5+
super(options);
6+
}
7+
8+
sendEvent(event) {
9+
console.log("Sending Event");
10+
return super.sendEvent(event);
11+
}
12+
13+
sendSession(session) {
14+
console.log("Sending Session");
15+
return super.sendSession(session);
16+
}
17+
}
18+
19+
init({
20+
dsn: "https://[email protected]/0000000",
21+
transport: CustomTransport
22+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-custom-transport",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { init } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
sendClientReports: false,
6+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-no-client-reports",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { init } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
defaultIntegrations: false,
6+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-no-default-integrations",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { init } from "@sentry/browser";
2+
3+
init();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-no-dsn",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { init } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
release: "[email protected]",
6+
autoSessionTracking: false,
7+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-no-sessions",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { init } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
debug: true,
6+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-with-debug",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { init } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
release: "[email protected]",
6+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-with-sessions",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { init } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
tunnel: "/errors",
6+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic-with-tunnel",
3+
"private": true,
4+
"version": "0.0.0"
5+
}

scenarios/browser/basic/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { init } from "@sentry/browser";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
});

scenarios/browser/basic/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "basic",
3+
"private": true,
4+
"version": "0.0.0"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { init } from "@sentry/nextjs/esm/index.client";
2+
3+
init({
4+
dsn: "https://[email protected]/0000000",
5+
});

0 commit comments

Comments
 (0)