You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the correct way to depend on packages from within the monorepo?
With this folder layout, where holograph-app and holograph-operator are our two apps, that both use single all encompassing UI/utils library packages/holograph/,
After installing from the root with pnpm install, I see this output
>pnpm install
Scope: all 11 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +1979
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1979, reused 1974, downloaded 0, added 1979, done
devDependencies:
+ eslint 7.32.0
+ eslint-config-holograph 0.0.0 <- packages\eslint-config-holograph
+ turbo 1.13.4
+ typescript 5.4.5
...
Which seems to understand the link for eslint-config-holograph correctly,
HOWEVER,
when I browse the holograph-app or operator projects' files, I get unresolved dependencies in VSCode, and a failing pnpm build command too - which can't resolve dependencies.
(ignore the first two unrelated errors)
At some point I was also receiveing errors like these, but after several tries and configuration changes, I am no longer getting these.
eslint-config-holograph is not in the npm registry, or you have no permission to fetch it.
Adding this to the root package.json seems to have fixed it, but it doesn't feel right, given the pnpm-workspace.yaml and .npmrc configurations.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
tl;dr
What is the correct way to depend on packages from within the monorepo?
With this folder layout, where holograph-app and holograph-operator are our two apps, that both use single all encompassing UI/utils library
packages/holograph/
,and these files
pnpm-workspace.yaml
.npmrc
(tried with and without this file)package.json
both
apps/holograph-app/package.json
andapps/holograph-operator/package.json
After installing from the root with
pnpm install
, I see this outputWhich seems to understand the link for
eslint-config-holograph
correctly,HOWEVER,
when I browse the
holograph-app
or operator projects' files, I get unresolved dependencies in VSCode, and a failingpnpm build
command too - which can't resolve dependencies.(ignore the first two unrelated errors)
At some point I was also receiveing errors like these, but after several tries and configuration changes, I am no longer getting these.
Adding this to the root
package.json
seems to have fixed it, but it doesn't feel right, given thepnpm-workspace.yaml
and.npmrc
configurations.package.json
What is the correct way to solve this?
Meaning: Have a monorepo with several apps, all of them depending on other monorepo's packages?
Beta Was this translation helpful? Give feedback.
All reactions