Commit Graph

7 Commits

Author SHA1 Message Date
Steven
675c3e2915 [cli] Change error message from Error! to Error: (#8498)
We have code that tries to detect and highlight errors in the build logs, however it doesn't look for `Error!`, only `Error:`.

We could update that highlight code or we could update Vercel CLI to make it consistent.

This PR is the latter.
2022-09-01 13:12:41 -04:00
Sean Massa
34cd8b4144 [cli] revert git connect inside vc link (#8450) 2022-08-24 09:07:04 -05:00
Matthew Stanciu
c98c9996bf [cli] MAJOR: Connect a Git provider repository in vc link (#8290)
#8100 added a new `vc git` command, which allows users to connect a Git provider repository, enabling them to set up a full Git workflow for their Vercel projects without having to leave the CLI.

This PR takes this functionality a step further by including it as part of the `vc link` flow. This way, users can set up a Vercel project and add a Git provider repository all in one step.

This PR is blocked by a PR to `front` which adds an option to the Git Settings page for a Project to re-enable the prompt if the user opted out (in review).

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-08-11 22:49:36 +00:00
Matthew Stanciu
99e5c4a6db [cli] Accept URL argument in vc git connect (#8351)
* Add functional but bad code

* Add docs

* Re-add thing just in case

* Fix some things

* Add a few tests

* Add test for multiple

* Add another test

* Small type fix

* Update packages/cli/src/commands/git/index.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/src/commands/git/index.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/src/commands/git/index.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/test/unit/commands/git.test.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/src/commands/git/index.ts

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>

* Fix typo

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>

* Update packages/cli/src/commands/git/connect.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/src/commands/git/connect.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/src/commands/git/connect.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/src/commands/git/connect.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/cli/src/commands/git/connect.ts

Co-authored-by: Steven <steven@ceriously.com>

* return 0

* only return boolean in `promptConnectArg()`

* Remove err.meta check

* `parseRepoUrl()`: parse url without a scheme

* Remove todo

* Fix typo

* Small wording change

* Print each line instead of building buffer

* Make consistent quotes vs template literals

* Remove `multiple` variable

* Remove else

* Accept objects & rename some variables

* Move `connect-git-provider` to `git` folder

* Don't pass in `output`

* Fix small thing

* Add another test

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2022-08-11 14:28:58 -07:00
Chris Barber
15080364b8 [cli] Standardize on --yes instead of --confirm (#8330)
Allow for `--yes` flag consistently throughout CLI commands.

Also adds a deprecation warning for usage of `--confirm`,
since `--yes` is now preferred.
2022-08-08 18:05:22 -07:00
Matthew Stanciu
0140db38fa [cli] Support multiple remote URLs in Git config (#8145)
Two features that handle a user's local Git config have been shipped:

- #8100 
- #7910 

Both of these features currently pull only from the user's remote origin URL. This covers 90% of cases, but there are cases in which the user has more than one remote URL, and may want to use one other than the origin URL, especially in `vc git connect`. This PR:

- Adds support for multiple remote URLs in a user's Git config
- Updates `vc git connect` to prompt the user to select a URL if they have multiple remote URLs
- Updates `createGitMeta` to send the connected Git repository url by default, origin url otherwise

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-07-20 07:17:53 +00:00
Matthew Stanciu
27d80f13cd [cli] Add ability to connect Git provider repo (#8100)
This PR adds a new subcommand `vc git`, which allows you to create a Git provider repository from your local `.git` config to your Vercel project.

Usage:

- `vc git connect` – connects a Git provider repository
- `vc git disconnect` – disconnects a Git provider repository

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-07-12 17:55:40 +00:00