This repository was archived by the owner on Dec 20, 2024. It is now read-only.
Vercel CLI monorepo support #5060
Locked
andrevenancio
started this conversation in
Idea
Replies: 2 comments 4 replies
-
|
We have Using |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
@anthonyshew That sounds incredible, was there an update on the status of this? Was it still in alpha? does it work for pushing all |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to bring your attention to this quote from vercel's documentation
There is no explanation to why
vercel linkneeds to be run from the root of the monorepo, but it doesn't make sense from a scaling POV. Let me explainI'm running Turborepo to manage multiple applications and packages within my Organisation. Assume this illustrative folder structure
All examples and documentation across vercel CLI and turborepo suggest:
apps/app1and we're off to the races).NEXT_PUBLIC_GOOGLE_ANALYTICS(analytics is just a generic example) add a value to it and define that acrossdev,preview,production.On our local copy of the repository we then need to run
vercel linkfrom the root. Following the steps we login to our Org, we select our Project and we runvercel env pullto populate the dev environment variables for the selected project (which I remind you wasapps/app1So now we have a new file on our monorepo
.env.localwhich contains ourNEXT_PUBLIC_GOOGLE_ANALYTICS.Now lets go back to vercel.app and lets create another project and associate it with the same monorepo but this time with
apps/app2.We go to the dashboard of this new app, and we add the same exact env variable and we have a different value now.
Now I would expect that since both projects have been created and they have their own set of env variables with different values that when applications are build and deploy they run off those env variables. And they do.
I would also expect that if I want to run
npm run dev(concurrently runapp1andapp2that they both have access to their individual env variables). And this is where the design for the Vercel CLI is failing. By requiring it to be on the root of the folder, you are locking each monorepo to only be able to build 1 app at a time, and adding unnecessary steps tovercel linkandvercel env pullevery time we want to work on either of the apps.What is a better solution?
I believe a more elegant solution is to do
vercel linkinside eachapp/**because its this folder that has to be selected on vercel when creating a new project. So I expect thatlinks the
apps/app1folder to the correct vercel project (e.g.App 1) and pulls the.env.localfile to the locationapps/app1/.env.localIn the same way I expect that
Links the
apps/app2to theApp 2Project on vercel and pulls enenv.localtoapps/app2/.env.localTherefore My final structure will be
This is the expected behavior. What is not expected, and perhaps is a silly suggestion is that we need to duplicate the whole monorepo in a different folder on our machine so we can have each folder link to a different app.
I would like to understand if this issue is part of the roadmap for Vercel CLI and Turborepo.
This issue was first discussed 2 weeks ago here With no feedback, I'm hopping to have someone from the team to be able to help advise on this.
Beta Was this translation helpful? Give feedback.
All reactions