Does patch-package support turborepo / monorepo using npm?
My repo has a similar structure to: https://github.com/vercel/turborepo/blob/main/examples/basic/README.md
Namely, each app / package (workspace) has a package.json but no package-lock.json, which gives me an error when trying to patch.
Steps to Repo
- navigate to workspace
cd apps/myApp
- install
patch-package
npm i patch-package --save-dev
- fix a bug in one of your dependencies
vim node_modules/some-package/brokenFile.js
- run patch-package to create a .patch file
npx patch-package some-package
Creating temporary folder
Error: Can't find yarn.lock file
It is throwing this error because it cannot find the package-lock.json in the workspace directory, so it assumes yarn.
|
const packageLockExists = fs.existsSync( |
|
join(appRootPath, "package-lock.json"), |
Patch Package in root
The package/file I want to patch is located in the node_modules of the app / package (workspace).
apps/myApp/nod_modules/some-package
Is it possible to target that via npx patch-package some-package when running in the root directory?
Does
patch-packagesupport turborepo / monorepo using npm?My repo has a similar structure to: https://github.com/vercel/turborepo/blob/main/examples/basic/README.md
Namely, each
app/package(workspace) has apackage.jsonbut nopackage-lock.json, which gives me an error when trying to patch.Steps to Repo
cd apps/myApppatch-packagenpm i patch-package --save-devvim node_modules/some-package/brokenFile.jsnpx patch-package some-packageIt is throwing this error because it cannot find the
package-lock.jsonin the workspace directory, so it assumes yarn.patch-package/src/detectPackageManager.ts
Lines 44 to 45 in bd2e9a4
Patch Package in root
The package/file I want to patch is located in the
node_modulesof theapp/package(workspace).apps/myApp/nod_modules/some-packageIs it possible to target that via
npx patch-package some-packagewhen running in the root directory?