Commit Graph

1171 Commits

Author SHA1 Message Date
JJ Kasper
8f7c2f6385 Publish Canary
- @vercel/build-utils@2.11.2-canary.5
 - vercel@23.0.2-canary.10
 - @vercel/client@10.1.2-canary.6
 - @vercel/frameworks@0.4.2-canary.4
 - @vercel/routing-utils@1.11.3-canary.1
2021-07-26 13:02:53 -05:00
Lee Robinson
43d365c73d Publish Canary
- @vercel/build-utils@2.11.2-canary.4
 - vercel@23.0.2-canary.9
 - @vercel/client@10.1.2-canary.5
 - @vercel/frameworks@0.4.2-canary.3
2021-07-23 09:21:24 -05:00
Nathan Rajlich
868fc6159c Publish Canary
- vercel@23.0.2-canary.8
2021-07-22 17:33:30 -07:00
Nathan Rajlich
7cadbc3989 [cli] Add request counter to --debug logs (#6510)
Follow up to #6508. Adds a request "counter" that increments for every API request, matching how `front` does it.

Also tweaks the `output.time()` output a bit by rendering the timestamp in gray, and with `[]` brackets. If the time diff is < 1000ms then the full milliseconds will be printed intstead of the seconds.

<img width="710" alt="Screen Shot 2021-07-22 at 2 45 39 PM" src="https://user-images.githubusercontent.com/71256/126713843-db70ed9c-4752-4ca9-8f54-313c4cb44914.png">
2021-07-22 22:36:01 +00:00
Kaitlyn
89553e6015 [cli] Add "x-vercel-id" response header to --debug logs (#6508) 2021-07-22 14:26:21 -07:00
Nathan Rajlich
181f1d60b6 [cli] Allow dynamic label in output.time() function (#6492)
Updates the `output.time()` function to accept a function as the "label" parameter. When a function is passed, it will be invoked twice, once at the beginning of the promise being executed, and a second time after the promise has resolved. The second time, the return value of the promise is passed to the label function, so that the resolved value may be used to create the label.

Drops usage of Node's `console.time()` and `console.timeEnd()` since we were using it in a hacky and unnecessary way.
2021-07-19 20:48:02 +00:00
Nathan Rajlich
8cc72a6872 [cli] Remove "now" from variable names in vc dev (#6483) 2021-07-19 10:32:21 -07:00
Nathan Rajlich
e37e558674 Publish Canary
- vercel@23.0.2-canary.7
2021-07-16 09:35:15 -07:00
Markoz Peña
e0a62dabaa [cli] Convert vc ls and vc rm commands to TypeScript (#6460) 2021-07-15 01:33:15 -07:00
Nathan Rajlich
c23473df49 [cli] Handle the ssoUserId being pasted in "out-of-band" login mode (#6476)
Handles the edge case where a SAML login is executed for an unconnected user, so they have to complete a two-step login.
2021-07-14 18:58:36 +00:00
Nathan Rajlich
0569b268e6 [cli] Add "Local Development" section to README (#6472)
Adds a section to the CLI readme explaining how to check out the source code and use `ts-eager` for local development.
2021-07-14 07:24:57 +00:00
ernestd
db955473d9 Add billing to list of commands (#6471) 2021-07-13 14:15:56 -04:00
Steven
311ef26f60 Publish Canary
- @vercel/build-utils@2.11.2-canary.3
 - vercel@23.0.2-canary.6
 - @vercel/client@10.1.2-canary.4
 - @vercel/frameworks@0.4.2-canary.2
2021-07-13 12:34:37 -04:00
Nathan Rajlich
24b2f16afb Publish Canary
- vercel@23.0.2-canary.5
 - @vercel/client@10.1.2-canary.3
2021-07-12 15:00:14 -07:00
Nathan Rajlich
919c667ff1 [cli] Add "out-of-band" mode to vc login (#6455)
Adds an "out-of-band" login mode to the `vc login` command, for use in headless environments like inside a Docker container or an SSH session. In these situations, spawning a localhost HTTP server won't work, because the HTTP server will not be accessible to the web browser that is doing the authentication.

In "out-of-band" mode, the login URL is simply presented to the user, and they must visit the login URL in their web browser and complete the authentication. The callback URL is a page on front that shows the verification token to the user and instructs them to copy + paste the token back into the CLI, at which point the login can complete.

Docker/SSH sessions are attempted to be automatically detected, and "out-of-band" mode is enabled implicitly. But there is also an `--oob` flag in case that detection logic were to fail (or if you'd like to run OOB mode locally).

This PR also adds shortcut flags for the Git provider login mechanisms, i.e. `vc login --github`.


https://user-images.githubusercontent.com/71256/125129304-1f5f3380-e0b4-11eb-8139-d1109811bd86.mov
2021-07-12 20:29:54 +00:00
Mark Glagola
ab3f99bfea [cli][client] Printable link from deployment.aliasWarning (#6454)
* Ability to print `links` from `aliasWarning`

* Update latest.ts

* Add link style
2021-07-08 18:58:22 -05:00
Markoz Peña
a8615d3c34 [cli] Convert vc projects to TypeScript (#6452) 2021-07-08 14:46:37 -07:00
Nathan Rajlich
0a09a5232c Publish Canary
- vercel@23.0.2-canary.4
 - @vercel/node-bridge@2.0.1-canary.2
 - @vercel/node@1.11.2-canary.4
2021-07-07 19:35:35 -07:00
JJ Kasper
cf827a8b91 Publish Canary
- @vercel/build-utils@2.11.2-canary.2
 - vercel@23.0.2-canary.3
 - @vercel/client@10.1.2-canary.2
 - @vercel/frameworks@0.4.2-canary.1
 - @vercel/go@1.2.3-canary.0
 - @vercel/node-bridge@2.0.1-canary.1
 - @vercel/node@1.11.2-canary.3
 - @vercel/python@2.0.5-canary.0
 - @vercel/routing-utils@1.11.3-canary.0
 - @vercel/ruby@1.2.7-canary.0
2021-07-06 22:43:13 -05:00
Markoz Peña
0f0ee4e845 [cli] Convert vc whoami to TypeScript (#6435) 2021-07-06 15:10:00 -04:00
Nathan Rajlich
887309f0a5 [cli] Convert vc deploy to TypeScript (#6413)
This is a continuation of https://github.com/vercel/vercel/pull/6382 (thank you @markozxuu!) with merge conflicts addressed and pushed to a local branch, so that CI tests run.
2021-06-30 18:26:29 +00:00
Nathan Rajlich
8a7657c80b [cli] Use output.spinner() instead of wait() (#6414) 2021-06-29 18:48:50 -07:00
Nathan Rajlich
279d0bf988 [cli] Set current scope to proper team after SSO login (#6415) 2021-06-29 16:42:40 -07:00
Nathan Rajlich
d2b31d03da [cli] Use Client instead of LoginParams for login (#6409)
* [cli] Use `Client` instead of `LoginParams`

* Use `client.fetch()`

* Fix email verify

* Remove redundant "user-agent" header

* Fix test
2021-06-29 01:48:36 -07:00
Nathan Rajlich
16acf906fc Update to TypeScript 4.3.4 (#6397)
Also updates eslint and related packages to work with the new TypeScript version.
2021-06-25 23:45:53 +00:00
Steven
0bfc2a3693 Publish Canary
- @vercel/build-utils@2.11.2-canary.1
 - vercel@23.0.2-canary.2
 - @vercel/client@10.1.2-canary.1
 - @vercel/frameworks@0.4.2-canary.0
 - @vercel/node@1.11.2-canary.2
2021-06-25 11:22:56 -04:00
Nathan Rajlich
4b61f1dd61 [cli] Set proper currentTeam in vc deploy (#6394)
Fixes an edge case bug when the user has a current scope that is
different than the owner of the project that is being deployed.

When this was the case, the API call to get the certs for a domain at
the end of the `vc deploy` command was using the incorrect `teamId`,
potentially causing a 403 error (when the current auth token does not
have access to the selected scope).
2021-06-24 12:06:27 -07:00
Nathan Rajlich
ddf9e6cf3f [cli] Make vc deploy not load current "scope" (#6388)
`vc deploy` doesn't care about the current "scope" that the CLI has selected, since it uses the `.vercel` directory to determine the ownerId and projectId.

Therefore, it should not be fetching the team details of the selected scope during `vc deploy`, since it's possible that the token might not have access to the current scope and returns a 403, even though that API call is unnecessary for the `vc deploy` command to complete.
2021-06-23 12:32:43 -07:00
Steven
13b03c6abd Publish Canary
- @vercel/build-utils@2.11.2-canary.0
 - vercel@23.0.2-canary.1
 - @vercel/client@10.1.2-canary.0
 - @vercel/node@1.11.2-canary.1
2021-06-23 10:54:17 -04:00
Steven
7dd4c629ad [node] Add support for ESM to vc dev (#6385)
Follow up to #6121
2021-06-23 14:48:47 +00:00
Nathan Rajlich
81b3d7f5f1 [cli] Fix vc login hanging for a few seconds before exiting (#6387)
Closing keep-alive HTTP connections was causing the `server.close()` call
to take a few seconds before completing, so set the `Connection: close`
response header in order to make the connections close immediately,
so that `server.close()` is fast.
2021-06-22 20:57:15 -07:00
Nathan Rajlich
267ca7b379 [cli] Print timestamp for each line for multi-line log entries (#6384) 2021-06-22 16:46:03 -07:00
Steven
7b9d9954b8 Publish Canary
- vercel@23.0.2-canary.0
 - @vercel/node-bridge@2.0.1-canary.0
 - @vercel/node@1.11.2-canary.0
2021-06-22 15:46:21 -04:00
Nathan Rajlich
3ac8a3f67f [cli] Make vercel dev command exit quickly (#6365)
Considering that it's a development environment, it's not important to wait for ongoing HTTP request connections to complete. Sometimes it takes a long time for all the shutdown operations to complete, which makes the command feel sluggish. So let's just `process.exit()` and exit quickly.
2021-06-18 23:33:37 +00:00
Nathan Rajlich
2f19949133 [cli] Finish executing the original command after login with no credentials (#6364) 2021-06-18 13:10:30 -07:00
Steven
e659eecf48 Publish Stable
- @vercel/build-utils@2.11.1
 - vercel@23.0.1
 - @vercel/client@10.1.1
 - @vercel/frameworks@0.4.1
 - @vercel/node@1.11.1
 - @vercel/python@2.0.4
 - @vercel/routing-utils@1.11.2
2021-06-15 17:29:53 -04:00
Steven
b428f7ff83 Publish Canary
- vercel@23.0.1-canary.4
2021-06-15 16:37:28 -04:00
Nathan Rajlich
469eb4315d [cli] Update "open" to v8.2.0 (#6348)
Fixes an issue where the bundled `xdg-open` script would not be used.
2021-06-10 19:14:57 -07:00
JJ Kasper
6dc54d0d64 Publish Canary
- @vercel/build-utils@2.11.1-canary.1
 - vercel@23.0.1-canary.3
 - @vercel/client@10.1.1-canary.1
 - @vercel/frameworks@0.4.1-canary.1
 - @vercel/routing-utils@1.11.2-canary.1
2021-06-08 11:38:01 -05:00
Nathan Rajlich
88642b1ce8 [cli] Print login URL to terminal (#6336)
In some cases (i.e. when SSH'd to a remote machine) the `open` command will not work reliably. So we need to print the URL to the user as a fallback for those cases when the web browser is not automatically opened.

This also moves where `tokenName` is specified to be in the "verify" endpoint, so that it does not need to be part of the URL that gets printed to the user.

<img width="738" alt="Screen Shot 2021-06-07 at 2 12 47 PM" src="https://user-images.githubusercontent.com/71256/121089239-b5452d00-c79b-11eb-85b2-0e45b817dff0.png">
2021-06-07 22:13:58 +00:00
Steven
4b8d207533 [cli] Warn when vercel.json uses has (#6327) 2021-06-07 14:45:36 -04:00
Steven
36fe5cc4d1 [test] Fix corrupt bmp test (#6328) 2021-06-07 09:31:51 -04:00
JJ Kasper
370b0dbed2 Publish Canary
- vercel@23.0.1-canary.2
 - @vercel/node@1.11.1-canary.0
2021-06-06 15:24:50 -05:00
Markoz Peña
6eea26c39e [cli] Convert vc alias to TS (#6325)
* refactor: Remove unncessary file

* feat(cli/alias): Migration to TS

* refactor(cli/alias): Add a line break

* refactor(cli/alias): Remove unnecesary code

* feat(cli): Add `Paginationoptions` type to `pagination`

* feat(cli/commands): Rewrite th `alias ls` command to TS

* refactor: Remove unncessary code

* feat: Create helper function for `getSafeAlias`

* refactor: Remove unnecessary code

* feat: Remove parameter generic, "null" for the fetch

* feat(cli/alias): Rewritten in full TS

* feat: Add Partial to opts

* refactor: Remove comment @ts-ignore

* feat: Add Partial to opts

* feat: Only should be return `alias.uid`

* refactor: Remove `Alias` type from of the parameter `id`

* refactor: Remove destructuring from alias object

* refactor: Remove unnecessary code

* feat: Rename `created` property to `createdAt` of number type

* refactor: Move getSafeAlias function in the same file

* refactor: Simplifying code

* refactor: Intentation did not affect diff on git

* Add null back to type

Co-authored-by: Steven <steven@ceriously.com>
2021-06-04 16:43:39 -04:00
Nathan Rajlich
b8bfae7840 [cli] Fix vc logout command when using Team scope (#6322)
Fixes logout command not working when switched to a Team scope:

```
$ vc login
$ vc switch $some_team
$ vc logout
Failed during logout
```
2021-06-04 19:48:03 +00:00
Nathan Rajlich
dc6a0a1cbb [cli] Upgrade token scopes in vc switch command (#6323)
Pass the `Authorization` request header to the verify endpoint so that the current auth token will be upgraded with the new scope.

[ch22273]
2021-06-04 18:33:49 +00:00
Steven
a6807c9d21 Publish Canary
- vercel@23.0.1-canary.1
 - @vercel/python@2.0.4-canary.0
2021-06-01 14:35:09 -04:00
Steven
c628090d08 [cli] Fix vc projects rm race condition (#6306)
The call to `GET /projects/info` is used to check existence but it can cause a race condition if the project was removed before the `DELETE /v2/projects` is called.

Instead, we rely on the response from `DELETE /v2/projects` to determine if the project exists or not.

This will also allow us to remove a legacy API endpoint in the future (see related API PR)
2021-06-01 18:31:20 +00:00
JJ Kasper
ee0bc9b0c8 Publish Canary
- @vercel/build-utils@2.11.1-canary.0
 - vercel@23.0.1-canary.0
 - @vercel/client@10.1.1-canary.0
 - @vercel/frameworks@0.4.1-canary.0
 - @vercel/routing-utils@1.11.2-canary.0
2021-05-26 13:44:39 -05:00
Nathan Rajlich
f2d396caae Publish Stable
- @vercel/build-utils@2.11.0
 - vercel@23.0.0
 - @vercel/client@10.1.0
 - @vercel/frameworks@0.4.0
 - @vercel/node@1.11.0
 - @vercel/python@2.0.3
 - @vercel/routing-utils@1.11.1
2021-05-25 14:56:11 -07:00