New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cli] Add support for vc deploy --prebuilt
command with repo link
#10083
Conversation
🦋 Changeset detectedLatest commit: c5d486f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// For repo-style linking, update `cwd` to be the Project | ||
// subdirectory when `rootDirectory` setting is defined | ||
if ( | ||
link.status === 'linked' && | ||
link.repoRoot && | ||
link.project.rootDirectory | ||
) { | ||
cwd = join(cwd, link.project.rootDirectory); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change. The rest is just a move of the existing code to a point after link
is defined.
@@ -355,6 +305,66 @@ export default async (client: Client): Promise<number> => { | |||
throw new Error(`"org" is not defined`); | |||
} | |||
|
|||
// build `--prebuilt` | |||
if (argv['--prebuilt']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't test this because I can't get vc build
to work. When I try it in a project dir:
$ vc build
Vercel CLI 30.2.1-e945958
? Please select a Project: vercel-cli-monorepo-test-two
? No Project Settings found locally. Run `vercel pull` for retrieving them? [Y/n] y
Error: ENOENT: no such file or directory, chdir '/Users/smassa/source/demo/vercel-cli-monorepo-test/packages/one' -> '/Users/smassa/source/demo/vercel-cli-monorepo-test/packages/one/packages/one'
and when I try it in the root, I hit an infinite loop:
$ vc build
Vercel CLI 30.2.1-e945958
? Please select a Project: vercel-cli-monorepo-test-one
? No Project Settings found locally. Run `vercel pull` for retrieving them? [Y/n] y
? Please select a Project: vercel-cli-monorepo-test-one
> Downloading `preview` Environment Variables for Project vercel-cli-monorepo-test-one
✅ Created .vercel/.env.preview.local file [109ms]
> Downloading project settings
✅ Downloaded project settings to ~/source/demo/vercel-cli-monorepo-test/packages/one/packages/one/.vercel/project.json [0ms]
? No Project Settings found locally. Run `vercel pull` for retrieving them? [Y/n] y
? Please select a Project: vercel-cli-monorepo-test-one
> Overwriting existing .vercel/.env.preview.local file
> Downloading `preview` Environment Variables for Project vercel-cli-monorepo-test-one
> No changes found.
✅ Updated .vercel/.env.preview.local file [113ms]
> Downloading project settings
✅ Downloaded project settings to ~/source/demo/vercel-cli-monorepo-test/packages/one/packages/one/.vercel/project.json [0ms]
? No Project Settings found locally. Run `vercel pull` for retrieving them? [Y/n] y
? Please select a Project:
● vercel-cli-monorepo-test-one
○ vercel-cli-monorepo-test-two
...
When repo linked,
vc deploy --prebuilt
will change working directory to the Project root directory, instead of the repo root, so that the project's local.vercel/output
directory is what gets uploaded + deployed.