Commit Graph

1171 Commits

Author SHA1 Message Date
Nathan Rajlich
67e20a6ede [cli] Add repo linking support for deploy command (#10013)
Adds support for `vercel deploy` command when the repository has been linked via `vercel link --repo`.
2023-05-31 18:07:30 +00:00
Nathan Rajlich
57515d2d07 [cli] Fix link subcommand unit tests on Windows (#10033)
Follow-up to #10031 which broke the `link` unit tests on Windows.

For some reason Kodiak was a bad bot and merged the PR with failing tests <picture data-single-emoji=":rarityannoyed:" title=":rarityannoyed:"><img class="emoji" src="https://emoji.slack-edge.com/T0CAQ00TU/rarityannoyed/b62f8c87a5fb7239.png" alt=":rarityannoyed:" width="20" height="auto" align="absmiddle"></picture> 

_Note:_ Probably easier to review with [whitespace hidden](https://github.com/vercel/vercel/pull/10033/files?w=1).
2023-05-26 21:27:19 +00:00
Nathan Rajlich
ef30a46c03 [cli] Add client.cwd to unify all working directory related logic (#10031)
A few commands were still checking on `--cwd` explicitly, which is incorrect since the entrypoint file already handles the directory change.

The new `client.cwd` property is a helper to make writing tests easier. Tests no longer need to `chdir()` explicitly and then revert afterwards.
2023-05-26 20:42:03 +00:00
Nathan Rajlich
00813a3945 [cli] Add expect dev dependency to fix type error in toOutput (#10021)
Also make the timeout print what was buffered to help with debugging failed tests.
2023-05-24 21:35:33 +00:00
Chris Barber
a73ec6343f [cli] Clean up 'vc rollback' (#10019)
This PR removes dependency on the deprecated `lastRollbackTarget` project property and adopts many of the code conventions used in `vc promote`.

Important! Please merge #9984 first!
2023-05-24 19:10:28 +00:00
Chris Barber
4bd70d4b6e [cli] New vc promote command (#9984)
~This PR is blocked by https://github.com/vercel/api/pull/19508.~

Linear: https://linear.app/vercel/issue/VCCLI-262/cli-new-command-to-promote-deployment
2023-05-24 17:22:11 +00:00
Vercel Release Bot
aab95532d6 Version Packages (#10006)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-24 10:13:01 -05:00
Sean Massa
1b18c853c2 [cli] implement vc deploy --prod --skip-domain (#9836)
Adds the `--skip-domain` option to be used like `vc deploy --prod --skip-domain`. This passes along the `autoAliasCustomDomains: false` flag to the API so that the deployment will not auto alias domains for this deployment.

This PR also moves the `commands/deploy/archive` fixture to `commands/deploy/static` to better describe what the fixture is, not how it is sometimes used in a test.

---

Depends on: https://github.com/vercel/api/pull/18730
Card: https://linear.app/vercel/issue/VCCLI-276/cli-allow-creation-of-production-deployment-without-auto-alias
2023-05-23 19:26:47 +00:00
Samuel Bodin
a19edc985b [cli] Fix vercel git connect command when passing a URL parameter (#9967)
Hey team,

I had an error this morning when trying to link my repo using the CLI 
![Screenshot 2023-05-17 at 11 38 01](https://github.com/vercel/vercel/assets/1637651/798d6e4f-8c9e-41b7-b712-0322001fca02)


Seems like a combination of `: any` and a recent refacto introduced an issue here.

~- Removed all `any` that were hiding the error~
- Correctly pass the URL already parsed

~- Removed the second useless parsing~
~- Added missing `--help` flag~
  ~I noticed you never specify them and Typescript screams because of that, not sure if on purpose and how you make the compilation pass with this error. Don't hesitate to tell me.~

The fix could be improved by using `arg.Result<THE_ACTUAL_TYPE>` but that would require to store the dictionnary of flags somewhere else and also create an external type. This is already better so...

--- 

NB: 
I had multiple issues while cloning this repo
- pnpm bootstrap does not work
- missing `constants.ts` file that is not explained in the Contributing guidelines
- maybe due to bootstrap not working, almost nothing else worked and the tests too.
2023-05-23 02:50:42 +00:00
Nathan Rajlich
4fd593ac09 Sync repo package versions (#10002)
Some of these packages got out of sync at some point, causing duplicate
/ older copies to be installed. Additionally, the `@vercel-internal`
packages should have "version" fields.

Attempting to fix these
[warnings](https://github.com/vercel/vercel/actions/runs/5048844603/jobs/9057538600)
during release:

```
Package "examples" must depend on the current version of "@vercel/frameworks": "1.4.2" vs "1.3.0"
Package "@vercel-internals/constants" must depend on the current version of "@vercel/build-utils": "6.7.3" vs "6.3.2"
Package "@vercel-internals/constants" must depend on the current version of "@vercel/routing-utils": "2.2.1" vs "2.1.10"
Package "@vercel-internals/constants" must depend on the current version of "@vercel-internals/tsconfig": "undefined" vs "*"
Package "@vercel-internals/get-package-json" must depend on the current version of "@vercel-internals/tsconfig": "undefined" vs "*"
Package "@vercel-internals/types" must depend on the current version of "@vercel-internals/constants": "undefined" vs "*"
Package "@vercel-internals/types" must depend on the current version of "@vercel/build-utils": "6.7.3" vs "6.3.2"
Package "@vercel-internals/types" must depend on the current version of "@vercel/routing-utils": "2.2.1" vs "2.1.10"
Package "@vercel-internals/types" must depend on the current version of "@vercel-internals/tsconfig": "undefined" vs "*"
Package "vercel" must depend on the current version of "@vercel-internals/constants": "undefined" vs "*"
Package "vercel" must depend on the current version of "@vercel-internals/get-package-json": "undefined" vs "*"
Package "vercel" must depend on the current version of "@vercel-internals/types": "undefined" vs "*"
Package "@vercel/node" must depend on the current version of "@vercel/error-utils": "1.0.10" vs "1.0.8"
```
2023-05-22 15:26:36 -07:00
Dan Stowell
1b0d72aba5 [cli] Change vc env pull default output file to .env.local (#9892)
`vc deploy` ignores `.env.local`. To make sure we don't inadvertently
push people's secrets to source control, have all environment pulls
default to writing to `.env.local`.
2023-05-22 15:24:38 -07:00
Chris Barber
cdf55b3b1a [cli] New vc redeploy command (#9956)
This adds a new `vc redeploy <url-or-id>` command. It fetches the requested deployment, then performs a redeploy with similar output to `vc deploy` including the ability to pipe the deployment URL into a file or program.

### Redeploy Example:

<img width="650" alt="image" src="https://github.com/vercel/vercel/assets/97262/b17fc424-558b-415c-8b74-63e450f4b753">

### Bad deployment URL:

<img width="579" alt="image" src="https://github.com/vercel/vercel/assets/97262/0cb53209-396e-4490-b5d0-744d5d870aaf">

### No args:

<img width="622" alt="image" src="https://github.com/vercel/vercel/assets/97262/cb36d625-991b-41fa-bb49-d7d36c1a201b">

Linear: https://linear.app/vercel/issue/VCCLI-558/cli-new-command-to-redeploy
2023-05-22 22:08:49 +00:00
Nathan Rajlich
8de42e0a70 [cli] Remove --platform-version global common arg (#9807)
Removes the unused `--platform-version` flag from the common args.

Technically this is a breaking change, so we should probably hold off on merging until we plan to do a major version bump.
2023-05-22 21:44:52 +00:00
Vercel Release Bot
46950633f4 Version Packages (#9994) 2023-05-22 10:47:47 -07:00
Nathan Rajlich
671e63e7b8 [cli] Add vc link --repo flag (alpha) (#8931)
Adding a new `--repo` flag to `vc link` which is a new linking style to
link to a Git URL rather then directly to a single Vercel Project. This
allows for multiple Projects to be linked simultaneously, which is
useful for monorepo setups.

Utilization of this new linking style in other commands will be done in
a follow-up PR.
2023-05-19 11:53:49 -07:00
Vercel Release Bot
f7bdc6cc26 Version Packages (#9991)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-19 12:08:50 -05:00
Vercel Release Bot
74e639a772 Version Packages (#9978)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/build-utils@6.7.3

### Patch Changes

- Deprecate Node.js 14.x and 16.x with warning
([#9976](https://github.com/vercel/vercel/pull/9976))

## vercel@29.3.5

### Patch Changes

- Updated dependencies
\[[`2c950d47a`](2c950d47ae),
[`71b9f3a94`](71b9f3a94b),
[`f00b08a82`](f00b08a820)]:
    -   @vercel/static-build@1.3.31
    -   @vercel/build-utils@6.7.3
    -   @vercel/next@3.8.5
    -   @vercel/node@2.14.3
    -   @vercel/remix-builder@1.8.10

## @vercel/client@12.5.1

### Patch Changes

- Updated dependencies
\[[`71b9f3a94`](71b9f3a94b)]:
    -   @vercel/build-utils@6.7.3

## @vercel/gatsby-plugin-vercel-builder@1.3.4

### Patch Changes

- Updated dependencies
\[[`71b9f3a94`](71b9f3a94b)]:
    -   @vercel/build-utils@6.7.3
    -   @vercel/node@2.14.3

## @vercel/next@3.8.5

### Patch Changes

- [next] Ensure app functions are detected/separated properly
([#9989](https://github.com/vercel/vercel/pull/9989))

## @vercel/node@2.14.3

### Patch Changes

- Updated dependencies
\[[`71b9f3a94`](71b9f3a94b)]:
    -   @vercel/build-utils@6.7.3

## @vercel/remix-builder@1.8.10

### Patch Changes

- Updated dependencies
\[[`71b9f3a94`](71b9f3a94b)]:
    -   @vercel/build-utils@6.7.3

## @vercel/static-build@1.3.31

### Patch Changes

- ensure cleanup after gatsby plugin runs
([#9975](https://github.com/vercel/vercel/pull/9975))

-   Updated dependencies \[]:
    -   @vercel/gatsby-plugin-vercel-builder@1.3.4

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-19 09:34:26 -07:00
Chris Barber
6cdd38d130 [tests] Pin Next.js version in test fixtures (#9910)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-05-19 09:06:08 -05:00
Vercel Release Bot
91b7f6dcd9 Version Packages (#9973)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@29.3.4

### Patch Changes

- Updated dependencies
\[[`67e556bc8`](67e556bc80),
[`ba10fb4dd`](ba10fb4dd4)]:
    -   @vercel/remix-builder@1.8.9
    -   @vercel/next@3.8.4

## @vercel/next@3.8.4

### Patch Changes

- Update handling for react prebundled flag
([#9974](https://github.com/vercel/vercel/pull/9974))

## @vercel/remix-builder@1.8.9

### Patch Changes

- Upgrade `@remix-run/dev` fork to v1.16.1
([#9971](https://github.com/vercel/vercel/pull/9971))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-18 10:38:24 -07:00
Vercel Release Bot
c879401bbc Version Packages (#9966)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@29.3.3

### Patch Changes

- Updated dependencies
\[[`6c6f3ce9d`](6c6f3ce9d2)]:
    -   @vercel/next@3.8.3

## @vercel/next@3.8.3

### Patch Changes

- Ensure un-necessary rsc routes are not added
([#9963](https://github.com/vercel/vercel/pull/9963))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-17 10:45:41 +02:00
Vercel Release Bot
06113d3e39 Version Packages (#9962)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-16 15:53:57 -05:00
Luc Leray
5150f21404 [vc dev] Fix serverless function size limit condition (#9961)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-05-16 14:17:00 -05:00
Vercel Release Bot
d8e3b6e738 Version Packages (#9950)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-05-16 11:48:06 -05:00
Luc Leray
25da051d62 [vc dev] Skip 50MB zip size limit for Python (#9944)
Do not apply the 50MB zip size limit for Python serverless function during `vc dev`.

Related to internal PR: https://github.com/vercel/api/pull/19279
2023-05-16 15:58:04 +00:00
Lee Robinson
6115f0d74a Update README (#9951)
To be more clear about what Vercel is actually providing you, as a developer.
2023-05-13 20:32:46 +00:00
Nathan Rajlich
14c877e468 [cli] Sort keys in vc env pull (#9949)
Makes sense to have the output be deterministic. Alphabetical sort seems like a logical choice.
2023-05-12 22:08:59 +00:00
Vercel Release Bot
b739c1845c Version Packages (#9939)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-11 10:46:10 -05:00
Sean Massa
e9f0fcf397 [cli] remove vc rollback beta label (#9928)
Remove the "beta" label from `vc rollback`.
2023-05-11 15:16:48 +00:00
Vercel Release Bot
380ed38c71 Version Packages (#9935)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.


# Releases
## vercel@29.2.1

### Patch Changes

-   Updated dependencies \[[`6d5983eaa`](6d5983eaae)]:
    -   @vercel/remix-builder@1.8.8

## @vercel/remix-builder@1.8.8

### Patch Changes

-   Upgrade `@remix-run/dev` to v1.16.0-patch.1 to fix erroneous "not found in your node_modules" warning ([#9930](https://github.com/vercel/vercel/pull/9930))
2023-05-10 22:55:42 +00:00
Nathan Rajlich
d1d3e9384d Publish Stable
- vercel@29.2.0
 - @vercel/client@12.5.0
 - @vercel/frameworks@1.4.2
 - @vercel/fs-detectors@3.9.2
 - @vercel/gatsby-plugin-vercel-builder@1.3.3
 - @vercel/node@2.14.2
 - @vercel/static-build@1.3.30
2023-05-10 10:39:11 -07:00
Nathan Rajlich
8428632eb1 [cli] Add support for Vercel CLI Extensions (#9800)
# Vercel CLI Extensions

Adds a new mechanism to add additional sub-commands to Vercel CLI, inspired by how Git handles sub-commands:

* Extensions are standalone executables that Vercel CLI will spawn as a child process.
* The name of the executable must begin with `vercel-`. For example, to add a sub-command called `vercel example`, there should exist an executable called `vercel-example`.
* The executable can either be a npm package with a `"bin"` entry installed into the local project's workspace, or be globally available in the `$PATH`.
* Extensions can access the [Vercel REST API](https://vercel.com/docs/rest-api), pre-authenticated, by utilizing the `VERCEL_API` env var. Vercel CLI spawns a local HTTP server that adds the `Authorization` header and then proxies to the Vercel REST API.

## Environment Variables

A few environment variables which provide features and context to the extension:

| Name      | Description |
| ----------- | ----------- |
| `VERCEL_API`      | HTTP URL to access the pre-authenticated Vercel API.       |
| `VERCEL_TEAM_ID`  | Provided when the currently selected scope is a Team. |
| `VERCEL_DEBUG` | Provided when the `--debug` flag is used. The command _may_ output additional debug logging. |
| `VERCEL_HELP` | Provided when the `--help` flag is used. The command _should_ print the help output and then end with exit code **2**. |

## Example

```bash
#!/usr/bin/env bash
set -euo pipefail

echo Hi, from a Vercel CLI Extension!
user="$(curl -s "$VERCEL_API/v2/user" | jq -r .user.username)"
echo "Logged in as: $user"
```

Usage:

```
$ vc example
Vercel CLI 28.18.5
Hi, from a Vercel CLI Extension!
Logged in as: tootallnate
```
2023-05-10 16:36:58 +00:00
Sean Massa
de2c7e1633 [cli] rename global options in help output (#9917)
Make the distinction between global and deploy options more clear.

The dim note about how to get `deploy`-specific help:

<img width="670" alt="Screenshot 2023-05-05 at 3 55 49 PM" src="https://user-images.githubusercontent.com/41545/236568356-10b9ce4f-2865-4267-a3eb-3488df88a133.png">
2023-05-05 22:00:27 +00:00
Sean Massa
75d2435138 [cli] refactor help output around default and deploy commands (#9912)
When getting help output for the default command `vc --help`, you get a list of commands. When you specify the `deploy` command with `vc deploy --help`, you get the same list of commands.

This PR makes a distinction between an explicit `deploy` command and a default one for the purposes of help output.

Should show CLI help:

- `vc -h`
- `vc --help`
- `vc help`

Should show `deploy` command help:

- `vc deploy -h`
- `vc deploy --help`
- `vc help deploy`
2023-05-05 18:54:50 +00:00
Kiko Beats
e3fe368baa [cli][node] upgrade async-listen to 3.0.0 (#9907)
The `async-listen@3.0.0` is ESM ready and always returns a `URL`
instance; That helps us to unify code.
2023-05-05 16:09:10 +02:00
Nathan Rajlich
99832587c5 [cli] Add support for HTTPS_PROXY env var (#9880)
By leveraging the [`proxy-agent`](https://www.npmjs.com/package/proxy-agent) npm module, enable CLI to support making HTTP requests over a proxy, by leveraging the `HTTPS_PROXY` or `ALL_PROXY` env var (same convention as `curl` uses).

Finally closes this ancient issue: https://github.com/vercel/vercel/issues/255
2023-05-05 00:52:18 +00:00
Sean Massa
c4915507aa Publish Stable
- vercel@29.1.1
 - @vercel/frameworks@1.4.1
 - @vercel/fs-detectors@3.9.1
 - @vercel/static-build@1.3.29
2023-05-03 16:20:45 -05:00
Sean Massa
672c1681cc Publish Stable
- vercel@29.1.0
 - @vercel/frameworks@1.4.0
 - @vercel/fs-detectors@3.9.0
 - @vercel/gatsby-plugin-vercel-builder@1.3.2
 - @vercel/node@2.14.1
 - @vercel/remix-builder@1.8.7
 - @vercel/static-build@1.3.28
2023-05-03 14:08:25 -05:00
Chris Barber
7a0dacf8bb [cli][fs-detectors][frameworks] Re-add Storybook support (#9891)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-05-03 14:05:44 -05:00
Chris Barber
678e13af53 [cli][fs-detectors][frameworks] Revert Storybook support (#9890) 2023-05-02 10:03:28 -05:00
Chris Barber
9240cbc022 [cli][fs-detectors][frameworks] Add Storybook support (#9839)
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-05-01 11:25:06 -05:00
Tim Neutkens
f8749e1ff1 Publish Stable
- vercel@29.0.3
 - @vercel/next@3.8.2
2023-04-30 15:59:21 +02:00
Tim Neutkens
85947b658e Publish Stable
- vercel@29.0.2
 - @vercel/next@3.8.1
2023-04-30 11:47:04 +02:00
Steven
b5db13c970 Publish Stable
- vercel@29.0.1
 - @vercel/fs-detectors@3.8.13
 - @vercel/gatsby-plugin-vercel-builder@1.3.1
 - @vercel/next@3.8.0
 - @vercel/node@2.14.0
 - @vercel/static-build@1.3.27
2023-04-29 18:02:35 -04:00
Sean Massa
ce597ce0ec [node] validate function runtime and throw when "nodejs" (#9851)
We want to keep the currently unused `runtime: "nodejs"` value clear for future use. This PR effectively makes any unrecognized value fail the build. If the value is "nodejs" specifically, a direct error is thrown suggesting they remove the value.

Only a handful of projects set this value currently. We're reaching out to them to let them know that this value is not currently supported and that they should remove it. Then, we should deploy this PR so that anyone else using this value will know to remove it.
2023-04-27 19:22:47 +00:00
Sean Massa
2de365f9cf Publish Stable
- @vercel/build-utils@6.7.2
 - vercel@29.0.0
 - @vercel/client@12.4.12
 - @vercel/edge@0.3.4
 - @vercel/frameworks@1.3.5
 - @vercel/fs-detectors@3.8.12
 - @vercel/gatsby-plugin-vercel-builder@1.3.0
 - @vercel/go@2.5.1
 - @vercel/hydrogen@0.0.64
 - @vercel/next@3.7.6
 - @vercel/node@2.13.0
 - @vercel/python@3.1.60
 - @vercel/redwood@1.1.15
 - @vercel/remix-builder@1.8.6
 - @vercel/routing-utils@2.2.1
 - @vercel/ruby@1.3.76
 - @vercel/static-build@1.3.26
 - @vercel/static-config@2.0.17
2023-04-27 13:09:25 -05:00
Nathan Rajlich
fb6fe46158 [cli] Remove --target global common arg (#9808)
It doesn't make sense to have `--target` as a global argument, because not all subcommands utilize this flag (actually only `vc deploy` does, and it's even deprecated).

This is technically a breaking change (though risk of someone using this flag on non-`vc deploy` is very unlikely), so we may want to hold off on merging this until we're ready to do a major version bump.
2023-04-27 18:00:17 +00:00
Sean Massa
0490a7733b [tests] install root typescript version 4.9.5 and standardize on that version (#9858)
This add a root-level `typescript` version that matches the one used throughout for VS Code (and other IDEs) to use when browsing the code. After this PR merges, you will be able to set VS Code's TypeScript version to match the project's version.

This will remove issues where the IDE says TypeScript compilation is good to go, but `pnpm build` disagrees.

If there's a better way to allow this, please suggest it!

---

To enable:

<img width="849" alt="Screenshot 2023-04-25 at 4 28 22 PM" src="https://user-images.githubusercontent.com/41545/234408245-205b3260-7b1d-4c43-a531-d616915dbefb.png">

Then:

<img width="1015" alt="Screenshot 2023-04-25 at 4 29 20 PM" src="https://user-images.githubusercontent.com/41545/234408271-4e7b4ec8-0be3-4743-afd7-813a267c0756.png">
2023-04-27 08:13:53 +00:00
Chris Barber
65a6e713c8 [node] Fix ESM dependency support (#9692) 2023-04-26 12:23:43 -05:00
Chris Barber
7082da8451 Publish Stable
- vercel@28.20.0
 - @vercel/client@12.4.11
 - @vercel/gatsby-plugin-vercel-analytics@1.0.10
 - @vercel/gatsby-plugin-vercel-builder@1.2.10
 - @vercel/node@2.12.0
 - @vercel/static-build@1.3.25
2023-04-20 09:19:59 -05:00
Chris
20a7b2f2d4 [all] Update naming for Next.js Analytics (#9835)
Updates the name of Next.js Analytics to Next.js Speed Insights

closes ALY-484
2023-04-20 10:07:41 -04:00