Thinkmill / manypkg

☔️ An umbrella for your monorepo
MIT License
864 stars 48 forks source link

Problem with local packages in turborepo #182

Open motiejunas opened 1 year ago

motiejunas commented 1 year ago

I have this dependency in my app package.json: "lib": "file:../../packages/lib"

lib package.json:

{ "name": "lib", "version": "0.0.0", "main": "./src/index.ts", "types": "./src/index.ts" }

I get this error when run npm install:

☔️ error api has a dependency on lib@file:../../packages/lib but the version of lib in the repo is 0.0.0 which is not within range of the depended on version, please update the dependency version ☔️ info the above errors may be fixable with yarn manypkg fix

I think this is a bug.

tkambler commented 1 year ago

Note: There seems to be an incompatibility problem here with manypkg and pnpm. This problem was first reported three years ago.

I have the same problem, but I'm referencing my local package dependency (ui) using the workspace:... syntax via pnpm:

"ui": "workspace:*"

Error:

web has a dependency on ui@workspace:* but the version of ui in the repo is 0.0.1 which is 
not within range of the depended on version, please update the dependency version

Related:

While this does work, be advised that you may be missing out on some of the benefits that come along with using the workspace:... protocol.

Andarist commented 1 year ago

PRs are welcome 😉 I definitely don't have the capacity to work on this but I could review a PR that would introduce such a feature.

jonathanpowers-storable commented 7 months ago

@Andarist Could you take a look at this PR? It seems to provide at least basic workspace support.

Turborepo defaults to pnpm and also recommends @manypkg/cli for managing deps, so this issue is going to pop up for anyone using that set of tools.