Skip to content

Commit 69c89f9

Browse files
authored
Merge branch 'master' into onur/graphql-tracing-integration
2 parents 053df74 + a72ea44 commit 69c89f9

File tree

100 files changed

+1255
-1474
lines changed

Some content is hidden

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

100 files changed

+1255
-1474
lines changed

.craft.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@ minVersion: '0.23.1'
22
changelogPolicy: simple
33
preReleaseCommand: bash scripts/craft-pre-release.sh
44
targets:
5-
- name: npm
6-
- name: github
7-
includeNames: /^sentry-.*$/
5+
- name: aws-lambda-layer
6+
includeNames: /^sentry-node-serverless-\d+(\.\d+)*\.zip$/
7+
layerName: SentryNodeServerlessSDK
8+
compatibleRuntimes:
9+
- name: node
10+
versions:
11+
- nodejs10.x
12+
- nodejs12.x
13+
- nodejs14.x
14+
license: MIT
815
- name: gcs
916
includeNames: /.*\.js.*$/
1017
bucket: sentry-js-sdk
1118
paths:
1219
- path: /{{version}}/
1320
metadata:
1421
cacheControl: 'public, max-age=31536000'
22+
- name: github
23+
includeNames: /^sentry-.*$/
24+
- name: npm
1525
- name: registry
1626
sdks:
1727
'npm:@sentry/browser':
@@ -34,13 +44,3 @@ targets:
3444
onlyIfPresent: /^sentry-wasm-.*\.tgz$/
3545
'npm:@sentry/nextjs':
3646
onlyIfPresent: /^sentry-nextjs-.*\.tgz$/
37-
- name: aws-lambda-layer
38-
includeNames: /^sentry-node-serverless-\d+(\.\d+)*\.zip$/
39-
layerName: SentryNodeServerlessSDK
40-
compatibleRuntimes:
41-
- name: node
42-
versions:
43-
- nodejs10.x
44-
- nodejs12.x
45-
- nodejs14.x
46-
license: MIT

.eslintrc.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es6: true,
5+
},
6+
parserOptions: {
7+
ecmaVersion: 2018,
8+
},
9+
extends: ['@sentry-internal/sdk'],
10+
ignorePatterns: [
11+
'coverage/**',
12+
'build/**',
13+
'dist/**',
14+
'esm/**',
15+
'examples/**',
16+
'scripts/**',
17+
'test/manual/**',
18+
],
19+
overrides: [
20+
{
21+
files: ['*.ts', '*.tsx', '*.d.ts'],
22+
parserOptions: {
23+
project: './tsconfig.json',
24+
},
25+
},
26+
{
27+
files: ['*.tsx'],
28+
rules: {
29+
// Turn off jsdoc on tsx files until jsdoc is fixed for tsx files
30+
// See: https://github.com/getsentry/sentry-javascript/issues/3871
31+
'jsdoc/require-jsdoc': 'off',
32+
},
33+
},
34+
],
35+
};

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
4747
- name: Install dependencies
4848
if: steps.cache_dependencies.outputs.cache-hit == ''
49-
run: yarn install
49+
run: yarn install --ignore-engines
5050
outputs:
5151
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
5252

@@ -102,6 +102,8 @@ jobs:
102102
uses: actions/checkout@v2
103103
- name: Set up Node
104104
uses: actions/setup-node@v1
105+
with:
106+
node-version: '12'
105107
- name: Check dependency cache
106108
uses: actions/cache@v2
107109
with:

.vscode/extensions.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
4-
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
4+
"recommendations": [
5+
"esbenp.prettier-vscode",
6+
"dbaeumer.vscode-eslint",
7+
"augustocdias.tasks-shell-input"
8+
],
59
}

.vscode/launch.json

