diff --git a/.github/workflows/e2e-v2.yml b/.github/workflows/e2e-v2.yml index b9500bf7b6..2b9b6e8caa 100644 --- a/.github/workflows/e2e-v2.yml +++ b/.github/workflows/e2e-v2.yml @@ -60,7 +60,7 @@ jobs: - uses: actions/setup-node@v5 with: package-manager-cache: false - node-version: 18 + node-version: 20 cache: 'yarn' cache-dependency-path: yarn.lock @@ -232,7 +232,7 @@ jobs: - uses: actions/setup-node@v5 with: package-manager-cache: false - node-version: 18 + node-version: 20 cache: 'yarn' cache-dependency-path: yarn.lock diff --git a/dev-packages/e2e-tests/cli.mjs b/dev-packages/e2e-tests/cli.mjs index 383391a079..9d8f958b80 100755 --- a/dev-packages/e2e-tests/cli.mjs +++ b/dev-packages/e2e-tests/cli.mjs @@ -103,18 +103,6 @@ if (actions.includes('create')) { env: env, }); - // Only apply the package.json patch for newer RN versions - const versionNumber = parseFloat(RNVersion.replace(/[^\d.]/g, '')); - if (versionNumber >= 0.80) { - execSync(`${patchScriptsDir}/rn.patch.package.json.js --path package.json`, { - stdio: 'inherit', - cwd: appDir, - env: env, - }); - } else { - console.log(`Skipping rn.patch.package.json.js for RN ${RNVersion} (< 0.80)`); - } - // Install dependencies // yalc add doesn't fail if the package is not found - it skips silently. let yalcAddOutput = execSync(`yalc add @sentry/react-native`, { cwd: appDir, env: env, encoding: 'utf-8' }); diff --git a/dev-packages/e2e-tests/patch-scripts/rn.patch.package.json.js b/dev-packages/e2e-tests/patch-scripts/rn.patch.package.json.js deleted file mode 100755 index a36d7693c4..0000000000 --- a/dev-packages/e2e-tests/patch-scripts/rn.patch.package.json.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const path = require('path'); -const { argv, cwd } = require('process'); -const parseArgs = require('minimist'); -const { debug } = require('@sentry/core'); -debug.enable(); - -const args = parseArgs(argv.slice(2), { string: ['app','path','file'], alias: { path: ['file'] } }); - -function resolvePkgPath() { - if (args.path) { - const p = path.resolve(args.path); - if (!p.endsWith('package.json')) throw new Error(`--path must point to package.json, got: ${p}`); - return p; - } - if (args.app) return path.join(path.resolve(args.app), 'package.json'); - return path.join(cwd(), 'package.json'); -} - -const pkgPath = resolvePkgPath(); -if (!fs.existsSync(pkgPath)) throw new Error(`package.json not found at: ${pkgPath}`); - -const raw = fs.readFileSync(pkgPath, 'utf8'); -let pkg; -try { pkg = JSON.parse(raw); } catch (e) { throw new Error(`Invalid JSON: ${e.message}`); } - -const METRO_VERSION = '0.83.2'; - -// List of Metro packages that need to be pinned -const METRO_PACKAGES = [ - 'metro', - 'metro-config' -]; - -pkg.overrides = pkg.overrides || {}; -METRO_PACKAGES.forEach(pkgName => { - pkg.overrides[pkgName] = METRO_VERSION; -}); - -pkg.resolutions = pkg.resolutions || {}; -METRO_PACKAGES.forEach(pkgName => { - pkg.resolutions[pkgName] = METRO_VERSION; -}); - -fs.writeFileSync(pkgPath + '.bak', raw); -fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n'); - -debug.log('Patched package.json: Metro packages set to', METRO_VERSION);