{"id":18831420,"url":"https://github.com/kingstinct/expo-native-dependency-hash","last_synced_at":"2025-08-03T01:11:42.116Z","repository":{"id":147650383,"uuid":"426264995","full_name":"kingstinct/expo-native-dependency-hash","owner":"kingstinct","description":"Simplified native dependency tracking for React Native","archived":false,"fork":false,"pushed_at":"2025-01-25T18:11:40.000Z","size":687,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T04:16:17.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingstinct.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-11-09T14:38:59.000Z","updated_at":"2025-01-25T18:11:44.000Z","dependencies_parsed_at":"2023-11-23T18:22:36.202Z","dependency_job_id":"5956e510-0eed-4162-b9eb-b2d0b4665d4d","html_url":"https://github.com/kingstinct/expo-native-dependency-hash","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Fexpo-native-dependency-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Fexpo-native-dependency-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Fexpo-native-dependency-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingstinct%2Fexpo-native-dependency-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingstinct","download_url":"https://codeload.github.com/kingstinct/expo-native-dependency-hash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819410,"owners_count":21166477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T01:54:10.873Z","updated_at":"2025-04-14T04:16:23.080Z","avatar_url":"https://github.com/kingstinct.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expo-native-dependency-hash - Simplified native dependency tracking for React Native\n\n⚠️ Deprecation Notice: This was a precursor to what [Expo Fingerprint](https://expo.dev/blog/fingerprint-your-native-runtime) now provides officially, so no further updates or support will be provided to this library.\n\n[![expo-native-dependency-hash on NPM](https://img.shields.io/npm/v/expo-native-dependency-hash)](https://www.npmjs.com/package/expo-native-dependency-hash)\n\n`expo-native-dependency-hash` strives to make it easier to keep track of when the native dependencies of a Expo (or React Native) project has changed. It does so by (1) detecting native modules in node_modules and (2) generating a hash based on those package names and versions. It provides these commands:\n  - expo-app-verify [rootDir]  Check if hash has changed, good for CI and git hooks\n  - expo-app-update [rootDir]  Update hash representing this apps native dependencies\n  - library-verify [rootDir]   Check if hash has changed, fails if it has, good for CI and git hooks\n  - library-update [rootDir]   Updates the hash based on the native files in the project\n  - list [rootDir]             Lists all native dependency identities of an app\n  - hash [rootDir]             Returns the hash for piping\n\nNote: This was previously called `expo-native-dependency-hash`, but with the 2.0 release it was renamed to `expo-native-dependency-hash` to better reflect its purpose.\n\n## Recipes\n\n### Update your runtimeVersion automatically when native dependencies has changed\nRun `expo-native-dependency-hash` on `postinstall` to always keep it up to date:\n```json\n{\n    \"scripts\": {\n        \"postinstall\": \"expo-native-dependency-hash expo-app-update\"\n    }\n}\n```\n\nThis will automatically update your runtimeVersion in your `app.json`. So when native dependencies has changed in your project, you'll get a new runtimeVersion to easily target the right binary with your OTA updates.\n\n### Verify that your runtimeVersion is up to date\nRun `expo-native-dependency-hash expo-app-verify` in a CI or git hook to verify that your runtimeVersion is up to date. This will fail if it's not up to date.\n\n### OTA updates / Expo release channels\nUse one release channel per hash to get predictability in your OTA updates.\n\n```bash\nexpo publish --release-channel `expo-native-dependency-hash hash`\n```\nor\n```bash\nexpo publish --release-channel `cat .expo-native-dependency-hashrc`\n```\n\n### Generate a new Native Client when native dependencies has changed\nGenerate new native builds automatically when it's needed. \n\nA simple example of how it can be done with GitHub Actions and EAS Build:\n```yml\n      - name: Get Hash\n        run: echo \"HASH=`npx expo-native-dependency-hash hash`\" \u003e\u003e $GITHUB_ENV\n\n      # Check if there has exists a build for this native hash\n      - name: Matching Native Builds\n        run: echo \"MATCHING_BUILDS=`npx eas-cli@latest build:list --platform=ios --status=finished | grep -c $HASH`\" \u003e\u003e $GITHUB_ENV\n\n      # Publish bundle if there is already a Native Build for this hash out there:\n      - name: Expo Publish\n        id: expo-publish\n        if: ${{ env.MATCHING_BUILDS \u003e 0 }}\n        run: eas update\n\n      # Build new Native Client if there are no\n      - name: EAS Build\n        id: eas-build\n        if: ${{ env.MATCHING_BUILDS == 0 }}\n        run: npx eas-cli@latest build --platform ios --non-interactive --no-wait\n```\n* There are obviously edge cases in this simple implementation; we could check per platform and for builds that are in progress so we don't build duplicates etc..\n\n## What is included in the hash\nWe detect native modules by looking for `ios` and/or `android` folders in each package. Please post an issue (PRs are welcome :) for any false positives/negatives you might find! To see whether everything looks right you can use `expo-native-dependency-hash list` for a full list of libraries that we detect as being native. The hash is by default `a-native-module@1.0.0` but if setting the nativeDependencyHash prop in package.json the libraries indicate whether a new version requires a new native build, then the hash will look like `a-native-module@the-specified-native-hash`.\n\nIf there is an `app.json` (as used by Expo) present some of its contents will also be included in the generated hash (see `androidPropsToHash`, `iosPropsToHash` and `expoPropsToHash` in index.js for an up-to-date-list).\n\nIf you have a native or bare project the contents of your iOS and Android folder is also hashed (any change, even a whitespace change, will result in a new hash).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingstinct%2Fexpo-native-dependency-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingstinct%2Fexpo-native-dependency-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingstinct%2Fexpo-native-dependency-hash/lists"}