Skip to content

Commit ca5ff47

Browse files
authored
Merge branch 'master' into abhi-jest-upgrade
2 parents 465d239 + 3fef982 commit ca5ff47

File tree

114 files changed

+866
-432
lines changed

Some content is hidden

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

114 files changed

+866
-432
lines changed

.eslintrc.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Note: All paths are relative to the directory in which eslint is being run, rather than the directory where this file
2+
// lives
3+
14
module.exports = {
25
root: true,
36
env: {
@@ -7,20 +10,18 @@ module.exports = {
710
ecmaVersion: 2018,
811
},
912
extends: ['@sentry-internal/sdk'],
10-
ignorePatterns: [
11-
'coverage/**',
12-
'build/**',
13-
'dist/**',
14-
'esm/**',
15-
'examples/**',
16-
'scripts/**',
17-
'test/manual/**',
18-
],
13+
ignorePatterns: ['coverage/**', 'build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**', 'test/manual/**'],
1914
overrides: [
2015
{
2116
files: ['*.ts', '*.tsx', '*.d.ts'],
2217
parserOptions: {
23-
project: './tsconfig.json',
18+
project: ['tsconfig.json'],
19+
},
20+
},
21+
{
22+
files: ['test/**/*.ts', 'test/**/*.tsx'],
23+
parserOptions: {
24+
project: ['tsconfig.test.json'],
2425
},
2526
},
2627
{

.github/workflows/build.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
CACHED_DEPENDENCY_PATHS: |
1111
${{ github.workspace }}/node_modules
1212
${{ github.workspace }}/packages/**/node_modules
13+
~/.cache/ms-playwright/
1314
1415
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
1516

@@ -269,11 +270,17 @@ jobs:
269270
${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip
270271
271272
job_browser_integration_tests:
272-
name: Browser Integration Tests
273+
name: Browser Integration Tests (${{ matrix.browser }})
273274
needs: job_build
274275
runs-on: ubuntu-latest
275-
timeout-minutes: 15
276+
timeout-minutes: 10
276277
continue-on-error: true
278+
strategy:
279+
matrix:
280+
browser:
281+
- ChromeHeadless
282+
- FirefoxHeadless
283+
- WebkitHeadless
277284
steps:
278285
- name: Check out current commit (${{ github.sha }})
279286
uses: actions/checkout@v2
@@ -290,7 +297,35 @@ jobs:
290297
path: ${{ env.CACHED_BUILD_PATHS }}
291298
key: ${{ env.BUILD_CACHE_KEY }}
292299
- name: Run integration tests
300+
env:
301+
KARMA_BROWSER: ${{ matrix.browser }}
293302
run: |
294303
cd packages/browser
304+
[[ $KARMA_BROWSER == WebkitHeadless ]] && yarn run playwright install-deps webkit
295305
yarn test:integration
306+
307+
job_browser_build_tests:
308+
name: Browser Build Tests
309+
needs: job_build
310+
runs-on: ubuntu-latest
311+
timeout-minutes: 5
312+
continue-on-error: true
313+
steps:
314+
- name: Check out current commit (${{ github.sha }})
315+
uses: actions/checkout@v2
316+
- name: Set up Node
317+
uses: actions/setup-node@v1
318+
- name: Check dependency cache
319+
uses: actions/cache@v2
320+
with:
321+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
322+
key: ${{ needs.job_build.outputs.dependency_cache_key }}
323+
- name: Check build cache
324+
uses: actions/cache@v2
325+
with:
326+
path: ${{ env.CACHED_BUILD_PATHS }}
327+
key: ${{ env.BUILD_CACHE_KEY }}
328+
- name: Run build tests
329+
run: |
330+
cd packages/browser
296331
yarn test:package

packages/angular/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@
3737
"typescript": "3.7.5"
3838
},
3939
"scripts": {
40-
"build": "run-p build:es5 build:esm",
40+
"build": "run-p build:cjs build:esm",
41+
"build:cjs": "tsc -p tsconfig.cjs.json",
4142
"build:dev": "run-s build",
42-
"build:es5": "tsc -p tsconfig.build.json",
43+
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
4344
"build:esm": "tsc -p tsconfig.esm.json",
44-
"build:watch": "run-p build:es5:watch build:esm:watch",
45+
"build:watch": "run-p build:cjs:watch build:esm:watch",
46+
"build:cjs:watch": "tsc -p tsconfig.cjs.json -w --preserveWatchOutput",
4547
"build:dev:watch": "run-s build:watch",
46-
"build:es5:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
48+
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4749
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
4850
"circularDepCheck": "madge --circular src/index.ts",
4951
"clean": "rimraf dist esm build coverage",

packages/angular/tsconfig.build.json

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

packages/angular/tsconfig.cjs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"module": "commonjs",
6+
"outDir": "dist"
7+
}
8+
}

packages/angular/tsconfig.esm.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
"extends": "../../tsconfig.esm.json",
2+
"extends": "./tsconfig.json",
3+
34
"compilerOptions": {
4-
"baseUrl": ".",
5-
"outDir": "esm",
6-
"experimentalDecorators": true
7-
},
8-
"include": ["src/**/*"]
5+
"module": "es6",
6+
"outDir": "esm"
7+
}
98
}

packages/angular/tsconfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
2-
"extends": "./tsconfig.build.json",
3-
"include": ["src/**/*.ts"],
4-
"exclude": ["dist"],
2+
"extends": "../../tsconfig.json",
3+
4+
"include": ["src/**/*"],
5+
56
"compilerOptions": {
6-
"rootDir": "."
7+
// package-specific options
8+
"experimentalDecorators": true
79
}
810
}

