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.
#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
* 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>
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
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