Blocks preview deployments from being directly promoted. This relies on a new API version bump.
Copied the warning text from the UI:

This is a breaking change and will require a major version bump. Please don't merge until we're ready.
I did some pruning of old projects on my personal account last night, and accidentally broke CI. I've created a new tarball on the `curated-tests` team so that it doesn't happen again.
The SSO Protection feature is now turned off by default for testing accounts. So this manual logic for disabling the feature on each project test fixture is no longer necessary.
Warn about imminent removal of promoting preview deployments directly to
production.
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
The only changes are from some slightly different punctuation and that typing 'y' or 'n' doesn't process the prompt, it now waits for "Enter". Easiest command to see this is an action is the `init`, if you provided an invalid example to initialize `vercel init astroz` and follow the prompts.
## Fix how we determine the GIT_CONFIG_PATH to support git worktrees and git submodules
We were previously checking for the root of the directory by looking for `.git/config` if the project was not already linked.
This was causing `ENOTDIR` error when checking `.git` in git worktree or git submodule repositories. This is due to `.git` being a file in those repo types with a pointer to the "parent" or "super" repo rather than a directory.
Resolves#10104
`status` here is guaranteed to either be `'linked'` or `'not_linked'` by this point in the code, switching the double negative to a positive condition makes it clearer.
Fixes the case in `vc dev` where importing a `.ts` file from another `.ts` file was failing in `vc dev` when `type: "module"` is not set in `package.json`.
Supersedes https://github.com/vercel/vercel/pull/11364.
# Overview
Changing to `@inquirer/prompts` meant updating all existing usage of `inquirer.prompt`. This removed a lot of code since the `inquirer.prompt` function was extra verbose.
The user experience shouldn't have changed much besides different styling. `patch-inquirer` is incompatible with `@inquirer/prompts`. ~~We probably don't want to merge this until we have a new solution for styling.~~ The new default styling is preferred over our old styling.
There are lots of changes over many files, so I went back and organized the commit history. It will probably be easier to review this PR by commit.
## Tests
~~I had to change tests in ways that aren't great. Tests had a hard time recognizing output with escape codes in them, so I had to make the expected output more generic.~~ Using `strip-ansi` worked nicely to ignore styling changes in unit and integration tests.
I removed the unit test "should list projects running on an soon-to-be-deprecated Node.js version" because that test doing `jest.useFakeTimers().setSystemTime(new Date('2023-12-08'));` would make the "should remove a project" test fail. Really strange stuff! Couldn't think of a better solution than removing this, so looking for suggestions here.
`vc deploy --prebuilt` has not properly worked for projects linked with
`vc link --repo` ever since
https://github.com/vercel/vercel/issues/11077.
To fix, don't mutate `cwd` to be the project subdir (so that `cwd` is
always the monorepo root), and instead pass in a new property to
`@vercel/client` that represents the `.vercel/output` file path. A lot
of the code is just passing this new variable through the multiple
layers of indirection in CLI before it finally reaches `@vercel/client.
Fixes https://github.com/vercel/vercel/issues/11097.
This reverts commit 78e2c012f9.
This commit causes a failing test which contains the `zeroConfig: true`
field. It should have not been merged in the first place due to the
failing test, but Kodiak erroneously merged it before the tests were
passing.
When there are `builds` configuration, the v10 create-deployment
endpoint is used instead of the latest v13 endpoint. `projectSettings`
is not allowed in the v10 endpoint, therefore we can not send the
`nodeVersion` when `builds` project exists. Instead, we should look into
moving away from the v10 endpoint so that we can be using the latest
version of the endpoint for all deployments.
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@7.10.0
### Minor Changes
- Allow environment variables to be specified for `EdgeFunction`
([#11029](https://github.com/vercel/vercel/pull/11029))
## vercel@33.6.2
### Patch Changes
- Added sunset warning to secrets command.
([#11333](https://github.com/vercel/vercel/pull/11333))
- Swap jest for vitest in CLI unit tests
([#11302](https://github.com/vercel/vercel/pull/11302))
- Updated dependencies
\[[`988f7b75a`](988f7b75a2),
[`1825b58df`](1825b58df8)]:
- @vercel/remix-builder@2.1.5
- @vercel/build-utils@7.10.0
- @vercel/node@3.0.25
- @vercel/static-build@2.4.5
## @vercel/client@13.1.8
### Patch Changes
- Updated dependencies
\[[`1825b58df`](1825b58df8)]:
- @vercel/build-utils@7.10.0
## @vercel/frameworks@3.0.1
### Patch Changes
- Swap jest for vitest in CLI unit tests
([#11302](https://github.com/vercel/vercel/pull/11302))
## @vercel/fs-detectors@5.2.2
### Patch Changes
- Updated dependencies
\[[`9ed967034`](9ed967034d)]:
- @vercel/frameworks@3.0.1
## @vercel/gatsby-plugin-vercel-builder@2.0.23
### Patch Changes
- Updated dependencies
\[[`1825b58df`](1825b58df8)]:
- @vercel/build-utils@7.10.0
## @vercel/node@3.0.25
### Patch Changes
- Updated dependencies
\[[`1825b58df`](1825b58df8)]:
- @vercel/build-utils@7.10.0
## @vercel/remix-builder@2.1.5
### Patch Changes
- Add `mjs` and `mts` extensions to vite detection
([#11307](https://github.com/vercel/vercel/pull/11307))
## @vercel/static-build@2.4.5
### Patch Changes
- Updated dependencies \[]:
- @vercel/gatsby-plugin-vercel-builder@2.0.23
## @vercel-internals/types@1.0.28
### Patch Changes
- Updated dependencies
\[[`1825b58df`](1825b58df8)]:
- @vercel/build-utils@7.10.0
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Forces the AL2 build container image for fixtures that depend on it,
via `engines.node` in package.json for most cases.
* The `testDeployment()` function was updated to send
`projectSettings.nodeVersion` in the POST body, to mimic the behavior in
CLI.
* For Go, Ruby, and Python tests, the `projectSettings.nodeVersion`
property is set "globally" in the Jest setup file, so that individual
fixtures didn't need to be adjusted.
This unit test fails on my machine:
```
Expected: "pnpm i vercel@latest"
Received: "pnpm i -g vercel@latest"
```
This change allows the test to succeed on machines that need the `-g` flag.
Previously, we used `semver` which correctly identified the nodeVersion used in `package.json`, but failed in two cases:
1. If the specified `engines` range started too low, it wouldn't correctly identify a later version compatible with Vercel. (`">10"` was detecting as Node `"10.x"` not `"20.x"`)
2. If the specified `engines` version was fixed too low to be compatible with Vercel, we sent it, and then Vercel predictably errored. (`"10"` was detecting as Node `"10.x"` which would lead to an error in the build process)
Now, case 1 should properly use the latest node version. And case 2 will not send a node version override to the API and will print a warning to the user on the CLI, but the deployment will still proceed with the version specified for the project in the web interface.
We chose to keep the error message shown to the user consistent with what shows in the logs for the build container, that is:
> WARN! Node.js Version "10.x" is discontinued and must be upgraded. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.
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@7.9.0
### Minor Changes
- Add `base` parameter to `scanParentDirs()`
([#11261](https://github.com/vercel/vercel/pull/11261))
## vercel@33.6.0
### Minor Changes
- Set `projectSettings.nodeVersion` in `vc deploy` based on
"engines.node" field
([#11261](https://github.com/vercel/vercel/pull/11261))
### Patch Changes
- Stops warning about legacy Speed Insights for Next.js apps
([#11268](https://github.com/vercel/vercel/pull/11268))
- Fix framework version detection in monorepos
([#11212](https://github.com/vercel/vercel/pull/11212))
- Updated dependencies
\[[`8ea93839c`](8ea93839cc),
[`58ef91bfe`](58ef91bfe8)]:
- @vercel/build-utils@7.9.0
- @vercel/remix-builder@2.1.3
- @vercel/node@3.0.23
- @vercel/static-build@2.4.3
## @vercel/client@13.1.6
### Patch Changes
- Updated dependencies
\[[`8ea93839c`](8ea93839cc)]:
- @vercel/build-utils@7.9.0
## @vercel/gatsby-plugin-vercel-builder@2.0.21
### Patch Changes
- Updated dependencies
\[[`8ea93839c`](8ea93839cc)]:
- @vercel/build-utils@7.9.0
## @vercel/node@3.0.23
### Patch Changes
- Updated dependencies
\[[`8ea93839c`](8ea93839cc)]:
- @vercel/build-utils@7.9.0
## @vercel/remix-builder@2.1.3
### Patch Changes
- Improve hueristics for detecting Remix + Vite
([#11256](https://github.com/vercel/vercel/pull/11256))
## @vercel/static-build@2.4.3
### Patch Changes
- Updated dependencies \[]:
- @vercel/gatsby-plugin-vercel-builder@2.0.21
## @vercel-internals/types@1.0.26
### Patch Changes
- Updated dependencies
\[[`8ea93839c`](8ea93839cc)]:
- @vercel/build-utils@7.9.0
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
### 🧐 What's in there?
Vercel's Speed Insights legacy injection is deprecated in favor of `@vercel/speed-insights` package.
CLI has a couple places where it warns users running `vc build` locally (or on their CI).
Some users complained about seeing the warning while they are already using the package.
This PR removes the message
### ❗ Note to reviewers
@tobiaslins, @timolins and I had a long discussion on the approach here.
This warning is issued because during `vc pull`, the project API on Vercel returns a legacy analytics.id field, [which is stored](https://github.com/vercel/vercel/blame/main/packages/cli/src/util/projects/project-settings.ts#L35) in `.vercel/project.json`.
While it is legit for users who never used `@vercel/speed-insights` package, it also appear for users who migrated from legacy.
Besides setting the warning, `VERCEL_ANALYTICS_ID` is set, which triggers auto-injection in Next.js, and is useful during self-hosting.
We first considered removing the legacy id from `project.json`, but it would break self-hosting.
We also considered printing the warning only if the application never used the package (which the project API on Vercel knows).
In the end, we realized that vercel.com Speed Insights dashboard has plenty of disclaimer and incentives to use the new package. Having it in the CLI doesn't worth the annoyance.
Read the package.json and use the `engines.node` value to set the
`projectSettings.nodeVersion` property on the create deployment API call
POST body. This allows for the Node 20 build container image to be
properly specified before the deployment is created on the server side.
I noticed that the framework version was not being printed on deployments in a monorepo. Turns out the framework detection logic was happening at the root of the monorepo, instead of the project directory.
There's an issue with `vc link` and `vc deploy` when using a project
root directory. Framework detection fails because it's looking in the
wrong directory.
---
Manually tested and this fixes the issue. A project with a rootDirectory
was previously not detecting a framework, but now it says:
```
Auto-detected Project Settings (Remix):
```
---------
Co-authored-by: Nathan Rajlich <n@n8.io>
- Removes all the legacy `flags`
- Renames the new `variants` to `flags`
Neither the legacy flags, nor the new variants were exposed to anyone, except for the type in build-utils, so there shouldn't be any issues removing/renaming them.
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/frameworks@3.0.0
### Major Changes
- Make "remix" framework preset supersede "vite"
([#11031](https://github.com/vercel/vercel/pull/11031))
## @vercel/fs-detectors@5.2.0
### Minor Changes
- Make "remix" framework preset supersede "vite"
([#11031](https://github.com/vercel/vercel/pull/11031))
### Patch Changes
- Updated dependencies
\[[`1333071a3`](1333071a3a)]:
- @vercel/frameworks@3.0.0
## @vercel/remix-builder@2.1.0
### Minor Changes
- Remix Vite plugin support
([#11031](https://github.com/vercel/vercel/pull/11031))
## vercel@33.5.3
### Patch Changes
- Updated dependencies
\[[`c2d99855e`](c2d99855ea),
[`1333071a3`](1333071a3a)]:
- @vercel/next@4.1.3
- @vercel/remix-builder@2.1.0
## @vercel/next@4.1.3
### Patch Changes
- Fix manifest with experimental flag
([#11192](https://github.com/vercel/vercel/pull/11192))
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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@7.7.0
### Minor Changes
- Revert "Revert "Default ruby to only currently supported version
(3.2.0)"" ([#11137](https://github.com/vercel/vercel/pull/11137))
## @vercel/static-build@2.4.0
### Minor Changes
- Revert "Revert "Default ruby to only currently supported version
(3.2.0)"" ([#11137](https://github.com/vercel/vercel/pull/11137))
### Patch Changes
- Updated dependencies \[]:
- @vercel/gatsby-plugin-vercel-builder@2.0.18
## vercel@33.5.1
### Patch Changes
- build: upgrade edge-runtime
([#11148](https://github.com/vercel/vercel/pull/11148))
- Updated dependencies
\[[`24c3dd282`](24c3dd282d),
[`10e200e0b`](10e200e0bf),
[`678ebbe52`](678ebbe525)]:
- @vercel/build-utils@7.7.0
- @vercel/static-build@2.4.0
- @vercel/node@3.0.19
## @vercel/client@13.1.3
### Patch Changes
- Updated dependencies
\[[`24c3dd282`](24c3dd282d)]:
- @vercel/build-utils@7.7.0
## @vercel/gatsby-plugin-vercel-builder@2.0.18
### Patch Changes
- Updated dependencies
\[[`24c3dd282`](24c3dd282d)]:
- @vercel/build-utils@7.7.0
## @vercel/node@3.0.19
### Patch Changes
- build: upgrade edge-runtime
([#11148](https://github.com/vercel/vercel/pull/11148))
- refactor: simplify content-length check
([#11150](https://github.com/vercel/vercel/pull/11150))
- Updated dependencies
\[[`24c3dd282`](24c3dd282d)]:
- @vercel/build-utils@7.7.0
## @vercel-internals/types@1.0.23
### Patch Changes
- Updated dependencies
\[[`24c3dd282`](24c3dd282d)]:
- @vercel/build-utils@7.7.0
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Makes adjustments to replace `flags` with `variants`.
Also marks the current `flags` implementation as deprecated, as it
should get removed soon. Which I'll do in a follow up PR.
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/static-build@2.2.0
### Minor Changes
- Default ruby to only currently supported version (3.2.0)
([#11104](https://github.com/vercel/vercel/pull/11104))
### Patch Changes
- [tests] Update Gatsby fixture versions
([#11101](https://github.com/vercel/vercel/pull/11101))
## vercel@33.4.1
### Patch Changes
- Updated dependencies
\[[`d05e41eea`](d05e41eeaf),
[`de63e3562`](de63e35622)]:
- @vercel/static-build@2.2.0
## @vercel/client@13.1.1
### Patch Changes
- More helpful error message when `vc deploy --prebuilt` has missing
files ([#11105](https://github.com/vercel/vercel/pull/11105))
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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@33.4.0
### Minor Changes
- Added a new option to add a sensitive environment variable
([#11033](https://github.com/vercel/vercel/pull/11033))
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>