packages/angular/tsconfig.test.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"include": ["test/**/*"],
5+
6+
"compilerOptions": {
7+
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8+
"types": ["jest"]
9+
10+
// other package-specific, test-specific options
11+
}
12+
}

packages/browser/package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@
3232
"karma": "^4.1.0",
3333
"karma-chai": "^0.1.0",
3434
"karma-chrome-launcher": "^2.2.0",
35+
"karma-firefox-launcher": "^2.1.2",
3536
"karma-mocha": "^1.3.0",
3637
"karma-mocha-reporter": "^2.2.5",
3738
"karma-rollup-preprocessor": "^7.0.0",
3839
"karma-sinon": "^1.0.5",
3940
"karma-typescript": "^4.0.0",
4041
"karma-typescript-es6-transform": "^4.0.0",
42+
"karma-webkit-launcher": "^1.0.2",
4143
"node-fetch": "^2.6.0",
4244
"npm-run-all": "^4.1.2",
45+
"playwright": "^1.17.1",
4346
"prettier": "1.19.0",
4447
"rimraf": "^2.6.3",
4548
"rollup": "^1.10.1",
@@ -53,15 +56,17 @@
5356
"webpack": "^4.30.0"
5457
},
5558
"scripts": {
56-
"build": "run-s build:es5 build:esm build:bundle",
59+
"build": "run-p build:cjs build:esm build:bundle",
5760
"build:bundle": "rollup --config",
58-
"build:dev": "run-s build:es5 build:esm",
59-
"build:es5": "tsc -p tsconfig.build.json",
61+
"build:cjs": "tsc -p tsconfig.cjs.json",
62+
"build:dev": "run-p build:cjs build:esm",
63+
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
6064
"build:esm": "tsc -p tsconfig.esm.json",
61-
"build:watch": "run-p build:es5:watch build:esm:watch build:bundle:watch",
65+
"build:watch": "run-p build:cjs:watch build:esm:watch build:bundle:watch",
6266
"build:bundle:watch": "rollup --config --watch",
63-
"build:dev:watch": "run-p build:es5:watch build:esm:watch",
64-
"build:es5:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
67+
"build:cjs:watch": "tsc -p tsconfig.cjs.json -w --preserveWatchOutput",
68+
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
69+
"build:dev:watch": "run-p build:cjs:watch build:esm:watch",
6570
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
6671
"circularDepCheck": "madge --circular src/index.ts",
6772
"clean": "rimraf dist esm build coverage .rpt2_cache",

packages/browser/rollup.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ const paths = {
3737

3838
const plugins = [
3939
typescript({
40-
tsconfig: 'tsconfig.build.json',
40+
tsconfig: 'tsconfig.esm.json',
4141
tsconfigOverride: {
4242
compilerOptions: {
4343
declaration: false,
4444
declarationMap: false,
45-
module: 'ES2015',
4645
paths,
46+
baseUrl: '.',
4747
},
4848
},
4949
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
@@ -103,13 +103,13 @@ export default [
103103
},
104104
plugins: [
105105
typescript({
106-
tsconfig: 'tsconfig.build.json',
106+
tsconfig: 'tsconfig.esm.json',
107107
tsconfigOverride: {
108108
compilerOptions: {
109109
declaration: false,
110110
declarationMap: false,
111-
module: 'ES2015',
112111
paths,
112+
baseUrl: '.',
113113
target: 'es6',
114114
},
115115
},
@@ -126,13 +126,13 @@ export default [
126126
},
127127
plugins: [
128128
typescript({
129-
tsconfig: 'tsconfig.build.json',
129+
tsconfig: 'tsconfig.esm.json',
130130
tsconfigOverride: {
131131
compilerOptions: {
132132
declaration: false,
133133
declarationMap: false,
134-
module: 'ES2015',
135134
paths,
135+
baseUrl: '.',
136136
target: 'es6',
137137
},
138138
},

packages/browser/test/integration/karma.conf.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
const path = require("path");
22

3+
const playwright = require("playwright");
4+
process.env.CHROME_BIN = playwright.chromium.executablePath();
5+
process.env.FIREFOX_BIN = playwright.firefox.executablePath();
6+
process.env.WEBKIT_HEADLESS_BIN = playwright.webkit.executablePath();
7+
38
const browserstackUsername = process.env.BROWSERSTACK_USERNAME;
49
const browserstackAccessKey = process.env.BROWSERSTACK_ACCESS_KEY;
510
const isLocalRun =
611
browserstackUsername === undefined || browserstackAccessKey === undefined;
712

813
const customLaunchers = isLocalRun ? {} : require("./browsers.js");
9-
const browsers = isLocalRun ? ["ChromeHeadless"] : Object.keys(customLaunchers);
14+
const browsers = isLocalRun
15+
? [process.env.KARMA_BROWSER || "ChromeHeadless"]
16+
: Object.keys(customLaunchers);
1017

1118
// NOTE: It "should" work as a global `build` config option, but it doesn't, so setting it up
1219
// for each browser here, so that we have a nice distinction of when the tests were run exactly.
@@ -28,6 +35,8 @@ const reporters = ["mocha"];
2835

2936
if (isLocalRun) {
3037
plugins.push("karma-chrome-launcher");
38+
plugins.push("karma-firefox-launcher");
39+
plugins.push("karma-webkit-launcher");
3140
} else {
3241
plugins.push("karma-browserstack-launcher");
3342
reporters.push("BrowserStack");

packages/browser/tsconfig.build.json

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

packages/browser/tsconfig.cjs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"module": "commonjs",
6+
"outDir": "dist"
7+
}
8+
}

packages/browser/tsconfig.esm.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"extends": "../../tsconfig.esm.json",
2+
"extends": "./tsconfig.json",
3+
34
"compilerOptions": {
4-
"baseUrl": ".",
5+
"module": "es6",
56
"outDir": "esm"
6-
},
7-
"include": ["src/**/*"]
7+
}
88
}

packages/browser/tsconfig.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"extends": "./tsconfig.build.json",
3-
"include": ["src/**/*", "test/**/*"],
4-
"exclude": ["dist"],
2+
"extends": "../../tsconfig.json",
3+
4+
"include": ["src/**/*"],
5+
56
"compilerOptions": {
6-
"rootDir": ".",
7-
"types": ["node", "mocha", "chai", "sinon", "jest"]
7+
// package-specific options
88
}
99
}

packages/browser/tsconfig.test.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"include": ["test/**/*"],
5+
6+
"compilerOptions": {
7+
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8+
"types": ["node", "mocha", "chai", "sinon", "jest"]
9+
10+
// other package-specific, test-specific options
11+
}
12+
}

packages/core/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@
2929
"typescript": "3.7.5"
3030
},
3131
"scripts": {
32-
"build": "run-p build:es5 build:esm",
32+
"build": "run-p build:cjs build:esm",
33+
"build:cjs": "tsc -p tsconfig.cjs.json",
3334
"build:dev": "run-s build",
34-
"build:es5": "tsc -p tsconfig.build.json",
35+
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
3536
"build:esm": "tsc -p tsconfig.esm.json",
36-
"build:watch": "run-p build:es5:watch build:esm:watch",
37+
"build:watch": "run-p build:cjs:watch build:esm:watch",
38+
"build:cjs:watch": "tsc -p tsconfig.cjs.json -w --preserveWatchOutput",
3739
"build:dev:watch": "run-s build:watch",
38-
"build:es5:watch": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
40+
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3941
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
4042
"circularDepCheck": "madge --circular src/index.ts",
4143
"clean": "rimraf dist esm coverage",

packages/core/tsconfig.build.json

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

packages/core/tsconfig.cjs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"module": "commonjs",
6+
"outDir": "dist"
7+
}
8+
}

0 commit comments

Comments
 (0)