Skip to content

Commit e68254c

Browse files
Merge remote-tracking branch 'origin/main' into kw-fix-capture-envelope-malformed-js-call
2 parents 0c87592 + 01d5710 commit e68254c

File tree

150 files changed

+11761
-4386
lines changed

Some content is hidden

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

150 files changed

+11761
-4386
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ module.exports = {
1313
version: 'detect', // React version. "detect" automatically picks the version you have installed.
1414
},
1515
ignorePatterns: [
16-
'test/react-native/versions/*',
16+
'test/react-native/versions/**/*',
1717
'coverage/**/*',
18+
'test/typescript/**/*',
1819
],
1920
overrides: [
2021
{
@@ -61,5 +62,6 @@ module.exports = {
6162
'@sentry-internal/sdk/no-async-await': 'off',
6263
'@sentry-internal/sdk/no-optional-chaining': 'off',
6364
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
65+
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
6466
},
6567
};

.github/workflows/buildandtest.yml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-node@v3
1717
with:
18-
node-version: 14
18+
node-version: 16
1919
- uses: actions/cache@v3
2020
id: cache
2121
with:
@@ -86,7 +86,7 @@ jobs:
8686
- uses: actions/checkout@v3
8787
- uses: actions/setup-node@v3
8888
with:
89-
node-version: 14
89+
node-version: 16
9090
- uses: actions/cache@v3
9191
id: cache
9292
with:
@@ -97,6 +97,16 @@ jobs:
9797
run: yarn install
9898
- name: Build
9999
run: yarn build
100+
- name: Archive dist
101+
uses: actions/upload-artifact@v3
102+
with:
103+
name: dist
104+
path: dist
105+
- name: Archive ts3.8
106+
uses: actions/upload-artifact@v3
107+
with:
108+
name: ts3.8
109+
path: ts3.8
100110
- name: Pack
101111
run: yarn pack
102112
- name: Archive Artifacts
@@ -106,6 +116,45 @@ jobs:
106116
path: |
107117
${{ github.workspace }}/*.tgz
108118
119+
job_type_check:
120+
name: Type Check Typescript 3.8
121+
runs-on: ubuntu-latest
122+
needs: [job_build]
123+
steps:
124+
- uses: actions/checkout@v3
125+
- uses: actions/setup-node@v3
126+
with:
127+
node-version: 16
128+
- uses: actions/cache@v3
129+
id: cache
130+
with:
131+
path: test/typescript/ts3.8/node_modules
132+
key: ${{ runner.os }}-${{ github.sha }}-ts3.8
133+
- name: Download dist
134+
uses: actions/download-artifact@v3
135+
with:
136+
name: dist
137+
path: dist
138+
- name: Download ts3.8
139+
uses: actions/download-artifact@v3
140+
with:
141+
name: ts3.8
142+
path: ts3.8
143+
- name: Install Global Dependencies
144+
run: yarn global add yalc
145+
- name: Publish SDK
146+
run: yalc publish
147+
- name: Install SDK
148+
working-directory: test/typescript/ts3.8
149+
run: yalc add @sentry/react-native
150+
- name: Install Dependencies
151+
if: ${{ steps.cache.outputs['cache-hit'] != 'true' }}
152+
working-directory: test/typescript/ts3.8
153+
run: yarn install
154+
- name: Type Check
155+
working-directory: test/typescript/ts3.8
156+
run: yarn type-check
157+
109158
job_bundle:
110159
name: Bundle
111160
runs-on: ubuntu-latest
@@ -120,7 +169,7 @@ jobs:
120169
- uses: actions/checkout@v3
121170
- uses: actions/setup-node@v3
122171
with:
123-
node-version: '14'
172+
node-version: 16
124173
- name: Cache Dependencies
125174
uses: actions/cache@v3
126175
id: cache

.github/workflows/codegen.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
platform: ["android"] # "ios" will be added after codegen is fixed
15+
platform: ["android", "ios"]
1616
include:
1717
- platform: android
1818
command: |
1919
cd sample-new-architecture/android
2020
./gradlew generateCodegenArtifactsFromSchema
21+
- platform: ios
22+
command: |
23+
cd sample-new-architecture/ios
24+
node ../node_modules/react-native/scripts/generate-codegen-artifacts.js \
25+
--path .. \
26+
--outputPath codegen
2127
steps:
2228
- uses: actions/checkout@v3
2329
- uses: actions/setup-node@v3

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@a34ca99b4610d924e04c68db79e503e1f79f9f02 # pin@v2
42+
uses: github/codeql-action/init@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # pin@v2
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@a34ca99b4610d924e04c68db79e503e1f79f9f02 # pin@v2
53+
uses: github/codeql-action/autobuild@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # pin@v2
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
@@ -61,4 +61,4 @@ jobs:
6161
# make bootstrap
6262
# make release
6363
- name: Perform CodeQL Analysis
64-
uses: github/codeql-action/analyze@a34ca99b4610d924e04c68db79e503e1f79f9f02 # pin@v2
64+
uses: github/codeql-action/analyze@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # pin@v2

.github/workflows/e2e.yml

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
java-version: '11'
4242
distribution: 'adopt'
4343

44+
- name: Install Global Dependencies
45+
run: brew install xcbeautify
46+
4447
- name: NPM cache
4548
uses: actions/cache@v3
4649
id: deps-cache
@@ -94,21 +97,32 @@ jobs:
9497
'-derivedDataPath' $(cd "DerivedData" ; pwd -P)
9598
)
9699
echo "buildArgs = ${buildArgs[@]}"
97-
xcodebuild \
100+
set -o pipefail && xcodebuild \
98101
-workspace sample.xcworkspace \
99102
-configuration Release \
100103
-scheme sample \
101104
"${buildArgs[@]}" \
102-
build
103-
xcodebuild \
105+
build \
106+
| tee sample-xcodebuild.log \
107+
| xcbeautify --quieter --is-ci --disable-colored-output
108+
set -o pipefail && xcodebuild \
104109
-project ../node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
105110
-scheme WebDriverAgentRunner \
106111
GCC_TREAT_WARNINGS_AS_ERRORS=0 \
107112
COMPILER_INDEX_STORE_ENABLE=NO \
108113
"${buildArgs[@]}" \
109-
build
114+
build \
115+
| tee webdriveragent-xcodebuild.log \
116+
| xcbeautify --quieter --is-ci --disable-colored-output
110117
fi
111118
119+
- name: Upload logs
120+
if: ${{ always() }}
121+
uses: actions/upload-artifact@v3
122+
with:
123+
name: ${{ matrix.platform }}-logs
124+
path: ./sample/ios/*.log
125+
112126
metrics:
113127
runs-on: macos-latest
114128
strategy:
@@ -128,7 +142,7 @@ jobs:
128142
- uses: actions/checkout@v3
129143
- uses: actions/setup-node@v3
130144
with:
131-
node-version: "14"
145+
node-version: 16
132146
- uses: actions/setup-java@v3
133147
with:
134148
java-version: "11"
@@ -151,7 +165,7 @@ jobs:
151165
run: yalc publish
152166
- uses: actions/setup-node@v3
153167
with:
154-
node-version: "16"
168+
node-version: 16
155169
- uses: actions/cache@v3
156170
id: app-plain-cache
157171
with:
@@ -231,11 +245,12 @@ jobs:
231245
name: Build RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
232246
runs-on: macos-latest
233247
env:
248+
RN_SENTRY_POD_NAME: RNSentry
234249
RN_DIFF_REPOSITORY: https://github.com/react-native-community/rn-diff-purge.git
235250
strategy:
236251
fail-fast: false # keeps matrix running if one fails
237252
matrix:
238-
rn-version: ['0.65.3', '0.71.0']
253+
rn-version: ['0.65.3', '0.71.3']
239254
rn-architecture: ['legacy', 'new']
240255
platform: ['android', 'ios']
241256
build-type: ['dev', 'production']
@@ -255,8 +270,10 @@ jobs:
255270
java-version: '11'
256271
distribution: 'adopt'
257272

258-
- name: Setup JS Tools
259-
run: yarn global add yalc semver
273+
- name: Setup Global Tools
274+
run: |
275+
yarn global add yalc semver
276+
brew install xcbeautify
260277
261278
- name: NPM cache SDK
262279
uses: actions/cache@v3
@@ -316,6 +333,7 @@ jobs:
316333
echo "ENABLE_PROD=$ENABLE_PROD"
317334
echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
318335
PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH pod install
336+
cat Podfile.lock | grep $RN_SENTRY_POD_NAME
319337
320338
- name: Patch App RN
321339
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
@@ -358,14 +376,16 @@ jobs:
358376
echo "Building $CONFIG"
359377
mkdir -p "DerivedData"
360378
derivedData="$(cd "DerivedData" ; pwd -P)"
361-
xcodebuild \
379+
set -o pipefail && xcodebuild \
362380
-workspace RnDiffApp.xcworkspace \
363381
-configuration "$CONFIG" \
364382
-scheme RnDiffApp \
365383
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
366384
ONLY_ACTIVE_ARCH=yes \
367385
-derivedDataPath "$derivedData" \
368-
build
386+
build \
387+
| tee xcodebuild.log \
388+
| xcbeautify --quieter --is-ci --disable-colored-output
369389
370390
- name: Archive Android APK
371391
if: matrix.platform == 'android' && matrix.build-type == 'production'
@@ -397,14 +417,21 @@ jobs:
397417
path: app.tar
398418
retention-days: 1
399419

420+
- name: Upload logs
421+
if: ${{ always() }}
422+
uses: actions/upload-artifact@v3
423+
with:
424+
name: rn-build-logs-${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}
425+
path: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios/*.log
426+
400427
react-native-test:
401428
name: Test RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
402429
needs: react-native-build
403430
runs-on: macos-latest
404431
strategy:
405432
fail-fast: false # keeps matrix running if one fails
406433
matrix:
407-
rn-version: ['0.65.3', '0.71.0']
434+
rn-version: ['0.65.3', '0.71.3']
408435
rn-architecture: ['legacy', 'new']
409436
platform: ['android', 'ios']
410437
build-type: ['production']
@@ -422,6 +449,9 @@ jobs:
422449
steps:
423450
- uses: actions/checkout@v3
424451

452+
- name: Setup Global Tools
453+
run: brew install xcbeautify
454+
425455
- name: Download App Package
426456
if: matrix.build-type == 'production'
427457
uses: actions/download-artifact@v3
@@ -456,15 +486,17 @@ jobs:
456486
run: |
457487
mkdir -p "DerivedData"
458488
derivedData="$(cd "DerivedData" ; pwd -P)"
459-
xcodebuild \
489+
set -o pipefail && xcodebuild \
460490
-project node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
461491
-scheme WebDriverAgentRunner \
462492
GCC_TREAT_WARNINGS_AS_ERRORS=0 \
463493
COMPILER_INDEX_STORE_ENABLE=NO \
464494
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
465495
ONLY_ACTIVE_ARCH=yes \
466496
-derivedDataPath "$derivedData" \
467-
build
497+
build \
498+
| tee xcodebuild.log \
499+
| xcbeautify --quieter --is-ci --disable-colored-output
468500
469501
- name: Start Appium Server
470502
working-directory: test/e2e

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
stale:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
10+
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84
1111
with:
1212
repo-token: ${{ github.token }}
1313
days-before-stale: 21

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
build/
1212
DerivedData
1313
dist
14+
ts3.8
1415
coverage
1516

1617
## Various settings

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
!CHANGELOG.md
66
!README.md
77
!/dist/**/*
8+
!ts3.8/**/*
89
!RNSentry.podspec
910
!sentry.gradle
1011
!react-native.config.js

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/test/react-native/versions
2+

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "avoid",
3+
"printWidth": 120,
4+
"proseWrap": "always",
5+
"singleQuote": true,
6+
"trailingComma": "all"
7+
}

0 commit comments

Comments
 (0)