Commit Graph

1171 Commits

Author SHA1 Message Date
jj@jjsweb.site
cd7185a872 Publish Canary
- @vercel/build-utils@2.12.3-canary.13
 - vercel@23.1.3-canary.15
 - @vercel/client@10.2.3-canary.13
 - @vercel/frameworks@0.5.1-canary.9
 - @vercel/routing-utils@1.11.4-canary.5
2021-10-21 17:58:50 -05:00
Nathan Rajlich
c35c05446b [cli] Add CLI login unit test (#6866)
This has just been sitting in my working tree for a while, might as well push it up.
2021-10-19 20:38:29 +00:00
Jared Palmer
b88e65c4ad [cli] Add vercel pull command (#6822)
Add `vercel pull` command. Closes https://github.com/vercel/runtimes/issues/142. 

![CleanShot 2021-10-19 at 08 50 07](https://user-images.githubusercontent.com/4060187/137946853-860204ba-afaa-42da-be8a-d35bec97c808.png)

It does the following:
- Pull the `.env` file (it calls `pull` internally)
- Adds the following to `.vercel/project.json` (which will then be used by `vercel build`):
   ```tsx
   interface ProjectLink {
        projectId: string
        orgId: string
        settings: {
          buildCommand: string | null,
          devCommand:  string | null,
          directoryListing:  string | null,
          outputDirectory:  string | null,
          rootDirectory:  string | null,
          framework: string | null,
        }
    }
   ```
This PR also deprecates `vc env pull` with a warning:

![CleanShot 2021-10-19 at 08 50 21](https://user-images.githubusercontent.com/4060187/137946847-e102bd99-943a-4f07-b457-fe886007c044.png)

### 📋 Checklist

- [x] Help output
- [x] Flags (need to combine flags from `env pull`)

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

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-10-19 19:10:31 +00:00
Javi Velasco
9e16ce750b Publish Canary
- @vercel/build-utils@2.12.3-canary.12
 - vercel@23.1.3-canary.14
 - @vercel/client@10.2.3-canary.12
 - @vercel/frameworks@0.5.1-canary.8
 - @vercel/routing-utils@1.11.4-canary.4
2021-10-19 14:52:11 +02:00
jj@jjsweb.site
3d7e01ebf0 Publish Canary
- @vercel/build-utils@2.12.3-canary.11
 - vercel@23.1.3-canary.13
 - @vercel/client@10.2.3-canary.11
 - @vercel/frameworks@0.5.1-canary.7
 - @vercel/routing-utils@1.11.4-canary.3
2021-10-18 16:50:01 -05:00
Katie Byers
f985d953ed [cli] Fix swapped error messages in executeBuild() (#6724) 2021-10-14 14:31:02 -07:00
Nathan Rajlich
b8f8289afe [cli] Use getters for Now props that mirror Client (#6838)
This will prevent any issues where the `Now` instance is out-of-sync with the `Client` instance, for example, during a re-auth where a new auth token is issued. Also reduces a bit of code which is nice.
2021-10-13 22:40:06 +00:00
Nathan Rajlich
e01a1cebfd [cli] Don't pass teamId query param to /verify token endpoint (#6841)
Fixes an issue where the token would not be properly upgraded while
a Team scope was currently active, causing a new auth token to be issued
and lose the previous access scope(s).
2021-10-13 14:39:24 -07:00
Nathan Rajlich
32e935d632 [cli] Use GET /v2/user endpoint (#6828)
The `/www/user` endpoint is deprecated.
2021-10-13 17:20:54 +00:00
Miroslav Simulcik
e6818dd3f9 Publish Canary
- @vercel/build-utils@2.12.3-canary.10
 - vercel@23.1.3-canary.12
 - @vercel/client@10.2.3-canary.10
2021-10-13 16:52:12 +02:00
Nathan Rajlich
1be75712e0 [cli] Add outputBuffer getter and mutable isTTY for tests (#6827)
These changes originally from #6652, but pulled out to be merged
separately.

`outputBuffer` is a simpler way of asserting tests against the CLI
output instead of working directly withe Jest mock function.

`output.isTTY` is also now mutable, so that we can write tests for both
cases when the output is different based on TTY-ness (for example,
see the updated `vc whoami` tests in this PR).
2021-10-12 16:16:55 -07:00
Andy Bitz
f682aefc9d Publish Canary
- @vercel/build-utils@2.12.3-canary.9
 - vercel@23.1.3-canary.11
 - @vercel/client@10.2.3-canary.9
 - @vercel/frameworks@0.5.1-canary.6
2021-10-12 12:56:49 +02:00
Steven
f7de7227b4 Publish Canary
- @vercel/build-utils@2.12.3-canary.8
 - vercel@23.1.3-canary.10
 - @vercel/client@10.2.3-canary.8
2021-09-23 14:28:52 -04:00
Steven
4e52f8532b Publish Canary
- @vercel/build-utils@2.12.3-canary.7
 - vercel@23.1.3-canary.9
 - @vercel/client@10.2.3-canary.7
 - @vercel/go@1.2.4-canary.3
 - @vercel/node@1.12.2-canary.4
 - @vercel/python@2.0.6-canary.4
 - @vercel/ruby@1.2.8-canary.3
2021-09-21 22:20:00 -04:00
Steven
702cb9e29c [all] Revert to @vercel/ncc@0.24.0 (#6749) 2021-09-21 22:17:06 -04:00
jj@jjsweb.site
d3d5555d79 Publish Canary
- @vercel/build-utils@2.12.3-canary.6
 - vercel@23.1.3-canary.8
 - @vercel/client@10.2.3-canary.6
 - @vercel/frameworks@0.5.1-canary.5
 - @vercel/routing-utils@1.11.4-canary.2
2021-09-20 19:35:05 -05:00
Steven
de0b13a46e Publish Canary
- vercel@23.1.3-canary.7
 - @vercel/node@1.12.2-canary.3
2021-09-16 12:54:47 -04:00
jj@jjsweb.site
bfbd927320 Publish Canary
- @vercel/build-utils@2.12.3-canary.5
 - vercel@23.1.3-canary.6
 - @vercel/client@10.2.3-canary.5
 - @vercel/frameworks@0.5.1-canary.4
 - @vercel/routing-utils@1.11.4-canary.1
2021-09-14 15:02:32 -05:00
Steven
07c369c542 Publish Canary
- @vercel/build-utils@2.12.3-canary.4
 - vercel@23.1.3-canary.5
 - @vercel/client@10.2.3-canary.4
 - @vercel/go@1.2.4-canary.2
 - @vercel/node@1.12.2-canary.2
 - @vercel/python@2.0.6-canary.3
 - @vercel/ruby@1.2.8-canary.2
2021-09-13 16:32:45 -04:00
Steven
a2e4186ccb [all] Bump ncc to 0.31.1 (#6700)
https://github.com/vercel/ncc/releases/tag/0.31.0

https://github.com/vercel/ncc/releases/tag/0.31.1
2021-09-13 20:20:48 +00:00
Steven
6e1d708e3f Publish Canary
- vercel@23.1.3-canary.4
 - @vercel/python@2.0.6-canary.2
2021-09-08 13:56:20 -04:00
jj@jjsweb.site
e8fec4b69c Publish Canary
- @vercel/build-utils@2.12.3-canary.3
 - vercel@23.1.3-canary.3
 - @vercel/client@10.2.3-canary.3
 - @vercel/frameworks@0.5.1-canary.3
 - @vercel/routing-utils@1.11.4-canary.0
2021-09-07 11:52:01 -05:00
Steven
2644e3127b Publish Canary
- @vercel/build-utils@2.12.3-canary.2
 - vercel@23.1.3-canary.2
 - @vercel/client@10.2.3-canary.2
2021-09-02 08:42:33 -04:00
Steven
0e51884725 Publish Canary
- @vercel/build-utils@2.12.3-canary.1
 - vercel@23.1.3-canary.1
 - @vercel/client@10.2.3-canary.1
 - @vercel/frameworks@0.5.1-canary.2
 - @vercel/go@1.2.4-canary.1
 - @vercel/node-bridge@2.1.1-canary.1
 - @vercel/node@1.12.2-canary.1
 - @vercel/python@2.0.6-canary.1
 - @vercel/ruby@1.2.8-canary.1
2021-08-31 17:18:35 -04:00
Nathan Rajlich
f18bca9718 [cli] Refactor legacy Now client to TypeScript (#6650) 2021-08-31 12:47:17 -07:00
Nathan Rajlich
273718e0b7 [cli] Rewrite Unit tests to TypeScript + Jest (#6638)
* Rewrites the CLI unit tests to be TypeScript and use Jest (consistent with the unit tests in the other packages in this repo).
* The file structure of the new test files mirrors that of the `src` directory, so that it's easy to find the relevant tests.
* Code coverage is also properly set up through Jest - you can already see a big increase in coverage from this PR.
* Adds a mock API server framework, with the intention of making it possible to write granular tests of the CLI commands. Using mocks also has the benefit of not requiring `VERCEL_TOKEN` env var to be set, so 3rd party PRs will be able to have their tests run. Ultimately this will also help with test coverage, since we will be writing unit tests that test the commands' code directly.
* Converts `Output` into a proper class (which is subclassed for the mocks).
2021-08-30 22:07:09 +00:00
Nathan Rajlich
230b88bf9b [cli] Remove broken vc downgrade command (#6643)
It maps to an "upgrade" command, which does not exist.

Fixes:

```
$ vc downgrade
Vercel CLI 23.1.2
Error! Cannot find module './upgrade'
```
2021-08-28 18:01:31 +00:00
Nathan Rajlich
676a3d2568 [cli] Refactor src/index to TypeScript (#6602)
Refactors the CLI entrypoint `src/index.js` to TypeScript.
2021-08-27 19:48:31 +00:00
Nathan Rajlich
f221f041d0 Update @vercel/ncc to v0.29.2 (#6605) 2021-08-27 10:03:36 -07:00
Nathan Rajlich
ee9a8a0415 [cli] Refactor vc teams to TypeScript (#6610) 2021-08-24 11:08:30 -07:00
jj@jjsweb.site
2ad27eefb0 Publish Canary
- @vercel/build-utils@2.12.3-canary.0
 - vercel@23.1.3-canary.0
 - @vercel/client@10.2.3-canary.0
 - @vercel/frameworks@0.5.1-canary.1
 - @vercel/go@1.2.4-canary.0
 - @vercel/node-bridge@2.1.1-canary.0
 - @vercel/node@1.12.2-canary.0
 - @vercel/python@2.0.6-canary.0
 - @vercel/ruby@1.2.8-canary.0
2021-08-24 09:36:40 -05:00
Nathan Rajlich
578fe8a930 [cli] Support --project flag in vc link command (#6614)
To make setting up local dev README instructions easier for new users being introduced to a Vercel project, support flags to make the `vc link` command be non-interactive, in the case where the project name does not match the name of the directory where the code is located:

```
$ vc link --scope acme --project docs
```

Related to https://github.com/vercel/front/pull/10732.
2021-08-23 23:22:57 +00:00
Steven
46116022b7 [cli] Update readme (#6622) 2021-08-23 12:04:38 -04:00
Nathan Rajlich
0bd028cd84 [cli] Show server-side errorMessage upon deployment UNEXPECTED_ERROR (#6606)
Before:

```
Error! Unexpected error. Please try again later. ()
```

After:

```
Error! An unexpected error happened when running this build. We have been notified of the problem. If you have any questions, please contact support@vercel.com.
```
2021-08-17 18:28:56 -07:00
Nathan Rajlich
1c48030e1e [cli] Stop installing @now/build-utils for vc dev (#6604)
Users should not be using any legacy Runtimes that depend on `@now/build-utils` at this point, since those have not received updates in a long time.
2021-08-17 17:35:55 +00:00
Nathan Rajlich
288dca045c [cli] Refactor a handful of util modules to TypeScript (#6584) 2021-08-13 20:26:02 +00:00
Nathan Rajlich
9af3054d41 [cli] Use client.fetch() in vc init (#6575)
Gives us debug logging and retries, etc.
2021-08-11 19:04:01 +00:00
Nathan Rajlich
9fb254e14a [cli] Attempt to fix the "lambda-with-3-second-timeout" E2E test (#6579) 2021-08-11 00:50:57 -07:00
Nathan Rajlich
52a89fd4b7 [cli] Remove withSpinner() helper (#6576)
It's not really necessary and doesn't use the common `Output` instance.
2021-08-10 10:41:44 -07:00
Nathan Rajlich
d4db6635f1 [cli] Remove unnecessary await in Dev tests (#6572)
This is the result of VS Code's "remove all unneeded await calls" formatter.
2021-08-10 02:01:56 -07:00
Nathan Rajlich
5b61b16bd1 Publish Stable
- @vercel/build-utils@2.12.2
 - vercel@23.1.2
 - @vercel/client@10.2.2
 - @vercel/node@1.12.1
2021-08-09 11:21:40 -07:00
Nathan Rajlich
41c61f8f8b Publish Canary
- vercel@23.1.2-canary.1
2021-08-09 10:00:43 -07:00
Nathan Rajlich
6c52e1fad7 [cli] Add "outDir" to tsconfig.json (#6566)
Fixes TypeScript errors.
2021-08-09 09:58:30 -07:00
Nathan Rajlich
d2e82fdc3a [cli] Fix in-flight re-login when there are no existing credentials (#6565) 2021-08-08 00:57:23 -07:00
Nathan Rajlich
a60b1b225b Publish Canary
- @vercel/build-utils@2.12.2-canary.0
 - vercel@23.1.2-canary.0
 - @vercel/client@10.2.2-canary.0
 - @vercel/node@1.12.1-canary.0
2021-08-06 17:15:13 -07:00
Nathan Rajlich
e6fb2ffe05 Publish Stable
- @vercel/build-utils@2.12.1
 - vercel@23.1.1
 - @vercel/client@10.2.1
2021-08-06 13:00:16 -07:00
Nathan Rajlich
3db8618885 Publish Canary
- @vercel/build-utils@2.12.1-canary.0
 - vercel@23.1.1-canary.0
 - @vercel/client@10.2.1-canary.0
 - @vercel/frameworks@0.5.1-canary.0
2021-08-06 11:52:56 -07:00
Nathan Rajlich
1a776ad343 Publish Stable
- @vercel/build-utils@2.12.0
 - vercel@23.1.0
 - @vercel/client@10.2.0
 - @vercel/frameworks@0.5.0
 - @vercel/go@1.2.3
 - @vercel/node-bridge@2.1.0
 - @vercel/node@1.12.0
 - @vercel/python@2.0.5
 - @vercel/routing-utils@1.11.3
 - @vercel/ruby@1.2.7
2021-08-05 12:50:38 -07:00
Kaitlyn Carter
f0dab7d26d Publish Canary
- @vercel/build-utils@2.11.2-canary.7
 - vercel@23.0.2-canary.12
 - @vercel/client@10.1.2-canary.8
2021-08-04 16:43:03 -04:00
Nathan Rajlich
a6243962b8 Publish Canary
- @vercel/build-utils@2.11.2-canary.6
 - vercel@23.0.2-canary.11
 - @vercel/client@10.1.2-canary.7
 - @vercel/frameworks@0.4.2-canary.5
2021-08-03 11:13:36 -07:00