Lines changed: 58 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -3,150 +3,95 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
6-
// TODO: these are all alike save the package, so figure out how to make that variable
6+
"inputs": [
7+
{
8+
"id": "getPackageName",
9+
"type": "command",
10+
"command": "shellCommand.execute",
11+
"args": {
12+
"command": "echo '${file}' | sed s/'.*sentry-javascript\\/packages\\/'// | grep --extended-regexp --only-matching --max-count 1 '[^\\/]+' | head -1",
13+
"cwd": "${workspaceFolder}" ,
14+
// normally `input` commands bring up a selector for the user, but given that there should only be one
15+
// choice here, this lets us skip the prompt
16+
"useSingleResult": true
17+
}
18+
}
19+
],
720
"configurations": [
8-
9-
// @sentry/core - run a specific test file in watch mode
10-
// must have file in currently active tab when hitting the play button
21+
// Run a specific test file in watch mode (must have file in currently active tab when hitting the play button).
22+
// NOTE: If you try to run this and VSCode complains that the command `shellCommand.execute` can't be found, go
23+
// install the recommended extension Tasks Shell Input.
1124
{
25+
"name": "Debug unit tests - just open file",
1226
"type": "node",
27+
"cwd": "${workspaceFolder}/packages/${input:getPackageName}",
1328
"request": "launch",
14-
"cwd": "${workspaceFolder}/packages/core",
15-
"name": "Debug @sentry/core tests - just open file",
1629
"program": "${workspaceFolder}/node_modules/.bin/jest",
1730
"args": [
1831
"--watch",
32+
// this makes the output less noisy (and at some point in the past seemed necessary to fix... something)
1933
"--runInBand",
34+
// TODO: when we unify jest config, we may need to change this
2035
"--config",
21-
"${workspaceFolder}/packages/core/package.json",
36+
"${workspaceFolder}/packages/${input:getPackageName}/package.json",
37+
// coverage messes up the source maps
2238
"--coverage",
23-
"false", // coverage messes up the source maps
24-
"${relativeFile}" // remove this to run all package tests
39+
"false",
40+
// remove this to run all package tests
41+
"${relativeFile}"
2542
],
26-
"disableOptimisticBPs": true,
2743
"sourceMaps": true,
2844
"smartStep": true,
29-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
30-
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
45+
// otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on
46+
// "outputCapture" option here; default is to show console logs), but not both
47+
"console": "integratedTerminal",
48+
// since we're not using it, don't automatically switch to it
49+
"internalConsoleOptions": "neverOpen",
3150
},
3251

33-
// @sentry/nextjs - run a specific test file in watch mode
34-
// must have file in currently active tab when hitting the play button
35-
{
36-
"type": "node",
37-
"request": "launch",
38-
"cwd": "${workspaceFolder}/packages/nextjs",
39-
"name": "Debug @sentry/nextjs tests - just open file",
40-
"program": "${workspaceFolder}/node_modules/.bin/jest",
41-
"args": [
42-
"--watch",
43-
"--runInBand",
44-
"--config",
45-
"${workspaceFolder}/packages/nextjs/package.json",
46-
"--coverage",
47-
"false", // coverage messes up the source maps
48-
"${relativeFile}" // remove this to run all package tests
49-
],
50-
"disableOptimisticBPs": true,
51-
"sourceMaps": true,
52-
"smartStep": true,
53-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
54-
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
55-
},
5652

57-
// @sentry/nextjs - run a specific integration test file
58-
// must have file in currently active tab when hitting the play button
53+
// @sentry/nextjs - Run a specific integration test file
54+
// Must have test file in currently active tab when hitting the play button, and must already have run `yarn` in test app directory
5955
{
56+
"name": "Debug @sentry/nextjs integration tests - just open file",
6057
"type": "node",
61-
"request": "launch",
6258
"cwd": "${workspaceFolder}/packages/nextjs",
63-
"name": "Debug @sentry/nextjs integration tests - just open file",
64-
// TODO create a build task
65-
// "preLaunchTask": "yarn build",
59+
"request": "launch",
60+
// since we're not using the normal test runner, we need to make sure we're using the current version of all local
61+
// SDK packages and then manually rebuild the test app
62+
"preLaunchTask": "Prepare nextjs integration test app for debugging",
63+
// running `server.js` directly (rather than running the tests through yarn) allows us to skip having to reinstall
64+
// dependencies on every new test run
6665
"program": "${workspaceFolder}/packages/nextjs/test/integration/test/server.js",
6766
"args": [
6867
"--debug",
6968
// remove these two lines to run all integration tests
7069
"--filter",
7170
"${fileBasename}"
7271
],
73-
"disableOptimisticBPs": true,
74-
"sourceMaps": true,
75-
"skipFiles": [
76-
"<node_internals>/**", "**/tslib/**"
77-
],
78-
},
7972

80-
// @sentry/node - run a specific test file in watch mode
81-
// must have file in currently active tab when hitting the play button
82-
{
83-
"type": "node",
84-
"request": "launch",
85-
"cwd": "${workspaceFolder}/packages/node",
86-
"name": "Debug @sentry/node tests - just open file",
87-
"program": "${workspaceFolder}/node_modules/.bin/jest",
88-
"args": [
89-
"--watch",
90-
"--runInBand",
91-
"--config",
92-
"${workspaceFolder}/packages/node/package.json",
93-
"--coverage",
94-
"false", // coverage messes up the source maps
95-
"${relativeFile}" // remove this to run all package tests
73+
"skipFiles": [
74+
"<node_internals>/**",
75+
// this prevents us from landing in a neverending cycle of TS async-polyfill functions as we're stepping through
76+
// our code
77+
"${workspaceFolder}/node_modules/tslib/**/*"
9678
],
97-
"disableOptimisticBPs": true,
9879
"sourceMaps": true,
99-
"smartStep": true,
100-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
101-
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
102-
},
103-
104-
// @sentry/tracing - run a specific test file in watch mode
105-
// must have file in currently active tab when hitting the play button
106-
{
107-
"type": "node",
108-
"request": "launch",
109-
"cwd": "${workspaceFolder}/packages/tracing",
110-
"name": "Debug @sentry/tracing tests - just open file",
111-
"program": "${workspaceFolder}/node_modules/.bin/jest",
112-
"args": [
113-
"--watch",
114-
"--runInBand",
115-
"--config",
116-
"${workspaceFolder}/packages/tracing/package.json",
117-
"--coverage",
118-
"false", // coverage messes up the source maps
119-
"${relativeFile}" // remove this to run all package tests
80+
// this controls which files are sourcemapped
81+
"outFiles": [
82+
// our SDK code
83+
"${workspaceFolder}/**/dist/**/*.js",
84+
// the built test app
85+
"${workspaceFolder}/packages/nextjs/test/integration/.next/**/*.js",
86+
"!**/node_modules/**"
12087
],
121-
"disableOptimisticBPs": true,
122-
"sourceMaps": true,
123-
"smartStep": true,
124-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
125-
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
126-
},
127-
128-
// @sentry/utils - run a specific test file in watch mode
129-
// must have file in currently active tab when hitting the play button
130-
{
131-
"type": "node",
132-
"request": "launch",
133-
"cwd": "${workspaceFolder}/packages/utils",
134-
"name": "Debug @sentry/utils tests - just open file",
135-
"program": "${workspaceFolder}/node_modules/.bin/jest",
136-
"args": [
137-
"--watch",
138-
"--runInBand",
139-
"--config",
140-
"${workspaceFolder}/packages/utils/package.json",
141-
"--coverage",
142-
"false", // coverage messes up the source maps
143-
"${relativeFile}" // remove this to run all package tests
88+
"resolveSourceMapLocations": [
89+
"${workspaceFolder}/**/dist/**",
90+
"${workspaceFolder}/packages/nextjs/test/integration/.next/**",
91+
"!**/node_modules/**"
14492
],
145-
"disableOptimisticBPs": true,
146-
"sourceMaps": true,
147-
"smartStep": true,
148-
"console": "integratedTerminal", // otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on "outputCapture" option here), but not both
149-
"internalConsoleOptions": "neverOpen", // since we're not using it, don't automatically switch to it
93+
"internalConsoleOptions": "openOnSessionStart"
94+
15095
},
15196
]
15297
}

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558 for documentation about `tasks.json` syntax
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"label": "Prepare nextjs integration test app for VSCode debugger",
7+
"type": "npm",
8+
"script": "predebug",
9+
"path": "packages/nextjs/test/integration/",
10+
"detail": "Link the SDK (if not already linked) and build test app"
11+
}
12+
]
13+
}

0 commit comments

Comments
 (0)