From 356d801a5d19b84ab5f9fa508dff6cf9750ee2ea Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Tue, 23 Jul 2024 17:49:52 +0100 Subject: [PATCH 01/13] Fix Expo v49 test fixture build --- features/fixtures/test-app/app.json | 4 ++-- features/scripts/build-common.sh | 2 +- features/scripts/build-ios.sh | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/features/fixtures/test-app/app.json b/features/fixtures/test-app/app.json index 35dd2033..631447ed 100644 --- a/features/fixtures/test-app/app.json +++ b/features/fixtures/test-app/app.json @@ -20,11 +20,11 @@ ], "ios": { "supportsTablet": true, - "bundleIdentifier": "com.bugsnag.expo.testfixture", + "bundleIdentifier": "com.bugsnag.expo.fixture", "buildNumber": "1" }, "android": { - "package": "com.bugsnag.expo.testfixture", + "package": "com.bugsnag.expo.fixture", "adaptiveIcon": { "foregroundImage": "./assets/adaptive-icon.png", "backgroundColor": "#FFFFFF" diff --git a/features/scripts/build-common.sh b/features/scripts/build-common.sh index 021c43b2..e6bfafee 100755 --- a/features/scripts/build-common.sh +++ b/features/scripts/build-common.sh @@ -36,6 +36,6 @@ yarn import ./run-bugsnag-expo-cli-install -cp $EXPO_UNIVERSAL_CREDENTIALS_DIR/* . +cp $EXPO_CREDENTIALS_DIR/* . echo "Common setup complete" diff --git a/features/scripts/build-ios.sh b/features/scripts/build-ios.sh index 952bc2ff..d13d2ce0 100755 --- a/features/scripts/build-ios.sh +++ b/features/scripts/build-ios.sh @@ -2,6 +2,12 @@ set -e ./features/scripts/build-common.sh +if [[ -z ${EAS_LOCAL_BUILD_WORKINGDIR:-} ]]; then + EAS_LOCAL_BUILD_WORKINGDIR=$BUILDKITE_BUILD_CHECKOUT_PATH/features/fixtures/build + export EAS_LOCAL_BUILD_WORKINGDIR + export EAS_LOCAL_BUILD_SKIP_CLEANUP=1 +fi + pushd features/fixtures/test-app eas build \ From 9f2b5c2c70d02b0acdc8b89a6646a83db202f1c1 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Tue, 23 Jul 2024 18:13:16 +0100 Subject: [PATCH 02/13] Use macOS 14 build machines --- .buildkite/pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index fe1cdf31..dde58117 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -5,7 +5,7 @@ steps: - label: ':copyright: License Audit' timeout_in_minutes: 20 agents: - queue: opensource-arm-mac-cocoa-12 + queue: "macos-14" env: DEVELOPER_DIR: "/Applications/Xcode13.app" command: scripts/license_finder.sh @@ -14,7 +14,7 @@ steps: key: "build-expo-apk" timeout_in_minutes: 20 agents: - queue: "opensource-arm-mac-cocoa-12" + queue: "macos-14" env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} artifact_paths: build/output.apk @@ -25,7 +25,7 @@ steps: key: "build-expo-ipa" timeout_in_minutes: 20 agents: - queue: "opensource-arm-mac-cocoa-12" + queue: "macos-14" env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} DEVELOPER_DIR: "/Applications/Xcode14.app" From 36ee3bf0fe98cff4e4d700b13503a0a9fec2ceea Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Tue, 23 Jul 2024 19:35:39 +0100 Subject: [PATCH 03/13] Correct Xcode version --- .buildkite/pipeline.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index dde58117..15450cd8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -6,8 +6,6 @@ steps: timeout_in_minutes: 20 agents: queue: "macos-14" - env: - DEVELOPER_DIR: "/Applications/Xcode13.app" command: scripts/license_finder.sh - label: ':android: Build expo APK' @@ -28,7 +26,7 @@ steps: queue: "macos-14" env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} - DEVELOPER_DIR: "/Applications/Xcode14.app" + DEVELOPER_DIR: "/Applications/Xcode-15.app" artifact_paths: build/output.ipa commands: - bundle install From 56f94f0a22e366276c85df249074c25555921ca5 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Tue, 23 Jul 2024 19:41:50 +0100 Subject: [PATCH 04/13] Fix versions --- .buildkite/pipeline.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 15450cd8..1e3e43c7 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -15,6 +15,8 @@ steps: queue: "macos-14" env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} + NODE_VERSION: "18.18" + JAVA_VERSION: "17" artifact_paths: build/output.apk commands: - features/scripts/build-android.sh @@ -26,7 +28,7 @@ steps: queue: "macos-14" env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} - DEVELOPER_DIR: "/Applications/Xcode-15.app" + XCODE_VERSION: "15.3.0" artifact_paths: build/output.ipa commands: - bundle install From 3435f850f2b937f822aad1c59aeef780e4e0fac5 Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Mon, 5 Feb 2024 17:32:20 +0000 Subject: [PATCH 05/13] configure test fixture for monorepo use --- features/fixtures/test-app/.gitignore | 31 +++++++++++++++++----- features/fixtures/test-app/index.js | 8 ++++++ features/fixtures/test-app/metro.config.js | 30 ++++++++++++--------- features/fixtures/test-app/package.json | 2 +- 4 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 features/fixtures/test-app/index.js diff --git a/features/fixtures/test-app/.gitignore b/features/fixtures/test-app/.gitignore index e093f3a7..05647d55 100644 --- a/features/fixtures/test-app/.gitignore +++ b/features/fixtures/test-app/.gitignore @@ -1,18 +1,35 @@ +# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files + +# dependencies node_modules/ + +# Expo .expo/ dist/ -npm-debug.* +web-build/ + +# Native +*.orig.* *.jks *.p8 *.p12 *.key *.mobileprovision -scenario.json -bugsnag-expo-*.tgz -android -ios -*.orig.* -web-build/ + +# Metro +.metro-health-check* + +# debug +npm-debug.* +yarn-debug.* +yarn-error.* # macOS .DS_Store +*.pem + +# local env files +.env*.local + +# typescript +*.tsbuildinfo diff --git a/features/fixtures/test-app/index.js b/features/fixtures/test-app/index.js new file mode 100644 index 00000000..1d6e981e --- /dev/null +++ b/features/fixtures/test-app/index.js @@ -0,0 +1,8 @@ +import { registerRootComponent } from 'expo'; + +import App from './App'; + +// registerRootComponent calls AppRegistry.registerComponent('main', () => App); +// It also ensures that whether you load the app in Expo Go or in a native build, +// the environment is set up appropriately +registerRootComponent(App); diff --git a/features/fixtures/test-app/metro.config.js b/features/fixtures/test-app/metro.config.js index b50e5d17..83df2a55 100644 --- a/features/fixtures/test-app/metro.config.js +++ b/features/fixtures/test-app/metro.config.js @@ -1,15 +1,21 @@ -const { getDefaultConfig } = require('@expo/metro-config'); +const { getDefaultConfig } = require('expo/metro-config'); +const path = require('path'); -const defaultConfig = getDefaultConfig(__dirname); +// Find the project and workspace directories +const projectRoot = __dirname; +// This can be replaced with `find-yarn-workspace-root` +const workspaceRoot = path.resolve(projectRoot, '../..'); -defaultConfig.resolver.extraNodeModules = { - 'expo': `${__dirname}/node_modules/expo`, - 'expo-modules-core': `${__dirname}/node_modules/expo-modules-core`, - 'react-native': `${__dirname}/node_modules/react-native`, - 'react': `${__dirname}/node_modules/react`, - '@babel/runtime': `${__dirname}/node_modules/@babel/runtime`, - 'promise': `${__dirname}/node_modules/promise`, - '@unimodules/core': `${__dirname}/node_modules/@unimodules/core`, -} +const config = getDefaultConfig(projectRoot); -module.exports = defaultConfig; +// 1. Watch all files within the monorepo +config.watchFolders = [workspaceRoot]; +// 2. Let Metro know where to resolve packages and in what order +config.resolver.nodeModulesPaths = [ + path.resolve(projectRoot, 'node_modules'), + path.resolve(workspaceRoot, 'node_modules'), +]; +// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths` +// config.resolver.disableHierarchicalLookup = true; + +module.exports = config; diff --git a/features/fixtures/test-app/package.json b/features/fixtures/test-app/package.json index f3609a04..c658879d 100644 --- a/features/fixtures/test-app/package.json +++ b/features/fixtures/test-app/package.json @@ -1,7 +1,7 @@ { "name": "test-fixture", "version": "1.0.0", - "main": "node_modules/expo/AppEntry.js", + "main": "index.js", "scripts": { "start": "expo start", "android": "expo start --android", From 6ff4634529c2023e7fdd1760f05da12270dd8879 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Wed, 24 Jul 2024 10:52:21 +0100 Subject: [PATCH 06/13] Updates for monorepo --- .gitignore | 1 + features/fixtures/test-app/metro.config.js | 2 +- package.json | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7bfbf44b..268dd1d4 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ compile_commands.json .cache .clangd package-lock.json +yarn.lock /config diff --git a/features/fixtures/test-app/metro.config.js b/features/fixtures/test-app/metro.config.js index 83df2a55..6a873c9b 100644 --- a/features/fixtures/test-app/metro.config.js +++ b/features/fixtures/test-app/metro.config.js @@ -4,7 +4,7 @@ const path = require('path'); // Find the project and workspace directories const projectRoot = __dirname; // This can be replaced with `find-yarn-workspace-root` -const workspaceRoot = path.resolve(projectRoot, '../..'); +const workspaceRoot = path.resolve(projectRoot, '../../..'); const config = getDefaultConfig(projectRoot); diff --git a/package.json b/package.json index 78deb6c5..4d3f2696 100644 --- a/package.json +++ b/package.json @@ -22,5 +22,9 @@ "test:lint": "eslint --report-unused-disable-directives --max-warnings=0 .", "local-npm:start": "verdaccio --config ./verdaccio-config.yml", "local-npm:publish-all": "lerna publish --yes --force-publish --exact --no-push --no-git-reset --no-git-tag-version --registry 'http://localhost:4873'" - } + }, + "private": true, + "workspaces": [ + "packages/*", "features/fixtures/test-app" + ] } From 1e352839d22e49c33f0e4c549a35c7b9067b48a7 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Wed, 24 Jul 2024 11:02:24 +0100 Subject: [PATCH 07/13] Use new style build script --- features/scripts/build-common.sh | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/features/scripts/build-common.sh b/features/scripts/build-common.sh index e6bfafee..ae216b07 100755 --- a/features/scripts/build-common.sh +++ b/features/scripts/build-common.sh @@ -7,20 +7,12 @@ git clean -xfdf # And the yarn cache is clean yarn cache clean --all -# Install expo requirements -npm install - -# Bump package versions to a high value so only our values will match -npx lerna version 999.999.999 --no-git-tag-version --no-push --no-changelog --yes - -# Pack the packages and move them to the test fixture -npm pack packages/*/ -mv *.tgz features/fixtures/test-app +# Install repo dependencies +yarn install cd features/fixtures/test-app -# Install the bugsnag-expo-cli and run setup -npm install bugsnag-expo-cli*.tgz +# Set the api key via the CLI ./run-bugsnag-expo-cli # Set EAS Project ID @@ -29,13 +21,8 @@ sed -i '' "s/EXPO_EAS_PROJECT_ID/$EXPO_EAS_PROJECT_ID/g" app.json # set bugsnag-js override versions if this build was triggered from the bugsnag-js repo ./set-bugsnag-js-overrides $BUGSNAG_JS_BRANCH $BUGSNAG_JS_COMMIT -# install the remaining packages, this also re-installs the correct @bugsnag/expo version -npm install *.tgz -npm install -yarn import - ./run-bugsnag-expo-cli-install -cp $EXPO_CREDENTIALS_DIR/* . +cp $EXPO_UNIVERSAL_CREDENTIALS_DIR/* . echo "Common setup complete" From 2d936322496fafacfb35bac77f98177d0e0f826e Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Wed, 24 Jul 2024 12:07:19 +0200 Subject: [PATCH 08/13] Add bugsnag deps to test fixture --- features/fixtures/test-app/package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/features/fixtures/test-app/package.json b/features/fixtures/test-app/package.json index c658879d..d14765a2 100644 --- a/features/fixtures/test-app/package.json +++ b/features/fixtures/test-app/package.json @@ -9,6 +9,7 @@ "web": "expo start --web" }, "dependencies": { + "@bugsnag/expo": "*", "@react-native-community/netinfo": "9.3.10", "expo": "^49.0.0", "expo-application": "~5.3.0", @@ -22,7 +23,10 @@ "react-native": "0.72.3" }, "devDependencies": { - "@babel/core": "^7.20.0" + "@babel/core": "^7.20.0", + "@bugsnag/plugin-expo-eas-sourcemaps": "*", + "@bugsnag/source-maps": "^2.3.1", + "bugsnag-expo-cli": "*" }, "private": true } From 42a4ba5e65cc5a8f32265b0accba803cc0e39bbe Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Wed, 24 Jul 2024 11:16:05 +0100 Subject: [PATCH 09/13] Correct env var --- features/scripts/build-common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/scripts/build-common.sh b/features/scripts/build-common.sh index ae216b07..45909849 100755 --- a/features/scripts/build-common.sh +++ b/features/scripts/build-common.sh @@ -23,6 +23,6 @@ sed -i '' "s/EXPO_EAS_PROJECT_ID/$EXPO_EAS_PROJECT_ID/g" app.json ./run-bugsnag-expo-cli-install -cp $EXPO_UNIVERSAL_CREDENTIALS_DIR/* . +cp $EXPO_CREDENTIALS_DIR/* . echo "Common setup complete" From 9d55a1a8135aff83f3d562d9e8e5d493af9aff3d Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Wed, 24 Jul 2024 12:23:02 +0200 Subject: [PATCH 10/13] Set node version for iOS build --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1e3e43c7..74481bfc 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -29,6 +29,7 @@ steps: env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} XCODE_VERSION: "15.3.0" + NODE_VERSION: "18.18" artifact_paths: build/output.ipa commands: - bundle install From d9820fd8d30579305001e5d6835413b0b10cab92 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Wed, 24 Jul 2024 12:03:56 +0100 Subject: [PATCH 11/13] Corrections --- .buildkite/pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 1e3e43c7..cacc9af8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,3 +1,6 @@ +agents: + queue: "opemnsource" + steps: # # License audit @@ -28,6 +31,7 @@ steps: queue: "macos-14" env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} + NODE_VERSION: "18.18" XCODE_VERSION: "15.3.0" artifact_paths: build/output.ipa commands: From 8227bb49dbf51fb597b7760b0fb7731e9e7abcbf Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Wed, 24 Jul 2024 12:24:03 +0100 Subject: [PATCH 12/13] Correct queue name --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 7a9f31e5..a22fd178 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,5 +1,5 @@ agents: - queue: "opemnsource" + queue: "opensource" steps: # From 1e523ddec0bd99f26239ffac19b8c0d15c90c05b Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Wed, 24 Jul 2024 13:19:41 +0100 Subject: [PATCH 13/13] Remove duplicated variable --- .buildkite/pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a22fd178..862c8c4c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -31,7 +31,6 @@ steps: queue: "macos-14" env: EXPO_RELEASE_CHANNEL: ${BUILDKITE_BUILD_ID} - NODE_VERSION: "18.18" XCODE_VERSION: "15.3.0" NODE_VERSION: "18.18" artifact_paths: build/output.ipa