microsoft / rnx-kit

Modern, scalable tools. Exceptional developer experience.
https://microsoft.github.io/rnx-kit/
MIT License
1.53k stars 97 forks source link

align-deps not aware of dependencies of react-native-code-push #3082

Closed chetstone closed 7 months ago

chetstone commented 7 months ago

What happened?

I just upgraded react-native from 0.70 to 0.71. After making all the required changes to RN template files, I ran rnx-align-deps and inspected the results. It did not tell me my react-native-code-push was incompatible with 0.71. I had to track down a very inscrutable error message until I finally found this issue and realized I needed to update RNCodePush.

If I hadn't had access to rnx-kit align-deps I probably would have checked code-push compatibility before trying to build, because I am aware it's one of the packages that can have this problem. But I was counting on align-deps to find these dependencies, and I would have thought that since code-push is a popular package, and built by (ahem), the same company, that it would be included.

Perhaps I'm misunderstanding what I should be expecting from align-deps?

Affected Package

@rnx-kit/align-deps

Version

2.4.2

Which platforms are you seeing this issue on?

System Information

info Fetching system and libraries information...
System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 112.56 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 18.12.1 - ~/.nodenv/versions/18.12.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - ~/.nodenv/versions/18.12.1/bin/npm
    Watchman: 2022.11.28.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.1 - /Users/chet/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 2023.2 AI-232.10300.40.2321.11567975
    Xcode: 15.2/15C500b - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.18 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.18 => 0.71.18 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to Reproduce

This is my package.json

