{"name":"@expo/fingerprint","version":"0.0.1-canary-20231130-ede75a7","keywords":["expo","react-native","fingerprint","hash","node"],"author":{"name":"650 Industries, Inc."},"license":"MIT","_id":"@expo/fingerprint@0.0.1-canary-20231130-ede75a7","maintainers":[{"name":"kadikraman","email":"hellokadi@gmail.com"},{"name":"radoslawkrzemien","email":"radoslaw.krzemien@swmansion.com"},{"name":"aleqsio","email":"mikucki@gmail.com"},{"name":"marklawlor","email":"mwlawlor@gmail.com"},{"name":"gabrieldonadel","email":"donadeldev@gmail.com"},{"name":"simek","email":"gosimek@gmail.com"},{"name":"keith-kurak","email":"keith@expo.io"},{"name":"christopherwalter","email":"chris@christopherwalter.com"},{"name":"kbrandwijk","email":"kim.brandwijk@gmail.com"},{"name":"fiber-god","email":"datwheat@gmail.com"},{"name":"ide","email":"ide+npm@jameside.com"},{"name":"brentvatne","email":"brentvatne@gmail.com"},{"name":"evanbacon","email":"baconbrix@gmail.com"},{"name":"quinlanj","email":"quinlanjung@gmail.com"},{"name":"expoadmin","email":"support@expo.io"},{"name":"tsapeta","email":"npm@tsapeta.com"},{"name":"exponent","email":"exponent.team@gmail.com"},{"name":"wschurman","email":"wschurman@gmail.com"},{"name":"wkozyra","email":"wojciech.kozyra@swmansion.com"},{"name":"bycedric","email":"me@bycedric.com"},{"name":"lukmccall","email":"kosmatylukasz@gmail.com"},{"name":"jonsamp","email":"sampjon@gmail.com"},{"name":"princefleaswallow","email":"mhampton@hey.com"},{"name":"kudochien","email":"ckchien@gmail.com"}],"homepage":"https://github.com/expo/expo/tree/main/packages/@expo/fingerprint#readme","bugs":{"url":"https://github.com/expo/expo/issues"},"bin":{"fingerprint":"bin/cli.js"},"dist":{"shasum":"dd8204d65e51d4812a3579a680d8e727b5b3a3ee","tarball":"http://registry-npm.ywwl.com/@expo/fingerprint/download/@expo/fingerprint-0.0.1-canary-20231130-ede75a7.tgz","fileCount":49,"integrity":"sha512-PEyDg29Hj3pekyB2mMKFWfGrAJJD+348Dsk7tBjPQlaJ+T/shk85+M4Xo8WhuVyR1h4PxFUu25YNoK450aW0Gg==","signatures":[{"sig":"MEUCIQC9Hwoppmjzrn+kY9BLq1tHtQ+Uxd1xHHzhkAGxaSi8WQIgPtXSFmrRlOK+CgH0wmKarV7PI6kodOLi8rENgOTmRZg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":89410,"size":21688,"noattachment":false,"key":"/@expo/fingerprint/-/@expo/fingerprint-0.0.1-canary-20231130-ede75a7.tgz"},"main":"build/index.js","types":"build/index.d.ts","readme":"# @expo/fingerprint\n\nA library to generate a fingerprint from a React Native project\n\n## Usage\n\n```ts\nimport * as Fingerprint from '@expo/fingerprint';\n\nawait Fingerprint.createFingerprintAsync('/projectRoot');\n```\n\n### `async function createFingerprintAsync(projectRoot: string, options?: Options): Promise<Fingerprint>`\n\nCreate a fingerprint from project\n\nExample:\n\n```ts\nconst fingerprint = await createFingerprintAsync('/app');\nconsole.log(fingerprint);\n```\n\n```json\n{\n  \"sources\": [\n    {\n      \"type\": \"file\",\n      \"filePath\": \"app.json\",\n      \"reasons\": [\"expoConfig\"],\n      \"hash\": \"378083de0c6e6bb6caf8fb72df658b0b26fb29ef\"\n    },\n    {\n      \"type\": \"file\",\n      \"filePath\": \"eas.json\",\n      \"reasons\": [\"easBuild\"],\n      \"hash\": \"f723802b6ea916d1a6c4767b2299cc81ddb22eb4\"\n    },\n    {\n      \"type\": \"dir\",\n      \"filePath\": \"node_modules/expo\",\n      \"reasons\": [\"expoAutolinkingIos\", \"expoAutolinkingAndroid\", \"bareRncliAutolinking\"],\n      \"hash\": \"1faee4057fa943300905750b51c3b0cbf05f4b0d\"\n    }\n  ],\n  \"hash\": \"bf8a3b08935f056270b1688333b02f1ef5fa25bf\"\n}\n```\n\n### `async function createProjectHashAsync(projectRoot: string, options?: Options): Promise<string>`\n\nCreate a native hash value from project\n\nExample:\n\n```ts\nconst hash = await createProjectHashAsync('/app');\nconsole.log(hash);\n```\n\n```json\nbf8a3b08935f056270b1688333b02f1ef5fa25bf\n```\n\n### `diffFingerprintChangesAsync(fingerprint: Fingerprint, projectRoot: string, options?: Options): Promise<FingerprintSource[]>`\n\nDifferentiate given `fingerprint` with the current project fingerprint state\n\nExample:\n\n```ts\nconst fingerprint = {\n  sources: [\n    {\n      type: 'file',\n      filePath: 'app.json',\n      reasons: ['expoConfig'],\n      hash: '378083de0c6e6bb6caf8fb72df658b0b26fb29ef',\n    },\n    {\n      type: 'file',\n      filePath: 'eas.json',\n      reasons: ['easBuild'],\n      hash: 'f723802b6ea916d1a6c4767b2299cc81ddb22eb4',\n    },\n    {\n      type: 'dir',\n      filePath: 'node_modules/expo',\n      reasons: ['expoAutolinkingIos', 'expoAutolinkingAndroid', 'bareRncliAutolinking'],\n      hash: '1faee4057fa943300905750b51c3b0cbf05f4b0d',\n    },\n  ],\n  hash: 'bf8a3b08935f056270b1688333b02f1ef5fa25bf',\n};\nconst result = await diffFingerprintChangesAsync(fingerprint, '/app');\nconsole.log(result);\n```\n\n```json\n[\n  {\n    \"filePath\": \"ios\",\n    \"hash\": \"e4190c0af9142fe4add4842777d9aec713213cd4\",\n    \"reasons\": [\"bareNativeDir\"],\n    \"type\": \"dir\"\n  },\n  {\n    \"filePath\": \"app.json\",\n    \"hash\": \"9ff1b51ca9b9435e8b849bcc82e3900d70f0feee\",\n    \"reasons\": [\"expoConfig\"],\n    \"type\": \"file\"\n  }\n]\n```\n\n## CLI Usage\n\n### Generate a fingerprint for a given project\n\n`npx @expo/fingerprint /path/to/projectRoot`\n\n### Generate a fingerprint for a given project and write it to a file\n\n`npx @expo/fingerprint /path/to/projectRoot > fingerprint.json`\n\n### Compare a fingerprint with the current project state\n\n`npx @expo/fingerprint /path/to/projectRoot fingerprint.json`\n\n## Limitations\n\n## Limited support for [config-plugins raw functions](https://docs.expo.dev/config-plugins/plugins-and-mods/#raw-functions)\n\nWhen using config-plugins with raw functions, it's essential to be aware of certain limitations, particularly in the context of fingerprinting. Expo makes its best effort to generate fingerprints for changes made through config-plugins; however, raw functions pose specific challenges. Raw functions are not serializable as fingerprints, which means they cannot be directly used for generating unique hashes.\n\nTo work around this limitation, Expo employs one of the following strategies to create serializable fingerprints for raw functions:\n\n1. **Using `Function.name`**: Expo utilizes the `Function.name` property if available for named raw functions. This property provides a recognizable name for the function, which can be used as a fingerprint property.\n\n2. **Using `withAnonymous`**: For anonymous raw functions without a `Function.name`, Expo resorts to using 'withAnonymous' as the fingerprint property. This is a generic identifier for anonymous functions.\n\nHere's an example to illustrate these concepts:\n\n```javascript\n// In app.config.js\nconst { withInfoPlist } = require('expo/config-plugins');\n\nconst withMyPlugin = (config) => {\n  return withInfoPlist(config, (config) => {\n    config.modResults.NSLocationWhenInUseUsageDescription = 'Allow $(PRODUCT_NAME) to use your location';\n    return config;\n  });\n};\n\nexport default ({ config }) => {\n  config.plugins ||= [];\n  config.plugins.push(withMyPlugin);\n  config.plugins.push((config) => config);\n  return config;\n};`\n```\n\nIn this example, Expo will use ['withMyPlugin', 'withAnonymous'] as plugin properties for fingerprint hashing.\n\nIt's important to note that due to this design, if you make changes to the implementation of raw config-plugins functions, such as altering the Info.plist value within 'withMyPlugin', the fingerprint will still generate the same hash value. To ensure unique fingerprints when modifying config-plugins implementations, consider the following options:\n\n- **Avoid Anonymous Functions**: Avoid using anonymous raw config-plugins functions. Instead, use named functions whenever possible, and ensure that their names remain consistent as long as the implementation changes.\n\n- **Use Local config-plugins**: Alternatively, you can create local config-plugins as separate modules, each with its own export. This approach allows you to specify a different function name when making changes to the config-plugins implementations.\n\n  Here's an example of using a local config-plugin:\n\n  ```javascript\n  // In ./plugins/withMyPlugin.js\n  const { withInfoPlist } = require('expo/config-plugins');\n\n  const withMyPlugin = (config) => {\n    return withInfoPlist(config, (config) => {\n      config.modResults.NSLocationWhenInUseUsageDescription =\n        'Allow $(PRODUCT_NAME) to use your location';\n      return config;\n    });\n  };\n\n  module.exports = withMyPlugin;\n  ```\n\n  ```json\n  // in app.json\n  {\n    \"expo\": {\n      // ...\n      \"plugins\": \"./plugins/withMyPlugin\"\n    }\n  }\n  ```\n\nBy following these guidelines, you can effectively manage changes to config-plugins and ensure that fingerprinting remains consistent and reliable.\n","gitHead":"ede75a72bdcfa7dcf593a0c98f201aa45871da42","scripts":{"lint":"expo-module lint","test":"expo-module test","build":"expo-module tsc","clean":"expo-module clean","watch":"expo-module tsc --watch","prepare":"expo-module clean && expo-module tsc","test:e2e":"yarn run prepare && expo-module test --config e2e/jest.config.js","typecheck":"expo-module typecheck","prepublishOnly":"expo-module prepublishOnly"},"_npmUser":{"name":"brentvatne","email":"brentvatne@gmail.com"},"repository":{"url":"git+https://github.com/expo/expo.git","type":"git","directory":"packages/@expo/fingerprint"},"_npmVersion":"9.6.7","description":"A library to generate a fingerprint from a React Native project","directories":{},"_nodeVersion":"18.17.1","dependencies":{"chalk":"^4.1.2","debug":"^4.3.4","find-up":"^5.0.0","p-limit":"^3.1.0","minimatch":"^3.0.4","resolve-from":"^5.0.0","@expo/spawn-async":"^1.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"glob":"^7.1.7","temp-dir":"^2.0.0","@types/find-up":"^4.0.0","expo-module-scripts":"0.0.1-canary-20231130-ede75a7"},"_npmOperationalInternal":{"tmp":"tmp/fingerprint_0.0.1-canary-20231130-ede75a7_1701386963378_0.844695184293174","host":"s3://npm-registry-packages"},"publish_time":1701386963584,"_cnpm_publish_time":1701386963584,"dist-tags":{"canary":"1.0.0-canary-20260909-ea7a89a","canary-sdk-55":"0.17.0-canary-20260429-a5e59cf","canary-sdk-56":"1.0.0-canary-20260701-9100865","latest":"0.21.9","next":"0.21.5","sdk-50":"0.6.0","sdk-51":"0.8.0","sdk-54":"0.15.5","sdk-55":"0.16.8","sdk-56":"0.19.10","sdk-57":"0.20.15"}}