passing the "directory of code location" where the code lives in Vercel CLI
Answered
Yellow-horned horntail posted this in #help-forum
Yellow-horned horntailOP
### Problem Description
It would be really great if we could pass in the "directory of code location" where the code lives as an option
Very naive eg :
Reason :
We have a starter kit/template which is
i.e we have two packages
Now when you do
https://user-images.githubusercontent.com/80153681/233417569-2a84957d-3d32-41c5-bbaf-9a20157f2696.jpg
It would really be great we could preconfigure it use
Am I missing something ? Is this already built in verlce cli ? Is there a way to preconfigure it throught
checkout this comment -> https://github.com/scaffold-eth/scaffold-eth-2/pull/231#issuecomment-1471632149 for more context
Tysm 🙌ðŸ™
It would be really great if we could pass in the "directory of code location" where the code lives as an option
Very naive eg :
vercel --code-location ./packages/nextsReason :
We have a starter kit/template which is
monorepo having below directory stucture : root/
├── packages/
│ └── nextjs
| | ├─- vercel.json
| └── hardhat
├── package.jsoni.e we have two packages
nextjs and hardhat we have vercel installed at the root of the project as mentioned in FAQ's of https://vercel.com/docs/concepts/monoreposNow when you do
yarn vercel at the root its asks you : https://user-images.githubusercontent.com/80153681/233417569-2a84957d-3d32-41c5-bbaf-9a20157f2696.jpg
It would really be great we could preconfigure it use
pacakges/nextjs as the source where the code lives and users don't need specify the path themselvesAm I missing something ? Is this already built in verlce cli ? Is there a way to preconfigure it throught
vercel.json ? If not I think this feature should be there built in vercel cli 😅 checkout this comment -> https://github.com/scaffold-eth/scaffold-eth-2/pull/231#issuecomment-1471632149 for more context
Tysm 🙌ðŸ™
Answered by Yellow-horned horntail
https://github.com/scaffold-eth/scaffold-eth-2/pull/544
check out this, its kind of work around were we buid locally the build first and then push it vercel
check out this, its kind of work around were we buid locally the build first and then push it vercel
33 Replies
can't you just
cd into the package folder and run vercel there?actually, if you set up the vercel project on the web, you choose which folder it starts from
Yellow-horned horntailOP
Yeah currently we have the workaround but the problem is that since its a monorepo the "yarn.lock" lives in the root which is not uploaded vercel
have you checked the box at the bottom?
@riský Click to see attachment
Yellow-horned horntailOP
Yeah but we are a starter kit and want our users to use the CLI which does it all
@riský Click to see attachment
Yellow-horned horntailOP
This seems very manual process :(, I wish there was an option to mention this directly while typing CLI command instead of going to UI and adding it ther e
and a but under makes it sound like a web thing ðŸ˜
To access source files outside the Root Directory (which enables Yarn & Lerna Workspaces), enable the "Include source files outside of the Root Directory in the Build Step" option in the Root Directory section within the project settings.
Yellow-horned horntailOP
Yeah :(, There we very less to configure with monorepos its really sad that vercel dosen't have this by default
to be fair, i expected it to exist... ðŸ˜
its not even an option for button: https://vercel.com/docs/deployments/deploy-button/build-settings#root-directory
Yellow-horned horntailOP
ooh yes 😦
I actually created this discussion but lol no one responded => https://github.com/vercel/vercel/discussions/10211
But thanks Risky User really appreciate your try 🙌
But thanks Risky User really appreciate your try 🙌
i found a way... you have to use the api: https://vercel.com/docs/rest-api/endpoints#update-an-existing-project and
sourceFilesOutsideRootDirectory property@Yellow-horned horntail could you make it work with the api, or would this be chaotic..?
@riský <@435412297825910795> could you make it work with the api, or would this be chaotic..?
Yellow-horned horntailOP
This is a great find !! But actually yeah its PITA to make it work through API and not that user friendly who will be using starter kit 😅
edit: they have it on the vercel file: https://github.com/vercel/vercel/blob/main/packages/remix/test/fixtures/07-turborepo/vercel.json
Yellow-horned horntailOP
I get this in vercel.json, but let me try it 🙌
@Yellow-horned horntail This is a great find !! But actually yeah its PITA to make it work through API and not that user friendly who will be using starter kit 😅
i actually looked at the http req when i changed the config... and tried to find it on the vercel website... it wasnt easy (their search didn't have it included)
@riský i actually looked at the http req when i changed the config... and tried to find it on the vercel website... it wasnt easy (their search didn't have it included)
Yellow-horned horntailOP
The build was complete but it give me this in the end :
lol thats an error and a half
Yellow-horned horntailOP
trying with this config now
lol the way this looks done is kinda weird...idk if its messeing with things... search for the name and see complexness: https://github.com/vercel/vercel/blob/main/packages/cli/src/commands/deploy/index.ts
@Yellow-horned horntail trying with this config now
Yellow-horned horntailOP
it seems that nextjs is not recognizing "nextjs" framework and its serving all the contents in ".next" dir 😦
somehow it is reading that info and forgetting about the other info ðŸ˜
lol idk anymore
this is just weirdness
@riský somehow it is reading that info and forgetting about the other info ðŸ˜
Yellow-horned horntailOP
Yeah
Any which way tysm @riský really appreciate it !
@Yellow-horned horntail did you happen to find any better solutions here?
Yellow-horned horntailOP
https://github.com/scaffold-eth/scaffold-eth-2/pull/544
check out this, its kind of work around were we buid locally the build first and then push it vercel
check out this, its kind of work around were we buid locally the build first and then push it vercel
Answer
i love the
yolo