{
  "name": "MalaMode",
  "version": "3.0.3",
  "license": "UNLICENSED",
  "private": "true",
  "type": "app",
  "description": "Firebase-based counter",
  "bundleId": "io.malamode.MalaMode",
  "scripts": {
    "android": "react-native run-android --appId io.malamode.debug --port 8082",
    "droid": "react-native run-android --variant=releaseStaging --appId io.malamode.staging",
    "ndroid": "react-native run-android --appIdSuffix \"\"",
    "cli-version": "react-native --version",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "version": "react-native-version --never-amend --target ios && git add .",
    "postinstall": "patch-package",
    "clean": "react-native-clean-project",
    "prettier": "prettier --write .",
    "check-dependencies": "rnx-align-deps",
    "fix-dependencies": "rnx-align-deps --write",
    "tests-all": "mocha -u exports -R spec --compilers js:babel/register --require babel-core/external-helpers test",
    "test": "jest"
  },
  "prettier": {
    "singleQuote": true
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@bugsnag/source-maps": "^2.3.1",
    "@react-native-community/eslint-config": "^3.2.0",
    "@rnx-kit/align-deps": "^2.4.2",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^29.2.1",
    "@types/react": "^18.0.24",
    "@types/react-test-renderer": "^18.0.0",
    "babel-core": "^6.0.0",
    "babel-jest": "^29.2.1",
    "babel-polyfill": "^6.9.1",
    "babel-preset-es2015": "^6.5.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-1": "^6.5.0",
    "babelify": "^6.1.3",
    "browserify": "^11.0.1",
    "code-push": "^1.10.0-beta",
    "eslint": "^8.19.0",
    "express": "^4.12.3",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.73.10",
    "node-libs-browser": "^0.5.2",
    "patch-package": "^6.2.0",
    "postinstall-postinstall": "^2.0.0",
    "prettier": "2.0.5",
    "proxy-middleware": "^0.11.0",
    "react-test-renderer": "18.2.0",
    "require-from": "^0.10.0",
    "source-map": "^0.5.6",
    "typescript": "4.8.4"
  },
  "dependencies": {
    "@bugsnag/react-native": "^7.18.0",
    "@firebase/app-types": "0.x",
    "@react-native-async-storage/async-storage": "1.17.11",
    "@react-native-community/datetimepicker": "^6.7.5",
    "@react-native-community/netinfo": "^9.0.0",
    "@react-native-community/push-notification-ios": "1.10.1",
    "@react-native-community/slider": "^4.3.1",
    "@react-navigation/bottom-tabs": "^6.5.7",
    "@react-navigation/drawer": "^6.x",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/native-stack": "^6.9.12",
    "@react-navigation/stack": "^6.3.16",
    "@types/alt": "^0.16.39",
    "alt": "=0.17.1",
    "alt-mixins": "chetstone/mixins#chetstone-patch-1",
    "create-react-class": "^15.6.3",
    "debug": "chetstone/debug#no-document",
    "deep-equal": "^1.0.1",
    "deprecated-react-native-prop-types": "^5.0.0",
    "firebase": "10",
    "hoist-non-react-statics": "^3.3.0",
    "localforage": "^1.2.7",
    "markdown-to-react-components": "^0.2.0",
    "moment": "^2.10.6",
    "moment-duration-format": "^2.2.2",
    "prop-types": "^15.7.2",
    "react": "18.2.0",
    "react-bootstrap": "^0.28.3",
    "react-dom": "^18.1.0",
    "react-native": "0.71.18",
    "react-native-button": "^3.0.1",
    "react-native-code-push": "^7.1.0",
    "react-native-device-info": "https://github.com/chetstone/react-native-device-info.git#rn70",
    "react-native-dialog-input": "^1.0.8",
    "react-native-draggable-flatlist": "^4.0.1",
    "react-native-gesture-handler": "^2.9.0",
    "react-native-iap": "^12.3.2",
    "react-native-idle-timer": "^2.1.6",
    "react-native-image-base64": "^0.1.4",
    "react-native-image-picker": "^5.3.1",
    "react-native-image-resizer": "^1.4.5",
    "react-native-mail": "^4.0.0",
    "react-native-modal-datetime-picker": "^11.0.0",
    "react-native-palette": "^1.2.2",
    "react-native-push-notification": "^8.1.1",
    "react-native-radio-buttons": "^1.0.0",
    "react-native-reanimated": "^2.x",
    "react-native-safe-area-context": "^4.5.0",
    "react-native-screens": "^3.20.0",
    "react-native-sortable-list": "gitim/react-native-sortable-list#78c8ec0e66ba792784131065fbeab3f365deb0dc",
    "react-native-sound": "^0.11.0",
    "react-native-spinkit": "^1.5.1",
    "react-native-status-bar-height": "^2.5.0",
    "react-native-swipe-list-view": "^2.5.0",
    "react-native-tableview": "^3.0.0",
    "react-native-tableview-simple": "^3.2.0",
    "react-native-tabs": "^1.0.9",
    "react-native-vector-icons": "^9.2.0",
    "react-native-watch-connectivity": "^1.1.0",
    "react-native-webview": "^11.23.0",
    "react-navigation-props-mapper": "^3.1.0",
    "react-timer-mixin": "^0.13.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "resolutions": {
    "@types/react": "=16.9.0"
  },
  "rnx-kit": {
    "kitType": "app",
    "alignDeps": {
      "presets": [
        "microsoft/react-native"
      ],
      "requirements": [
        "react-native@0.71"
      ],
      "capabilities": [
        "animation",
        "babel-preset-react-native",
        "core",
        "core-android",
        "core-ios",
        "datetime-picker",
        "gestures",
        "jest",
        "navigation/native",
        "navigation/stack",
        "netinfo",
        "react",
        "react-dom",
        "react-test-renderer",
        "safe-area",
        "screens",
        "storage",
        "webview"
      ]
    }
  }
}

Code of Conduct

kelset commented 7 months ago

The whole list of packages that are part of the default preset (as mentioned in many places across the documentation) can be found here: https://github.com/microsoft/rnx-kit/tree/main/packages/align-deps#capabilities

As you can see there, codepush is not one of those. That's precisely why we have a way for expanding and customizing the presets.

By the way, keep in mind that:

Visual Studio App Center is scheduled for retirement on March 31, 2025. After that date it will not be possible to sign in with your user account nor make API calls. App Center will continue to be supported until March 31, 2025, with critical bug fixes and technical support.

find more info in the dedicated documentation.

chetstone commented 7 months ago

Thanks for the heads up about codepush retirement. Frankly, I haven't actually used it to update production apps for a few years. Maybe I'll just remove it.