Skip to content
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

Merged
merged 5 commits into from Jun 9, 2023

Conversation

TooTallNate
Copy link
Member

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.

@changeset-bot
Copy link

changeset-bot bot commented Jun 7, 2023

🦋 Changeset detected

Latest commit: c5d486f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

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

Comment on lines +310 to +318
// 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);
}
Copy link
Member Author

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.

@TooTallNate TooTallNate added the pr: automerge Automatically merge the PR when checks pass label Jun 7, 2023
@@ -355,6 +305,66 @@ export default async (client: Client): Promise<number> => {
throw new Error(`"org" is not defined`);
}

// build `--prebuilt`
if (argv['--prebuilt']) {
Copy link
Contributor

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

...

@TooTallNate TooTallNate added pr: automerge Automatically merge the PR when checks pass and removed pr: automerge Automatically merge the PR when checks pass labels Jun 7, 2023
@kodiakhq kodiakhq bot merged commit dea58de into main Jun 9, 2023
103 of 108 checks passed
@kodiakhq kodiakhq bot deleted the update/vc-deploy-prebuilt-repo-link branch June 9, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Automatically merge the PR when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants