{"_id":"@carimus/metro-symlinked-deps","_rev":"15-679ba53a3236f56ca2f630f6a78de38e","name":"@carimus/metro-symlinked-deps","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.0-development":{"name":"@carimus/metro-symlinked-deps","version":"0.0.0-development","keywords":["metro","react-native","jest-haste-map"],"license":"MIT","_id":"@carimus/metro-symlinked-deps@0.0.0-development","maintainers":[{"name":"carimus-deploy-bot","email":"carimus-deploy-bot@carimus.com"},{"name":"bericp1","email":"bericp1@gmail.com"},{"name":"nicog-carimus","email":"nicog@carimus.com"},{"name":"shugands","email":"dans@carimus.com"},{"name":"bryanmcarimus","email":"bryanm@carimus.com"},{"name":"spencerr","email":"spencerr@carimus.com"}],"homepage":"https://github.com/Carimus/metro-symlinked-deps#readme","bugs":{"url":"https://github.com/Carimus/metro-symlinked-deps/issues"},"dist":{"shasum":"7e8f7c34cb7f082259119e1651914ac59e029d18","tarball":"https://registry.npmjs.org/@carimus/metro-symlinked-deps/-/metro-symlinked-deps-0.0.0-development.tgz","fileCount":12,"integrity":"sha512-r81AVFpYHAal48G5S1aSoOzjBXt7rr3AZlfgZ3+nlHeNoyqra/gdu22Gf1ZDftyV4rM/cw3manH2gfg6egl/uQ==","signatures":[{"sig":"MEUCIDbI1y44kvJBM/5VZ8V1/96/tI7D8X9ndij4dvz2A6MFAiEAo+KEMFpw+f903Y1cFWf2MfcsSx7Hez+ji1YpEb9FqKY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":405277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjlqnCRA9TVsSAnZWagAAX1MQAI0pF9VusCWTruTCMj1F\naHp4Rt3VDmNQiZEs8EWxe9m/39eRlsg4yKy4tunXevWJewwZKxfvGWpkw2Ve\nK4wu6ceSuk5/d4i135FNIXyrxKx5JHbap2OrFNbWHKq8ZSOyTxLoaD2CLLv7\nTIeG8iWcHm33XKlJNwyEUxIOPtl82MIGZ+KN1VeqcGGlk4I/+rzrYx6a8uvp\nuLTfwFsSR2ups8a7sIAgXE06yiUrLTDLEflzuhvqQd1Wqdo9p1aXEsp2lCEZ\nbjIPThPwlb9MCkpc57cTwCfVJUpESri7oDExxIRVzb4Kwx6oCDT2dAzxpE6z\nQMy2dhM21wRzcAydx75T7O49/8plM2WHtam/+a0prEDjnGimJJW1rIN8EC8h\n50drbYfGszKhpwasfHHF9GJ7ggVlGq0bbCIQ2MIY4olMJlKYkqsVkAdSt0ZV\nRbMkwMsDBwrBait+zBVcEqbTfqR+dw1lhZPyopi6r6kIBWtWrSTdDpVIYceT\nIOkiro1NA/o0QL1szY5B6wbREpcZIDNWGq/ITQnKEKlp+EJ/mxMD7349SqUY\n6Y2ppJT+ue+BIxNUToExGKKj1/XVorMulWVWRDHHWm4LbigNGFv2TqQtg9In\n7TozUGA1GogVcEr7FkEodZRQlSPgVODk4QzHrfPoUT8lemJBVd1dWui0KJJj\nonjd\r\n=je8b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=8"},"gitHead":"0376d5672259367949a20804d70016d489b7e509","private":false,"scripts":{"lint":"eslint '{*,{src,docs}/**/*,__{tests,mocks,support}__/**/*}.{js,jsx}' || true","test":"jest --passWithNoTests","commit":"git-cz","pretty":"prettier --write '{*,{src,docs,.github}/**/*,__{tests,mocks,support}__/**/*}.{json,md,yml,js,jsx}'","fixcode":"yarn run pretty","release":"yarn run semantic-release","release-ci":"echo 'unsafe-perm = true' > ./.npmrc && yarn run semantic-release && rm -rf ./.npmrc","test:watch":"yarn run test --watch","semantic-release":"semantic-release"},"_npmUser":{"name":"bericp1","email":"bericp1@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/Carimus/metro-symlinked-deps.git","type":"git"},"_npmVersion":"6.4.1","description":"Metro bundler configuration utilities to workaround a lack of symlink support.","directories":{},"lint-staged":{"{*,{src,docs}/**/*,__{tests,mocks,support}__/**/*}.{js,jsx}":["prettier --write","eslint","git add"],"{*,{src,docs,.github}/**/*,__{tests,mocks,support}__/**/*}.{json,md,yml}":["prettier --write","git add"]},"_nodeVersion":"10.15.3","dependencies":{"chalk":"^2.4.2","metro-config":"^0.56.0","get-dev-paths":"^0.1.1","escape-string-regexp":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.9.0","husky":"^3.0.5","eslint":"^6.4.0","prettier":"^1.18.2","commitizen":"^4.0.3","lint-staged":"^9.3.0","babel-eslint":"^10.0.3","@commitlint/cli":"^8.2.0","semantic-release":"^15.13.24","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^10.0.0","eslint-plugin-babel":"^5.3.0","eslint-plugin-import":"^2.18.2","eslint-plugin-promise":"^4.2.1","eslint-config-prettier":"^6.3.0","eslint-config-standard":"^14.1.0","eslint-plugin-standard":"^4.0.1","cz-conventional-changelog":"^3.0.2","@commitlint/config-conventional":"^8.2.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/metro-symlinked-deps_0.0.0-development_1569610406525_0.9241895360648875","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@carimus/metro-symlinked-deps","version":"1.0.0","keywords":["metro","react-native","jest-haste-map"],"license":"MIT","_id":"@carimus/metro-symlinked-deps@1.0.0","maintainers":[{"name":"bericp1","email":"bericp1@gmail.com"},{"name":"bryanmcarimus","email":"bryanm@carimus.com"},{"name":"carimus-deploy-bot","email":"carimus-deploy-bot@carimus.com"},{"name":"nicog-carimus","email":"nicog@carimus.com"},{"name":"shugands","email":"dans@carimus.com"},{"name":"spencerr","email":"spencerr@carimus.com"}],"homepage":"https://github.com/Carimus/metro-symlinked-deps#readme","bugs":{"url":"https://github.com/Carimus/metro-symlinked-deps/issues"},"dist":{"shasum":"06ca959c72c04911c30d9db89f033616abb96ba9","tarball":"https://registry.npmjs.org/@carimus/metro-symlinked-deps/-/metro-symlinked-deps-1.0.0.tgz","fileCount":12,"integrity":"sha512-2uZQzW30TCPQ+uUeEdx8QbyUz3bzkJ+oJxZ3K7aiJplDiUSskZERkaQy7PJZlGTlhlXo7wtjhS6vRzel6IxkKw==","signatures":[{"sig":"MEQCIHslUM4GcJ6rjsR8biElXwddP6zlswGHEMM1AhSgrBFiAiAJxZbB4xa1akst5y/KFGIfJwhpWpAzMioc+w9EDOwBYw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":405265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjlr+CRA9TVsSAnZWagAAxzIP/2NYGDlKOv3caoBjUfSf\nJEuW5xwVTkdC1Iy/mVhBekKHrcpONBXlwkKXC7a0smFD+fEQJDBgUHZYREDx\nkIuyP8IVvOQdQMOhkMUQGvR6i2MqF5GahDbednzLhgacbIDtCBG6MTgAavfx\nYyKP1nbvlQh+T9LNvKmZO4k/AlxZMLNev4SUwUUo7jrobQg9X7h7uwnjB3Lq\nK+DtwM82d5c0Hfcge+MGnFetoymWpe26+7Ih4VIZnvUtbKeLmnOXbE31kC+t\nLMyP6sFpkpXjWRseBzCEy0WndMV6L4ize0BaL07QQABNWGVTj7wyN7HHVey0\nbjwcgF4/o55yxAyM5Iri0HjC1FGUN+99UvG5wKa2sPprQz8ozE7bkF3v3zrX\nWE7kF73t0G8IOHXfoNMhm+qNdrjgMX0SODfNV88Q4vOTcz2V1q5QwuaRDLZh\nS5vz/Wy3MtH8T2+Gvc6u53yxmKOrjg4ej0XzRWoPzyrGlS5+svPfaqEnQ4Fg\nlRMWiA5XbxGUJb2GyA/bp8LmsAEVuQFaFuzI3LJOHXRBpW9uQvlIBvEH5rk0\nr7lBTXgqAEyQcOr8yDzbMvkiSmzvR6X6RWv1Dw8XmnURcbeLdTwDGHj2MnKt\n9oGnggrBs1ZwfPq/0M60roayU+WuiauTdPvWBa+2k+Xgx9cB49VF4xukH6St\ns2MZ\r\n=OGNw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=8"},"gitHead":"0376d5672259367949a20804d70016d489b7e509","private":false,"scripts":{"lint":"eslint '{*,{src,docs}/**/*,__{tests,mocks,support}__/**/*}.{js,jsx}' || true","test":"jest --passWithNoTests","commit":"git-cz","pretty":"prettier --write '{*,{src,docs,.github}/**/*,__{tests,mocks,support}__/**/*}.{json,md,yml,js,jsx}'","fixcode":"yarn run pretty","release":"yarn run semantic-release","release-ci":"echo 'unsafe-perm = true' > ./.npmrc && yarn run semantic-release && rm -rf ./.npmrc","test:watch":"yarn run test --watch","semantic-release":"semantic-release"},"_npmUser":{"name":"bericp1","email":"bericp1@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/Carimus/metro-symlinked-deps.git","type":"git"},"_npmVersion":"6.4.1","description":"Metro bundler configuration utilities to workaround a lack of symlink support.","directories":{},"lint-staged":{"{*,{src,docs}/**/*,__{tests,mocks,support}__/**/*}.{js,jsx}":["prettier --write","eslint","git add"],"{*,{src,docs,.github}/**/*,__{tests,mocks,support}__/**/*}.{json,md,yml}":["prettier --write","git add"]},"_nodeVersion":"10.15.3","dependencies":{"chalk":"^2.4.2","metro-config":"^0.56.0","get-dev-paths":"^0.1.1","escape-string-regexp":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.9.0","husky":"^3.0.5","eslint":"^6.4.0","prettier":"^1.18.2","commitizen":"^4.0.3","lint-staged":"^9.3.0","babel-eslint":"^10.0.3","@commitlint/cli":"^8.2.0","semantic-release":"^15.13.24","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^10.0.0","eslint-plugin-babel":"^5.3.0","eslint-plugin-import":"^2.18.2","eslint-plugin-promise":"^4.2.1","eslint-config-prettier":"^6.3.0","eslint-config-standard":"^14.1.0","eslint-plugin-standard":"^4.0.1","cz-conventional-changelog":"^3.0.2","@commitlint/config-conventional":"^8.2.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/metro-symlinked-deps_1.0.0_1569610493768_0.4382600121511733","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@carimus/metro-symlinked-deps","version":"1.1.0","keywords":["metro","react-native","jest-haste-map"],"license":"MIT","_id":"@carimus/metro-symlinked-deps@1.1.0","maintainers":[{"name":"bericp1","email":"bericp1@gmail.com"},{"name":"bryanmcarimus","email":"bryanm@carimus.com"},{"name":"carimus-deploy-bot","email":"carimus-deploy-bot@carimus.com"},{"name":"nicog-carimus","email":"nicog@carimus.com"},{"name":"shugands","email":"dans@carimus.com"},{"name":"spencerr","email":"spencerr@carimus.com"}],"homepage":"https://github.com/Carimus/metro-symlinked-deps#readme","bugs":{"url":"https://github.com/Carimus/metro-symlinked-deps/issues"},"dist":{"shasum":"d309616c868fb492bc7de53e6957d5e343ffdfeb","tarball":"https://registry.npmjs.org/@carimus/metro-symlinked-deps/-/metro-symlinked-deps-1.1.0.tgz","fileCount":11,"integrity":"sha512-2bCTuTIxof5uabtqI+VlovlKClDBomB9FoqRSrS/GVkpNbxSKMX23d219AwBQ9dyeQH9U/sGeMQAB2VslSpbuQ==","signatures":[{"sig":"MEYCIQCTLvohdOyS+b0sv/wEHw9Lj3zUahcyDDqvZxkZJenDgwIhAITMaXjzxv4Cvh/VjlF9fpWKi4ewP2kHr5Uz701JcjBW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdk2I1CRA9TVsSAnZWagAAiAgP/RIwk3HGR5IfvtJrXrlx\nJiwrYCk7j+wxSDGg8kT8xiNXntG4SvUaBA5UjhDjOdqHeqFl05XiVHSzwrI3\nfbg8CCQYlLdgIK2+LU50D0ymXsXVY+Zmb4Ux2x/yaypg4fopg7ODlPKHv2zb\ns2dGhyfMTqytKFPBtAgNUtNSKdodEQ9oWU9b11hPdKjAX7qRgL/TqcyB1UNm\nb24GYY9FWhDrT5x0P5nIDD8uVjV2wte3NAjpXabU0Sgt5b99R1NYI5DtFrtU\nGqSjdhohZNjbt5CrNoDcIT6Uv8iEYsAigxczDBPiQCOyYWdx217ZXhgzXWE5\nOM/OEYaiIuWE02fJZulFsI5NlE0zXBpJGoaZ+qW7F/hm6hmKynNMkuVkuokL\n8hc1pVTuqxtDcjVV4OhXhn+BJdDoDfEfW0QcKYRKcAubVZ05DfCwqkU/acbW\nXGCz0/iMZRodyslN2XP1/hBcFBIVigznc7iy6nojugtHBdPlfsNDuHuPEyhK\non7Vt0VIY+iFFXtQZ/kEHnOq9P1t1tMUmrvZcxcskNRcB8JaSIKOQ4ORmQrE\nmE+uCdeAdsZJHzqG4X8EInFFZS3+0xxaP50nBMXPJH9Aox6HG1YE3B80XiNY\nkfh+iNNbIiYkKy6kHFY4qQ1xnGodHmJ/KYVc7OmMi6aDQnylcPsO8b393Z/y\nHOPx\r\n=acc/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=8"},"gitHead":"656658961517edda8349c656f408cb681ea66da3","private":false,"scripts":{"lint":"eslint '{*,{src,docs}/**/*,__{tests,mocks,support}__/**/*}.{js,jsx}' || true","test":"jest --passWithNoTests","commit":"git-cz","pretty":"prettier --write '{*,{src,docs,.github}/**/*,__{tests,mocks,support}__/**/*}.{json,md,yml,js,jsx}'","fixcode":"yarn run pretty","release":"yarn run semantic-release","release-ci":"echo 'unsafe-perm = true' > ./.npmrc && yarn run semantic-release && rm -rf ./.npmrc","test:watch":"yarn run test --watch","semantic-release":"semantic-release"},"_npmUser":{"name":"carimus-deploy-bot","email":"carimus-deploy-bot@carimus.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/Carimus/metro-symlinked-deps.git","type":"git"},"_npmVersion":"6.11.3","description":"Metro bundler configuration utilities to workaround a lack of symlink support.","directories":{},"lint-staged":{"{*,{src,docs}/**/*,__{tests,mocks,support}__/**/*}.{js,jsx}":["prettier --write","eslint","git add"],"{*,{src,docs,.github}/**/*,__{tests,mocks,support}__/**/*}.{json,md,yml}":["prettier --write","git add"]},"_nodeVersion":"10.16.3","dependencies":{"chalk":"^2.4.2","ramda":"^0.26.1","metro-config":"^0.56.0","get-dev-paths":"^0.1.1","escape-string-regexp":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.9.0","husky":"^3.0.5","eslint":"^6.4.0","prettier":"^1.18.2","commitizen":"^4.0.3","lint-staged":"^9.3.0","babel-eslint":"^10.0.3","@commitlint/cli":"^8.2.0","semantic-release":"^15.13.24","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^10.0.0","eslint-plugin-babel":"^5.3.0","eslint-plugin-import":"^2.18.2","eslint-plugin-promise":"^4.2.1","eslint-config-prettier":"^6.3.0","eslint-config-standard":"^14.1.0","eslint-plugin-standard":"^4.0.1","cz-conventional-changelog":"^3.0.2","@commitlint/config-conventional":"^8.2.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/metro-symlinked-deps_1.1.0_1569940020435_0.6287259339979108","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-09-27T18:53:26.478Z","modified":"2025-05-28T17:44:17.886Z","0.0.0-development":"2019-09-27T18:53:26.746Z","1.0.0":"2019-09-27T18:54:53.993Z","1.1.0":"2019-10-01T14:27:00.568Z"},"bugs":{"url":"https://github.com/Carimus/metro-symlinked-deps/issues"},"license":"MIT","homepage":"https://github.com/Carimus/metro-symlinked-deps#readme","keywords":["metro","react-native","jest-haste-map"],"repository":{"url":"git+https://github.com/Carimus/metro-symlinked-deps.git","type":"git"},"description":"Metro bundler configuration utilities to workaround a lack of symlink support.","maintainers":[{"email":"nicog@carimus.com","name":"nicog-carimus"},{"email":"dans@carimus.com","name":"shugands"},{"email":"bryanm@carimus.com","name":"bryanmcarimus"},{"email":"carimus-deploy-bot@carimus.com","name":"carimus-deploy-bot"},{"email":"digital-security@carimus.com","name":"carimusprivate"}],"readme":"# `@carimus/metro-symlinked-deps`\n\nUtilities to customize the [`metro`](https://github.com/facebook/metro) bundler configuration in order to workaround\nits lack of support for symlinks.\n\nThe primary use case for this package is to support development on react native dependencies using `yarn link` or\n`npm link`.\n\n## Motivation\n\nFacebook's [`metro`](https://github.com/facebook/metro) bundler used by React Native\n[doesn't support symlinks](https://github.com/facebook/metro/issues/1) which is a huge hindrance in the ability to\nshare code locally.\n\nIt's related and dependent on [this issue with `jest`](https://github.com/facebook/jest/pull/7549) since `metro`\nuses `jest-haste-map` internally to track and watch file changes.\n\nThe general process for developing on a dependency that is sharing components with the main app would be\nto use `yarn link` / `npm link` to symlink the dependency into the app's `node_modules`. Since Metro ignores symlinks\nthough, it simply doesn't work out of the box with metro. There's mountains of workarounds to this that work to varying\ndegrees. This is the one that worked for us that we're going to re-use until it's unnecessary.\n\n## Usage\n\nInstall as a dev dependency using `npm` or `yarn`:\n\n```shell script\nyarn add --dev @carimus/metro-symlinked-deps\n```\n\n### Option 1: Automatic\n\nIf you don't need greater control of the `resolver.blacklistRE` outside of adding additional paths or expressions to\nthe list, you can safely use the single `applyConfigForLinkedDependencies` function which will use `metro-config`'s\n`mergeConfig` to merge in the configuration updates required for the `resolver.blacklistRE` and `watchFolders`.\n\n1.  Modify your `metro.config.js` (creating it if it doesn't exist, or converting your `metro.config.json` to\n    `metro.config.js` if its present) to require and call `applyConfigForLinkedDependencies` on your existing\n    configuration:\n\n    ```javascript\n    const {\n        applyConfigForLinkedDependencies,\n    } = require('@carimus/metro-symlinked-deps');\n\n    module.exports = applyConfigForLinkedDependencies(\n        {\n            /* Your existing configuration, optional */\n        },\n        {\n            /* Options to pass to applyConfigForLinkedDependencies, optional */\n        },\n    );\n    ```\n\n`applyConfigForLinkedDependencies` takes the following options:\n\n-   `projectRoot` (`string`, optional **but recommended**): The root of the metro bundled project. If not provided, it\n    will be detected assuming the current `process.cwd()` is the project root. It's recommended to explicitly provide\n    this to avoid detection issues.\n-   `blacklistLinkedModules` (`string[]`, defaults to `[]`): a list of modules to blacklist/ignore if they show up in\n    any linked dependencies' `node_modules`. If you get naming collisions for certain modules, add those modules\n    by name here and restart the bundler using `--reset-cache`. A common one is `react-native` which will typically\n    show up as a dev dependency in react native packages since it's used in tests.\n-   `blacklistDirectories` (`string[]`, defaults to `[]`): a list of absolute or relative (to `projectRoot`) directories\n    that should be blacklisted in addition to the directories determined via `blacklistLinkedModules`.\n-   `resolveBlacklistDirectoriesSymlinks` (`boolean`, defaults to `true`): whether or not to resolve symlinks when\n    processing `blacklistDirectories`.\n-   `additionalWatchFolders` (`string[]`, defaults to `[]`): a list of additional absolute paths to watch, merged\n    directly into the `watchFolders` option.\n-   `resolveAdditionalWatchFoldersSymlinks` (`boolean`, defaults to `true`): whether or not to resolve symlinks when\n    processing `additionalWatchFolders`.\n-   `resolveNodeModulesAtRoot` (`boolean`, defaults to `false`): Set this to `true` to set up a Proxy for\n    `resolver.extraNodeModules` in order to ensure that all modules (even the ones required by linked dependencies or\n    any other out-of-root watch folders) will resolve to the project root's `node_modules` directory. This is primarily\n    useful if the linked dependencies rely on the presence of peerDependencies installed in the project root.\n-   `silent` (`boolean`, defaults to `false`): Set this to `true` to suppress warning output in the bundler that shows\n    up when linked dependencies are detected.\n-   `debug` (`boolean`, defaults to `false`): Set this to `true` to log out valuable debug information like the final\n    merged metro configuration.\n\n#### Example\n\nThis setup should work for an out of the box react-native 0.60+ project:\n\n```javascript\nconst {\n    applyConfigForLinkedDependencies,\n} = require('@carimus/metro-symlinked-deps');\n\nmodule.exports = applyConfigForLinkedDependencies(\n    {\n        transformer: {\n            getTransformOptions: async () => ({\n                transform: {\n                    experimentalImportSupport: false,\n                    inlineRequires: false,\n                },\n            }),\n        },\n    },\n    {\n        projectRoot: __dirname,\n        blacklistLinkedModules: ['react-native'],\n    },\n);\n```\n\n### Option 2: Manual\n\nTODO\n\n## Caveats\n\n-   At the time of writing the blacklist approach appears to fix the naming collision error however it requires that\n    the developer knows which packages are in-common and that they provide that list to this package in order to\n    generate the regular expression\n-   The naming collision doesn't appear to occur for ALL in-common packages. It's not clear if it also considers\n    versions too, though that would make sense.\n\n## How it works\n\nThis is a workaround and as such it was built by incrementally addressing errors that show up.\n\n### Error #1: Module not found\n\nOut of the box, if you try to use a symlinked dependency, you get the following error from the bundler when it first\nbuilds the bundle (not on during the transform step):\n\n```\nerror: bundling failed: Error: Unable to resolve module `your-symlinked-module` from `/path/in/project/that/requires/the/module.js`: Module `your-symlinked-module` does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.\n  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.\n```\n\nNot extremely helpful but what's happening here is `metro` is just outright ignoring the symlink and as such, your\nmodule is invisible to it.\n\nThe workaround here provided by [`aleclarson`](https://github.com/aleclarson) in\n[this comment on the `metro` issue](https://github.com/facebook/metro/issues/1#issuecomment-421628147) is to\nuse his home-grown `get-dev-paths` package which searches `node_modules` for any symlinked dependencies that\nare referenced as `dependencies` in your `package.json`, resolve those links to their real dependencies, and then\ntell metro to also watch those real directories.\n\n### Error #2: Haste module naming collision\n\nThat works great with one important caveat: if your linked dependency has any installed dependencies in its\n`node_modules` that are identical to any installed dependencies in the root project, you get the following error\n(this error names `react-native` as the common dependency).\n\n```\njest-haste-map: Haste module naming collision: react-native\n  The following files share their name; please adjust your hasteImpl:\n    * <rootDir>/node_modules/react-native/package.json\n    * <rootDir>/../../your-symlinked-module/node_modules/react-native/package.json\n```\n\nWhen your dependency is installed legitimately (and not linked) any common dependencies are automatically deduped\nduring the install (during `yarn install` or `npm install`) and `metro` (or rather `jest-haste-map`) seems to rely\non this behaviour and can't identify the fact that the two packages are not conflicting with eachother and are\nlegitimately identical. There's unfortunately no way to tell `metro` this is the case and that it should, as an\nexample, prefer the version of the code in the root project's `node_modules` so instead we have to manually construct\na blacklist of the in-common packages in the linked dependency, construct a regular expression from that, and\nhand that regular expression to the `blacklistRE` option of the metro bundler's `resolver` config.\n\n## TODO\n\n-   [ ] Remove `resolveNodeModulesAtRoot` and replace with `nodeModulesResolutionStrategy` with three options:\n    -   `null`: default, don't apply any `extraNodeModules` config\n    -   `'peers'`: apply `extraNodeModules` that will automatically detect peer dependencies in linked deps and ensure\n        those are resolved in the project root while allowing all other dependencies to resolve naturally.\n    -   `'root'`: apply `extraNodeModules` that will force all node modules to resolve in the project root, equivelant\n        to `resolveNodeModulesAtRoot` being set to `true` currently.\n","readmeFilename":"README.md"}