@bugsee/react-native 0.0.0-stage → 7.0.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BugseeReactNative.podspec +95 -0
- package/LICENSE +21 -0
- package/README.md +557 -2
- package/android/build.gradle +162 -0
- package/android/consumer-rules.pro +2 -0
- package/android/src/main/AndroidManifest.xml +33 -0
- package/android/src/main/java/com/bugsee/reactnative/AppearanceBridge.java +82 -0
- package/android/src/main/java/com/bugsee/reactnative/AttributeBridge.java +209 -0
- package/android/src/main/java/com/bugsee/reactnative/BreadcrumbFilterBridge.java +443 -0
- package/android/src/main/java/com/bugsee/reactnative/BridgeJson.java +168 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeModule.java +1869 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeOptionEnums.java +136 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseePackage.java +42 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeReactNativeWrapper.java +200 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeStatusMapper.java +66 -0
- package/android/src/main/java/com/bugsee/reactnative/BugseeTokens.java +22 -0
- package/android/src/main/java/com/bugsee/reactnative/ConsoleEchoDedup.java +202 -0
- package/android/src/main/java/com/bugsee/reactnative/CreatedReports.java +127 -0
- package/android/src/main/java/com/bugsee/reactnative/DataRequestBridge.java +375 -0
- package/android/src/main/java/com/bugsee/reactnative/ExceptionBridge.java +88 -0
- package/android/src/main/java/com/bugsee/reactnative/ExceptionExecutors.java +33 -0
- package/android/src/main/java/com/bugsee/reactnative/LogFilterBridge.java +375 -0
- package/android/src/main/java/com/bugsee/reactnative/NetworkEvents.java +227 -0
- package/android/src/main/java/com/bugsee/reactnative/NetworkFilterBridge.java +498 -0
- package/android/src/main/java/com/bugsee/reactnative/PluginEndpoint.java +48 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactNativeWebException.java +19 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactNativeWrapperInitProvider.java +61 -0
- package/android/src/main/java/com/bugsee/reactnative/ReactRootOriginTracker.java +867 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportArgs.java +58 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportHandlerBridge.java +336 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportHandlerDeadlines.java +57 -0
- package/android/src/main/java/com/bugsee/reactnative/ReportOps.java +287 -0
- package/android/src/main/java/com/bugsee/reactnative/SecureRectanglePulls.java +113 -0
- package/android/src/main/java/com/bugsee/reactnative/SecureRectangleStore.java +692 -0
- package/android/src/main/java/com/bugsee/reactnative/SpanHandles.java +143 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperChannelHolder.java +137 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperEventBus.java +110 -0
- package/android/src/main/java/com/bugsee/reactnative/WrapperRegistrar.java +54 -0
- package/app.plugin.js +4 -0
- package/ios/BGSRNConsoleCapture.h +52 -0
- package/ios/BGSRNConsoleCapture.mm +344 -0
- package/ios/BugseeModule.h +25 -0
- package/ios/BugseeModule.mm +2728 -0
- package/ios/Package.swift +71 -0
- package/ios/Support/Package.resolved +14 -0
- package/ios/Support/Package.swift +44 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNAttributes.m +52 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReportOps.m +236 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReports.m +184 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNDataRequestBridge.m +431 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNErrorMessage.m +40 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNEventBus.m +70 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNExceptions.m +63 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNGuardedEmit.mm +32 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNJSON.m +40 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNLaunchHold.m +147 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNMainThread.m +23 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkEvents.m +159 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkFilter.m +155 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNPluginEndpoint.m +21 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReactRootOriginTracker.m +63 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReactWindow.m +251 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportArgs.m +47 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportDeadlines.m +8 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportHandlerBridge.m +308 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNReportOps.m +345 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSecureRectangles.m +508 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSettleOnce.m +62 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNSpanHandles.m +136 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNStatusMapper.m +18 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNTokens.m +9 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNValues.m +5 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapper.m +54 -0
- package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapperChannelHolder.m +59 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNAttributes.h +63 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReportOps.h +51 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReports.h +81 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNDataRequestBridge.h +118 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNErrorMessage.h +30 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNEventBus.h +45 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNExceptions.h +31 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNGuardedEmit.h +31 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNJSON.h +25 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNLaunchHold.h +86 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNMainThread.h +32 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkEvents.h +28 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkFilter.h +28 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNPluginEndpoint.h +17 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactRootOriginTracker.h +48 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactWindow.h +135 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportArgs.h +17 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportDeadlines.h +37 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h +94 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h +86 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSecureRectangles.h +198 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSettleOnce.h +25 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSpanHandles.h +49 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNStatusMapper.h +26 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNTokens.h +14 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNValues.h +18 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapper.h +40 -0
- package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h +74 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNAttributesTests.m +194 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportOpsTests.m +274 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportsTests.m +240 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNDataRequestBridgeTests.m +685 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNErrorMessageTests.m +102 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNEventBusTests.m +136 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNExceptionsTests.m +68 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h +41 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.m +166 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNGuardedEmitTests.mm +85 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNJSONTests.m +281 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNLaunchHoldTests.m +230 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNMainThreadTests.m +97 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkEventsTests.m +99 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkFilterTests.m +134 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNPluginEndpointTests.m +38 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactRootOriginTrackerTests.m +210 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactWindowTests.m +548 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportArgsTests.m +51 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportDeadlinesTests.m +22 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m +382 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportOpsTests.m +295 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSecureRectanglesTests.m +568 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSettleOnceTests.m +134 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSpanHandlesTests.m +153 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNStatusMapperTests.m +81 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNValuesTests.m +32 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m +205 -0
- package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperTests.m +66 -0
- package/ios/react-native-spm-prefix.h +10 -0
- package/native-versions.json +10 -0
- package/package.json +62 -3
- package/plugin/build/bundle-phase.d.ts +41 -0
- package/plugin/build/bundle-phase.js +116 -0
- package/plugin/build/bundle-phase.js.map +1 -0
- package/plugin/build/dsym-script.d.ts +32 -0
- package/plugin/build/dsym-script.js +159 -0
- package/plugin/build/dsym-script.js.map +1 -0
- package/plugin/build/endpoint.d.ts +30 -0
- package/plugin/build/endpoint.js +69 -0
- package/plugin/build/endpoint.js.map +1 -0
- package/plugin/build/gradle.d.ts +65 -0
- package/plugin/build/gradle.js +1066 -0
- package/plugin/build/gradle.js.map +1 -0
- package/plugin/build/index.d.ts +85 -0
- package/plugin/build/index.js +217 -0
- package/plugin/build/index.js.map +1 -0
- package/plugin/build/manifest.d.ts +48 -0
- package/plugin/build/manifest.js +69 -0
- package/plugin/build/manifest.js.map +1 -0
- package/plugin/build/native-versions.baked.json +4 -0
- package/plugin/build/native-versions.d.ts +10 -0
- package/plugin/build/native-versions.js +27 -0
- package/plugin/build/native-versions.js.map +1 -0
- package/plugin/build/pbx-string.d.ts +8 -0
- package/plugin/build/pbx-string.js +31 -0
- package/plugin/build/pbx-string.js.map +1 -0
- package/plugin/build/podfile.d.ts +3 -0
- package/plugin/build/podfile.js +28 -0
- package/plugin/build/podfile.js.map +1 -0
- package/plugin/build/properties.d.ts +19 -0
- package/plugin/build/properties.js +41 -0
- package/plugin/build/properties.js.map +1 -0
- package/plugin/build/scheme.d.ts +20 -0
- package/plugin/build/scheme.js +107 -0
- package/plugin/build/scheme.js.map +1 -0
- package/react-native.config.js +26 -0
- package/scripts/bugsee-sourcemaps.gradle +201 -0
- package/scripts/bugsee-xcode.sh +83 -0
- package/scripts/compose-then-inject.js +113 -0
- package/scripts/hermes-sourcemaps.js +634 -0
- package/scripts/hermesc-preserve-js.cmd +6 -0
- package/scripts/hermesc-preserve-js.js +200 -0
- package/scripts/hermesc-preserve-js.sh +7 -0
- package/src/NativeBugsee.ts +622 -0
- package/src/apm/notify.ts +58 -0
- package/src/apm/span.ts +403 -0
- package/src/apm/types.ts +57 -0
- package/src/appearance/report.ts +171 -0
- package/src/architecture.ts +48 -0
- package/src/attributes/errors.ts +39 -0
- package/src/attributes/validate.ts +150 -0
- package/src/breadcrumbs/add.ts +58 -0
- package/src/breadcrumbs/data.ts +33 -0
- package/src/breadcrumbs/filter.ts +215 -0
- package/src/breadcrumbs/types.ts +64 -0
- package/src/bridge/json.ts +110 -0
- package/src/console/capture.ts +180 -0
- package/src/console/dedup.ts +175 -0
- package/src/data/validate.ts +259 -0
- package/src/errorName.ts +32 -0
- package/src/exceptions/ErrorBoundary.tsx +92 -0
- package/src/exceptions/RootErrorReporter.tsx +61 -0
- package/src/exceptions/debugIds.ts +118 -0
- package/src/exceptions/handlers.ts +236 -0
- package/src/exceptions/options.ts +85 -0
- package/src/exceptions/payload.ts +456 -0
- package/src/exceptions/report.ts +170 -0
- package/src/exceptions/sha1.ts +148 -0
- package/src/exceptions/stack.ts +355 -0
- package/src/index.ts +962 -0
- package/src/logs/filter.ts +90 -0
- package/src/logs/log.ts +36 -0
- package/src/network/add.ts +165 -0
- package/src/network/filter.ts +198 -0
- package/src/options/AndroidLaunchOptions.ts +78 -0
- package/src/options/BugseeLaunchOptions.ts +190 -0
- package/src/options/IOSLaunchOptions.ts +57 -0
- package/src/options/android-options-manifest.json +646 -0
- package/src/options/createDefaultLaunchOptions.ts +29 -0
- package/src/options/endpoint.ts +58 -0
- package/src/options/enums.ts +104 -0
- package/src/options/ios-enums.json +19 -0
- package/src/options/keys.ts +39 -0
- package/src/options/option-enums.json +34 -0
- package/src/options/option-keys.json +107 -0
- package/src/report/BugseeReport.ts +264 -0
- package/src/report/CreatedReport.ts +127 -0
- package/src/report/dispatcher.ts +95 -0
- package/src/report/errors.ts +48 -0
- package/src/report/fields.ts +40 -0
- package/src/report/types.ts +157 -0
- package/src/report/validate.ts +197 -0
- package/src/secure/BugseeSecure.tsx +202 -0
- package/src/secure/ancestry.ts +622 -0
- package/src/secure/drivers.ts +342 -0
- package/src/secure/followEvents.ts +57 -0
- package/src/secure/hold.ts +99 -0
- package/src/secure/measureLoop.ts +323 -0
- package/src/secure/nativeAnimation.ts +1005 -0
- package/src/secure/rectangles.ts +93 -0
- package/src/secure/registry.ts +237 -0
- package/src/secure/surface.ts +83 -0
- package/src/secure/tracker.ts +723 -0
- package/src/secure/transition.ts +488 -0
- package/src/secure/unit.ts +22 -0
- package/src/status.ts +16 -0
- package/src/version.ts +9 -0
- package/src/viewtree/anchor.tsx +105 -0
- package/src/viewtree/constants.ts +20 -0
- package/src/viewtree/fiber.ts +251 -0
- package/src/viewtree/requests.ts +347 -0
- package/src/viewtree/walk.ts +902 -0
- package/src/wrapper/channel.ts +33 -0
- package/src/wrapper/collect.ts +52 -0
- package/src/wrapper/events.ts +45 -0
- package/src/wrapper/identity.ts +54 -0
- package/src/wrapper/lifecycle-events.ts +89 -0
package/package.json
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bugsee/react-native",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "7.0.0-beta2",
|
|
4
|
+
"description": "Bugsee SDK for React Native",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://www.bugsee.com",
|
|
7
|
+
"main": "src/index.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"src",
|
|
10
|
+
"!src/**/__tests__",
|
|
11
|
+
"!src/**/__mocks__",
|
|
12
|
+
"android",
|
|
13
|
+
"!android/src/test",
|
|
14
|
+
"ios",
|
|
15
|
+
"app.plugin.js",
|
|
16
|
+
"plugin/build/**",
|
|
17
|
+
"scripts/hermes-sourcemaps.js",
|
|
18
|
+
"scripts/compose-then-inject.js",
|
|
19
|
+
"scripts/bugsee-xcode.sh",
|
|
20
|
+
"scripts/hermesc-preserve-js.js",
|
|
21
|
+
"scripts/hermesc-preserve-js.sh",
|
|
22
|
+
"scripts/hermesc-preserve-js.cmd",
|
|
23
|
+
"scripts/bugsee-sourcemaps.gradle",
|
|
24
|
+
"react-native.config.js",
|
|
25
|
+
"*.podspec",
|
|
26
|
+
"native-versions.json"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@bugsee/cli": "0.7.12",
|
|
30
|
+
"@expo/config-plugins": "~57.0.9"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "*",
|
|
34
|
+
"react-native": ">=0.81.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"react-native": "0.87.1"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build:plugin": "node ../../node_modules/typescript/lib/tsc.js -p plugin/tsconfig.json && node plugin/bake-native-versions.js",
|
|
41
|
+
"prepack": "node ../../scripts/cli-check-releasable-pins.ts && node ../../scripts/cli-pack-native-versions.ts stage",
|
|
42
|
+
"postpack": "node ../../scripts/cli-pack-native-versions.ts unstage"
|
|
43
|
+
},
|
|
44
|
+
"codegenConfig": {
|
|
45
|
+
"name": "RNBugseeSpec",
|
|
46
|
+
"type": "modules",
|
|
47
|
+
"jsSrcsDir": "src",
|
|
48
|
+
"android": {
|
|
49
|
+
"javaPackageName": "com.bugsee.reactnative"
|
|
50
|
+
},
|
|
51
|
+
"ios": {
|
|
52
|
+
"modulesProvider": {
|
|
53
|
+
"Bugsee": "BugseeModule"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git+https://github.com/bugsee/bugsee-react-native.git",
|
|
60
|
+
"directory": "packages/react-native"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
}
|
|
6
65
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "Bundle React Native code and images" shell script from the bare
|
|
3
|
+
* example's pbxproj. It runs `bugsee-xcode.sh`, which makes
|
|
4
|
+
* `REACT_NATIVE_PATH` absolute with `cd`/`pwd`, injects after compose, and
|
|
5
|
+
* uploads the composed map when a real token is configured.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BARE_BUNDLE_SCRIPT: string;
|
|
8
|
+
export interface BundlePhaseSettings {
|
|
9
|
+
/** `false` exports BUGSEE_UPLOAD_SOURCEMAPS=false for bugsee-xcode.sh. */
|
|
10
|
+
readonly uploadSourcemaps?: boolean;
|
|
11
|
+
/** Exported as BUGSEE_PLUGIN_APP_TOKEN, ahead of every other token source. */
|
|
12
|
+
readonly iosAppToken?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The validated `endpoint` option, exported as BUGSEE_ENDPOINT for the
|
|
15
|
+
* source-map upload, ahead of the environment's and credentials.json's.
|
|
16
|
+
*/
|
|
17
|
+
readonly endpoint?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const UNRECOGNISED_BUNDLE_PHASE: string;
|
|
20
|
+
/**
|
|
21
|
+
* Wires bugsee-xcode.sh into the bundle phase. Only the two shapes the
|
|
22
|
+
* templates write are rewritten; any other script is refused rather than
|
|
23
|
+
* guessed at. A phase this plugin already rewrote keeps its body and gets
|
|
24
|
+
* its settings block replaced, so a later prebuild can change them.
|
|
25
|
+
*/
|
|
26
|
+
export declare function rewriteBundlePhase(script: string, settings?: BundlePhaseSettings): string;
|
|
27
|
+
export interface ShellPhase {
|
|
28
|
+
isa?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
shellScript?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface XcodeProjectLike {
|
|
33
|
+
hash?: {
|
|
34
|
+
project?: {
|
|
35
|
+
objects?: {
|
|
36
|
+
PBXShellScriptBuildPhase?: Record<string, ShellPhase | string | undefined>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare function rewriteProjectBundlePhase(project: XcodeProjectLike, settings?: BundlePhaseSettings): void;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNRECOGNISED_BUNDLE_PHASE = exports.BARE_BUNDLE_SCRIPT = void 0;
|
|
4
|
+
exports.rewriteBundlePhase = rewriteBundlePhase;
|
|
5
|
+
exports.rewriteProjectBundlePhase = rewriteProjectBundlePhase;
|
|
6
|
+
const pbx_string_1 = require("./pbx-string");
|
|
7
|
+
/**
|
|
8
|
+
* The "Bundle React Native code and images" shell script from the bare
|
|
9
|
+
* example's pbxproj. It runs `bugsee-xcode.sh`, which makes
|
|
10
|
+
* `REACT_NATIVE_PATH` absolute with `cd`/`pwd`, injects after compose, and
|
|
11
|
+
* uploads the composed map when a real token is configured.
|
|
12
|
+
*/
|
|
13
|
+
exports.BARE_BUNDLE_SCRIPT = [
|
|
14
|
+
'set -e',
|
|
15
|
+
'',
|
|
16
|
+
'WITH_ENVIRONMENT="$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"',
|
|
17
|
+
'BUGSEE_XCODE="${SRCROOT}/../node_modules/@bugsee/react-native/scripts/bugsee-xcode.sh"',
|
|
18
|
+
'',
|
|
19
|
+
'/bin/sh -c "\\"$WITH_ENVIRONMENT\\" \\"$BUGSEE_XCODE\\""',
|
|
20
|
+
'',
|
|
21
|
+
].join('\n');
|
|
22
|
+
/**
|
|
23
|
+
* Expo's bundle phase sets ENTRY_FILE, CLI_PATH and BUNDLE_COMMAND, then
|
|
24
|
+
* runs react-native-xcode.sh. Replacing the whole phase would drop those
|
|
25
|
+
* and the Expo bundle would not be the one bugsee-xcode.sh injects into.
|
|
26
|
+
* Swap only that invocation. Resolve the hook the way Expo resolves
|
|
27
|
+
* react-native-xcode.sh, so a hoisted node_modules still finds it.
|
|
28
|
+
*/
|
|
29
|
+
const EXPO_XCODE_INVOCATION = /`"\$NODE_BINARY" --print "require\('path'\)\.dirname\(require\.resolve\('react-native\/package\.json'\)\) \+ '\/scripts\/react-native-xcode\.sh'"`/;
|
|
30
|
+
const EXPO_REPLACEMENT = [
|
|
31
|
+
'export REACT_NATIVE_PATH="$("$NODE_BINARY" --print "require(\'path\').dirname(require.resolve(\'react-native/package.json\'))")"',
|
|
32
|
+
'BUGSEE_XCODE="$("$NODE_BINARY" --print "require(\'path\').join(require(\'path\').dirname(require.resolve(\'@bugsee/react-native/package.json\')), \'scripts/bugsee-xcode.sh\')")"',
|
|
33
|
+
'/bin/bash "$BUGSEE_XCODE"',
|
|
34
|
+
].join('\n');
|
|
35
|
+
const SETTINGS_BEGIN = '# >>> bugsee settings, written by the @bugsee/react-native config plugin';
|
|
36
|
+
const SETTINGS_END = '# <<< bugsee settings';
|
|
37
|
+
function settingsBlock(settings) {
|
|
38
|
+
const lines = [];
|
|
39
|
+
if (settings.uploadSourcemaps === false) {
|
|
40
|
+
lines.push('export BUGSEE_UPLOAD_SOURCEMAPS=false');
|
|
41
|
+
}
|
|
42
|
+
if (settings.iosAppToken) {
|
|
43
|
+
lines.push(`export BUGSEE_PLUGIN_APP_TOKEN='${settings.iosAppToken}'`);
|
|
44
|
+
}
|
|
45
|
+
if (settings.endpoint) {
|
|
46
|
+
lines.push(`export BUGSEE_ENDPOINT='${settings.endpoint}'`);
|
|
47
|
+
}
|
|
48
|
+
if (lines.length === 0) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return [SETTINGS_BEGIN, ...lines, SETTINGS_END].join('\n');
|
|
52
|
+
}
|
|
53
|
+
function stripSettings(script) {
|
|
54
|
+
const begin = script.indexOf(SETTINGS_BEGIN);
|
|
55
|
+
const end = script.indexOf(SETTINGS_END);
|
|
56
|
+
if (begin < 0 || end < begin) {
|
|
57
|
+
return script;
|
|
58
|
+
}
|
|
59
|
+
let stop = end + SETTINGS_END.length;
|
|
60
|
+
if (script[stop] === '\n') {
|
|
61
|
+
stop += 1;
|
|
62
|
+
}
|
|
63
|
+
return script.slice(0, begin) + script.slice(stop);
|
|
64
|
+
}
|
|
65
|
+
exports.UNRECOGNISED_BUNDLE_PHASE = 'Bundle React Native code and images does not run react-native-xcode.sh the way React Native ' +
|
|
66
|
+
"or Expo's templates do, so the Bugsee hook cannot be wired into it. Run bugsee-xcode.sh " +
|
|
67
|
+
'from that phase yourself, or regenerate it with `expo prebuild --clean`.';
|
|
68
|
+
/**
|
|
69
|
+
* Wires bugsee-xcode.sh into the bundle phase. Only the two shapes the
|
|
70
|
+
* templates write are rewritten; any other script is refused rather than
|
|
71
|
+
* guessed at. A phase this plugin already rewrote keeps its body and gets
|
|
72
|
+
* its settings block replaced, so a later prebuild can change them.
|
|
73
|
+
*/
|
|
74
|
+
function rewriteBundlePhase(script, settings = {}) {
|
|
75
|
+
const base = stripSettings(script);
|
|
76
|
+
let body;
|
|
77
|
+
if (base.includes('bugsee-xcode.sh')) {
|
|
78
|
+
body = base;
|
|
79
|
+
}
|
|
80
|
+
else if (EXPO_XCODE_INVOCATION.test(base)) {
|
|
81
|
+
body = base.replace(EXPO_XCODE_INVOCATION, EXPO_REPLACEMENT);
|
|
82
|
+
}
|
|
83
|
+
else if (base.includes('with-environment.sh') && base.includes('react-native-xcode.sh')) {
|
|
84
|
+
body = exports.BARE_BUNDLE_SCRIPT;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
throw new Error(exports.UNRECOGNISED_BUNDLE_PHASE);
|
|
88
|
+
}
|
|
89
|
+
const block = settingsBlock(settings);
|
|
90
|
+
return block ? `${block}\n${body}` : body;
|
|
91
|
+
}
|
|
92
|
+
function rewriteProjectBundlePhase(project, settings = {}) {
|
|
93
|
+
const section = project.hash?.project?.objects?.PBXShellScriptBuildPhase;
|
|
94
|
+
if (!section) {
|
|
95
|
+
throw new Error('PBXShellScriptBuildPhase is missing from the Xcode project');
|
|
96
|
+
}
|
|
97
|
+
const BUNDLE_PHASE = 'Bundle React Native code and images';
|
|
98
|
+
let found = false;
|
|
99
|
+
// `<id>_comment` entries are strings; a phase is an object.
|
|
100
|
+
for (const phase of Object.values(section)) {
|
|
101
|
+
if (typeof phase !== 'object' || (0, pbx_string_1.decodePbxString)(phase.name ?? '') !== BUNDLE_PHASE) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (typeof phase.shellScript !== 'string') {
|
|
105
|
+
throw new Error('Bundle React Native code and images has no shellScript');
|
|
106
|
+
}
|
|
107
|
+
const quoted = phase.shellScript.startsWith('"');
|
|
108
|
+
const next = rewriteBundlePhase((0, pbx_string_1.decodePbxString)(phase.shellScript), settings);
|
|
109
|
+
phase.shellScript = quoted ? (0, pbx_string_1.encodePbxString)(next) : next;
|
|
110
|
+
found = true;
|
|
111
|
+
}
|
|
112
|
+
if (!found) {
|
|
113
|
+
throw new Error('Bundle React Native code and images build phase not found');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=bundle-phase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-phase.js","sourceRoot":"","sources":["../src/bundle-phase.ts"],"names":[],"mappings":";;;AA0FA,gDAcC;AAkBD,8DA0BC;AApJD,6CAAgE;AAEhE;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG;IAChC,QAAQ;IACR,EAAE;IACF,yEAAyE;IACzE,wFAAwF;IACxF,EAAE;IACF,0DAA0D;IAC1D,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;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,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,MAAM,YAAY,GAAG,qCAAqC,CAAC;IAC3D,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,4DAA4D;IAC5D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAA,4BAAe,EAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,KAAK,YAAY,EAAE,CAAC;YACpF,SAAS;QACX,CAAC;QACD,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACjD,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAA,4BAAe,EAAC,KAAK,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC9E,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,IAAA,4BAAe,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1D,KAAK,GAAG,IAAI,CAAC;IACf,CAAC;IACD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Node --print source. Prints the CLI package.json path, or '' when missing. */
|
|
2
|
+
export declare const RESOLVE_BUGSEE_CLI_PACKAGE: string;
|
|
3
|
+
export declare function resolveNativeCliPackageSource(packageJson: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Stops the post-action, with exit 0 and one warning, when there is no real
|
|
6
|
+
* app token. `xcode post-action` registers the build and uploads dSYMs to the
|
|
7
|
+
* configured endpoint, or to the CLI's own default, production, when none is
|
|
8
|
+
* set; the placeholder token must reach neither. The rule is
|
|
9
|
+
* `isPlaceholderToken` (properties.ts) in POSIX sh: every dash goes first, and
|
|
10
|
+
* whitespace too, because the CLI trims the token before it builds the URL.
|
|
11
|
+
* The character lists are spelled out: a bracket range can follow the locale.
|
|
12
|
+
* Shared with the bare example's scheme (scripts/__tests__/dsym-scheme-post-action.test.ts).
|
|
13
|
+
*/
|
|
14
|
+
export declare const TOKEN_GUARD: readonly string[];
|
|
15
|
+
/**
|
|
16
|
+
* Relays bugsee-cli output with Xcode's `error:` diagnostics turned into
|
|
17
|
+
* `warning: bugsee: ...`, and returns the CLI's exit status. A failed upload
|
|
18
|
+
* must never read as a build error. Post-action output is not parsed for
|
|
19
|
+
* diagnostics, but every place that relays the CLI does this the same way
|
|
20
|
+
* (scripts/hermes-sourcemaps.js `diagnosticSafe`, and the bare example's
|
|
21
|
+
* scheme, which tests this shared text).
|
|
22
|
+
*/
|
|
23
|
+
export declare const CLI_OUTPUT_FILTER: readonly string[];
|
|
24
|
+
/**
|
|
25
|
+
* The Archive post-action script. `bakedToken` is the plugin's iOS token,
|
|
26
|
+
* written into the script so an Archive from the Xcode GUI, which does not
|
|
27
|
+
* inherit a shell environment, still has one. `bakedEndpoint`, the plugin's
|
|
28
|
+
* validated `endpoint` option, is exported the same way, ahead of the
|
|
29
|
+
* environment and credentials.json; without it the CLI keeps its default.
|
|
30
|
+
*/
|
|
31
|
+
export declare function dsymPostActionScript(bakedToken?: string, bakedEndpoint?: string): string;
|
|
32
|
+
export declare const DSYM_POST_ACTION_SCRIPT: string;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Archive post-action inserted into the Expo scheme. After NODE_BINARY is
|
|
3
|
+
// known, ${PROJECT_DIR}/.. is passed to node as the app root. The wrapper is
|
|
4
|
+
// resolved from that root, @bugsee/cli from the wrapper directory (a nested
|
|
5
|
+
// install is not visible from the app root), and the native optional
|
|
6
|
+
// dependency from the CLI directory. Otherwise the JS entry comes from the
|
|
7
|
+
// CLI package bin field. Without a real token (none, or the placeholder) the
|
|
8
|
+
// script stops, exit 0, before any of that (TOKEN_GUARD). A token or endpoint
|
|
9
|
+
// the Expo plugin baked in comes first; the environment and credentials.json
|
|
10
|
+
// follow it.
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DSYM_POST_ACTION_SCRIPT = exports.CLI_OUTPUT_FILTER = exports.TOKEN_GUARD = exports.RESOLVE_BUGSEE_CLI_PACKAGE = void 0;
|
|
13
|
+
exports.resolveNativeCliPackageSource = resolveNativeCliPackageSource;
|
|
14
|
+
exports.dsymPostActionScript = dsymPostActionScript;
|
|
15
|
+
const locateBugseeCliPackage = [
|
|
16
|
+
"const path = require('path');",
|
|
17
|
+
'const appRoot = process.argv[1];',
|
|
18
|
+
"const wrapperPkg = require.resolve('@bugsee/react-native/package.json', { paths: [appRoot] });",
|
|
19
|
+
'const wrapperDir = path.dirname(wrapperPkg);',
|
|
20
|
+
"const cliPkg = require.resolve('@bugsee/cli/package.json', { paths: [wrapperDir] });",
|
|
21
|
+
'const cliDir = path.dirname(cliPkg);',
|
|
22
|
+
].join(' ');
|
|
23
|
+
/** Node --print source. Prints the CLI package.json path, or '' when missing. */
|
|
24
|
+
exports.RESOLVE_BUGSEE_CLI_PACKAGE = `try { ${locateBugseeCliPackage} cliPkg; } catch (e) { '' }`;
|
|
25
|
+
function resolveNativeCliPackageSource(packageJson) {
|
|
26
|
+
return `try { ${locateBugseeCliPackage} require.resolve('${packageJson}', { paths: [cliDir] }); } catch (e) { '' }`;
|
|
27
|
+
}
|
|
28
|
+
const resolveBugseeCliJsSource = `try { const fs = require('fs'); ${locateBugseeCliPackage} const rel = JSON.parse(fs.readFileSync(cliPkg, 'utf8')).bin['bugsee-cli']; rel ? path.join(cliDir, rel) : ''; } catch (e) { '' }`;
|
|
29
|
+
function nodePrint(source) {
|
|
30
|
+
return `"$("$NODE_BINARY" --print "${source}" "$APP_ROOT")"`;
|
|
31
|
+
}
|
|
32
|
+
function tokenSource(bakedToken) {
|
|
33
|
+
if (!bakedToken) {
|
|
34
|
+
return ['TOKEN="$BUGSEE_APP_TOKEN"'];
|
|
35
|
+
}
|
|
36
|
+
return [`TOKEN='${bakedToken}'`, 'if [ -z "$TOKEN" ]; then', ' TOKEN="$BUGSEE_APP_TOKEN"', 'fi'];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Stops the post-action, with exit 0 and one warning, when there is no real
|
|
40
|
+
* app token. `xcode post-action` registers the build and uploads dSYMs to the
|
|
41
|
+
* configured endpoint, or to the CLI's own default, production, when none is
|
|
42
|
+
* set; the placeholder token must reach neither. The rule is
|
|
43
|
+
* `isPlaceholderToken` (properties.ts) in POSIX sh: every dash goes first, and
|
|
44
|
+
* whitespace too, because the CLI trims the token before it builds the URL.
|
|
45
|
+
* The character lists are spelled out: a bracket range can follow the locale.
|
|
46
|
+
* Shared with the bare example's scheme (scripts/__tests__/dsym-scheme-post-action.test.ts).
|
|
47
|
+
*/
|
|
48
|
+
exports.TOKEN_GUARD = [
|
|
49
|
+
'TOKEN_CHECK=$(printf \'%s\' "$TOKEN" | /usr/bin/tr -d \' \\t\\r\\n-\')',
|
|
50
|
+
'if [ -z "$TOKEN_CHECK" ]; then',
|
|
51
|
+
' echo "warning: bugsee: dSYM upload skipped: no app token is configured"',
|
|
52
|
+
' exit 0',
|
|
53
|
+
'fi',
|
|
54
|
+
'case "$TOKEN_CHECK" in',
|
|
55
|
+
' 000000000000[0123456789abcdefABCDEF]000[0123456789abcdefABCDEF]000000000000000)',
|
|
56
|
+
' echo "warning: bugsee: dSYM upload skipped: the app token is the placeholder"',
|
|
57
|
+
' exit 0',
|
|
58
|
+
' ;;',
|
|
59
|
+
'esac',
|
|
60
|
+
];
|
|
61
|
+
/**
|
|
62
|
+
* Relays bugsee-cli output with Xcode's `error:` diagnostics turned into
|
|
63
|
+
* `warning: bugsee: ...`, and returns the CLI's exit status. A failed upload
|
|
64
|
+
* must never read as a build error. Post-action output is not parsed for
|
|
65
|
+
* diagnostics, but every place that relays the CLI does this the same way
|
|
66
|
+
* (scripts/hermes-sourcemaps.js `diagnosticSafe`, and the bare example's
|
|
67
|
+
* scheme, which tests this shared text).
|
|
68
|
+
*/
|
|
69
|
+
exports.CLI_OUTPUT_FILTER = [
|
|
70
|
+
'# An "error:" line reads as a build error to Xcode; a failed upload is a warning.',
|
|
71
|
+
'run_cli() {',
|
|
72
|
+
' CLI_OUT=$("$@" 2>&1)',
|
|
73
|
+
' CLI_RC=$?',
|
|
74
|
+
' if [ -n "$CLI_OUT" ]; then',
|
|
75
|
+
' printf \'%s\\n\' "$CLI_OUT" | /usr/bin/sed -E \'s/^(.*: )?([Ff]atal [Ee]rror|[Ee]rror): (.*)$/warning: bugsee: \\3/\'',
|
|
76
|
+
' fi',
|
|
77
|
+
' return $CLI_RC',
|
|
78
|
+
'}',
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* The Archive post-action script. `bakedToken` is the plugin's iOS token,
|
|
82
|
+
* written into the script so an Archive from the Xcode GUI, which does not
|
|
83
|
+
* inherit a shell environment, still has one. `bakedEndpoint`, the plugin's
|
|
84
|
+
* validated `endpoint` option, is exported the same way, ahead of the
|
|
85
|
+
* environment and credentials.json; without it the CLI keeps its default.
|
|
86
|
+
*/
|
|
87
|
+
function dsymPostActionScript(bakedToken, bakedEndpoint) {
|
|
88
|
+
return [
|
|
89
|
+
'CREDS="${PROJECT_DIR}/../credentials.json"',
|
|
90
|
+
...(bakedEndpoint ? [`export BUGSEE_ENDPOINT='${bakedEndpoint}'`] : []),
|
|
91
|
+
...tokenSource(bakedToken),
|
|
92
|
+
'if [ -z "$TOKEN" ]; then',
|
|
93
|
+
' TOKEN="$BUGSEE_TOKEN_IOS"',
|
|
94
|
+
'fi',
|
|
95
|
+
'if [ -z "$TOKEN" ] && [ -f "$CREDS" ]; then',
|
|
96
|
+
' TOKEN=$(/usr/bin/plutil -extract ios raw -o - "$CREDS" 2>/dev/null || true)',
|
|
97
|
+
'fi',
|
|
98
|
+
...exports.TOKEN_GUARD,
|
|
99
|
+
...exports.CLI_OUTPUT_FILTER,
|
|
100
|
+
'if [ -n "$TOKEN" ]; then',
|
|
101
|
+
' export BUGSEE_APP_TOKEN="$TOKEN"',
|
|
102
|
+
'fi',
|
|
103
|
+
'if [ -z "$BUGSEE_ENDPOINT" ] && [ -f "$CREDS" ]; then',
|
|
104
|
+
' ENDPOINT=$(/usr/bin/plutil -extract endpoint raw -o - "$CREDS" 2>/dev/null || true)',
|
|
105
|
+
' if [ -n "$ENDPOINT" ]; then',
|
|
106
|
+
' export BUGSEE_ENDPOINT="$ENDPOINT"',
|
|
107
|
+
' fi',
|
|
108
|
+
'fi',
|
|
109
|
+
'',
|
|
110
|
+
"# Archive's PATH has no node, and the npm shim's shebang searches PATH.",
|
|
111
|
+
'if [ ! -x "$NODE_BINARY" ]; then',
|
|
112
|
+
' if [ -f "${PROJECT_DIR}/.xcode.env" ]; then',
|
|
113
|
+
' . "${PROJECT_DIR}/.xcode.env"',
|
|
114
|
+
' fi',
|
|
115
|
+
' if [ -f "${PROJECT_DIR}/.xcode.env.local" ]; then',
|
|
116
|
+
' . "${PROJECT_DIR}/.xcode.env.local"',
|
|
117
|
+
' fi',
|
|
118
|
+
'fi',
|
|
119
|
+
'if [ ! -x "$NODE_BINARY" ]; then',
|
|
120
|
+
' RN_FIND=""',
|
|
121
|
+
' if [ -n "$REACT_NATIVE_PATH" ] && [ -f "$REACT_NATIVE_PATH/scripts/find-node-for-xcode.sh" ]; then',
|
|
122
|
+
' RN_FIND="$REACT_NATIVE_PATH/scripts/find-node-for-xcode.sh"',
|
|
123
|
+
' elif [ -f "${PROJECT_DIR}/../node_modules/react-native/scripts/find-node-for-xcode.sh" ]; then',
|
|
124
|
+
' RN_FIND="${PROJECT_DIR}/../node_modules/react-native/scripts/find-node-for-xcode.sh"',
|
|
125
|
+
' fi',
|
|
126
|
+
' if [ -n "$RN_FIND" ]; then',
|
|
127
|
+
' NODE_BINARY=$(/bin/bash -c \'. "$1" >/dev/null 2>&1; command -v node\' _ "$RN_FIND" || true)',
|
|
128
|
+
' fi',
|
|
129
|
+
'fi',
|
|
130
|
+
'if [ -n "$NODE_BINARY" ] && [ -x "$NODE_BINARY" ]; then',
|
|
131
|
+
' PATH="$(dirname "$NODE_BINARY"):$PATH"',
|
|
132
|
+
' export PATH NODE_BINARY',
|
|
133
|
+
' APP_ROOT="${PROJECT_DIR}/.."',
|
|
134
|
+
' if [ "$(uname -m)" = "x86_64" ]; then',
|
|
135
|
+
` NATIVE_PKG=${nodePrint(resolveNativeCliPackageSource('@bugsee/cli-darwin-x64/package.json'))}`,
|
|
136
|
+
' else',
|
|
137
|
+
` NATIVE_PKG=${nodePrint(resolveNativeCliPackageSource('@bugsee/cli-darwin-arm64/package.json'))}`,
|
|
138
|
+
' fi',
|
|
139
|
+
' if [ -n "$NATIVE_PKG" ]; then',
|
|
140
|
+
' NATIVE_BIN="$(dirname "$NATIVE_PKG")/bin/bugsee-cli"',
|
|
141
|
+
' if [ -x "$NATIVE_BIN" ]; then',
|
|
142
|
+
' run_cli "$NATIVE_BIN" xcode post-action',
|
|
143
|
+
' exit $?',
|
|
144
|
+
' fi',
|
|
145
|
+
' fi',
|
|
146
|
+
` CLI_JS=${nodePrint(resolveBugseeCliJsSource)}`,
|
|
147
|
+
' if [ -n "$CLI_JS" ]; then',
|
|
148
|
+
' run_cli "$NODE_BINARY" "$CLI_JS" xcode post-action',
|
|
149
|
+
' exit $?',
|
|
150
|
+
' fi',
|
|
151
|
+
'fi',
|
|
152
|
+
'',
|
|
153
|
+
'echo "bugsee-cli: not found" >&2',
|
|
154
|
+
'exit 1',
|
|
155
|
+
'',
|
|
156
|
+
].join('\n');
|
|
157
|
+
}
|
|
158
|
+
exports.DSYM_POST_ACTION_SCRIPT = dsymPostActionScript();
|
|
159
|
+
//# sourceMappingURL=dsym-script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dsym-script.js","sourceRoot":"","sources":["../src/dsym-script.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,qEAAqE;AACrE,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,aAAa;;;AAcb,sEAEC;AAkED,oDAsEC;AAtJD,MAAM,sBAAsB,GAAG;IAC7B,+BAA+B;IAC/B,kCAAkC;IAClC,gGAAgG;IAChG,8CAA8C;IAC9C,sFAAsF;IACtF,sCAAsC;CACvC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,iFAAiF;AACpE,QAAA,0BAA0B,GAAG,SAAS,sBAAsB,6BAA6B,CAAC;AAEvG,SAAgB,6BAA6B,CAAC,WAAmB;IAC/D,OAAO,SAAS,sBAAsB,qBAAqB,WAAW,6CAA6C,CAAC;AACtH,CAAC;AAED,MAAM,wBAAwB,GAAG,mCAAmC,sBAAsB,mIAAmI,CAAC;AAE9N,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,8BAA8B,MAAM,iBAAiB,CAAC;AAC/D,CAAC;AAED,SAAS,WAAW,CAAC,UAA8B;IACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,CAAC,UAAU,UAAU,GAAG,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,IAAI,CAAC,CAAC;AACpG,CAAC;AAED;;;;;;;;;GASG;AACU,QAAA,WAAW,GAAsB;IAC5C,wEAAwE;IACxE,gCAAgC;IAChC,2EAA2E;IAC3E,UAAU;IACV,IAAI;IACJ,wBAAwB;IACxB,mFAAmF;IACnF,mFAAmF;IACnF,YAAY;IACZ,QAAQ;IACR,MAAM;CACP,CAAC;AAEF;;;;;;;GAO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,QAAQ;QACR,MAAM;QACN,YAAY,SAAS,CAAC,wBAAwB,CAAC,EAAE;QACjD,6BAA6B;QAC7B,wDAAwD;QACxD,aAAa;QACb,MAAM;QACN,IAAI;QACJ,EAAE;QACF,kCAAkC;QAClC,QAAQ;QACR,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAEY,QAAA,uBAAuB,GAAG,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin's `endpoint` option: a self-hosted, staging or regional Bugsee
|
|
3
|
+
* API base. Unset (the default) leaves every tool and both SDKs on their own
|
|
4
|
+
* default, production.
|
|
5
|
+
*
|
|
6
|
+
* The value is the version-EXCLUSIVE base, as `plugin.endpoint` in
|
|
7
|
+
* bugsee.properties and bugsee-cli's BUGSEE_ENDPOINT take it: both add the
|
|
8
|
+
* API version themselves. Only the iOS SDK's runtime option wants the
|
|
9
|
+
* version in it, and `iosRuntimeEndpoint` adds it.
|
|
10
|
+
*
|
|
11
|
+
* The shape is narrow on purpose. The value is written into a properties
|
|
12
|
+
* file, a single-quoted shell word in the bundle phase and the Archive
|
|
13
|
+
* post-action, an Info.plist and AndroidManifest.xml; a value that is safe
|
|
14
|
+
* in all of them, and a URL every one of their readers parses the same way,
|
|
15
|
+
* is https, a host of letters, digits, dots and dashes, an optional port and
|
|
16
|
+
* an optional plain path. Nothing in the error echoes the value.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ENDPOINT_NOT_VALID: string;
|
|
19
|
+
export declare const ENDPOINT_HAS_VERSION: string;
|
|
20
|
+
/**
|
|
21
|
+
* The validated endpoint, without trailing slashes, or undefined when the
|
|
22
|
+
* option is unset or empty. Throws for anything else.
|
|
23
|
+
*/
|
|
24
|
+
export declare function pluginEndpoint(value: unknown): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The iOS SDK's `endpoint` launch option for a validated base. It reads the
|
|
27
|
+
* value verbatim as the versioned API base (src/options/endpoint.ts
|
|
28
|
+
* `endpointFor`), so the version segment is added here.
|
|
29
|
+
*/
|
|
30
|
+
export declare function iosRuntimeEndpoint(base: string): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The plugin's `endpoint` option: a self-hosted, staging or regional Bugsee
|
|
4
|
+
* API base. Unset (the default) leaves every tool and both SDKs on their own
|
|
5
|
+
* default, production.
|
|
6
|
+
*
|
|
7
|
+
* The value is the version-EXCLUSIVE base, as `plugin.endpoint` in
|
|
8
|
+
* bugsee.properties and bugsee-cli's BUGSEE_ENDPOINT take it: both add the
|
|
9
|
+
* API version themselves. Only the iOS SDK's runtime option wants the
|
|
10
|
+
* version in it, and `iosRuntimeEndpoint` adds it.
|
|
11
|
+
*
|
|
12
|
+
* The shape is narrow on purpose. The value is written into a properties
|
|
13
|
+
* file, a single-quoted shell word in the bundle phase and the Archive
|
|
14
|
+
* post-action, an Info.plist and AndroidManifest.xml; a value that is safe
|
|
15
|
+
* in all of them, and a URL every one of their readers parses the same way,
|
|
16
|
+
* is https, a host of letters, digits, dots and dashes, an optional port and
|
|
17
|
+
* an optional plain path. Nothing in the error echoes the value.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.ENDPOINT_HAS_VERSION = exports.ENDPOINT_NOT_VALID = void 0;
|
|
21
|
+
exports.pluginEndpoint = pluginEndpoint;
|
|
22
|
+
exports.iosRuntimeEndpoint = iosRuntimeEndpoint;
|
|
23
|
+
const ENDPOINT_SHAPE = /^https:\/\/[A-Za-z0-9.-]+(?::[0-9]{1,5})?(?:\/[A-Za-z0-9._~%/-]*)?$/;
|
|
24
|
+
const VERSION_SUFFIX = /\/v2$/i;
|
|
25
|
+
exports.ENDPOINT_NOT_VALID = '@bugsee/react-native: endpoint must be an https URL with a host, an optional port and an optional path, ' +
|
|
26
|
+
'and no credentials, query or fragment (for example https://bugsee.example.com)';
|
|
27
|
+
exports.ENDPOINT_HAS_VERSION = '@bugsee/react-native: endpoint must not end in /v2. Give the API base: the Gradle plugin, bugsee-cli ' +
|
|
28
|
+
'and the SDKs add the API version themselves';
|
|
29
|
+
/**
|
|
30
|
+
* The validated endpoint, without trailing slashes, or undefined when the
|
|
31
|
+
* option is unset or empty. Throws for anything else.
|
|
32
|
+
*/
|
|
33
|
+
function pluginEndpoint(value) {
|
|
34
|
+
if (value === undefined || value === null) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
if (typeof value !== 'string') {
|
|
38
|
+
throw new Error(exports.ENDPOINT_NOT_VALID);
|
|
39
|
+
}
|
|
40
|
+
const trimmed = value.trim();
|
|
41
|
+
if (trimmed === '') {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
if (!ENDPOINT_SHAPE.test(trimmed)) {
|
|
45
|
+
throw new Error(exports.ENDPOINT_NOT_VALID);
|
|
46
|
+
}
|
|
47
|
+
// The shape already means https and a host; the parser adds what a regular
|
|
48
|
+
// expression does not say, such as a port above 65535.
|
|
49
|
+
try {
|
|
50
|
+
new URL(trimmed);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
throw new Error(exports.ENDPOINT_NOT_VALID);
|
|
54
|
+
}
|
|
55
|
+
const base = trimmed.replace(/\/+$/, '');
|
|
56
|
+
if (VERSION_SUFFIX.test(base)) {
|
|
57
|
+
throw new Error(exports.ENDPOINT_HAS_VERSION);
|
|
58
|
+
}
|
|
59
|
+
return base;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The iOS SDK's `endpoint` launch option for a validated base. It reads the
|
|
63
|
+
* value verbatim as the versioned API base (src/options/endpoint.ts
|
|
64
|
+
* `endpointFor`), so the version segment is added here.
|
|
65
|
+
*/
|
|
66
|
+
function iosRuntimeEndpoint(base) {
|
|
67
|
+
return `${base}/v2`;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=endpoint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,4BAAoB,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,IAAY;IAC7C,OAAO,GAAG,IAAI,KAAK,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { AndroidConfig } from '@expo/config-plugins';
|
|
2
|
+
/** Every refusal starts with this, then the file, the reason and the manual fix. */
|
|
3
|
+
export declare const CANNOT_EDIT = "@bugsee/react-native cannot edit";
|
|
4
|
+
/**
|
|
5
|
+
* The plugin marker is on Maven Central, not the Plugin Portal. Declaring
|
|
6
|
+
* any repositories block replaces Gradle's implicit Plugin Portal, so a
|
|
7
|
+
* missing block gets the portal, Google, and Maven Central together.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ensureMavenCentral(settingsGradle: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Declares the plugin `apply false` on the root project. A declaration from
|
|
12
|
+
* an earlier prebuild gets this version written over its own, so a
|
|
13
|
+
* `--no-clean` prebuild after a wrapper bump does not keep the old pin.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ensureGradlePluginDeclared(projectBuildGradle: string, version: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* `ndkVersion` is the baked `android.sdk`, or null when native crash
|
|
18
|
+
* reporting is explicitly off. Null strips a direct
|
|
19
|
+
* `implementation "com.bugsee:bugsee-android-ndk"` line from an earlier
|
|
20
|
+
* prebuild and excludes the wrapper's transitive `api` artifact. A
|
|
21
|
+
* configuration exclude does not drop a direct dependency. A later run
|
|
22
|
+
* with the option omitted or on removes that exclude and adds the
|
|
23
|
+
* implementation line. The wrapper `api` itself is left in place.
|
|
24
|
+
*
|
|
25
|
+
* `ndk.debugSymbolLevel` is never written: Bugsee Gradle plugin 4.0.8 and
|
|
26
|
+
* later upload native symbols from the unstripped libraries in
|
|
27
|
+
* `merged_native_libs`, whatever the level, which only decides what AGP packs
|
|
28
|
+
* for Google Play (the app's own choice). The `debugSymbolLevel
|
|
29
|
+
* 'SYMBOL_TABLE'` block earlier versions wrote is removed, recognised by its
|
|
30
|
+
* marker and exact lines only; a level of the user's is left alone. The
|
|
31
|
+
* Hermes preserve command and the finish hook are the JS source-map path,
|
|
32
|
+
* so they are written either way. The hook
|
|
33
|
+
* applies the package's scripts/bugsee-sourcemaps.gradle, which injects the
|
|
34
|
+
* debug id and uploads the composed map unless `bugseeUploadSourcemaps=false`
|
|
35
|
+
* or no real token is configured.
|
|
36
|
+
*/
|
|
37
|
+
export declare function ensureAppAppliesPlugin(appBuildGradle: string, ndkVersion: string | null, log?: (message: string) => void): string;
|
|
38
|
+
export declare const CHANGED_SYMBOL_BLOCK_NOTE = "@bugsee/react-native: android/app/build.gradle has the symbol-table block an earlier version of the plugin wrote, changed inside; it is left as you have it. Bugsee no longer needs ndk.debugSymbolLevel, so you can remove the block, or keep it for Google Play";
|
|
39
|
+
/**
|
|
40
|
+
* The launcher for the host the build runs on: React Native runs
|
|
41
|
+
* hermesCommand through `cmd /c` on Windows, which cannot run a shell
|
|
42
|
+
* script. Chosen when Gradle configures, so one build.gradle serves a repo
|
|
43
|
+
* shared across macOS, Linux and Windows.
|
|
44
|
+
*/
|
|
45
|
+
export declare const HERMES_COMMAND_EXPR = "new File([\"node\", \"--print\", \"require.resolve('@bugsee/react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/scripts/hermesc-preserve-js\" + (System.getProperty(\"os.name\").startsWith(\"Windows\") ? \".cmd\" : \".sh\")";
|
|
46
|
+
/**
|
|
47
|
+
* The value earlier versions wrote: the shell launcher on every host, which
|
|
48
|
+
* a Windows build cannot run. Recognised only as this exact text, and moved
|
|
49
|
+
* to HERMES_COMMAND_EXPR.
|
|
50
|
+
*/
|
|
51
|
+
export declare const LEGACY_HERMES_COMMAND_EXPR = "new File([\"node\", \"--print\", \"require.resolve('@bugsee/react-native/package.json')\"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + \"/scripts/hermesc-preserve-js.sh\"";
|
|
52
|
+
export declare const HERMES_COMMAND_UNREWRITABLE = "@bugsee/react-native cannot edit android/app/build.gradle: react.hermesCommand spans several lines or shares its line with another statement, so it cannot be pointed at scripts/hermesc-preserve-js.sh (.cmd on Windows). Put it alone on one line, or delete it, and prebuild again";
|
|
53
|
+
/**
|
|
54
|
+
* `uploadSymbols: false` on Android: disables every `uploadBugsee*` task
|
|
55
|
+
* (mapping, NDK symbols, build info) inside a marked block. On again
|
|
56
|
+
* removes exactly that block.
|
|
57
|
+
*/
|
|
58
|
+
export declare function ensureSymbolUploads(appBuildGradle: string, enabled: boolean): string;
|
|
59
|
+
export type GradleProperty = AndroidConfig.Properties.PropertiesItem;
|
|
60
|
+
/**
|
|
61
|
+
* `uploadSourcemaps: false` writes `bugseeUploadSourcemaps=false` into
|
|
62
|
+
* android/gradle.properties, which the finish hook reads. On (the default)
|
|
63
|
+
* removes that key.
|
|
64
|
+
*/
|
|
65
|
+
export declare function applyUploadSourcemapsProperty(properties: GradleProperty[], enabled: boolean): GradleProperty[];
|