Commit Graph

1171 Commits

Author SHA1 Message Date
Steven
93f5a4438b [cli] Improve error message when using legacy @now builders (#8677)
This PR adds a helpful error message when using a legacy `@now` builder.

This mimics the behavior of the build-container.
2023-01-23 17:49:24 +00:00
Andy McKay
4bf3c237ee [cli] Revert some tables back to stdout (#9227)
In https://github.com/vercel/vercel/pull/8735 some output was sent to `stderr`, this sends them `stdout` instead.
2023-01-20 20:58:28 +00:00
Ethan Arrowood
92f5b6e0c9 Publish Stable
- vercel@28.13.0
 - @vercel/gatsby-plugin-vercel-builder@0.1.2
 - @vercel/next@3.3.18
 - @vercel/node@2.8.15
 - @vercel/static-build@1.2.0
2023-01-20 10:27:31 -07:00
Nathan Rajlich
e174a06673 Publish Stable
- vercel@28.12.8
 - @vercel/gatsby-plugin-vercel-builder@0.1.1
 - @vercel/next@3.3.17
 - @vercel/remix@1.2.7
2023-01-18 15:19:12 -08:00
Steven
ad107ecf79 [tests] Split more dev tests (#9230)
This PR attempts to balance the tests so they run concurrently and therefore faster.

I also sorted the tests so they are deterministic when splitting/chunking.
2023-01-18 17:35:45 +00:00
Steven
79ef5c3724 Publish Stable
- vercel@28.12.7
 - @vercel/client@12.3.2
 - @vercel/gatsby-plugin-vercel-builder@0.1.0
 - @vercel/next@3.3.16
 - @vercel/node-bridge@3.1.10
 - @vercel/node@2.8.14
 - @vercel/remix@1.2.6
2023-01-18 08:39:44 -05:00
Steven
4ccdcde463 Publish Stable
- @vercel/build-utils@5.9.0
 - vercel@28.12.6
 - @vercel/client@12.3.1
 - @vercel/fs-detectors@3.7.5
 - @vercel/go@2.2.30
 - @vercel/hydrogen@0.0.44
 - @vercel/next@3.3.15
 - @vercel/node@2.8.13
 - @vercel/python@3.1.40
 - @vercel/redwood@1.0.51
 - @vercel/remix@1.2.5
 - @vercel/ruby@1.3.56
 - @vercel/static-build@1.1.7
2023-01-17 19:25:26 -05:00
Sean Massa
6d97e1673e Publish Stable
- vercel@28.12.5
 - @vercel/client@12.3.0
 - @vercel/node-bridge@3.1.9
 - @vercel/node@2.8.12
2023-01-17 13:46:58 -06:00
Steven
35024a4e3a [tests] Split up dev tests to increase concurrency (#9228)
This will speed up CI because we can run more tests concurrently.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-13 18:53:57 -05:00
Sean Massa
b5cdc82a1c Publish Stable
- @vercel/build-utils@5.8.3
 - vercel@28.12.4
 - @vercel/client@12.2.31
 - @vercel/edge@0.2.6
 - @vercel/error-utils@1.0.8
 - @vercel/frameworks@1.2.4
 - @vercel/fs-detectors@3.7.4
 - @vercel/gatsby-plugin-vercel-analytics@1.0.6
 - @vercel/go@2.2.29
 - @vercel/hydrogen@0.0.43
 - @vercel/next@3.3.14
 - @vercel/node-bridge@3.1.8
 - @vercel/node@2.8.11
 - @vercel/python@3.1.39
 - @vercel/redwood@1.0.50
 - @vercel/remix@1.2.4
 - @vercel/routing-utils@2.1.8
 - @vercel/ruby@1.3.55
 - @vercel/static-build@1.1.6
 - @vercel/static-config@2.0.11
2023-01-13 15:45:03 -06:00
Nathan Rajlich
c7851404b3 [*] Remove "workspace:" (#9225) 2023-01-13 15:42:29 -06:00
Sean Massa
e54da8a2e5 Publish Stable
- @vercel/build-utils@5.8.2
 - vercel@28.12.3
 - @vercel/client@12.2.30
 - @vercel/edge@0.2.5
 - @vercel/error-utils@1.0.7
 - @vercel/frameworks@1.2.3
 - @vercel/fs-detectors@3.7.3
 - @vercel/gatsby-plugin-vercel-analytics@1.0.5
 - @vercel/go@2.2.28
 - @vercel/hydrogen@0.0.42
 - @vercel/next@3.3.13
 - @vercel/node-bridge@3.1.7
 - @vercel/node@2.8.10
 - @vercel/python@3.1.38
 - @vercel/redwood@1.0.49
 - @vercel/remix@1.2.3
 - @vercel/routing-utils@2.1.7
 - @vercel/ruby@1.3.54
 - @vercel/static-build@1.1.5
 - @vercel/static-config@2.0.10
2023-01-13 15:06:45 -06:00
Sean Massa
b793a67588 Publish Stable
- @vercel/build-utils@5.8.1
 - vercel@28.12.2
 - @vercel/client@12.2.29
 - @vercel/edge@0.2.4
 - @vercel/error-utils@1.0.6
 - @vercel/frameworks@1.2.2
 - @vercel/fs-detectors@3.7.2
 - @vercel/gatsby-plugin-vercel-analytics@1.0.4
 - @vercel/go@2.2.27
 - @vercel/hydrogen@0.0.41
 - @vercel/next@3.3.12
 - @vercel/node-bridge@3.1.6
 - @vercel/node@2.8.9
 - @vercel/python@3.1.37
 - @vercel/redwood@1.0.48
 - @vercel/remix@1.2.2
 - @vercel/routing-utils@2.1.6
 - @vercel/ruby@1.3.53
 - @vercel/static-build@1.1.4
 - @vercel/static-config@2.0.9
2023-01-13 15:01:55 -06:00
Sean Massa
e71d5638ee Publish Stable
- @vercel/build-utils@5.8.0
 - vercel@28.12.1
 - @vercel/client@12.2.28
 - @vercel/edge@0.2.3
 - @vercel/error-utils@1.0.5
 - @vercel/frameworks@1.2.1
 - @vercel/fs-detectors@3.7.1
 - @vercel/gatsby-plugin-vercel-analytics@1.0.3
 - @vercel/go@2.2.26
 - @vercel/hydrogen@0.0.40
 - @vercel/next@3.3.11
 - @vercel/node-bridge@3.1.5
 - @vercel/node@2.8.8
 - @vercel/python@3.1.36
 - @vercel/redwood@1.0.47
 - @vercel/remix@1.2.1
 - @vercel/routing-utils@2.1.5
 - @vercel/ruby@1.3.52
 - @vercel/static-build@1.1.3
 - @vercel/static-config@2.0.8
2023-01-13 14:47:25 -06:00
Sean Massa
62b28ad0b4 Publish Stable
- @vercel/build-utils@5.7.6
 - vercel@28.12.0
 - @vercel/client@12.2.27
 - @vercel/edge@0.2.2
 - @vercel/error-utils@1.0.4
 - @vercel/frameworks@1.2.0
 - @vercel/fs-detectors@3.7.0
 - @vercel/gatsby-plugin-vercel-analytics@1.0.2
 - @vercel/go@2.2.25
 - @vercel/hydrogen@0.0.39
 - @vercel/next@3.3.10
 - @vercel/node-bridge@3.1.4
 - @vercel/node@2.8.7
 - @vercel/python@3.1.35
 - @vercel/redwood@1.0.46
 - @vercel/remix@1.2.0
 - @vercel/routing-utils@2.1.4
 - @vercel/ruby@1.3.51
 - @vercel/static-build@1.1.2
 - @vercel/static-config@2.0.7
2023-01-13 14:00:46 -06:00
Chris Barber
e20b74687f [docs] Updated local dev instructions in CLI readme (#9215)
When I run `pnpm`, it just prints the help screen. I need to specify the install command `pnpm i`.
2023-01-13 16:25:53 +00:00
Sean Massa
8f1358bd15 [cli][frameworks][fs-detectors][next] detect framework versions (#9009)
This PR:

- updates `packages/frameworks` to have most supported frameworks specify which dependency version should reflect the overall framework version
- updates `packages/fs-detectors` to allow framework detection that returns the full `Framework` record instead of just the slug
- updates `packages/next` to return the detected Next.js version in the build result
- updates `packages/cli` to leverage these changes so that `vc build` can add `framework: { version: string; }` to `config.json` output

The result is that Build Output API and supported frameworks will return their framework version in the build result of `vc build` when possible, which is used by the build container  when creating the deployment. The dashboard later retrieves this value to display in richer deployment outputs.

Supports:

- https://github.com/vercel/api/pull/15601
- https://github.com/vercel/front/pull/18319

---

With the related build container updates, we get to see Next.js version in the build output. You'll see this with BOA+Prebuilt or a normal deploy:

<img width="1228" alt="Screen Shot 2022-12-09 at 2 48 12 PM" src="https://user-images.githubusercontent.com/41545/206793639-f9cd3bdf-b822-45dd-9564-95b94994271d.png">

---

### The Path to this PR

I went through all the supported frameworks and figured out how to best determine their versions. For most of them, we can check a known dependency's installed version number. 

We can get most of the way only checking npm. For a handful, we'd have to support Go/Ruby/Rust/Whatever dependencies.

I started with a more complex method signature to allow for later expansion without changing the signature. It looked like this, in practice:

```
async getVersion(dependencies: DependencyMap) => depedencies['next']
```

However, after checking all currently supported frameworks, I don't think this will end up being necessary. It also has the constraint that all dependencies have to be gathered and presented to the function even though it only needs to check for one or two. That's not a huge deal if we have them already where we need them, but we don't. We could use a variant here where this function does its own lookups, but this seemed unnecessary and would beg for duplication and small variances that could cause bugs.

Further, if we only look at `package.json`, we're going to either see a specific version of a version range. To be precise, we have to look at the installed version of the package. That means checking one of the various types of lockfiles that can exist or poking into node_modules.

If we poke into node_modules to detect the installed version, we introduce another point where Yarn 3 (default mode) will not be supported. If we read lockfiles, we have to potentially parse `npm`, `pnpm`, and `yarn` lockfiles.

If we use `npm ls <package-name>`, that also fails in Yarn 3 (default mode). We could accept that and go forward anyway, which would look like:

```
const args = `ls ${packageName} --depth=0 --json`.split(' ');
const { stdout } = await execa('npm', args, { cwd });
const regex = new RegExp(String.raw`${packageName}@([\.\d]+)`);
const matches = stdout.match(regex);
if (matches) {
  return matches[1];
}
```

But it turns out there's a `--json` option! That's what I ended up using, for now.

We could explore the lockfile route more, but after some initial digging, it' non-trivial. There are 3 main lockfiles we'd want to check for (npm, pnpm, and yarn) and there are different lockfile versions that put necessary data in different places. I looked for existing tools that parse this, but I didn't find any. We could certainly go down this path, but the effort doesn't seem worth it when `npm ls` gets us really close.

---

### Follow-up Versioning

Now that we know how to determine version per framework, we can vary configuration by version. In a future PR, we could allow a given value to vary by version number:

```
name: (version) => {
  if (semver.gt(version, '9.8.7')) {
    return 'some-framework-2''
  }

  return 'some-framework';
}
```

However, it may still be easier to differentiate significant versions by adding multiple entries in the list.
2023-01-13 07:50:00 +00:00
Chris Barber
eb0a031aeb [tests] Adding missing jest-matcher-utils dependency (#9214)
Fixes the following error when tests are run:

```
Cannot find module 'jest-matcher-utils' from 'test/mocks/matchers/to-output.ts'
```

Log: https://github.com/vercel/vercel/actions/runs/3898221824/jobs/6656730316#step:10:3049
2023-01-12 23:32:11 +00:00
Chris Barber
f327be2d1f [cli] Bumped get latest version test timeouts (#9213) 2023-01-12 22:45:21 +00:00
Steven
90cbd675fa [cli] Remove qs dependency (#9206)
There is no need for `qs` because the query string for `teamId` is already handled here:

5b88f673f8/packages/cli/src/util/client.ts (L99)
2023-01-12 02:01:16 +00:00
Ethan Arrowood
9c768b98b7 [tests] Migrate from yarn to pnpm (#9198)
<picture data-single-emoji=":pnpm:" title=":pnpm:"><img class="emoji" src="https://single-emoji.vercel.app/api/emoji/eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..4mJzrO94AnSn0Pue.4apgaKtTUdQ-wxNyahjdJj28u8bbXreLoTA8AGqYjLta3MrsFvbo9DsQFth4CoIkBgXFhQ5_BVcKNfYbwLg4bKzyIvItKe4OFS8AzG7Kkicz2kUUZk0.nXyK_PvHzZFGA-MQB6XHfA" alt=":pnpm:" width="20" height="auto" align="absmiddle"></picture> 

yarn has become increasingly more difficult to use as the v1 we rely on no longer receives updates. pnpm is faster and is actively maintained. 

This PR migrates us to pnpm.
2023-01-11 23:35:13 +00:00
JJ Kasper
4c3bc05322 Publish Stable
- @vercel/build-utils@5.7.5
 - vercel@28.11.1
 - @vercel/client@12.2.26
 - @vercel/fs-detectors@3.6.2
 - @vercel/gatsby-plugin-vercel-analytics@1.0.1
 - @vercel/go@2.2.24
 - @vercel/hydrogen@0.0.38
 - @vercel/next@3.3.9
 - @vercel/node@2.8.6
 - @vercel/python@3.1.34
 - @vercel/redwood@1.0.45
 - @vercel/remix@1.1.7
 - @vercel/ruby@1.3.50
 - @vercel/static-build@1.1.1
2023-01-11 12:01:03 -08:00
Chris Barber
e1aaf8080b [cli] Replace update-notifier dependency with build in (#9098)
This PR replaces the `update-notifier` dependency with a custom implementation.

There are a few reasons: the dependency is quite large, it requires ESM in order to update, can sometimes suggest an update to an older version, and used dependencies with known security issues.

The result looks like:

<img width="768" alt="image" src="https://user-images.githubusercontent.com/97262/208452226-b7508299-f830-4d42-a96a-7646ec8227aa.png">

Note: This PR is the successor to https://github.com/vercel/vercel/pull/8090.
2023-01-11 03:45:36 +00:00
Chris Barber
f92d229a63 [cli] Rollback team check (#9120)
https://linear.app/vercel/issue/VCCLI-377/rollback-failing-for-enterprise-teams

When running `vc rollback` for a deployment belonging to another team, the command will fail requesting the rollback. Technically, the command should have failed trying to get the deployment. This PR checks that the current team matches the deployment being rolled back.

![image](https://user-images.githubusercontent.com/97262/210431585-ffb73658-b15c-4adb-b110-a8c5e816db32.png)

This PR also cleans up a bunch of deployment related things. There were 3 functions to get a deployment and now there's just one which uses the latest v13 API. Get deployment error handling now throws instead of returning an error. The `Deployment` type definition has been updated to match the v13 response and mock deployment data was also updated.
2023-01-10 21:05:08 +00:00
Ethan Arrowood
721cd3afcb Publish Stable
- @vercel/build-utils@5.7.4
 - vercel@28.11.0
 - @vercel/client@12.2.25
 - @vercel/frameworks@1.1.18
 - @vercel/fs-detectors@3.6.1
 - @vercel/gatsby-plugin-vercel-analytics@1.0.0
 - @vercel/go@2.2.23
 - @vercel/hydrogen@0.0.37
 - @vercel/next@3.3.8
 - @vercel/node@2.8.5
 - @vercel/python@3.1.33
 - @vercel/redwood@1.0.44
 - @vercel/remix@1.1.6
 - @vercel/ruby@1.3.49
 - @vercel/static-build@1.1.0
2023-01-09 15:53:47 -07:00
Ethan Arrowood
976e082c44 [tests] Fix monorepo tests so they are less flaky (#9181)
This PR generates lockfiles for the various monorepo build tests and updates the package versions to their latest within the major. This should help make these tests less flaky.
2023-01-06 22:42:38 +00:00
Steven
fc0e6872e5 Publish Stable
- vercel@28.10.3
 - @vercel/frameworks@1.1.17
 - @vercel/fs-detectors@3.6.0
 - @vercel/next@3.3.7
 - @vercel/node-bridge@3.1.3
 - @vercel/node@2.8.4
 - @vercel/redwood@1.0.43
 - @vercel/remix@1.1.5
 - @vercel/static-build@1.0.46
2023-01-05 16:27:06 -05:00
Ethan Arrowood
d800d9cd68 [fs-detectors][cli] move monorepo default setting code to fs-detectors (#9101)
Makes the monorepo default setting logic reusable by API and includes a `commandForIgnoringBuildStep` setting for Turbo projects.
2023-01-05 21:16:03 +00:00
Steven
feceeef7b7 [node] Fix ESM output from TS source (#7954)
- Depends on https://github.com/vercel/nft/pull/297
- Fixes #7908 
- Fixes #6194 

This PR bumps `@vercel/nft` (for production) and `ts-node` (for
development) to fix ESM behavior.

Because Node.js cannot dynamically set [loader
hooks](https://nodejs.org/docs/latest-v18.x/api/esm.html#loaders) once a
process is started, I had to change the way `ts-node` is registered by
using environment variables such as `NODE_OPTIONS`. Most of the logic
for TS and ESM was pulled out of the child process and into the parent.

Co-authored-by: Ethan Arrowood <ethan.arrowood@vercel.com>
2023-01-05 15:25:32 -05:00
Steven
d6cccd70f2 Publish Stable
- @vercel/build-utils@5.7.3
 - vercel@28.10.2
 - @vercel/client@12.2.24
 - @vercel/fs-detectors@3.5.7
 - @vercel/go@2.2.22
 - @vercel/hydrogen@0.0.36
 - @vercel/next@3.3.6
 - @vercel/node@2.8.3
 - @vercel/python@3.1.32
 - @vercel/redwood@1.0.42
 - @vercel/remix@1.1.4
 - @vercel/ruby@1.3.48
 - @vercel/static-build@1.0.45
2023-01-03 17:31:50 -05:00
Chris Barber
cb29bfdd68 Publish Stable
- @vercel/build-utils@5.7.2
 - vercel@28.10.1
 - @vercel/client@12.2.23
 - @vercel/frameworks@1.1.16
 - @vercel/fs-detectors@3.5.6
 - @vercel/go@2.2.21
 - @vercel/hydrogen@0.0.35
 - @vercel/next@3.3.5
 - @vercel/node@2.8.2
 - @vercel/python@3.1.31
 - @vercel/redwood@1.0.41
 - @vercel/remix@1.1.3
 - @vercel/ruby@1.3.47
 - @vercel/static-build@1.0.44
2022-12-22 18:47:23 -06:00
Steven
04e9f771df Publish Stable
- vercel@28.10.0
 - @vercel/edge@0.2.1
 - @vercel/next@3.3.4
2022-12-21 11:13:25 -05:00
Nathan Rajlich
21f25f5eb0 [cli] Add Output#link() function to format terminal hyperlinks (#8370)
This adds a `link()` helper function to the `Output` class that is inspired by the `terminal-link` npm package.

The main difference with this version is that it's more tightly integrated with the `Output` class for the purposes of being able to toggle hyperlinks support on/off for [unit tests](4a54b19f46/packages/cli/test/unit/util/output/create-output.test.ts) by setting the `output.supportsHyperlink` boolean.

> **Note:** Since hyperlinks are still a relatively new feature, and users might not yet understand how to interact with them, we should only use this function for progressive enhancement scenarios at this time, and _not_ as part of a critical UX.
2022-12-20 02:33:59 +00:00
Chris Barber
019590e845 [cli] Only throw DeploymentNotReady if deployment not ready (#9100)
When adding an alias, the server can return a 400 Bad Request under these circumstances:

1. Invalid alias: no alias, empty string, null alias, alias domain is invalid, alias is not public, alias is not a subdomain (code: `'invalid_alias'`)
2. The deployment is indeed not ready (code `'deployment_not_ready'`)
3. The cert for the provided alias is not ready (code `'cert_missing'`)
4. There was an error assigning the alias (code varies)

`vc alias add` will treat all 4 of those bad request errors as the deployment "is not ready". Instead of treating all 400's as not ready, only return `DeploymentNotReady` if the `code` is set to `'deployment_not_ready'`.
2022-12-19 18:20:04 +00:00
Steven
4484c13448 Publish Stable
- @vercel/build-utils@5.7.1
 - vercel@28.9.0
 - @vercel/client@12.2.22
 - @vercel/frameworks@1.1.15
 - @vercel/fs-detectors@3.5.5
 - @vercel/go@2.2.20
 - @vercel/hydrogen@0.0.34
 - @vercel/next@3.3.3
 - @vercel/node@2.8.1
 - @vercel/python@3.1.30
 - @vercel/redwood@1.0.40
 - @vercel/remix@1.1.2
 - @vercel/ruby@1.3.46
 - @vercel/static-build@1.0.43
2022-12-14 16:23:22 -05:00
Sean Massa
25e2b7f0ce [tests] fix flakey tests (#9071)
Fixes flakey tests / CI:

- git metadata test for corrupted `.git` directory
- version identifier for `build-utils` being using in `fs-detectors`'s `devDependencies`
- bad import from `../dist/..`
2022-12-13 04:19:26 +00:00
Nathan Rajlich
17a7ec5456 [cli] Add --git-branch option to vc pull and vc env pull (#9028)
Allows for the the Git branch name to be specified when pulling Preview environment variables.

```
$ vc pull --branch feat/new-header --environment preview
…
  Updated .vercel/.env.preview.local file [236ms]
…

$ cat .vercel/.env.preview.local
# Created by Vercel CLI
A="a"

$ vc pull --branch remove/something --environment preview
…
  Updated .vercel/.env.preview.local file [340ms]
…

$ cat .vercel/.env.preview.local
# Created by Vercel CLI
B="b"
```
2022-12-09 19:29:50 +00:00
Steven
f619441eb4 [cli] Remove unused dependency email-prompt (#9042)
Remove unused dependency `email-prompt`

- closes https://github.com/vercel/vercel/issues/1190
2022-12-08 14:21:05 +00:00
Sean Massa
e65af715de Revert "testing a theory in CI" (#9044)
Reverts vercel/vercel#9041
2022-12-07 18:04:27 -05:00
Sean Massa
beee71cfe3 testing a theory in CI (#9041)
DO NOT MERGE
2022-12-07 22:52:28 +00:00
Steven
34b93e52c8 [examples] Bump decode-uri-component (#9029)
This PR closes all the dependabot PRs created today

- #9018
- #9019 
- #9020 
- #9021 
- #9022 
- #9023 
- #9024 
- #9025 
- #9026

Co-authored-by: Chris Barber <chris.barber@vercel.com>
2022-12-07 11:17:54 -05:00
Sean Massa
584d0ea853 Publish Stable
- vercel@28.8.0
 - @vercel/node@2.8.0
2022-12-07 09:53:52 -06:00
Damien Simonin Feugas
2413e684a1 feat(node,cli): allows 'edge' as possible runtime value (#9016)
### 📖 What's in there?

As part of Edge function GA, we're allowing `edge` as a runtime value.
This is adding to the allowed list, so we stay backward compatible.

[Linear ticket](https://linear.app/vercel/issue/EC-481/add-edge-to-the-list-of-allowed-runtimes)

I've kept one instance of `experimental-edge` in the test fixtures to ensure we still supports it.

### 📋 Checklist

####  🧪 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
2022-12-07 13:35:08 +00:00
Andy McKay
9b92a810bb [cli] Allow ls to specify a limit up to 100 (#8735)
### Related Issues

Allow the `ls` commands to have a `--limit` option that allows a user to fetch up to 100 records per page. Currently the default is 20, but the API allows up to 100. This keeps the default, if unspecified at 20. 

Fixes: https://linear.app/vercel/issue/VCCLI-244/add-limit-option-all-the-ls-subcommands

This adds in `ls --limit` into:
- [x] `alias ls`
- [x] `certs ls`
- [x] `dns ls`
- [x] `domains ls`

I note that `env` has an `ls` command, but it doesn't have a pagination command and [looking at the API](https://vercel.com/docs/rest-api#endpoints/projects/retrieve-the-environment-variables-of-a-project-by-id-or-name) it doesn't support pagination or limit.

Wasn't sure if I should add in `-L` as a short cut to `--limit`, seems like a good idea.

~Couldn't find any tests that cover this API, but I could be looking in the wrong place, this is the first pull request, so my apologies if I've missed it. But I'll take another look tomorrow and leave it in the draft state for now.~

Added in unit tests for each of the commands and mocks for those unit tests, which is has caused this PR to get quite a bit larger, sorry about that.

Of note for reviewers, there were a few places where I changed `console.log` to `output.log` to get the output passed to the tests - as far as I can tell everything works on the command line and in tests.

### 📋 Checklist


#### 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
2022-12-07 00:46:31 +00:00
Chris Barber
17a73f4f11 Publish Stable
- vercel@28.7.2
2022-12-02 18:20:48 -06:00
Lee Robinson
2e0cbf10de [cli] Revert replace update-notifier dependency with built in (#9000)
Reverts https://github.com/vercel/vercel/pull/8090.


![image](https://user-images.githubusercontent.com/9113740/205410222-efd63ff6-8094-4cba-8316-559845c64289.png)
2022-12-02 18:20:11 -06:00
Sean Massa
b37ac5f798 Publish Stable
- @vercel/build-utils@5.7.0
 - vercel@28.7.1
 - @vercel/client@12.2.21
 - @vercel/go@2.2.19
 - @vercel/hydrogen@0.0.33
 - @vercel/next@3.3.2
 - @vercel/node@2.7.1
 - @vercel/python@3.1.29
 - @vercel/redwood@1.0.39
 - @vercel/remix@1.1.1
 - @vercel/ruby@1.3.45
 - @vercel/static-build@1.0.42
2022-12-02 14:15:48 -06:00
Steven
577fd3e979 [cli] Replace update-notifier dependency with built in (#8090)
This PR replaces the `update-notifier` dependency with a custom
implementation.

There are a few reasons: the dependency is quite large, it requires ESM
in order to update, and can sometimes suggest an update to an older
version. For example:


![image](https://user-images.githubusercontent.com/229881/195891579-c8c047a6-51ec-45f2-b597-daf927f48203.png)


- Related to #8038

Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: Chris Barber <chris@cb1inc.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-01 17:07:52 -06:00
Chris Barber
a036b03398 Publish Stable
- vercel@28.7.0
 - @vercel/frameworks@1.1.14
 - @vercel/fs-detectors@3.5.4
 - @vercel/next@3.3.1
 - @vercel/static-build@1.0.41
2022-11-30 15:52:38 -06:00
Chris Barber
1a6a030df5 [cli] Add vc rollback command (#8942)
The `vc rollback` command provides the ability to redeploy a previous
deployment and check the status of a rollback request.

#### Requesting a rollback

    vc rollback <id | url>

Upon requesting a rollback, the command will being a status polling loop
for 3 minutes. This timeout can be adjusted via the `--timeout <value>`
option which accepts time formats such as `30s` or `2m`. A timeout of
`0` (zero) will skip the status polling and immediately exit after
successfully requesting a rollback.

#### Querying rollback status 

    vc rollback
    vc rollback status

The `status` action will return the most recent rollback info within the
last 3 minutes.

### Related Issues

>
https://linear.app/vercel/issue/HIT-117/cli-add-support-for-vc-rollback-deployid
>
https://linear.app/vercel/issue/HIT-118/cli-add-support-for-vc-rollback-[status]

### 📋 Checklist

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

#### Tests

- [ ] The code changed/added as part of this PR has been covered with
tests
- [ ] 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-11-30 14:08:06 -06:00