Compare commits

...

1109 Commits

Author SHA1 Message Date
Vercel Release Bot
7582571d94 Version Packages (#10913)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-11 10:39:34 -06:00
John Pham
e6aaf79d04 Update Next.js screenshot preview (#10921)
This new screenshot matches the template. It removes the version number
so this screenshot will not go stale.
2023-12-08 11:25:42 -08:00
Ethan Arrowood
a1df25a197 [cli] Clean up project ls --deprecate (#10926)
Follow up to #10919

Removes console.log statements and changes log into warning.
2023-12-08 17:55:24 +00:00
Ethan Arrowood
dfe47f6e6c [cli] add --deprecated option to vc project ls command (#10919)
Adds a `--deprecated` option to the `vc project ls` command that will only show projects currently running on a soon-to-be-deprecated Node.js version.

It also adds additional output providing more information to the user about what versions and a link to our documentation so they can learn more.

Example:

<img width="836" alt="Screenshot 2023-12-07 at 15 01 22" src="https://github.com/vercel/vercel/assets/16144158/3b7f7b13-802e-4af1-a76e-a158a477beb4">
2023-12-08 17:09:18 +00:00
Vercel Release Bot
3a58431695 [examples][tests] Upgrade Next.js to version 14.0.4 (#10923)
This auto-generated PR updates 7 packages to Next.js version 14.0.4
2023-12-08 11:17:39 +01:00
Vercel Release Bot
204c3592c7 [remix] Update @remix-run/dev to v2.3.1 (#10908)
This auto-generated PR updates `@remix-run/dev` to version 2.3.1.
2023-12-07 01:29:54 +00:00
Nathan Rajlich
3cede43ca7 [ruby] Remove VERCEL_ALLOW_RUBY32 env var check (#10910) 2023-12-07 01:28:17 +00:00
Nathan Rajlich
1dbb22bb6d [ruby] Use Ruby 3.2 in test fixtures (#10909) 2023-12-07 00:57:10 +00:00
Matt Straka
f124779b35 Update README.md (#10898) 2023-12-02 14:23:03 -05:00
Vercel Release Bot
371c7a08f2 Version Packages (#10896) 2023-12-01 11:43:49 -08:00
Ethan Arrowood
447c20fb99 Add GitHub Runner Image Version to turbo-cache-key.json (#10887)
Add GitHub Runner Image Version to turbo-cache-key.json
2023-12-01 19:39:07 +00:00
Nathan Rajlich
0fe8c07194 [cli] Revert "forbids globally installed @vercel/speed-insights and @vercel/analytics (#10848)" (#10895)
This reverts commit 6afdd7fb0b.
2023-12-01 19:35:04 +00:00
Vercel Release Bot
78d1d548d9 Version Packages (#10865) 2023-11-30 11:01:27 -08:00
Trek Glowacki
c41ff450c0 [cli] Fix behavior for combination of northstar user + team scope provided to cli as an argument. (#10884)
Fixes a neat little bug with the intersection of northstar users, teams, and the behavior of `Array#find_index`:

When selecting an org for various cli actions _non_ northstar users will see a select list with their user in the 0th position, and their teams in the 1..nth positions, like so:

```
// user: Logan
// teams: [Avengers, X-Men]
○ Logan
○ Avengers
○ X-Men
``` 

We'd like to preselect either a team referenced in `client.config.currentTeam` or if said team cannot be found in the collection of a user's teams, preselect the user. So if `X-Men` is `currentTeam`, we find that item (element `1` in the teams array) and increment that value by `1` to account for the user being element `0` in the list of choices:

```
// currentTeam: X-Men
// user: Logan
// teams: [Avengers, X-Men]
○ Logan
○ Avengers
● X-Men
``` 

If we _can't_ find the `currentTeam` in the list of teams (or one isn't provided), `Array#find_index` returns `-1`, which we increment to by `1` to get the 0th element in the list of choices:

```
// currentTeam: undefined
// user: Logan
// teams: [Avengers, X-Men]
● Logan
○ Avengers
○ X-Men
``` 

Neat trick!

However, Northstar users _don't_ use the user account as the 0th element in the list of choices. Northstar users will in fact have a team that represents a hidden default team with the same name as their `user.name` and this will be the 0th element in their teams:

```
// user: Logan
// teams: [Logan, Avengers, X-Men]
○ Logan
○ Avengers
○ X-Men
``` 

This of course means the trick of `+1` to index of the team selects the wrong item _and_ can result in `undefined` in cases where the `currentTeam` references the last team.

```
// currentTeam: X-Men
// user: Logan
// teams: [Logan, Avengers, X-Men]
○ Logan
○ Avengers
○ X-Men
``` 

● how'd we get out here?!?! 👀 

To address the issue this PR:
1. calls `findIndex` on the array of _choices_ checking for matches to `currentTeam`
2. wraps that in `Math.max` to set to `0` if `find_index` returns `-1` when a `currentTeam` can't be found.
2023-11-29 14:15:17 +00:00
Chris Barber
ca2cbf06fb [remix] Resolve static dir using non-parent publicPath segments (#10685) 2023-11-28 17:22:36 -06:00
Trek Glowacki
2d86a2d4ba [tests] tidy and make select-org tests more realistic (#10882)
Tracking down a bug with "northstar" users and have a little prefactor that 

a) isolates setup code so it's less repeated
b) makes the "northstar" tests more reflective of actual execution.

Northstar users will always have a `currentTeam` value on their `client.config`:

aa0f3d712b/packages/cli/src/util/get-scope.ts (L18-L20)

And finally c) add tests for the case of a non-northstar users where a team scope is supplied.

The final hypothetical matching group (northstart users with team scope provided) is the bug that I'll fix with a refactor.
2023-11-28 23:21:32 +00:00
Nathan Rajlich
4edfcd74b6 [remix] Fix issue where npm install was not properly injecting forked compiler (#10819)
User reported a scenario in which npm was ignoring the second `npm install` command to replace the Remix compiler with our forked version. This seems like a bug in npm. Workaround that seems to work is to remove `@remix-run/dev` entirely and install our forked version as a "standard" dependency (instead of using the `npm:` syntax). The `bin` entry for `remix` should at that point be our forked compiler.
2023-11-28 22:41:39 +00:00
Nathan Rajlich
c52bdf7758 [go] Set Lambda runtime to "provided.al2" behind env var (#10880)
This is a re-land of https://github.com/vercel/vercel/pull/10856, but with the addition of the env var check so that we can feature flag this change.
2023-11-28 22:38:37 +00:00
Nathan Rajlich
bc5ac1ec50 [static-build] Add yarn.lock and force jsdom@22 to fix "umi-v2" test fixture (#10881)
`jsdom@23` does not work with Node 16, but UmiJS v2 does not work with Node 18. So use the lower common denominator and force a older version of jsdom that still works with 16.x.
2023-11-28 18:49:02 +00:00
Lee Robinson
aa0f3d712b chore: update Nuxt example (#10869)
This updates the default Nuxt example to start with a static route, plus
updates dependencies with the latest version.

Demo: https://nuxt-vercel-inky.vercel.app/

---------

Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-11-27 19:40:30 -06:00
Csaba Palfi
e02212ae80 Fix changeset lint for forks (#10737) 2023-11-27 16:38:02 -08:00
Lee Robinson
a8934da623 Update placeholder for Nuxt to be correct command. (#10873)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-11-27 10:54:49 -06:00
Vercel Release Bot
0e9bb30fd2 [tests] Update Gatsby fixture versions (#10875)
Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`
2023-11-27 14:56:18 +00:00
Damien Simonin Feugas
6afdd7fb0b [cli] forbids globally installed @vercel/speed-insights and @vercel/analytics (#10848) 2023-11-22 09:29:40 +01:00
Vercel Release Bot
fdef0339f2 Version Packages (#10861) 2023-11-21 13:59:05 -08:00
Nathan Rajlich
4636ae54c6 [ruby] Enable ruby3.2 runtime (#10859)
Allows for Ruby 3.2 Serverless Functions to be created.

**Note:** New test fixtures will be added after this is deployed to production.
2023-11-21 21:57:23 +00:00
Nathan Rajlich
61a23f1382 Revert "[go] Set Lambda runtime to provided.al2" (#10864)
This reverts commit 4b8b4992c4.

We'll re-land this after Thanksgiving.
2023-11-21 21:13:24 +00:00
Nathan Rajlich
4b8b4992c4 [go] Set Lambda runtime to "provided.al2" (#10856)
Migrate from the deprecated `go1.x` runtime to the `provided.al2` runtime, [as suggested by AWS in their migration guide](https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/).
2023-11-21 19:29:53 +00:00
Zack Tanner
611fbdd5ac Revert "[cli][tests] Work around Yarn + Corepack issue in tests" (#10860) 2023-11-21 10:21:56 -06:00
Zack Tanner
ffd2f34c6c [next] ensure function configs apply to route groups (#10855)
`getSourceFilePathFromPage` attempts to match patterns found in `vercel.json` with source files. However, the `page` argument to this function is stripped of route groups, so these files are erroneously skipped and function settings are not applied. 

For app-dir routes which might contain route groups, this checks an internal mapping which maps the "normalized" paths (e.g. `app/dashboard/[slug]/page.js`) to the file-system path (e.g. `app/dashboard/[slug]/(group)/page.js`)
2023-11-21 00:44:46 +00:00
Nathan Rajlich
8feaa9c3b3 [cli][tests] Work around Yarn + Corepack issue in tests (#10858)
CI started failing on corepack related tests with error:

```
error This project's package.json defines "packageManager": "yarn@npm@8.1.0". However the current global version of Yarn is 1.22.21.
```

This appears to be a bug in the Yarn v1.22.21, which was released a week ago: https://github.com/yarnpkg/yarn/releases/tag/v1.22.21

Setting the `SKIP_YARN_COREPACK_CHECK` env var disables this new check which fixes the issue for us.

**NOTE:** Review with [whitespace changes disabled](https://github.com/vercel/vercel/pull/10858/files?w=1) for an easier view.
2023-11-20 21:47:39 +00:00
Vercel Release Bot
31daff66af [examples][tests] Upgrade Next.js to version 14.0.3 (#10847) 2023-11-19 10:54:04 -08:00
Simon H
48c6b2dcc3 [docs] mention nodejs20.x in LambdaRuntime (#10849)
The error message when trying to deploy with an invalid runtime value
leads you there, where `nodejs20.x` is missing currently
2023-11-18 22:43:16 -06:00
Vercel Release Bot
6f3ae1a0ed Version Packages (#10836)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-15 23:19:35 -06:00
Nathan Rajlich
88da7463ce [build-utils] Remove Node v20 env var check (#10834)
It's safe to remove this env var check, because #10822 makes it explicit on which versions of Node are actually present in the build environment.
2023-11-15 22:04:36 +00:00
Ethan Arrowood
142aa55a5d Add .node-version file (#10820)
This a small QOL change. Essentially if you have a tool like `fnm` on your machine for using multiple versions of Node.js, they will look for files like this one and automatically switch your terminal session node version to the value in it. 

The `vercel/front` repo uses this too
2023-11-15 20:12:05 +00:00
Vercel Release Bot
7bc8b65d13 Version Packages (#10832)
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.2.4

### Patch Changes

-   Select Node.js version based on what's available in build-container ([#10822](https://github.com/vercel/vercel/pull/10822))

## vercel@32.5.4

### Patch Changes

-   Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
    -   @vercel/build-utils@7.2.4
    -   @vercel/node@3.0.10
    -   @vercel/static-build@2.0.11

## @vercel/client@13.0.8

### Patch Changes

-   Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
    -   @vercel/build-utils@7.2.4

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

### Patch Changes

-   Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
    -   @vercel/build-utils@7.2.4

## @vercel/node@3.0.10

### Patch Changes

-   Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
    -   @vercel/build-utils@7.2.4

## @vercel/static-build@2.0.11

### Patch Changes

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

## @vercel-internals/types@1.0.15

### Patch Changes

-   Updated dependencies \[[`65dec5b7e`](65dec5b7e7)]:
    -   @vercel/build-utils@7.2.4
2023-11-15 00:45:19 +00:00
Nathan Rajlich
65dec5b7e7 [build-utils] Select Node.js version based on what's available in build-container (#10822)
Makes `getLatestNodeVersion()` and `getSupportedNodeVersion()` (and thus by extension - `getNodeVersion()`) be aware of the available Node.js versions when running inside the build-container. This is to address the situation with the new AL2023 build-container image which has different Node versions installed compared to the existing AL2 build image.

### Project Settings `20.x` with package.json `"engines": "18.x"`

If the Project Settings Node Version is set to `20.x`, but the package.json has `"engines": "18.x"`, then the build will fail like so, because Node 18 is not present on the AL2023 build image:

<img width="1044" alt="Screenshot 2023-11-09 at 1 25 41 PM" src="https://github.com/vercel/vercel/assets/71256/572c544b-6574-4eb1-98f7-787075a60000">

### Project Settings `18.x` with package.json `"engines": "20.x"`

If the Project Settings Node Version is set to `18.x`, but the package.json has `"engines": "20.x"`, then the build will fail like so, because Node 20 is not present on the AL2 build image:

<img width="1042" alt="Screenshot 2023-11-09 at 1 34 43 PM" src="https://github.com/vercel/vercel/assets/71256/c6a2d955-9453-4ef5-a99d-b49a6d9af766">

### Project Settings `18.x` with no package.json `"engines"`

If Project Settings Node Version is set to `18.x`, but the package.json has no "engines" (and thus wants "latest"), then the latest available Node version in the build-container, which would be Node 18.
2023-11-14 23:08:27 +00:00
Brooks Lybrand
f3b62d8ea2 chore: Update Remix example README (#10830)
Not sure the best spot to put this command in the Readme, but I thought having a `create-remix` command might be useful for people trying to get going.

If there's a more preferred way to scaffold this project on your machine, I'm open to that, just using what I know
2023-11-13 20:10:57 +00:00
Wyatt Johnson
9472c22bf7 [next] Added more PPR tests (#10823)
This adds additional regression tests for PPR support for Next.js.
2023-11-09 23:45:35 +00:00
Vercel Release Bot
493185709a Version Packages (#10809)
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@32.5.3

### Patch Changes

- Handle `TooManyProjects` error in places where projects are created
([#10807](https://github.com/vercel/vercel/pull/10807))

- Updated dependencies
\[[`89c1e0323`](89c1e03233),
[`fd29b966d`](fd29b966d3)]:
    -   @vercel/node@3.0.9
    -   @vercel/next@4.0.14

## @vercel/next@4.0.14

### Patch Changes

- Fixed headers for static routes when PPR is enabled
([#10808](https://github.com/vercel/vercel/pull/10808))

## @vercel/node@3.0.9

### Patch Changes

- Replace usage of `fetch` with `undici.request`
([#10767](https://github.com/vercel/vercel/pull/10767))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-08 10:36:37 -07:00
Ethan Arrowood
89c1e03233 [node] swap undici.fetch for undici.request in serverless-handler.mts (#10767)
In a recent undici update, setting the `host` header for fetch requests became invalid (https://github.com/nodejs/undici/pull/2322). 

We relied on this in order to proxy serverless dev server requests via `@vercel/node`. 

This PR replaces the usage of `undici.fetch` with `undici.request`. 

It is blocked by an `undici` type change: https://github.com/nodejs/undici/pull/2373
2023-11-08 17:31:03 +00:00
Zach Ward
ebd7e3ac39 Project limits error handling (#10807)
This PR adds improved error handling for the 200 project limit error
that will start being returned for free tier teams/accounts. The
following changes have been made:
- improve error message format by using `client.output.prettyError` so
that the docs link
(https://vercel.com/docs/limits/overview#general-limits) returned with
the error response is included with the error message
- add explicit error handling of this error from any places where
`createProject` is called, which includes the following commands:
  - `vc project add`
  - `vc link` (indirectly called via `ensureLink`)
  - `vc list` (indirectly called via `ensureLink`)
  - `vc git connect` (indirectly called via `ensureLink`)

### Testing
- sign in to a vercel account that is associated with your work email
(ends in `@vercel.com`), this is necessary for creating a team with the
proper conditions to artificially trigger the error message
- create a Pro Trial team and make sure to prefix the name with:
`vtest314 too many projects `, for example `vtest314 too many projects
test 1`
- check out this branch and cd to `vercel/vercel/packages/cli`
- run: `pnpm dev add [project-name] --cwd=/path/to/some/project`
- the project should fail to be created and you should see the expected
error message (screenshot below) in the terminal output

**Screenshot of error message when attempting to add project from cli**
<img width="798" alt="image"
src="https://github.com/vercel/vercel/assets/14896430/43e6ac2c-ae1c-4367-8d57-0aeb7fbddf33">

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
2023-11-08 11:48:12 -05:00
Wyatt Johnson
fd29b966d3 tests: added tests for PPR (#10808)
This adds some tests to the PPR implementation for Next.js. This also
fixes a bug where the static pages were incorrectly generating a header
that falsly indicated that it postponed.
2023-11-08 09:21:51 -07:00
Vercel Release Bot
2bd9216403 Version Packages (#10805)
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@32.5.2

### Patch Changes

- Updated dependencies
\[[`c94a082f6`](c94a082f6b)]:
    -   @vercel/next@4.0.13

## @vercel/next@4.0.13

### Patch Changes

- Added `getRequestHandlerWithMetadata` export
([#10753](https://github.com/vercel/vercel/pull/10753))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-07 12:20:58 -07:00
Wyatt Johnson
c94a082f6b Added getRequestHandlerWithMetadata export (#10753)
This adds a new `getRequestHandlerWithMetadata` export if enabled and
available to the exported method.

---------

Co-authored-by: Joe Haddad <timer@vercel.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-11-07 10:32:03 -08:00
Vercel Release Bot
66cd626d1c Version Packages (#10765)
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.2.3

### Patch Changes

- Add experimental flag to allow Node.js v20
([#10802](https://github.com/vercel/vercel/pull/10802))

## vercel@32.5.1

### Patch Changes

- Debug log load user exceptions
([#10773](https://github.com/vercel/vercel/pull/10773))

- bump: edge-runtime
([#10712](https://github.com/vercel/vercel/pull/10712))

- Updated dependencies
\[[`fc90a3dc0`](fc90a3dc0b),
[`644b8a52c`](644b8a52cb),
[`0861dc8fb`](0861dc8fbc),
[`33cc8e0ac`](33cc8e0acf),
[`f5296c3c0`](f5296c3c06),
[`d9065c210`](d9065c2102)]:
    -   @vercel/next@4.0.12
    -   @vercel/node@3.0.8
    -   @vercel/build-utils@7.2.3
    -   @vercel/remix-builder@2.0.11
    -   @vercel/static-build@2.0.10

## @vercel/client@13.0.7

### Patch Changes

- Updated dependencies
\[[`0861dc8fb`](0861dc8fbc)]:
    -   @vercel/build-utils@7.2.3

## @vercel/edge@1.1.1

### Patch Changes

- bump: edge-runtime
([#10712](https://github.com/vercel/vercel/pull/10712))

## @vercel/error-utils@2.0.2

### Patch Changes

- use Node.js `util.types.isNativeError` for `isError` method
([#10764](https://github.com/vercel/vercel/pull/10764))

## @vercel/frameworks@2.0.3

### Patch Changes

- update Angular output path discovery
([#10678](https://github.com/vercel/vercel/pull/10678))

- Updated dependencies
\[[`34dd9c091`](34dd9c0918)]:
    -   @vercel/error-utils@2.0.2

## @vercel/fs-detectors@5.1.3

### Patch Changes

- Updated dependencies
\[[`306f653da`](306f653da9),
[`34dd9c091`](34dd9c0918)]:
    -   @vercel/frameworks@2.0.3
    -   @vercel/error-utils@2.0.2

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

### Patch Changes

- Fix nested SSR routes
([#10751](https://github.com/vercel/vercel/pull/10751))

- Updated dependencies
\[[`0861dc8fb`](0861dc8fbc)]:
    -   @vercel/build-utils@7.2.3

## @vercel/next@4.0.12

### Patch Changes

- fix re-mapping logic for index prefetches
([#10750](https://github.com/vercel/vercel/pull/10750))

- Fixes a case where using `basePath` along with static generation would
output a lambda that conflicts with the root route.
([#10738](https://github.com/vercel/vercel/pull/10738))

- Rework prefetch route handling
([#10779](https://github.com/vercel/vercel/pull/10779))

## @vercel/node@3.0.8

### Patch Changes

- bump: edge-runtime
([#10712](https://github.com/vercel/vercel/pull/10712))

- Updated dependencies
\[[`0861dc8fb`](0861dc8fbc),
[`34dd9c091`](34dd9c0918)]:
    -   @vercel/build-utils@7.2.3
    -   @vercel/error-utils@2.0.2

## @vercel/remix-builder@2.0.11

### Patch Changes

- Update `@remix-run/dev` fork to v2.2.0
([#10788](https://github.com/vercel/vercel/pull/10788))

## @vercel/static-build@2.0.10

### Patch Changes

- Updated dependencies
\[[`efd3cc05d`](efd3cc05dc)]:
    -   @vercel/gatsby-plugin-vercel-builder@2.0.9

## @vercel-internals/types@1.0.14

### Patch Changes

- Updated dependencies
\[[`0861dc8fb`](0861dc8fbc)]:
    -   @vercel/build-utils@7.2.3

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-07 10:51:39 -07:00
Nathan Rajlich
0861dc8fbc [build-utils] Add experimental flag to allow Node.js v20 (#10802)
Similar to #8836, but now for Node.js v20.
2023-11-07 13:43:29 +00:00
JJ Kasper
7b553c7032 Disable deployment SSO protection for tests (#10799)
Our tests rely on not being behind deployment protection which is now enabled by default so this adds a step to tests to disable this setting to allow tests to continue working as expected.
2023-11-07 05:04:29 +00:00
Kiko Beats
644b8a52cb bump: edge-runtime (#10712) 2023-11-06 09:58:22 +01:00
Bryce Kalow
33cc8e0acf fix(next): do not generate conflicting lambdas when using basePath with app router (#10738)
When using `basePath` with statically generated routes, the builder
currently generates lambdas for the root route that conflict with the
prerender functions generated.

E.g. if we have `basePath: "test"` and a root route at: `app/page.js`,
this is currently the output:

```
test
test.rsc
test/index
test/index.rsc
```

The result is that visiting the deployed app at `/test` renders an
incomplete page. On the other hand visiting `/test/index` outputs the
expected markup.

It seems like the intent is that we want to delete the lambdas that
conflict with the prerender functions. I've updated the lambda name
generation logic when doing the deleting to line up with how the lambda
names are generated initially.
2023-11-03 13:25:56 -07:00
Steven
c0efce29ad chore: remove styfle from codeowners (#10790) 2023-10-31 18:01:48 -05:00
Ethan Arrowood
b4d115b24a [error-utils] fix jest coverage issue (#10789) 2023-10-31 14:08:28 -07:00
Ethan Arrowood
34dd9c0918 [error-utils] use Node.js util.types.isNativeError for isError method (#10764)
I recently learned about https://nodejs.org/api/util.html#utiltypesisnativeerrorvalue which is pretty great. It will return `true` for all errors including subclasses (`class MyError extends Error {}`)
2023-10-31 19:39:30 +00:00
JJ Kasper
f5296c3c06 Rework prefetch route handling (#10779)
Follow-up to https://github.com/vercel/vercel/pull/10750 this removes the underscore prefetching from all prefetch outputs and instead only applies it to the index route itself as this causes issues with PPR making these outputs prerenders and being able to interpolate the route param values. 

There is the edge case of a user returning the literal value `index` from `generateStaticParams` but we can tolerate that more than ppr not working as expected.
2023-10-31 18:15:13 +00:00
Vercel Release Bot
d9065c2102 [remix] Update @remix-run/dev to v2.2.0 (#10788)
This auto-generated PR updates `@remix-run/dev` to version 2.2.0.
2023-10-31 17:59:35 +00:00
Vercel Release Bot
0ad37829da [tests] Update Gatsby fixture versions (#10745)
Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`
2023-10-30 14:12:31 +00:00
Vercel Release Bot
67748b5207 [examples][tests] Upgrade Next.js to version 14.0.0 (#10774)
This auto-generated PR updates 7 packages to Next.js version 14.0.0
2023-10-29 15:59:56 +00:00
Alan Agius
306f653da9 Update Angular output path discovery (#10678) 2023-10-27 08:54:24 -05:00
Chris Barber
9e2120a325 [cli] Debug log load user exceptions (#10773)
When `getUser(client)` throws an exception, the actual error is never printed. This is useful information, so we should write it to the debug log output.
2023-10-26 16:12:16 +00:00
Vercel Release Bot
a6463d2636 [tests] Upgrade Turbo to version 1.10.16 (#10744)
This auto-generated PR updates Turbo to version 1.10.16
2023-10-26 15:55:22 +00:00
Trek Glowacki
429a111b50 [tests] Add package-lock.json file to dev-server-and-routes vc dev fixture (#10771) 2023-10-26 10:30:56 -05:00
Trek Glowacki
431dde5fa8 [tests] Migrate docusaurus vc dev test to package-lock.json file (#10769) 2023-10-25 09:19:23 -05:00
Trek Glowacki
1f09979c6f [examples] Migrate hydrogen example from yarn.lock to package-lock.json (#10766)
This example occasionally fails with `ERROR: Command "yarn install"
exited with 1 at nowDeploy`. We've noticed errors at the yarn registry
being a root cause of lots of tests failures. This migrates the example
to use the npm registry instead.

Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-10-24 17:12:11 -05:00
Zack Tanner
fc90a3dc0b [next] fix re-mapping logic for index prefetches (#10750)
Follow-up to https://github.com/vercel/vercel/pull/10734 -- but considers that the static prefetch associated with `/` might be inside of a dir such as `index/index.prefetch.rsc`. 

To avoid any future matching conflicts, this PR updates to prefix all static prefetches
2023-10-24 20:51:55 +00:00
Trek Glowacki
57541e230d [examples] Update Saber to use npm registry (#10755)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-10-24 15:33:04 -05:00
Nathan Rajlich
efd3cc05dc [gatsby-plugin-vercel-builder] Fix nested SSR routes (#10751)
Fixes SSR / DSG pages that are nested deeper than the root path for Gatsby projects.

Also introduces unit tests for the logic related to determining which page name to use.
2023-10-24 20:15:46 +00:00
Trek Glowacki
a732b64c02 [examples][tests] Update fixture test names to be concretely named (#10752) 2023-10-24 10:44:53 -07:00
Zack Tanner
f8320417a8 [next] replace next export with output: export in tests (#10756)
`next export` has been deprecated on the latest Next.js canary so these
tests will no longer pass.

This changes it to use `output: export` from `next.config.js` instead.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-10-24 09:41:54 -07:00
Trek Glowacki
50791803b6 [examples] Migrate Sanity to use npm over yarn (#10754) 2023-10-24 11:17:48 -05:00
Vercel Release Bot
7504bfbe26 Version Packages (#10668)
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@32.5.0

### Minor Changes

-   Indicates whether @vercel/speed-insights or @vercel/analytics are used ([#10623](https://github.com/vercel/vercel/pull/10623))

-   [cli] update env var validation rule to allow name start with underscore ([#10697](https://github.com/vercel/vercel/pull/10697))

### Patch Changes

-   Updated dependencies \[[`da300030c`](da300030c9), [`de84743e1`](de84743e10), [`913608de4`](913608de4d), [`7fa08088e`](7fa08088ea)]:
    -   @vercel/next@4.0.11
    -   @vercel/python@4.1.0
    -   @vercel/remix-builder@2.0.10
    -   @vercel/redwood@2.0.5
    -   @vercel/static-build@2.0.9

## @vercel/python@4.1.0

### Minor Changes

-   Add support for pip3.10 and pip3.11 ([#10648](https://github.com/vercel/vercel/pull/10648))

## @vercel/routing-utils@3.1.0

### Minor Changes

-   Adds support for statusCode property on rewrites ([#10495](https://github.com/vercel/vercel/pull/10495))

## @vercel/client@13.0.6

### Patch Changes

-   Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
    -   @vercel/routing-utils@3.1.0

## @vercel/fs-detectors@5.1.2

### Patch Changes

-   Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
    -   @vercel/routing-utils@3.1.0

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

### Patch Changes

-   Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
    -   @vercel/routing-utils@3.1.0

## @vercel/next@4.0.11

### Patch Changes

-   fix `build` in appDir on Windows ([#10708](https://github.com/vercel/vercel/pull/10708))

-   Fix RSC prefetch for index route with catch-all ([#10734](https://github.com/vercel/vercel/pull/10734))

## @vercel/redwood@2.0.5

### Patch Changes

-   Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
    -   @vercel/routing-utils@3.1.0

## @vercel/remix-builder@2.0.10

### Patch Changes

-   Update `@remix-run/dev` fork to v2.1.0 ([#10732](https://github.com/vercel/vercel/pull/10732))

## @vercel/static-build@2.0.9

### Patch Changes

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

## @vercel-internals/types@1.0.13

### Patch Changes

-   Updated dependencies \[[`9e9fac019`](9e9fac0191)]:
    -   @vercel/routing-utils@3.1.0
2023-10-20 18:51:02 +00:00
Vercel Release Bot
7fa08088ea [remix] Update @remix-run/dev to v2.1.0 (#10732)
This auto-generated PR updates `@remix-run/dev` to version 2.1.0.
2023-10-20 18:00:14 +00:00
Chris Barber
5d40da17ba [python] Mock Python for tests running on machines without Python actually installed (#10742) 2023-10-20 12:41:15 -05:00
JJ Kasper
de84743e10 Fix RSC prefetch for index route with catch-all (#10734)
When matching outputs and we have an `index.{ext}` file it will take priority over dynamic routes which we don't want to match prefetch RSC index outputs unless it's specifically a prefetch request so this remaps this specific file to avoid the overlap. 

x-ref: [slack thread](https://vercel.slack.com/archives/C061DMGDXQW/p1697664158904469?thread_ts=1697647520.783419&cid=C061DMGDXQW)
2023-10-20 15:05:30 +00:00
JJ Kasper
39ce9166ba Update to run Next.js integration with Node.js v18 (#10740)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: Steven <steven@ceriously.com>
2023-10-20 09:36:50 -05:00
Vercel Release Bot
ce54ca631b [examples][tests] Upgrade Next.js to version 13.5.6 (#10735)
This auto-generated PR updates 7 packages to Next.js version 13.5.6
2023-10-18 20:31:38 -04:00
Ethan Arrowood
d6ca05d975 [static-build] remove old gatsby tests and merge into new gatsby-v2 (#10727)
Removes some old Gatsby tests and merge's their relevant probes into the newer `gatsby-v2` fixture. 

No point having 3 separate Gatsby v2 tests when they can all be in one.
2023-10-18 14:40:56 +00:00
Chris Barber
f8c893bb15 Add Zero Config Team to 'edge' codeowners (#10729) 2023-10-17 16:40:30 -05:00
Chris Barber
5e6ef3d569 Enable source maps in tests (#10725)
The `tsconfig` files were unified with a common configuration in https://github.com/vercel/vercel/pull/10667 including disabling source maps. The source maps greatly increase the distribution size, but they are invaluable when the tests run, so this PR enables source maps for tests including adding a `tsconfig.json` where absent.

Linear: https://linear.app/vercel/issue/ZERO-364/enable-sourcemaps-in-all-testtsconfigjson-files
2023-10-17 15:15:29 +00:00
Vercel Release Bot
88715ad598 [examples][tests] Upgrade Next.js to version 13.5.5 (#10718)
This auto-generated PR updates 7 packages to Next.js version 13.5.5
2023-10-16 22:55:18 +00:00
Trek Glowacki
ed19b26603 [cli] Migrate 30-next-image-optimization fixture to use npm install (#10720) 2023-10-16 13:55:43 -05:00
Trek Glowacki
9c4589ed28 [cli] autoconfirm in CI to domain buys (#10703)
The `try to purchase a domain` CLI test starting failing on  11 October when the API became slightly slower to respond. This is because `vercel domains buy example.com` displays a prompt asking the user to `y` into agreeing to the purchase. We interacted with this in tests by spamming `y` on STDIN for a few seconds. The timing required is now a bit longer but I think we can skip that pattern entirely by passing the `--yes` option to the subcommand.

I don't _think_ we want this anywhere but in CI and let people unintentionally buy domains , so I've gated the use based on that, but happy to make it available always.

Ironically this issue went away on 13 October when the API response times improved and we could just unskip the test https://github.com/vercel/vercel/pull/10707
2023-10-16 17:33:13 +00:00
Zack Tanner
da300030c9 [next] fix build in appDir on windows (#10708)
On Windows, `globPath` is a non-POSIX path (ie `'favicon.ico\\route.js'`) which won't match the paths generated by the `glob` util, since it normalizes Windows separators to Unix separators ([ref](https://github.com/vercel/vercel/blob/main/packages/build-utils/src/fs/normalize-path.ts#L6-L8))
2023-10-16 14:57:38 +00:00
Vercel Release Bot
90b14b689d [tests] Update Gatsby fixture versions (#10710)
Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`
2023-10-15 19:28:50 +00:00
Ethan Arrowood
e0ed2d1e76 [static-build] update astro-v2 fixture (#10706)
Astro-v2 fixture was using the wrong major version
2023-10-13 19:34:08 +00:00
Shohei Maeda
e7516f8002 [cli] update env var validation rule to allow name start with underscore (#10697)
internal ref: https://github.com/vercel/api/pull/20129

Vercel now accepts env var names that start with underscore.
2023-10-13 14:52:47 +00:00
Felix Haus
9e9fac0191 [routing-utils] Adds support for statusCode property on rewrites (#10495)
Allows to define a `statusCode` property on `rewrites` in the same way as we already have it for `redirects`.
This is still blocked internally as it requires a feature flag to build with that setting.

So it would allow to set the status in `vercel.json` like this:
```json
{
  "rewrites": [
    {
      "source": "/*",
      "destination": "not-found.html",
      "statusCode": 404
    }
  ]
}

```

Once released, I'll update the documentation on that as well.

### Requirements
> Cause once router sees a status code is set, it stops routing.
> So it wont run the `miss` and `rewrite` sections again once it has a status.
> So just need to make sure wherever status code is set, its at the end of its routing.
> [[internal ref](https://vercel.slack.com/archives/C01A2M9R8RZ/p1691594782351809?thread_ts=1691540814.244679&cid=C01A2M9R8RZ)]
2023-10-13 10:03:36 +00:00
Trek Glowacki
00f26b3571 [cli] Add lockfile mistakenly missed due to gitignore (#10699) 2023-10-12 19:54:18 -05:00
Trek Glowacki
68b4516722 Remove svelte v5 fixture (#10698)
I originally created with following the instructions on the site `npm create svelte@latest` but got confused seeing a version `5.1.1` but that's for `create-svelte`, not `svelte` itself. It creates a svelte 4 app still.
2023-10-12 22:22:46 +00:00
Ethan Arrowood
7bf7591dd3 [static-build] add angular v16 (#10683) 2023-10-12 21:57:07 +00:00
Ethan Arrowood
a012a1e749 [static-build] ember-v5 (#10696) 2023-10-12 21:30:56 +00:00
Ethan Arrowood
6dbeb5c3ee [static-build] stencil-v4 (#10695) 2023-10-12 21:05:50 +00:00
Ethan Arrowood
853a570384 [static-build] nuxt-v3 (#10694) 2023-10-12 20:42:34 +00:00
Trek Glowacki
353a7ddfcd Disable failing e2e test (#10700) 2023-10-12 15:25:56 -05:00
Ethan Arrowood
6fcbdb90c7 [static-build] scully-v2 (#10693) 2023-10-12 18:20:25 +00:00
Ethan Arrowood
80a6960dc9 [static-build] hydrogen-v2023 (#10688) 2023-10-11 23:25:12 +00:00
Ethan Arrowood
b52741b1bb [static-build] blitz-v2 (#10690) 2023-10-11 22:59:44 +00:00
Ethan Arrowood
1d4c86d0f8 [static-build] storybook-v7 (#10686) 2023-10-11 22:35:18 +00:00
Chris Barber
913608de4d [python] Add support for pip3.10 and pip3.11 in vc build (#10648) 2023-10-11 14:53:54 -05:00
Steven
d595db6294 [ci] update codeowners (#10691)
Remove styfle from a few examples and static-build
2023-10-11 14:40:11 -04:00
Trek Glowacki
ae489687d2 Revert "Remove comment (testing branch protection)"
This reverts commit 6fc2872794.
2023-10-11 09:06:10 -05:00
Trek Glowacki
6fc2872794 Remove comment (testing branch protection) 2023-10-10 18:04:31 -05:00
Ethan Arrowood
6697a0e846 [static-build] vite-v4 (#10675) 2023-10-10 22:52:47 +00:00
Ethan Arrowood
ed9ef486a8 Revert "[static-build] hydrogen-v2023"
This reverts commit 213ec69db3.
2023-10-10 16:44:10 -06:00
Ethan Arrowood
213ec69db3 [static-build] hydrogen-v2023 2023-10-10 16:41:59 -06:00
Ethan Arrowood
7512bf64b1 [static-build] hexo-v6 fixture (#10684) 2023-10-10 20:42:44 +00:00
Trek Glowacki
00e12792d8 [static-build] Add basic Middleman v4 fixture (#10682)
Adding a new fixture for middleman. Currently missing.
2023-10-10 19:54:49 +00:00
Vercel Release Bot
469d38aad8 [tests] Upgrade Turbo to version 1.10.15 (#10677)
This auto-generated PR updates Turbo to version 1.10.15
2023-10-10 19:26:06 +00:00
Chris Barber
0e84a6775d Run workflows using Node 16 (#10680)
Align the `lint` and `update-remix-run-dev` workflows to use Node 16 since all other workflows use Node 16.

Linear: https://linear.app/vercel/issue/ZERO-997/update-node-version-in-workflows
2023-10-10 17:58:36 +00:00
Trek Glowacki
3029af5a2b [static-build] add umi-4 fixture (#10659)
Added new umi-v4 fixture by following the [new project directions for `npm`](https://umijs-org.translate.goog/docs/guides/getting-started?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp&_x_tr_hist=true)
2023-10-10 16:50:55 +00:00
Trek Glowacki
4422eee5c4 Add vue-3 (#10660)
Adds a fixture test for vue@3
2023-10-09 12:23:46 +00:00
Chris Barber
222710f612 Add type-check and unify tsconfig (#10667)
This adds a new `pnpm type-check` that leverages `turbo` to validate the TypeScript code. This can be run at the top-level or for an individual package.

The `test-lint` workflow will run it after linting and doing the prettier check.

As apart of this effort, each package's `tsconfig.json` has been simplified. There's a new top-level `tsconfig.base.json` file that extends the Vercel Style Guide for TypeScript. Each package's `tsconfig.json` has been audited and previously suppressed rules that no longer apply have been removed. The result is each package's `tsconfig.json` is greatly simplified and we can control common settings in the base config while keeping the flexibility of package-level overrides.

Lastly, in `package/cli`, `pnpm build` calls `scripts/build.mjs` which calls `scripts/compile-templates.mjs`. The `compile-templates.mjs` file was generating invalid TypeScript code. I've fixed it and now it's happier than ever.

Note: In order to run `pnpm type-check`, you must first `pnpm build` because we need the `.d.ts` definition files.
2023-10-09 11:58:23 +00:00
Ethan Arrowood
d8179032e2 [static-build] add parcel v2 fixture (#10674)
Kinda simple. Not sure how else to improve this. Parcel is a pretty
basic build tool I think.
2023-10-06 11:07:27 -06:00
Trek Glowacki
f2d7f3f444 Move existing framework fixtures to numeric-free prefix (#10670) 2023-10-05 16:05:12 -05:00
Trek Glowacki
60929bb1af [static-build] Add fixtures for latest versions of tested frameworks (#10656)
Adds `preact@10`, `eleventy@2` and `jekyll@4` fixtures.
2023-10-05 18:55:51 +00:00
Damien Simonin Feugas
4ef0b19508 [cli] indicates whether @vercel/speed-insights or @vercel/analytics are used (#10623) 2023-10-05 16:08:13 +02:00
Trek Glowacki
6041a3f6c8 [cli] Remove unused test helpers (#10663)
These helpers are unused in the project.
2023-10-04 21:58:36 +00:00
Trek Glowacki
5ee94e0dce [cli] Remove unused options to testFixtureStdio test helper (#10662)
Auditing for options use of `testFixtureStdio`:

* `{ skipDeploy: true }` is used frequently.
* `{ readyTimeout: 2000 }` is used once in `'[vercel dev] 08-hugo'`
* `{ projectSettings: { directoryListing: true } }` is used once in `'[vercel dev] 00-list-directory'`

Both `isExample` and `expectedCode` have stopped being used.
2023-10-04 21:39:54 +00:00
Trek Glowacki
9bc5bb4afc [cli] Move from yarn to npm for fixtures and ensure lockfiles to speed up installs (#10619)
Some of our tests take quite some time to run and occasionally timeout when accessing https://yarnpkg.com/. We decided to make sure there is a lockfile for this _and_ just move over to `npm`. Shifting the `packages/cli` fixtures over in this PR.

I possibly missed one but I changed the install commands in tests and ran

* pnpm test
* pnpm test-unit
* pnpm test-dev
* pnpm test-e2e
2023-10-04 17:31:08 +00:00
Trek Glowacki
cf6152d16b [static-build] Update existing fixtures to latest of their currently pinned framework dependency (#10652)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-10-04 11:04:39 -05:00
Vercel Release Bot
0f5ec80cc6 Version Packages (#10647)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-03 17:13:03 -05:00
Steven
c523a755f8 Revert "[next] Correct output file tracing and limit calculation (#10631)" (#10651)
This reverts commit e9026c7a69.

This was causing some builds using Turbo + Next.js to fail with:

```
...writing to cache...
--
17:02:42.820 | Traced Next.js server files in: 169.874ms
17:02:42.871 | Error: Config file was not found at "/vercel/output/config.json"
17:02:42.871 | at f3 (/var/task/sandbox.js:239:2647)
17:02:42.872 | at async TCe (/var/task/sandbox.js:245:4681)
17:02:42.872 | at async WBt (/var/task/sandbox.js:261:1990)
17:02:42.872 | at async zBt (/var/task/sandbox.js:261:1791)
```

INC-442
2023-10-03 22:07:56 +00:00
Steven
fa8e313222 [next] fix test missing yarn.lock file (#10642)
- Follow up to https://github.com/vercel/vercel/pull/10630

Was passing in the PR
https://github.com/vercel/vercel/actions/runs/6386018083/job/17332012211#step:9:269

But is failing on main
https://github.com/vercel/vercel/actions/runs/6386371621/job/17332970210

Looks like the `yarn.lock` was removed right before merging so this PR
adds it back.

INC-442
2023-10-03 17:22:30 -04:00
Trek Glowacki
0c1603f41b [static-build] Add Svelte 5 fixture (#10645)
Adds Svelte 5 fixture for testing as we expand our test matrix. This is an updated version of `11-svelte`
2023-10-03 15:26:37 +00:00
Trek Glowacki
18b04b3589 [static-build] Add fixture for svelte 4 apps (#10637)
Adds Svelte 4 fixture for testing as we expand our test matrix. This is an updated version of `11-svelte`
2023-10-03 15:06:46 +00:00
Jimmy Lai
58215906f9 next: bump minimal version for bundled server usage (#10646)
There was a bug that we caught in the bundled server when using the instrumentation hook that we fixed in https://github.com/vercel/next.js/pull/56318 . This PR bumps the version that we check so that we don't use it if the Next version is not up to date.
2023-10-03 14:46:00 +00:00
Vercel Release Bot
1feb4d797e [examples][tests] Upgrade Next.js to version 13.5.4 (#10643)
This auto-generated PR updates 5 packages to Next.js version 13.5.4

Co-authored-by: Steven <steven@ceriously.com>
2023-10-03 10:24:44 -04:00
Vercel Release Bot
45ae16e371 Version Packages (#10576)
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@32.4.0

### Minor Changes

- Restore unsetting teamId for non-team accounts
([#10612](https://github.com/vercel/vercel/pull/10612))

### Patch Changes

- remove unused source map pkg
([#10577](https://github.com/vercel/vercel/pull/10577))

- disable source map for prod build
([#10575](https://github.com/vercel/vercel/pull/10575))

- Better rendering upon authentication error in `vc cert ls`
([#10551](https://github.com/vercel/vercel/pull/10551))

- Updated dependencies
\[[`e9026c7a6`](e9026c7a69),
[`ea5bc8806`](ea5bc88062),
[`a4996e1c5`](a4996e1c5a),
[`a18ed98f2`](a18ed98f2d),
[`2f5b0aeeb`](2f5b0aeeb1),
[`09f1bbfa4`](09f1bbfa41),
[`ce7e82fa7`](ce7e82fa7a)]:
    -   @vercel/next@4.0.9
    -   @vercel/go@3.0.3
    -   @vercel/build-utils@7.2.2
    -   @vercel/node@3.0.7
    -   @vercel/redwood@2.0.4
    -   @vercel/remix-builder@2.0.9
    -   @vercel/static-build@2.0.8

## @vercel/build-utils@7.2.2

### Patch Changes

- [cli] Update bun detection and add tests for projects with both
bunlock binary and yarn.lock text files
([#10583](https://github.com/vercel/vercel/pull/10583))

## @vercel/client@13.0.5

### Patch Changes

- Updated dependencies
\[[`2f5b0aeeb`](2f5b0aeeb1)]:
    -   @vercel/build-utils@7.2.2

## @vercel/fs-detectors@5.1.1

### Patch Changes

- [cli] Update bun detection and add tests for projects with both
bunlock binary and yarn.lock text files
([#10583](https://github.com/vercel/vercel/pull/10583))

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

### Patch Changes

- Updated dependencies
\[[`2f5b0aeeb`](2f5b0aeeb1)]:
    -   @vercel/build-utils@7.2.2

## @vercel/go@3.0.3

### Patch Changes

- Update broken documentation link
([#10579](https://github.com/vercel/vercel/pull/10579))

## @vercel/next@4.0.9

### Patch Changes

- Correct output file tracing and limit calculation
([#10631](https://github.com/vercel/vercel/pull/10631))

- Fix the instrumentation hook on Next.js Edge Functions
([#10608](https://github.com/vercel/vercel/pull/10608))

- [next] fix lambda creation for i18n edge pages
([#10630](https://github.com/vercel/vercel/pull/10630))

- Revert "[next][node][redwood][remix] Update @vercel/nft (#10540)"
([#10633](https://github.com/vercel/vercel/pull/10633))

- Update `@vercel/nft` to 0.24.2
([#10644](https://github.com/vercel/vercel/pull/10644))

## @vercel/node@3.0.7

### Patch Changes

- Revert "[next][node][redwood][remix] Update @vercel/nft (#10540)"
([#10633](https://github.com/vercel/vercel/pull/10633))

- Update `@vercel/nft` to 0.24.2
([#10644](https://github.com/vercel/vercel/pull/10644))

- Updated dependencies
\[[`2f5b0aeeb`](2f5b0aeeb1)]:
    -   @vercel/build-utils@7.2.2

## @vercel/redwood@2.0.4

### Patch Changes

- Revert "[next][node][redwood][remix] Update @vercel/nft (#10540)"
([#10633](https://github.com/vercel/vercel/pull/10633))

- Update `@vercel/nft` to 0.24.2
([#10644](https://github.com/vercel/vercel/pull/10644))

## @vercel/remix-builder@2.0.9

### Patch Changes

- Revert "[next][node][redwood][remix] Update @vercel/nft (#10540)"
([#10633](https://github.com/vercel/vercel/pull/10633))

- Update `@vercel/nft` to 0.24.2
([#10644](https://github.com/vercel/vercel/pull/10644))

## @vercel/static-build@2.0.8

### Patch Changes

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

## @vercel-internals/types@1.0.12

### Patch Changes

- Updated dependencies
\[[`2f5b0aeeb`](2f5b0aeeb1)]:
    -   @vercel/build-utils@7.2.2

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-03 05:38:27 -06:00
Ethan Arrowood
ce7e82fa7a [next][node][redwood][remix] Update @vercel/nft 0.24.2 (#10644)
Updates nft to 0.24.2 fixing a broken feature
2023-10-03 05:15:00 -06:00
JJ Kasper
e9026c7a69 [next] Correct output file tracing and limit calculation (#10631)
While investigating build times noticed that our lambda creation times were increasing linearly with the number of pages which is unexpected since there are mostly shared dependencies. After further investigation it seems we were falling back to our legacy manual `nodeFileTrace` calls in the builder when we shouldn't have been.

Also noticed we were still doing the un-necessary reading/calculating for uncompressed lambda sizes which is as discussed previously isn't required and the only limit we need to keep enforcing is the uncompressed size which is a lot less expensive to compute. 

As a further optimization this adds proper usage of our lstat cache/sema where it wasn't previously and proper parallelizing where applicable. 

These changes reduce tracing/lambda creation times by 3-5x in larger applications and can fix edge cases where we weren't leveraging our more accurate traces from the build. 

Before: 

```sh
Traced Next.js server files in: 444.05ms
Created all serverless functions in: 1:36.311 (m:ss.mmm)
Collected static files (public/, static/, .next/static): 241.47ms
```

After: 

```sh
Traced Next.js server files in: 10.4ms
Created all serverless functions in: 43.684s
Collected static files (public/, static/, .next/static): 250.828ms
```
2023-10-03 00:00:20 +00:00
Csaba Palfi
a18ed98f2d [next] fix lambda creation for i18n edge pages (#10630)
An issue similar to https://github.com/vercel/next.js/issues/44381
exists whereby vercel creates lambda functions for edge pages when i18n
is configured.

Fixes https://github.com/vercel/next.js/issues/42854

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-10-02 18:57:50 -04:00
Sean Massa
09f1bbfa41 Revert "[next][node][redwood][remix] Update @vercel/nft" (#10633)
This reverts commit ab329f0fe8.

@TooTallNate confirmed with a user that this revert fixed their issue: https://github.com/orgs/vercel/discussions/4231#discussioncomment-7102952
2023-10-02 21:14:29 +00:00
Trek Glowacki
13efc4f04f [static-build] Add Astro 2.x fixture (#10634)
Adds Astro 2 fixture for testing as we expand our test matrix. Not sure what all probes we'd want beyond a "did it work" one.
2023-10-02 19:56:59 +00:00
Trek Glowacki
08c5a9b0fc [static-build] Add Astro 3.x fixture (#10632)
Adds Astro 3 fixture for testing as we expand our test matrix. Not sure what all probes we'd want beyond a "did it work" one.
2023-10-02 19:32:42 +00:00
Trek Glowacki
5349fb9181 [tests] *Also* run Determine HIT or MISS step regardless of sucess status (#10638)
The `if:` "condition" for "Upload Test Report to Datadog" will always be false if "Determine Turbo HIT or MISS" does not run.

Added a forced-fail test to verify:
<img width="544" alt="CleanShot 2023-10-02 at 12 43 57@2x" src="https://github.com/vercel/vercel/assets/9736/ce18bfa4-9cc5-4eae-b223-04a4ca4cb009">
2023-10-02 18:05:07 +00:00
Ethan Arrowood
2f51171a17 [tests] improve gatsby fixtures in static-build (#10620) 2023-09-29 16:11:17 +00:00
Trek Glowacki
63c010a7f4 Move full GitHub Actions expression into curlies in test workflow (#10622) 2023-09-29 08:31:00 -05:00
Trek Glowacki
7128a65ccd [cli] Restore setting of currentTeam (#10612)
As part of a refactor in #10535, we lost the – admittedly untested – behavior of 

1. setting the new `teamId` from a login `result`
2. removing this value if it was `undefined` ensuring we didn't write `"currentTeam": undefined` to `config.json`.

This resulted in subsequent calls to `vc login` keeping the last known defined `teamId`.

This should restore that behavior but also retain the behavior of calling `updateCurrentTeamAfterLogin` to check if the user has a new `defaultTeamId` to be stored.

Not a fan of just how much mutation exists on `client.config` in this flow, but that predates this change and I wanted to keep this bugfix as small as possible.
2023-09-28 16:25:41 +00:00
Ethan Arrowood
d402c4350a [tests] Reduce ionic fixture sizes to improve test timing (#10605)
This PR regenerates the ionic-angular and ionic-react fixtures to be significantly smaller and simpler. 

I don't know why the lock files are so massive. If anyone has ideas to reduce the size of those (I've tried ripping out a bunch of dependencies).
2023-09-28 15:29:39 +00:00
Trek Glowacki
f88afba733 Report tests to DataDog even on failed runs (#10616) 2023-09-28 09:44:12 -05:00
Andrew Gadzik
ea5bc88062 [next] fix next.js edge functions that use the instrumentation hook (#10608)
Fixes a issue when a Next.js app uses app router + edge runtime + instrumentation hook deployed out on Vercel.  The issue is that the code to register the instrumentation hook in Next.js expects `_ENTRIES` to be defined on `globalThis`.

```ts
async function registerInstrumentation() {
  console.log("'_ENTRIES' in globalThis:", '_ENTRIES' in globalThis)
  console.log(
    '_ENTRIES.middleware_instrumentation:',
    Boolean(_ENTRIES.middleware_instrumentation)
  )
  console.log(
    '_ENTRIES.middleware_instrumentation.register:',
    Boolean(_ENTRIES.middleware_instrumentation.register)
  )

  if (
    '_ENTRIES' in globalThis &&
    _ENTRIES.middleware_instrumentation &&
    _ENTRIES.middleware_instrumentation.register
  ) {
    try {
      console.log('registering middleware instrumentation...')
      await _ENTRIES.middleware_instrumentation.register()
      console.log('registered middleware instrumentation!')
    } catch (err: any) {
      err.message = `An error occurred while loading instrumentation hook: ${err.message}`
      console.error(err)
      throw err
    }
  }
}
```

produced the following output,

![image](https://github.com/vercel/vercel/assets/1278714/d0a3a536-5579-4a63-a726-2e34a575e713)

This PR fixes this by changing `let _ENTRIES = {}'` to `globalThis._ENTRIES = {};`

![image](https://github.com/vercel/vercel/assets/1278714/7ba558ac-7364-4d91-869e-920662161022)
2023-09-27 18:25:27 +00:00
Ethan Arrowood
eb06bd262b Fix internal-dependency-trace script by handling commands/secrets/index.js (#10599) 2023-09-27 16:52:17 +00:00
Trek Glowacki
cb37ff2c89 Fix incorrect comment (#10603)
Fixes an errant comment from #10583.
2023-09-27 12:05:24 +00:00
Trek Glowacki
2f5b0aeeb1 [cli] Update bun detection and add tests for projects with both bunlock.b and yarn.lock files (#10583)
Updates package manager detection to account for two lock files. All other managers will only have the one lock file. Bun, however, may have both a `bun.lockb` _and_ a `yarn.lock` file. To ensure bun is properly detected, the presence of `bun.lockb` with `yarn.lock` must occur before `yarn.lock` so we don't mistake the presence of a `yarn.lock` to mean "Yarn".

This PR also adds a test for this situation in `fs-detectors`. The behavior is currently correct there, but was not tested initially. It is now to avoid future regressions.
2023-09-26 21:11:57 +00:00
Steven
ab01608785 Revert "[ci] use --output-logs=new-only to only list tests that changed" (#10584)
Reverts vercel/vercel#10570

This was causing a bug because my assumption about turbo cache hit/miss was incorrect. 

I thought `turbo run test-e2e --listTests` would be use the same cache as `turbo run test-e2e` but it does not. So what was happening is that tests were not running on a second push to a PR because turbo already "cached" the result of `--listTests` so that `new-only` was saying there are no new tests and nothing to run 🤦
2023-09-25 20:11:40 +00:00
balazs4
905c7b6ad4 [vc cert ls] remove error shallowing (#10551)
During [project-level-rbac bug bash](https://linear.app/vercel/issue/IAM-1267/vc-certs-ls-fails-with-typeerror-for-contributors) we were facing a runtime error 

```
Error: An unexpected error occurred in certs: TypeError: Cannot read properties of undefined (reading 'length')
```

The reason for that is because the API responded with `403`, which was expected in our test. However the CLI should not exit with a generic runtime error in this case.

This PR removes the `.catch(err => err)` error shallowing instruction.
2023-09-25 16:25:46 +00:00
Vercel Release Bot
717dd82c51 [examples][tests] Upgrade Next.js to version 13.5.3 (#10581)
This auto-generated PR updates 5 packages to Next.js version 13.5.3
2023-09-25 15:58:07 +00:00
Jack Wilson
a4996e1c5a Update broken documentation link (#10579)
The error link for the Go runtime documentation was broken. This PR updates the link.
2023-09-25 13:36:09 +00:00
Steven
c147ead1bc [cli] remove unused source map pkg (#10577)
This PR removes a [deprecated package](https://www.npmjs.com/package/@zeit/source-map-support) that was originally added in PR https://github.com/vercel/vercel/pull/1205

The comment said:

```js
// we only enable source maps while developing, since
// they have a small performance hit. for this, we
// look for `pkg`, which is only present in the final bin
```

Some time along the way this was changed from development only, to always being installed.

However, no longer need this package because we can enable source maps for development by using [`--enable-source-map`](https://nodejs.org/docs/latest-v18.x/api/cli.html#--enable-source-maps) which has been available since Node.js 12
2023-09-23 03:25:28 +00:00
Steven
2ab5ce5d90 [cli] disable source map for prod build (#10575)
I noticed the latest release got [larger in size](https://packagephobia.com/result?p=vercel@32.3.1) when we were expecting it to get smaller.

This is because a 14MB source map was published to npm as [`dist/index.js.map`](https://unpkg.com/browse/vercel@32.3.1/dist/).

This PR disables source maps by default and you can optionally enable when running locally to debug.
2023-09-23 02:12:03 +00:00
Steven
33e43e103a [ci] use --output-logs=new-only to only list tests that changed (#10570)
This PR effectively reverts the change in https://github.com/vercel/vercel/pull/9172 since it is safe to skip tests that are not part of the turbo cache miss results. Previously, we were unable to do this because all of those jobs/checks were marked as required on the github repo settings. But now we have a single ["Summary" job](f6e863d4bb/.github/workflows/test.yml (L111-L128)) that is marked as required at the repo level so now we don't need to create jobs anymore just to see the turbo cache hit go green.

- [15f90b0](15f90b057d) correctly skipped all e2e tests since none of the packages changed
- [2613963](26139634fb) correctly ran the `vercel` e2e tests since the cli package was changed
- [8488b05](8488b0543b) correctly runs tests for all packages since build-utils was changed and all packages depend on it

Also see [Turbo `-output-logs` docs](https://turbo.build/repo/docs/reference/command-line-reference/run#--output-logs) for more.
2023-09-22 17:14:57 +00:00
Steven
3dbc75580d [ci] increase concurrency for e2e tests (#10569)
Increase concurrency for e2e tests so they finish faster
2023-09-22 16:50:21 +00:00
Vercel Release Bot
f6e863d4bb Version Packages (#10565)
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@32.3.1

### Patch Changes

- Use "esbuild" to build CLI
([#10555](https://github.com/vercel/vercel/pull/10555))

- Updated dependencies
\[[`9f63ca60a`](9f63ca60ad),
[`e3f9faf51`](e3f9faf513)]:
    -   @vercel/next@4.0.8
    -   @vercel/remix-builder@2.0.8

## @vercel/next@4.0.8

### Patch Changes

- Fix edge case for setting `__NEXT_PRIVATE_PREBUNDLED_REACT`
([#10568](https://github.com/vercel/vercel/pull/10568))

## @vercel/remix-builder@2.0.8

### Patch Changes

- Update `@remix-run/dev` fork to v2.0.1
([#10566](https://github.com/vercel/vercel/pull/10566))
2023-09-22 12:54:57 -03:00
Nathan Rajlich
9f63ca60ad [next] Fix a couple issues with server-build template injecting (#10568)
(Includes e2e thanks to @feedthejim)
2023-09-22 15:40:54 +00:00
Nathan Rajlich
873327e9bd Remove @vercel/ncc dependency from all packages (#10559) 2023-09-22 13:57:20 +00:00
Vercel Release Bot
e3f9faf513 [remix] Update @remix-run/dev to v2.0.1 (#10566)
This auto-generated PR updates `@remix-run/dev` to version 2.0.1.
2023-09-22 13:25:08 +00:00
Nathan Rajlich
1a5bd6c5b9 [cli] Use "esbuild" (#10555) 2023-09-22 09:25:26 -03:00
Vercel Release Bot
6d312d85b2 Version Packages (#10542)
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@32.3.0

### Minor Changes

- [cli] Support northstar users
([#10535](https://github.com/vercel/vercel/pull/10535))

### Patch Changes

- Internal variants
([#10549](https://github.com/vercel/vercel/pull/10549))

- [speed insights] Prepare for migration to new speed insights package
([#10500](https://github.com/vercel/vercel/pull/10500))

- Updated dependencies
\[[`b0898a665`](b0898a6659),
[`10d4e51ac`](10d4e51ac5),
[`decdf27fb`](decdf27fb5),
[`f5ca497b7`](f5ca497b75),
[`ab329f0fe`](ab329f0fe8),
[`d0d052011`](d0d0520111),
[`9bb3067de`](9bb3067de2)]:
    -   @vercel/static-build@2.0.7
    -   @vercel/node@3.0.6
    -   @vercel/build-utils@7.2.1
    -   @vercel/next@4.0.7
    -   @vercel/python@4.0.2
    -   @vercel/redwood@2.0.3
    -   @vercel/remix-builder@2.0.7
    -   @vercel/go@3.0.2

## @vercel/edge@1.1.0

### Minor Changes

- Add flag to geolocation
([#10443](https://github.com/vercel/vercel/pull/10443))

    Usage

        const { flag } = geolocation(req)

## @vercel/build-utils@7.2.1

### Patch Changes

- Internal variants
([#10549](https://github.com/vercel/vercel/pull/10549))

## @vercel/client@13.0.4

### Patch Changes

- Updated dependencies
\[[`decdf27fb`](decdf27fb5)]:
    -   @vercel/build-utils@7.2.1

## @vercel/gatsby-plugin-vercel-analytics@1.0.11

### Patch Changes

- Remove "babel" compilation
([#10546](https://github.com/vercel/vercel/pull/10546))

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

### Patch Changes

- Use "esbuild" to build package
([#10508](https://github.com/vercel/vercel/pull/10508))

- Updated dependencies
\[[`decdf27fb`](decdf27fb5)]:
    -   @vercel/build-utils@7.2.1

## @vercel/go@3.0.2

### Patch Changes

- Add support for Go v1.21.0
([#10552](https://github.com/vercel/vercel/pull/10552))

## @vercel/next@4.0.7

### Patch Changes

- Internal variants
([#10549](https://github.com/vercel/vercel/pull/10549))

- Update `@vercel/nft` to v0.24.1.
([#10540](https://github.com/vercel/vercel/pull/10540))

- Build package using "esbuild"
([#10482](https://github.com/vercel/vercel/pull/10482))

## @vercel/node@3.0.6

### Patch Changes

- Use "esbuild" to build package
([#10553](https://github.com/vercel/vercel/pull/10553))

- Update `@vercel/nft` to v0.24.1.
([#10540](https://github.com/vercel/vercel/pull/10540))

- Updated dependencies
\[[`decdf27fb`](decdf27fb5)]:
    -   @vercel/build-utils@7.2.1

## @vercel/python@4.0.2

### Patch Changes

- Fix docs URL in error message
([#10544](https://github.com/vercel/vercel/pull/10544))

## @vercel/redwood@2.0.3

### Patch Changes

- Update `@vercel/nft` to v0.24.1.
([#10540](https://github.com/vercel/vercel/pull/10540))

## @vercel/remix-builder@2.0.7

### Patch Changes

- Update `@vercel/nft` to v0.24.1.
([#10540](https://github.com/vercel/vercel/pull/10540))

## @vercel/static-build@2.0.7

### Patch Changes

- Mark `@vercel/static-config` and `ts-morph` as externals
([#10543](https://github.com/vercel/vercel/pull/10543))

- Updated dependencies
\[[`4b376a564`](4b376a564a),
[`b8bc682d3`](b8bc682d3e)]:
    -   @vercel/gatsby-plugin-vercel-builder@2.0.6
    -   @vercel/gatsby-plugin-vercel-analytics@1.0.11

## @vercel-internals/types@1.0.11

### Patch Changes

- Updated dependencies
\[[`decdf27fb`](decdf27fb5)]:
    -   @vercel/build-utils@7.2.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-21 11:59:12 -06:00
Nathan Rajlich
10d4e51ac5 [node] Use "esbuild" to build package (#10553) 2023-09-20 18:35:57 -03:00
Tobias Lins
57231a0d60 [speed insights] Prepare for migration to new speed insights package (#10500)
During `vc build` do following when `@vercel/speed-insights` package is in dependencies:
- Show a warning when `VERCEL_ANALYTICS_ID` is set in environment variables
- Unset it in process.env to prevent auto-injecting old speed insights in Next.js

Durning `vc env pull` prevent pulling internal environment variables `VERCEL_ANALYTICS_ID`, `VERCEL_SPEED_INSIGHTS_ID` & `VERCEL_WEB_ANALYTICS_ID`. They are never required in the frontend
2023-09-20 21:06:12 +00:00
Vercel Release Bot
e0e9cffc8d [examples][tests] Upgrade Next.js to version 13.5.2 (#10554)
This auto-generated PR updates 4 packages to Next.js version 13.5.2
2023-09-20 20:19:36 +00:00
Nathan Rajlich
d0d0520111 [next] Use "esbuild" to build package (#10482)
### Before

```
$ time pnpm run build

> @vercel/next@4.0.6 build /Users/nrajlich/Code/vercel/vercel/packages/next
> node build.js

ncc: Version 0.24.0
ncc: Compiling file index.js
ncc: Using typescript@4.9.5 (local user-provided)
1506kB  dist/main/index.js
1506kB  [3345ms] - ncc 0.24.0

real    0m5.210s
user    0m9.083s
sys     0m0.506s

$ ls -l dist/
total 1700
-rw-r--r-- 1 nrajlich staff    2176 Sep 20 15:18 ___get-nextjs-edge-function.js
-rw-r--r-- 1 nrajlich staff    3283 Sep 20 15:18 create-serverless-config.js
drwxr-xr-x 6 nrajlich staff     192 Sep 20 15:18 edge-function-source/
-rw-r--r-- 1 nrajlich staff 1542314 Sep 20 15:18 index.js
-rw-r--r-- 1 nrajlich staff     728 Sep 20 15:18 legacy-launcher.js
-rw-r--r-- 1 nrajlich staff    6807 Sep 20 15:18 legacy-versions.js
-rw-r--r-- 1 nrajlich staff   66662 Sep 20 15:18 server-build.js
-rw-r--r-- 1 nrajlich staff    1583 Sep 20 15:18 server-launcher.js
-rw-r--r-- 1 nrajlich staff    5167 Sep 20 15:18 sourcemapped.js
-rw-r--r-- 1 nrajlich staff    1003 Sep 20 15:18 templated-launcher-shared.js
-rw-r--r-- 1 nrajlich staff     799 Sep 20 15:18 templated-launcher.js
-rw-r--r-- 1 nrajlich staff   83876 Sep 20 15:18 utils.js

$ pnpm pack && ls -lh vercel-next-4.0.6.tgz 
-rw-r--r-- 1 nrajlich staff 373K Sep 20 15:19 vercel-next-4.0.6.tgz
```

### After

```
$ time pnpm run build

> @vercel/next@4.0.6 build /Users/nrajlich/Code/vercel/vercel/packages/next
> node build.mjs

real    0m1.144s
user    0m0.550s
sys     0m0.171s

$ ls -l dist/
total 540
-rw-r--r-- 1 nrajlich staff   2176 Sep 20 15:15 ___get-nextjs-edge-function.js
-rw-r--r-- 1 nrajlich staff 528575 Sep 20 15:15 index.js
-rw-r--r-- 1 nrajlich staff   1680 Sep 20 15:15 legacy-launcher.js
-rw-r--r-- 1 nrajlich staff    901 Sep 20 15:15 server-launcher.js
-rw-r--r-- 1 nrajlich staff    532 Sep 20 15:15 templated-launcher-shared.js
-rw-r--r-- 1 nrajlich staff    316 Sep 20 15:15 templated-launcher.js

$ pnpm pack && ls -lh vercel-next-4.0.6.tgz 
-rw-r--r-- 1 nrajlich staff 104K Sep 20 15:15 vercel-next-4.0.6.tgz
```
2023-09-20 20:01:03 +00:00
Ethan Arrowood
9bb3067de2 [go] add support for Go 1.21.0 (#10552)
as titled

updates a test to check for runtime version

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
2023-09-20 12:30:38 -06:00
Andy
decdf27fb5 [cli][next][build-utils] Variants (#10549)
Co-authored-by: Ethan Arrowood <ethan.arrowood@vercel.com>
2023-09-20 19:42:20 +02:00
Nathan Rajlich
4b376a564a [gatsby-plugin-vercel-builder] Use "esbuild" to build package (#10508)
Removes the two-staged `tsc` build into a single `esbuild` bundle. The `ssr-handler.ts` template file is moved to the root of the package and converted to JavaScript.
2023-09-20 13:26:31 +00:00
Shu Uesugi
b7e93524e3 [cli] Support northstar users (#10535)
Supports users who have `version === 'northstar'` and `defaultTeamId`.
2023-09-19 21:45:42 +00:00
Paul Scanlon
62283356b8 feat: add flag to geolocation (#10443)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-09-19 16:25:46 -05:00
Vercel Release Bot
3305f5e832 [examples][tests] Upgrade Next.js to version 13.5.1 (#10545)
This auto-generated PR updates 4 packages to Next.js version 13.5.1
2023-09-19 21:06:40 +00:00
Jiachi Liu
a938706916 update code owners for nextjs example (#10548)
Add @huozhi to nextjs example code owners

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-09-19 17:01:13 -04:00
Nathan Rajlich
b8bc682d3e [gatsby-plugin-vercel-analytics] Remove "babel" compilation (#10546)
The "babel" build for this package essentially does nothing. The output is still using ESM and no transformation is done. Let's just remove the "build" script entirely.
2023-09-19 20:45:26 +00:00
Nathan Rajlich
f5ca497b75 [python] Fix docs URL in error message (#10544) 2023-09-19 18:07:43 +00:00
Nathan Rajlich
b0898a6659 [static-build] Mark @vercel/static-config and ts-morph as externals (#10543)
To be consistent with the other packages that use `@vercel/static-config`/`ts-morph`, move these packages to "dependencies" so that they will be excluded from the bundle, and de-duped at the `node_modules` level when installing CLI.
2023-09-19 17:47:05 +00:00
Chris Barber
ab329f0fe8 [next][node][redwood][remix] Update @vercel/nft (#10540)
Updating `nft` to fix a bug. We're a couple version behind. Here's all cumulative changes:

- 0.24.1
  - resolve cjs deps as cjs instead of esm
- 0.24.0
  - drop node@14 
- 0.23.1
  - use builtinModules from module
- 0.23.0
  - resolve: export resolve() function
- 0.22.6
  - Make caching work correctly in async context
2023-09-19 14:27:54 +00:00
Nathan Rajlich
8b35333446 [examples] Update "remix" template to v2 (#10532) 2023-09-18 16:32:30 -03:00
Vercel Release Bot
a92467719b Version Packages (#10528)
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@32.2.5

### Patch Changes

- Updated dependencies
\[[`849eedf0f`](849eedf0f2),
[`f6f16b034`](f6f16b0347),
[`3035e18fb`](3035e18fb6),
[`cb784aeb9`](cb784aeb9c)]:
    -   @vercel/next@4.0.6
    -   @vercel/remix-builder@2.0.6

## @vercel/next@4.0.6

### Patch Changes

- Fix feature flag detection
([#10531](https://github.com/vercel/vercel/pull/10531))

## @vercel/remix-builder@2.0.6

### Patch Changes

- Fix ESM mode for Edge runtime
([#10530](https://github.com/vercel/vercel/pull/10530))

- Update `@remix-run/dev` fork to v2.0.0
([#10526](https://github.com/vercel/vercel/pull/10526))

- Fixes for Remix v2
([#10525](https://github.com/vercel/vercel/pull/10525))
2023-09-18 15:44:07 -03:00
Nathan Rajlich
f6f16b0347 [remix] Fix ESM mode for Edge runtime, add Remix v2 E2E test (#10530)
Similar to the default import fix from #10525 which was for Node runtime, but this one fixes Edge runtime.

Also adds an E2E test for Remix v2, including both a Node route and Edge route.
2023-09-18 18:26:53 +00:00
Trek Glowacki
92ad73b8f3 Restore datadog checking with logs not exit codes (#10527)
Restores DataDog flakey test detection. Briefly disabled because the old method of using exit codes would bail the entire workflow.

Taking the Turbo team's suggestion of looking at `runData.execution` values to avoid an extra loop. Now with unit tests!
2023-09-18 16:43:16 +00:00
Steven
849eedf0f2 [next] fix feature flag detection (#10531)
For feature flags, we use the string `1` for enabled and the string `0` for disabled.

So we need to check the value of the env var, not the presence of the env var.
2023-09-18 16:17:55 +00:00
Vercel Release Bot
848a62e4a5 [tests] Upgrade Turbo to version 1.10.14 (#10529)
This auto-generated PR updates Turbo to version 1.10.14
2023-09-18 15:31:52 +00:00
Nathan Rajlich
cb784aeb9c [remix] Fixes for Remix v2 (#10525)
The Remix v2 template now uses `"type": "module"` by default, so adjust our bundling logic to account for that possibility.
2023-09-18 14:32:08 +00:00
Vercel Release Bot
3035e18fb6 [remix] Update @remix-run/dev to v2.0.0 (#10526)
This auto-generated PR updates `@remix-run/dev` to version 2.0.0.
2023-09-18 14:05:42 +00:00
Vercel Release Bot
eb40c4c4a0 Version Packages (#10514)
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/fs-detectors@5.1.0

### Minor Changes

- Add support for bun detection in monorepo
([#10511](https://github.com/vercel/vercel/pull/10511))

## vercel@32.2.4

### Patch Changes

- Add support for bun detection in monorepo
([#10511](https://github.com/vercel/vercel/pull/10511))

- Updated dependencies
\[[`1b6f3a0f6`](1b6f3a0f65)]:
    -   @vercel/static-build@2.0.6

## @vercel/static-build@2.0.6

### Patch Changes

- Add support for bun detection in monorepo
([#10511](https://github.com/vercel/vercel/pull/10511))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-15 15:13:54 -04:00
Nathan Rajlich
c90ee12b17 Update bun changeset to bump static-build + CLI (#10516)
Also reverts https://github.com/vercel/vercel/pull/10515 since it didn't
work the way we were hoping.
2023-09-15 16:06:32 -03:00
Nathan Rajlich
78be0200b4 Enable changesets experimental updateInternalDependents: 'always' config (#10515)
From the [sounds of
it](https://github.com/changesets/changesets/blob/main/docs/experimental-options.md#updateinternaldependents-type-out-of-range--always),
setting this config value to "always" will make it so that a patch
release will happen for a package that depends on another package which
is being bumped. This would normally happen anyways, but does not happen
when a dependency is a `devDependency` rather than a `dependency` (which
happens for the Builders and CLI, since those packages get bundled and
thus have their deps listed as devDependencies).
2023-09-15 15:54:47 -03:00
Steven
1b6f3a0f65 [fs-detectors] Add support for bun detection in monorepo (#10511)
E2E test looks like:

```sh
bunx create-turbo@canary
cd my-turborepo
gh repo create
vc link --repo
vc deploy
```
2023-09-15 14:13:26 -04:00
Trek Glowacki
eceb15ace9 Revert skipping datadog reports (#10513)
Revert
[.github/workflows/test.yml](https://github.com/vercel/vercel/pull/10513/files#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88)
to an earlier version.
2023-09-15 13:49:24 -04:00
Vercel Release Bot
fa3f701e05 Version Packages (#10505)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-14 16:06:33 -05:00
Trek Glowacki
9953fc765f Complete the error message (#10509) 2023-09-14 11:39:53 -05:00
Trek Glowacki
29ea1af971 Skip DataDog reporting if Turbo cache indicates the uploaded files would be identical (#10501) 2023-09-14 10:47:20 -05:00
Zack Tanner
083aad448e [next] missed a prerender for experimentalBypassFor (#10504)
Missed this in https://github.com/vercel/vercel/pull/10497
2023-09-14 01:19:13 +00:00
Vercel Release Bot
314a105ba1 Version Packages (#10493)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-13 17:15:29 -05:00
Ikko Eltociear Ashimine
1abda9ca87 [cli] Fix typo in corepack.ts (#10499)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-09-13 08:26:51 -05:00
Zack Tanner
7a0fed970c [next] provide experimentalBypassFor to prerender from manifest (#10497) 2023-09-12 17:40:49 -05:00
Jimmy Lai
2f461a8b0b next.js: add option to use bundled runtime (#10485)
This PR adds an environment variable that should allow us to test the bundled version for Next.js on Vercel, see https://github.com/vercel/next.js/pull/52997 for reference.

The changes include:
- a new environment variable `VERCEL_NEXT_BUNDLED_SERVER`
- some logic changes that will put app route handlers into their own lambda groups
- extra logic to require early the rendering runtimes (see PR above for details)
2023-09-12 19:45:23 +00:00
Steven
ec894bdf7f [frameworks] Add bun install placeholder (#10492)
<img width="899" alt="image"
src="https://github.com/vercel/vercel/assets/229881/f37a3cfd-bbb9-4c33-88dc-cd19b9855a47">
2023-09-12 11:29:24 -04:00
Andy
009cea6d30 [examples] Use placeholder for API Key (#10490)
The Ionic example has an actual Google Maps API key by default and we'd
like to not have it displayed, so we'll replace it with a placeholder
instead. Considering it's commented out anyways, this will be a no-op.

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-09-12 11:25:02 -04:00
Nathan Rajlich
1bab21026e [remix] Fix usage with bun install (#10489) 2023-09-12 09:55:16 -05:00
Vercel Release Bot
bcebab7517 Version Packages (#10478)
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.2.0

### Minor Changes

- Add new optional prerender field: experimentalStreamingLambdaPath
([#10476](https://github.com/vercel/vercel/pull/10476))

- [build-utils] Add zero config detection for bun package manager
([#10486](https://github.com/vercel/vercel/pull/10486))

### Patch Changes

- add `experimentalBypassFor` field to Prerender
([#10481](https://github.com/vercel/vercel/pull/10481))

## vercel@32.2.1

### Patch Changes

- Update @vercel/fun@1.1.0
([#10477](https://github.com/vercel/vercel/pull/10477))

- [node] upgrade edge-runtime
([#10451](https://github.com/vercel/vercel/pull/10451))

- Updated dependencies
\[[`6784e7751`](6784e77516),
[`a8ad17626`](a8ad176262),
[`0ee089a50`](0ee089a501),
[`f15cba614`](f15cba6148),
[`b265e13d4`](b265e13d40),
[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`a732d30c8`](a732d30c84),
[`9d64312aa`](9d64312aaa),
[`6baefc825`](6baefc825a),
[`989f0d813`](989f0d8139),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/go@3.0.1
    -   @vercel/redwood@2.0.2
    -   @vercel/remix-builder@2.0.4
    -   @vercel/hydrogen@1.0.1
    -   @vercel/static-build@2.0.5
    -   @vercel/build-utils@7.2.0
    -   @vercel/next@4.0.3
    -   @vercel/node@3.0.5
    -   @vercel/python@4.0.1
    -   @vercel/ruby@2.0.2

## @vercel/client@13.0.3

### Patch Changes

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0

## @vercel/edge@1.0.2

### Patch Changes

- [node] upgrade edge-runtime
([#10451](https://github.com/vercel/vercel/pull/10451))

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

### Patch Changes

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`9d64312aa`](9d64312aaa),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0
    -   @vercel/node@3.0.5

## @vercel/go@3.0.1

### Patch Changes

- Update to esbuild script
([#10468](https://github.com/vercel/vercel/pull/10468))

## @vercel/hydrogen@1.0.1

### Patch Changes

- Use `build-builder.mjs` script to bundle, and remove types and source
maps ([#10480](https://github.com/vercel/vercel/pull/10480))

## @vercel/next@4.0.3

### Patch Changes

- fix content-type for RSC prefetches
([#10487](https://github.com/vercel/vercel/pull/10487))

## @vercel/node@3.0.5

### Patch Changes

- [node] upgrade edge-runtime
([#10451](https://github.com/vercel/vercel/pull/10451))

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0

## @vercel/python@4.0.1

### Patch Changes

- Update to esbuild script
([#10470](https://github.com/vercel/vercel/pull/10470))

## @vercel/redwood@2.0.2

### Patch Changes

- Update to esbuild script
([#10471](https://github.com/vercel/vercel/pull/10471))

## @vercel/remix-builder@2.0.4

### Patch Changes

- Use `build-builder.mjs` script to bundle, and remove types and source
maps ([#10479](https://github.com/vercel/vercel/pull/10479))

## @vercel/ruby@2.0.2

### Patch Changes

- Update to esbuild script
([#10472](https://github.com/vercel/vercel/pull/10472))

## @vercel/static-build@2.0.5

### Patch Changes

- Build package using "esbuild"
([#10462](https://github.com/vercel/vercel/pull/10462))

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

## @vercel-internals/types@1.0.10

### Patch Changes

- Updated dependencies
\[[`50e04dd85`](50e04dd858),
[`45b73c7e8`](45b73c7e86),
[`d8bc570f6`](d8bc570f60)]:
    -   @vercel/build-utils@7.2.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-11 17:30:02 -04:00
Steven
45b73c7e86 [build-utils] Add zero config detection for bun package manager (#10486)
> [!IMPORTANT]  
> This PR will only support Bun as a package manager at build time. 
> Bun will **not** work at runtime with Serverless Functions or Edge
Functions at this time.

- Depends on https://github.com/vercel/api/pull/21869
- Fixes https://github.com/orgs/vercel/discussions/2021
- Closes https://github.com/vercel/vercel/pull/10244
- Related https://github.com/nodejs/corepack/issues/295
- Docs https://bun.sh/docs/install
2023-09-11 17:26:34 -04:00
Zack Tanner
a732d30c84 [next] fix content-type for RSC prefetches (#10487)
This ensures that the `.prefetch.rsc` requests respond with the correct `content-type` since this is used by Next.js to determine if a request is valid or not (and in the case it's invalid, an mpa navigation will occur)

Fixes: https://github.com/vercel/next.js/issues/54934
2023-09-11 19:04:16 +00:00
Lee Robinson
8504735808 [examples] Update Astro starter (#10397)
Deployed https://astro.vercel.app/image.
2023-09-11 16:29:54 +00:00
Kiko Beats
9d64312aaa [node] upgrade edge-runtime (#10451) 2023-09-10 13:14:43 +00:00
Chris Barber
a8ad176262 [redwood] Use new esbuild script (#10471) 2023-09-09 01:48:54 +00:00
Nathan Rajlich
0ee089a501 [remix] Bundle, remove types and source maps (#10479)
For consistency with other Builders.
2023-09-09 00:35:56 +00:00
Zack Tanner
d8bc570f60 [build-utils] add experimentalBypassFor field to Prerender (#10481)
This adds an experimental flag to `Prerender` outputs as a way to programmatically bypass the cache and hit the lambda directly, using a similar interface to `has`. 

(Note: I copied over `HasField` from `@vercel/router-utils` since it wasn't available for import in `build-utils`, but can add it as a dep if that's preferred)

The specific use-case being targeted here relates to https://github.com/vercel/next.js/pull/51534 -- a Next.js page marked static should still be able to initiate server actions.
2023-09-08 23:33:59 +00:00
Nathan Rajlich
f15cba6148 [hydrogen] Bundle, remove types and source maps (#10480)
Similar to #10479, but for `@vercel/hydrogen`.
2023-09-08 22:55:03 +00:00
Chris Barber
989f0d8139 [ruby] Use new esbuild script (#10472) 2023-09-08 17:27:17 -05:00
Chris Barber
6784e77516 [go] Update to esbuild script (#10468)
Co-authored-by: Nathan Rajlich <n@n8.io>
2023-09-08 17:00:40 -05:00
Chris Barber
6baefc825a [python] Update to esbuild script (#10470)
Co-authored-by: Steven <steven@ceriously.com>
2023-09-08 16:23:23 -05:00
Chris Barber
0a08e4b23e [cli] Update @vercel/fun@1.1.0 (#10477) 2023-09-08 15:39:13 -05:00
Nathan Rajlich
b265e13d40 [static-build] Use esbuild (#10462)
Switch to using esbuild to compile + bundle `@vercel/static-build`.
2023-09-08 19:39:12 +00:00
Nabeel Sulieman
50e04dd858 Add optional experimentalStreamingLambda field for prerender (#10476)
This adds a new `experimentalStreamingLambda` field to Prerender
outputs, allowing references to an optional streaming lambda path.
2023-09-08 11:42:06 -07:00
Vercel Release Bot
82231058da Version Packages (#10400)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-08 11:41:32 -05:00
Steven
61227bf7e3 fix .changeset/nice-lies-sip.md (#10474)
I think we need to remove `api` since its private so its not published to npm and therefore isn't versioned.
2023-09-08 02:09:11 +00:00
Zack Tanner
6aa0aa4e65 [next] fix ENOENT on /404.html when fallback: false w/ basePath (#10473)
The following error occurs during build when `basePath` is present in conjunction with `fallback: false` in `getStaticPaths`:

> Error: ENOENT: no such file or directory, open '/vercel/path0/.next/server/pages/404.html'

`localePrefixed404` was incorrectly being set to `false` because it was looking for `/<basePath>/<locale>/404.html` (when it's actually `/<locale>/404.html`)

This meant that inside `onPrerenderRoute`, `htmlFsRef` was pointing to `/404.html` rather than `/en/404.html`.
2023-09-08 00:17:08 +00:00
JJ Kasper
caaba0d685 [next] fix app dir edge functions with basePath (#10465)
x-ref: https://github.com/vercel/vercel/pull/10394
2023-09-07 22:03:12 +00:00
Steven
335fd70a68 [ci] Update codeowners (#10467)
Update codeowners for Next.js
2023-09-07 14:20:20 +00:00
Zack Tanner
c3c54d6e69 [next]: Fix RSC rewrite behavior (#10415)
- Removes some of the hacks from #10388 that were attempting to resolve an issue with RSC prefetches to `pages` routes in favor of adding rsc rewrites for all dynamic paths, and letting it fall through to a 404 if there's no match
- Fixes an issue where RSC requests were matching the wrong path (filesystem rather than RSC variant) introduced in above mentioned change
  - Closes https://github.com/vercel/next.js/issues/54698
2023-09-07 14:03:14 +00:00
Shu Uesugi
43048a0dd8 [CLI] Fix team URL on vercel help switch (#10466)
In `vercel help switch`, it suggests that team URL is of the format `vercel.com/teams/name`, but this will be 404. It should be `vercel.com/name`.
2023-09-07 13:12:54 +00:00
Sean Massa
60c75fd76c [CLI] show instant preview url on vc deploy and vc redeploy (#10458)
Show Instant Preview URLs immediately during `vc deploy`.

This does mean that we'll no longer show the nicer aliased URLs, but that's probably fine.

https://github.com/vercel/vercel/assets/41545/5d6d5695-60c3-49ca-a54d-a16828583070

---

- [Card](https://linear.app/vercel/issue/VCCLI-897/show-instant-preview-url-on-vc-deploy)
2023-09-06 23:46:44 +00:00
Trek Glowacki
bd1319d7a3 [cli] Update secrets.js to more current styles (#10461)
Updates the `secrets` command to be a bit more modern. Initially I was going to covert this to typescript but that change was quite large, so going stepwise for easier review.

1. Moves the command implementation into a directory like other commands
2. Shifts the command data structure into its own file
3. Adds a test.

Other relevant comments inline.
2023-09-06 20:58:57 +00:00
Nathan Rajlich
1138f7e3d1 Use esbuild for non-ncc'd packages (#10430)
The intention is for this to be a drop-in replacement for compiling TypeScript to JavaScript, but using `esbuild` instead of `tsc`. `tsc` is still needed, but only for the cases where we want to generate type definitions.
2023-09-06 19:49:50 +00:00
Ethan Arrowood
bb95cb9225 [cli] migrate teams command (#10434)
Before:
<img width="661" alt="Screenshot 2023-08-31 at 13 59 35" src="https://github.com/vercel/vercel/assets/16144158/7d16367a-662e-4ef1-8561-c197f4badf48">

After:
<img width="1036" alt="Screenshot 2023-08-31 at 14 00 23" src="https://github.com/vercel/vercel/assets/16144158/64431bdb-48ce-4bc1-8ed0-c719bdfbb350">
2023-09-06 16:15:35 +00:00
Trek Glowacki
0048eb999e [cli] N, not n. (#10460)
Followup to https://github.com/vercel/vercel/pull/10432#discussion_r1315482954
2023-09-06 15:42:37 +00:00
Espen Hovlandsdal
1b4de4a986 chore(deps): upgrade semver dependency (#10411)
Addresses ReDoS vulnerability: https://security.snyk.io/vuln/SNYK-JS-SEMVER-3247795
Uses the latest unaffected versions in the respective major versions, to prevent having to deal with any other breaking changes.
2023-09-06 13:37:37 +00:00
JJ Kasper
c9ad4084ee [next] Update page config test (#10456)
Updates failing test in https://github.com/vercel/vercel/actions/runs/6090040294/job/16525842631?pr=10430 per changes in https://github.com/vercel/next.js/pull/54786
2023-09-06 00:46:37 +00:00
Trek Glowacki
98ee6e4728 [cli] Migrate domains to new command structure (#10427)
After:
<img width="790" alt="CleanShot 2023-08-31 at 11 39 25@2x" src="https://github.com/vercel/vercel/assets/9736/b2e0e090-8c7c-4659-b1aa-1c59744d2eb1">

Before:
<img width="813" alt="CleanShot 2023-08-31 at 11 40 06@2x" src="https://github.com/vercel/vercel/assets/9736/731626a0-86f0-446d-8f77-436205acac87">
2023-09-05 21:11:03 +00:00
Vercel Release Bot
d7db0c5794 [tests] Upgrade Turbo to version 1.10.13 (#10404)
This auto-generated PR updates Turbo to version 1.10.13
2023-09-05 20:28:17 +00:00
Sean Massa
e90e922ee8 migrate dev command structure for help output (#10433)
Migrates the `vc git` command to the command data structure for use in the help output.

---

<img width="1891" alt="Screenshot 2023-08-31 at 1 35 07 PM" src="https://github.com/vercel/vercel/assets/41545/d3d63faa-9427-49e8-8137-a76d4c208cb3">
2023-09-05 19:51:44 +00:00
Trek Glowacki
adb9ac87ce [cli] Remove mri workaround (#10452)
As of https://github.com/vercel/vercel/pull/10389 the `mri` package is no longer used and this workaround can be removed.
2023-09-05 16:17:18 +00:00
Steven
e43191b186 [next] fix 404 enoent for i18n (#10416)
This PR fixes the following error:

```
Error: ENOENT: no such file or directory, open '/vercel/path0/.next/server/pages/en/404.html'
```


https://github.com/vercel/vercel/actions/runs/6030773334/job/16364078054?pr=10415#step:9:1352
2023-09-01 10:39:52 -04:00
Dan Stowell
a962e84409 migrate env to command structure (#10429)
Migrates the `vc env` command to the command data structure for use in the help output.
2023-08-31 23:10:28 +00:00
Trek Glowacki
7593e219fd [cli] Update project command to new structure (#10432)
Before:
<img width="687" alt="CleanShot 2023-08-31 at 13 29 29@2x" src="https://github.com/vercel/vercel/assets/9736/87e0f445-701a-4851-b73f-c787db01abe3">

After:
<img width="868" alt="CleanShot 2023-08-31 at 13 31 50@2x" src="https://github.com/vercel/vercel/assets/9736/b6820654-3254-4a65-820a-30ff7b577a44">
2023-08-31 22:45:44 +00:00
Dan Stowell
ec95066689 migrate vc secrets to help command structure (#10435) 2023-08-31 15:17:51 -07:00
Sean Massa
42a71416b9 migrate init command structure for help output (#10428)
Migrates the `vc init` command to the command data structure for use in the help output.

---

<img width="1891" alt="Screenshot 2023-08-31 at 11 36 37 AM" src="https://github.com/vercel/vercel/assets/41545/1caeb203-470f-49a5-86b2-273b04bc0489">
2023-08-31 21:48:09 +00:00
Sean Massa
80af30ce60 migrate git command structure for help output (#10431) 2023-08-31 16:02:49 -05:00
Sean Massa
74a15b5f32 migrate rollback command structure for help output (#10426)
Migrates the `vc rollback` command to the command data structure for use in the help output.

---

<img width="1891" alt="Screenshot 2023-08-31 at 11 25 49 AM" src="https://github.com/vercel/vercel/assets/41545/a6d802ac-3851-4641-b950-764fc65fa9d2">
2023-08-31 19:09:59 +00:00
Sean Massa
c0416f7e95 migrate promote command structure for help output (#10425)
Migrates the `vc promote` command to the command data structure for use in the help output.

---

<img width="1878" alt="Screenshot 2023-08-31 at 11 04 32 AM" src="https://github.com/vercel/vercel/assets/41545/b79c6aec-af03-4685-8ee4-9c0d89b2f236">
2023-08-31 18:41:55 +00:00
Kiko Beats
fc1e13c099 fix: remove console.log (#10417) 2023-08-31 16:34:27 +02:00
Nathan Rajlich
0e9ec194a3 Keep vercel@canary up to date with vercel@latest (#10410) 2023-08-28 22:50:30 -07:00
Sean Massa
5609a1187b [build-utils] add descriptions to NodeVersion properties (#10403) 2023-08-26 19:49:47 -05:00
Sean Massa
cff72e3129 [examples] fix redwood template and update examples to use at least node@16 (#10395)
The redwood template was broken because it would use node@18, which is not supported for the version of redwood used in the template. This PR updates that version to be node@16, which does work.

While we're at it, I also updated other examples to be at least node@16. I tested deployments of each of these and the all work.
2023-08-25 15:01:55 +00:00
Vercel Release Bot
d3c84e5d2a Version Packages (#10398)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-24 16:04:39 -05:00
Andrew Barba
9e3827c785 [build-utils] Support serverless function architecture (#10392)
# Problem

Framework authors often produce build outputs from platforms like Github
Actions or M1 Macs where the arm64 architecture is being used. They then
deploy these outputs to Vercel using `vercel deploy`, bypassing Vercel's
build system. Today they must cross compile to x86_64 in order to deploy
compatible Serverless functions to Vercel.

# Solution

Allow Framework authors to detect the current architecture and specify
either x86_64 or arm64 when deploying a Serverless function to Vercel.

# Related PRs

https://github.com/vercel/api/pull/21559

https://github.com/vercel/proxy/pull/6901

https://github.com/vercel/front/pull/24924
2023-08-24 16:44:30 -04:00
Trek Glowacki
fb6d77afac [cli] Improve error messages for JSON parse issues (#10396) 2023-08-24 15:09:13 -05:00
Vercel Release Bot
cfc1bb180b Version Packages (#10384)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-24 13:56:29 -05:00
Trek Glowacki
f06776468f [cli] Remove mri package (#10389)
`vc secrets` appears to be mostly deprecated but this was a fairly straightforward change that lets us drop `mri` today. Tested pretty extensively locally.
2023-08-24 18:05:11 +00:00
Kiko Beats
597a8a8176 upgrade edge-runtime (#10385) 2023-08-24 16:52:49 +02:00
Kiko Beats
3f6d99470d [node] use undici instead of node-fetch (#10387) 2023-08-24 10:06:33 +02:00
JJ Kasper
4422326865 Add handling to leverage RSC prefetch outputs (#10390)
Implements handling for the RSC prefetch outputs when available that
were added in https://github.com/vercel/next.js/pull/54403
2023-08-23 22:26:58 -07:00
Zack Tanner
09446a8fe8 [next] fix RSC matching behavior & 404 status code on fallback: false (#10388)
Fixes two separate issues for the Next builder:

- `pages` routes unexpectedly matching to RSC routes when prefetching from `app`. This update will attempt to match the route with the corresponding `pages` entry rather than falling back to a catch-all RSC
  - Fixes https://github.com/vercel/next.js/issues/53776
- `fallback: false` returning a successful status code when underlying page as a param (e.g. `/blog/[slug]` would 200 but `/blog/non-existent` would 404)
  - [slack x-ref](https://vercel.slack.com/archives/C03S8ED1DKM/p1692817762403579)
2023-08-23 22:30:33 +00:00
Vercel Release Bot
37e93a91a8 [remix] Update @remix-run/dev to v1.19.3 (#10381)
This auto-generated PR updates `@remix-run/dev` to version 1.19.3.
2023-08-22 20:49:48 +00:00
Trek Glowacki
eec6e47232 [cli] Update dns commands to new structure (#10379)
Before:
<img width="795" alt="CleanShot 2023-08-22 at 10 46 34@2x" src="https://github.com/vercel/vercel/assets/9736/456faef8-6335-46ac-89ae-5ce13db4568e">


After:
<img width="815" alt="CleanShot 2023-08-22 at 10 48 04@2x" src="https://github.com/vercel/vercel/assets/9736/e78a9cc5-d9e9-4079-bd4a-81cd68917127">
2023-08-22 20:24:19 +00:00
Vercel Release Bot
3a0cfce669 Version Packages (#10375)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-22 14:43:00 -05:00
Maz
ae4a9535c1 [cli] Add --git-branch to pull command help output (#10382)
Improves the help for pull command by adding --git-branch to the output.
2023-08-22 12:27:29 -07:00
Sean Massa
c615423a0b [frameworks] move some devDependencies to dependencies (#10380)
Because `frameworks` isn't bundled with `ncc`, we need the runtime dependencies to exist in the `dependencies` section of `package.json`.
2023-08-22 17:31:19 +00:00
Steven
96f99c7147 [error-utils] fix files in package.json to use dist (#10378)
These packages were publishing unnecessary files to npm so we can reduce to only the `dist` directory.

- Example: https://unpkg.com/browse/@vercel/error-utils@2.0.0/
- Docs: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files
2023-08-22 17:04:57 +00:00
Trek Glowacki
8f318d44cb Migrate certs to new command structure (#10377)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-22 10:33:36 -05:00
Vercel Release Bot
ade5e4ea0a [examples][tests] Upgrade Next.js to version 13.4.19 (#10373)
This auto-generated PR updates 3 packages to Next.js version 13.4.19
2023-08-21 23:55:07 +00:00
Trek Glowacki
87dee36ef9 [cli] Update new --help structure to support subcommands (#10372)
Before:
<img width="727" alt="CleanShot 2023-08-21 at 11 07 25@2x" src="https://github.com/vercel/vercel/assets/9736/1ff4b5b8-75e3-4fcb-b44a-7172e7612ecc">

After:
<img width="759" alt="CleanShot 2023-08-21 at 11 13 21@2x" src="https://github.com/vercel/vercel/assets/9736/acdd954a-6137-4535-8fbb-db025491156b">

Some notes re: "Before"

* We've dropped wrapping required args in `<>` some time ago.
* The command name for alias is optional (default is `set`) but was incorrectly still listed as required.
2023-08-21 21:31:02 +00:00
Vercel Release Bot
c97407da49 Version Packages (#10361)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-21 15:10:45 -05:00
Steven
37f5c62700 BREAKING CHANGE: Drop Node.js 14, bump minimum to Node.js 16 (#10369)
https://vercel.com/changelog/node-js-14-and-16-are-being-deprecated


https://github.com/nodejs/Release/blob/main/README.md#end-of-life-releases
2023-08-21 08:51:38 -04:00
Trek Glowacki
104ab0332d [cli] Wrap description in help output (#10370)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-18 15:01:45 -05:00
Vercel Release Bot
8ed71bea65 [examples][tests] Upgrade Next.js to version 13.4.18 (#10366)
This auto-generated PR updates 3 packages to Next.js version 13.4.18
2023-08-18 13:36:13 -04:00
Chris Barber
bc7a5d38be Exclude Gatsby from default 404 error route (#10365)
All static builds (except Next.js) have a default 404 error route. This PR add the exclusion of Gatsby from being assigned a 404 error route. The error routes are now introduced by the `gatsby-plugin-vercel-builder`.

Linear: https://linear.app/vercel/issue/VCCLI-749/fix-gatsby-404500-pages-directory-listing-bug
2023-08-18 17:10:40 +00:00
Nathan Rajlich
09174df6cf [remix] Only add workspace check flag for Yarn v1 (#10364)
Yarn v2/v3 do not require this flag.
2023-08-17 19:17:28 +00:00
Trek Glowacki
6aa2dc6f51 Connecting Datadog / GH Actions / Turbo / Jest to detect flakey tests (#10334)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
Co-authored-by: Steven <steven@ceriously.com>
2023-08-17 10:31:16 -05:00
Vercel Release Bot
9db3794735 [examples][tests] Upgrade Next.js to version 13.4.17 (#10362)
This auto-generated PR updates 3 packages to Next.js version 13.4.17
2023-08-17 10:09:28 -04:00
Nathan Rajlich
ed806d8a6b [frameworks][fs-detectors] Add "supersedes" prop to Framework interface (#10345)
The `supersedes` property on the `Framework` interface may be specified by a framework in which the superseded framework should _not_ be included in the resulting framework matches during detection.

For example, a Hydrogen v2 project matches both the "remix" and "hydrogen" framework detectors, but we really only want "remix" to be selected.
2023-08-17 07:30:32 +00:00
Vercel Release Bot
de9a1dbab7 Version Packages (#10359)
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@31.4.0

### Minor Changes

- Force-publish ([#10358](https://github.com/vercel/vercel/pull/10358))

### Patch Changes

- Updated dependencies
\[[`6e44757ff`](6e44757ff5)]:
    -   @vercel/static-build@1.4.0

## @vercel/static-build@1.4.0

### Minor Changes

- Force-publish ([#10358](https://github.com/vercel/vercel/pull/10358))
2023-08-16 20:34:05 -07:00
Nathan Rajlich
ae9b33b801 Force-publish on @vercel/static-build 2023-08-16 20:12:12 -07:00
Chris Barber
6e44757ff5 v31.4.0 (#10358)
https://github.com/vercel/vercel/pull/10356 didn't publish a new CLI release, so this PR should do the trick.
2023-08-16 23:19:43 +00:00
Vercel Release Bot
8dcefe5e83 Version Packages (#10356)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-16 18:02:42 -05:00
Riz
65ab3b23e9 [frameworks] Amend Hugo default buildCommand to exclude drafts enabled flag (#7326)
### Related Issues

Reported in https://github.com/vercel/community/discussions/194

Having the `-D` flag results in all draft content to be published (docs reference [here](https://gohugo.io/getting-started/usage/)).

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

- [x] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2023-08-16 21:29:09 +00:00
Nathan Rajlich
8f152a5939 [build-utils] Fix Node 14.x tests (#10355) 2023-08-16 20:59:14 +00:00
Nathan Rajlich
10a6aa55f9 [tests] Fix failures due to Node 14.x being discontinued (#10346)
This PR upgrades test fixtures from Node.js 14 to 16 and also removes
the `35-puppeteer` test fixture since it doesn't support Node.js 16
unfortunately.

- See https://github.com/alixaxel/chrome-aws-lambda/pull/274

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-08-15 17:59:21 -04:00
Vercel Release Bot
936a428420 [examples][tests] Upgrade Next.js to version 13.4.16 (#10344)
This auto-generated PR updates 3 packages to Next.js version 13.4.16

Closes #10339
2023-08-15 15:21:06 +00:00
Steven
a93e1a7a64 [examples] update ember example (#10347)
This PR updates the ember example using the following:

```
npx ember new ember-quickstart --lang en
```

I also had to add `{ 'ember-welcome-page': { enabled: true } }` to the
build config because the `<WelcomePage>` only works in dev, but throws
when using the default build command:

```
ember build --environment=production
```

For posterity, the error looks like:
```
Uncaught TypeError: Cannot destructure property 'manager' of 'e' as it is null.
    at u.resolvedComponent (vendor-2e12520b7a71eead28708a24fafa7fbc.js:2094:28)
    at vendor-2e12520b7a71eead28708a24fafa7fbc.js:1999:5
    at ne (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1999:30)
    at l (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1991:18)
    at vendor-2e12520b7a71eead28708a24fafa7fbc.js:1981:836
    at _.compile (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1938:173)
    at re (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1991:61)
    at vendor-2e12520b7a71eead28708a24fafa7fbc.js:1988:30
    at ee.compile (vendor-2e12520b7a71eead28708a24fafa7fbc.js:1989:23)
    at Object.evaluate (vendor-2e12520b7a71eead28708a24fafa7fbc.js:2431:224)
```

- Related https://github.com/emberjs/ember.js/issues/19912
- Related https://github.com/ember-cli/ember-welcome-page/issues/385
2023-08-15 11:05:31 -04:00
Trek Glowacki
4ba188ce44 [cli] fix tyops (#10338)
Followup to #10333
2023-08-15 07:33:24 +00:00
Vercel Release Bot
7682c9234c Version Packages (#10343)
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@31.3.1

### Patch Changes

- Updated dependencies
\[[`844fb6e88`](844fb6e880)]:
    -   @vercel/remix-builder@1.10.1

## @vercel/remix-builder@1.10.1

### Patch Changes

- Set default env vars for Hydrogen v2 deployments
([#10341](https://github.com/vercel/vercel/pull/10341))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-14 18:13:53 -07:00
Nathan Rajlich
844fb6e880 [remix] Set default env vars for Hydrogen v2 deployments (#10341)
In order to make the default mock shop created from `npm create @shopify/hydrogen@latest` work out-of-the-box and without additional configuration, set the necessary default environment variables to make the server not render an error.
2023-08-15 01:11:01 +00:00
Nathan Rajlich
ae20c7230f [cli] Use vercel-php@0.6.0 in e2e test fixture (#10342)
`0.5.2` uses Node 14, so this test was failing.

<img width="934" alt="Screenshot 2023-08-14 at 5 13 31 PM"
src="https://github.com/vercel/vercel/assets/71256/654c8f71-6006-4b98-9ef0-fe288651d158">
2023-08-14 17:50:52 -07:00
Nathan Rajlich
a36b8eb738 [examples] Update "hydrogen-2" template readme (#10340)
A few tweaks to the readme file for `hydrogen-2`, based on feedback from
Shopify.
2023-08-14 16:05:12 -07:00
Vercel Release Bot
78be5aedd5 Version Packages (#10318)
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@31.3.0

### Minor Changes

- Update help output to use cli-table3
([#10333](https://github.com/vercel/vercel/pull/10333))

### Patch Changes

- Sanitize argv in log during `vc build`.
([#10311](https://github.com/vercel/vercel/pull/10311))

- Respect `--yes` flag for all prompts during `vc link --repo`
([#10337](https://github.com/vercel/vercel/pull/10337))

- Updated dependencies
\[[`8cb9385fd`](8cb9385fd3),
[`94c93dfb5`](94c93dfb5b)]:
    -   @vercel/node@2.15.10
    -   @vercel/static-build@1.3.46

## @vercel/frameworks@1.5.1

### Patch Changes

- Add "(v1)" suffix to "hydrogen" preset
([#10320](https://github.com/vercel/vercel/pull/10320))

- Use parenthesis on Docusaurus "name" fields
([#10324](https://github.com/vercel/vercel/pull/10324))

## @vercel/fs-detectors@4.1.2

### Patch Changes

- Updated dependencies
\[[`33d9c1b7f`](33d9c1b7f9),
[`f54598724`](f54598724c)]:
    -   @vercel/frameworks@1.5.1

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

### Patch Changes

- Updated dependencies
\[[`8cb9385fd`](8cb9385fd3),
[`94c93dfb5`](94c93dfb5b)]:
    -   @vercel/node@2.15.10

## @vercel/node@2.15.10

### Patch Changes

- Update 'edge-runtime' to 2.4.4
([#10255](https://github.com/vercel/vercel/pull/10255))

- `edge-light` condition interoperability with `vercel dev`
([#10313](https://github.com/vercel/vercel/pull/10313))

## @vercel/static-build@1.3.46

### Patch Changes

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

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-14 13:00:01 -06:00
Nathan Rajlich
a1c3bfb50f [cli] Respect --yes flag for all prompts during vc link --repo (#10337)
A couple of the prompts during `vc link --repo` were not honoring the `--yes` flag.
2023-08-14 18:26:45 +00:00
Trek Glowacki
78fa02292d [cli] Swap custom table code with cli-table3 (#10333)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-14 10:12:43 -05:00
Vladislav Ponomarev
94c93dfb5b edge-light condition interoperability with vercel dev (#10313)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-08-11 13:08:34 -05:00
Trek Glowacki
19addabb6e [cli] Add tests to demonstrate function detection precedence (#10331)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-11 11:18:13 -05:00
Lee Robinson
45fc0dd714 [examples] Update Storybook template (#10063)
To use stable App Router.

New deployment: https://storybook-template.vercel.app/
2023-08-11 00:09:02 +00:00
Nathan Rajlich
fc524a1e6a Fixes for changeset from #10255 (#10328) 2023-08-10 16:49:05 -07:00
Hassan Bazzi
8cb9385fd3 [node] bump edge-runtime to 2.4.4 (#10255)
# Summary

Edge-runtime 2.4.4 has many bug fixes, but most importantly it adds support for stream cancellation to the edge runtime. This is extremely important since a lot of projects are using `streams` related to `ai`. They currently have no way of handling a cancellation coming from the client.

This was introduced to `next` with as described by this comment: https://github.com/vercel-labs/ai/issues/90#issuecomment-1618915409

You can find the PR for that here: https://github.com/vercel/next.js/pull/51727

It also has a good description for what we're trying to do here, but for people not using `next`

# Problem

When a client sends an abort signal, it is currently not being handled by edge functions. This was fixed in edge-runtime@2.4.4

# Solution

Update the package
2023-08-10 23:39:35 +00:00
Nathan Rajlich
f54598724c [frameworks] Use parenthesis on Docusaurus and SvelteKit "name" fields (#10324)
For consistency with https://github.com/vercel/vercel/pull/10320.
2023-08-10 22:41:00 +00:00
Nathan Rajlich
abd1197c90 [fs-detectors] Fix "hydrogen-2" detection unit test (#10325)
Follow-up to https://github.com/vercel/vercel/pull/10319, which didn't exhibit this failing test since the fs-detectors package was not changed, and thus those tests didn't run.
2023-08-10 21:25:51 +00:00
Trek Glowacki
db27f409b6 [cli] tidy up use of package name and logo (#10323)
I erred on the side of preferring the more recently added versions of this behavior. I assume at some point in the distant past the removed function correctly toggled between some now/zeit/vercel transitioning.
2023-08-10 18:04:24 +00:00
Nathan Rajlich
33d9c1b7f9 [frameworks] Add "(v1)" suffix to "hydrogen" preset (#10320)
Now that the "remix" preset should be used for Hydrogen v2, it's not very clear that the "hydrogen" preset is only meant to be used for Hydrogen v1.

So add clarification in the "name" of the "hydrogen" preset to help remedy that.
2023-08-10 02:32:57 +00:00
Nathan Rajlich
97659c687b [examples] Add "hydrogen-2" template (#10319)
Adds a Hydrogen v2 template which is the output of the `npm create @shopify/hydrogen@latest` command.

Note that a `vercel.json` file is being used to define the environment variables that are required at runtime. This is required for the template to deploy with zero configuration, however the user should update these values (including replacing the session secret) and migrate them to the Project settings in the Vercel dashboard.

[Live example](https://hydrogen-v2-template.vercel.app)
2023-08-10 00:11:33 +00:00
Chris Barber
d6f18f4e2d [cli] Sanitize argv for vc build (#10311)
`vc build` writes a file `.vercel/output/build.json` that contains the `argv` contents which could include sensitive information that needs to be sanitized.
2023-08-09 15:01:18 +00:00
Vercel Release Bot
f43e413ba5 Version Packages (#10302)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-08 17:10:58 -05:00
Nathan Rajlich
0945d24cbe [remix] Add initial support for Hydrogen v2 (#10305)
Enables support for Hydrogen v2 apps using the "Remix" preset. This initial support works with the Hydrogen demo store template unmodified, and all pages will use Edge functions.

Node.js runtime, and also any other configuration via `export const config`, are not supported at this time, due to some pending blockers.
2023-08-08 21:39:57 +00:00
Steven
a8ecf40d6f [build-utils] Fix getPrefixedEnvVars() to handle VERCEL_BRANCH_URL (#10315)
- Fixes [NEXT-1500](https://linear.app/vercel/issue/NEXT-1500)
- See
[documentation](https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#framework-environment-variables)
2023-08-08 14:43:20 -04:00
Steven
2995781a58 Revert "Just testing changeset stuff"
This reverts commit e2096c268d.
2023-08-07 16:36:40 -04:00
Trek Glowacki
e2096c268d Just testing changeset stuff 2023-08-07 15:33:26 -05:00
Amy
663d8e6437 Update discussion templates (#10297)
The current note on discussion templates is not bold enough and easily overlooked.

In an effort to reduce off-topic discussion clutter in this repo and direct folks to the general support community which I monitor more closely, this update makes the note more prominent.
2023-08-07 18:33:41 +00:00
Trek Glowacki
153ca440fa Add basic tests for remove command (#10304)
Adds some minimal unit testing for the `remove` command. There is currently none.
2023-08-07 18:14:21 +00:00
Steven
c5e0cb4812 chore(ci): fix turbo logs to no longer group (#10310)
When we upgraded `turbo`, the default `--log-order` changed from `stream` to `grouped`.

This PR changes it back to `stream` which will prevent the collapsed group view that we currently see in CI.

https://turbo.build/repo/docs/reference/command-line-reference/run#--log-order

> If log order is set to auto and turbo detects that it is running on GitHub Actions, then turbo will create grouped logs(opens in a new tab). You can opt out of this behavior by setting a log order of your own.
2023-08-07 16:44:41 +00:00
Seiya Nuta
5bf1fe4c74 [next] Preserve sourceMappingURL comments in template literals (#10275)
We noticed some edge function builds are failing unexpectedly due to `SyntaxError`. It's triggered by valid code in [Webpack's style-loader](16e401b17a/src/runtime/styleDomAPI.js (L35C1-L40C1)):

```
  if (sourceMap && typeof btoa !== "undefined") {
    css += `\n/*# sourceMappingURL=data:application/json;base64,${btoa(
      unescape(encodeURIComponent(JSON.stringify(sourceMap)))
    )} */`;
  }
```

After minification this script looks like:

```
sourceMap&&typeof btoa!="undefined"&&(css+=`
/*# sourceMappingURL=data:application/json;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))} */`);
```

The key point here is `\n` is replaced with newline character (`0x0A`) and the second line starts with `/*# sourceMappingURL=`. This confuses `removeComments` API in [convert-source-map](https://github.com/thlorenz/convert-source-map/tree/master) package and it removes the second line:

```
sourceMap&&typeof btoa!="undefined"&&(css+=`

```

In this PR, we implement source map stripping based on that package's regex but add some heuristic checks to prevent false positives like above.
2023-08-07 16:05:39 +00:00
Vercel Release Bot
011f836aa7 [examples][tests] Upgrade Next.js to version 13.4.13 (#10308)
This auto-generated PR updates 3 packages to Next.js version 13.4.13
2023-08-07 15:12:14 +00:00
Trek Glowacki
ec107d7c91 Handle calls for deployment aliases when mocking deployment API (#10303)
Attempting to add tests to unblock a contributor https://github.com/vercel/vercel/pull/10236#issuecomment-1664183891 and finding a deployment also checks its aliases. This PR updates the mock deployment code to also create a handler for its aliases.
2023-08-07 14:34:49 +00:00
Shu Uesugi
0d27ae3b1a Remove unused code (#10309)
Reference was removed in https://github.com/vercel/vercel/pull/8377 but the code wasn't removed.
2023-08-07 14:10:22 +00:00
Vercel Release Bot
08da4b9c92 [remix] Update @remix-run/dev to v1.19.2 (#10299)
This auto-generated PR updates `@remix-run/dev` to version 1.19.2.
2023-08-04 23:17:40 +00:00
Trek Glowacki
877f09ff5c Be looser with mock server URLs (#10300)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-04 10:20:33 -05:00
Vercel Release Bot
5cca9b6c5c Version Packages (#10289)
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@31.2.2

### Patch Changes

- Migrate list command to new structure
([#10284](https://github.com/vercel/vercel/pull/10284))

- Migrate whoami command to new structure
([#10266](https://github.com/vercel/vercel/pull/10266))

- Migrate logs command to new structure
([#10281](https://github.com/vercel/vercel/pull/10281))

- Migrate login command to new structure
([#10283](https://github.com/vercel/vercel/pull/10283))

- Migrate pull command to new structure
([#10280](https://github.com/vercel/vercel/pull/10280))

- Migrate logout command to new structure
([#10282](https://github.com/vercel/vercel/pull/10282))

- Migrate build command to new structure
([#10286](https://github.com/vercel/vercel/pull/10286))

- Migrate inspect command to new structure
([#10277](https://github.com/vercel/vercel/pull/10277))

- Migrate redeploy command to new structure
([#10279](https://github.com/vercel/vercel/pull/10279))

- Migrate link command to new structure
([#10285](https://github.com/vercel/vercel/pull/10285))

- Update spacing of --help output for CLI
([#10287](https://github.com/vercel/vercel/pull/10287))

- Updated dependencies
\[[`4af242af8`](4af242af86),
[`0cbdae141`](0cbdae1411),
[`85dd66778`](85dd667781)]:
    -   @vercel/node@2.15.8
    -   @vercel/remix-builder@1.9.1
    -   @vercel/static-build@1.3.44

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

### Patch Changes

- Updated dependencies
\[[`4af242af8`](4af242af86),
[`85dd66778`](85dd667781)]:
    -   @vercel/node@2.15.8

## @vercel/node@2.15.8

### Patch Changes

- Move `@types/content-type` to dev dependency
([#10292](https://github.com/vercel/vercel/pull/10292))

- fix: compress condition
([#10288](https://github.com/vercel/vercel/pull/10288))

## @vercel/remix-builder@1.9.1

### Patch Changes

- Disable root workspace check in pnpm and yarn when adding deps
([#10291](https://github.com/vercel/vercel/pull/10291))

## @vercel/static-build@1.3.44

### Patch Changes

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

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-02 15:04:48 -05:00
Nathan Rajlich
4af242af86 [node] Move @types/content-type to dev dependency (#10292)
`@types/content-type` is only needed at build time.
2023-08-02 20:00:14 +00:00
Nathan Rajlich
0cbdae1411 [remix] Disable root workspace check in pnpm and yarn when adding deps (#10291)
The Remix application might _also_ be the root of a workspace, so check for that case and pass the appropriate flag to the package manager to make it not error.

See: https://github.com/orgs/vercel/discussions/3467
2023-08-02 18:36:38 +00:00
Kiko Beats
85dd667781 fix: compress condition (#10288)
I'm experiencing an issue due the condition is wrongly set.

When the response is buffered, it should be `compress: true` since we're acting as proxy, and we're going to recompress again.

When the response is streaming, then it should be `compress: false` since the response is going to be piped.
2023-08-02 18:15:16 +00:00
Trek Glowacki
7d3dda7341 [cli] Update spacing on --help output (#10287)
Indent more items rightwards to tidy up spacing.

Example of unmigrated `bisect` on current `main`:
<img width="561" alt="CleanShot 2023-07-31 at 14 47 38@2x" src="https://github.com/vercel/vercel/assets/9736/7474ac88-775c-43aa-937b-3f544c064c6d">

Migrated example (https://github.com/vercel/vercel/pull/10276) before changes in this PR:
<img width="661" alt="CleanShot 2023-07-31 at 15 07 26@2x" src="https://github.com/vercel/vercel/assets/9736/076b247c-35cf-45ea-8713-3c684b5063e4">


Migrated example after changes in this PR:
<img width="693" alt="CleanShot 2023-07-31 at 14 46 39@2x" src="https://github.com/vercel/vercel/assets/9736/f5f056a1-7f68-42e5-a724-79cf86031d09">
2023-08-02 17:33:59 +00:00
Vercel Release Bot
2144d0b2a9 [tests] Upgrade Turbo to version 1.10.12 (#10270)
This auto-generated PR updates Turbo to version 1.10.12
2023-08-02 17:12:33 +00:00
Trek Glowacki
976e6aedf9 [cli] Migrate link command to new structure (#10285)
Before:
<img width="785" alt="CleanShot 2023-07-31 at 09 55 03@2x" src="https://github.com/vercel/vercel/assets/9736/1f60cbcb-354f-4005-bb74-8ffd68a38fba">

After:
<img width="785" alt="CleanShot 2023-07-31 at 09 55 03@2x" src="https://github.com/vercel/vercel/assets/9736/4eea5e82-0304-4949-9e8f-aeaa1b2e74eb">
2023-08-02 16:48:24 +00:00
Trek Glowacki
6328751e14 [cli] Migrate whoami to new command structure (#10266)
Migrating `whoami` to the command structure created in #10090. Unsure about tests. This is technically a refactor so existing tests should suffice.
2023-08-02 14:21:57 +00:00
Trek Glowacki
8cb49a5136 [cli] Migrate logout command to new structure (#10282)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-08-02 08:59:49 -05:00
Trek Glowacki
3fa4f344cc [cli] Migrate pull command to new structure (#10280)
Before:
<img width="797" alt="CleanShot 2023-07-31 at 09 23 44@2x" src="https://github.com/vercel/vercel/assets/9736/88edd229-0aab-4155-9739-de64ad42e2f0">

After:
<img width="765" alt="CleanShot 2023-07-31 at 09 23 59@2x" src="https://github.com/vercel/vercel/assets/9736/574d0af0-5ce4-48dd-ad59-c4ca9893c147">
2023-08-01 20:24:25 +00:00
Trek Glowacki
27610896ed [cli] Migrate inspect command to new structure (#10277)
Before:
<img width="659" alt="CleanShot 2023-07-31 at 10 06 01@2x" src="https://github.com/vercel/vercel/assets/9736/32c91a94-9ae7-479c-8255-e4b554badd2f">


After:
<img width="664" alt="CleanShot 2023-07-31 at 10 06 11@2x" src="https://github.com/vercel/vercel/assets/9736/9237b42a-a015-4d58-8231-5e257342ac90">
2023-08-01 20:05:11 +00:00
Trek Glowacki
b9dae36e37 [cli] Migrate logs command to new structure (#10281)
Before:
<img width="669" alt="CleanShot 2023-07-31 at 09 36 25@2x" src="https://github.com/vercel/vercel/assets/9736/ee28d4b7-33eb-49cf-a565-fd4f56bf8bb6">

After:
<img width="693" alt="CleanShot 2023-07-31 at 09 36 46@2x" src="https://github.com/vercel/vercel/assets/9736/450d7c54-216f-4590-98b9-9f6b1a13d040">
2023-08-01 19:43:16 +00:00
Ilya Komichev
1537ff9c38 chore(README): set correct link to nuxt docs (#10265)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-08-01 13:46:39 -05:00
Trek Glowacki
7e0317775f [cli] Migrate build command to new structure (#10286)
Before:
<img width="854" alt="CleanShot 2023-07-31 at 09 59 18@2x" src="https://github.com/vercel/vercel/assets/9736/7a91572f-1481-4a2a-ac70-2384d6c30560">

After:
<img width="907" alt="CleanShot 2023-07-31 at 09 59 30@2x" src="https://github.com/vercel/vercel/assets/9736/ed358eae-9207-4ebe-ad41-865ce213560e">
2023-08-01 16:59:01 +00:00
Trek Glowacki
2dd27976b3 [cli] Migrate redeploy command to new structure (#10279)
Before:
<img width="816" alt="CleanShot 2023-07-31 at 09 19 16@2x" src="https://github.com/vercel/vercel/assets/9736/cf194706-8071-4f86-9a1c-896383a51a29">

After:
<img width="673" alt="CleanShot 2023-07-31 at 09 19 30@2x" src="https://github.com/vercel/vercel/assets/9736/d0f3faed-83e7-40b9-9252-c8b68855a7a3">
2023-08-01 16:37:32 +00:00
Trek Glowacki
25e2b7efba [cli] Migrate login command to new structure (#10283)
We currently incorrectly specify the argument is required with `<>`, but the examples show you can do `vercel login` without an argument, so I've corrected that as part of this migration.

Before:
<img width="549" alt="CleanShot 2023-07-31 at 09 44 28@2x" src="https://github.com/vercel/vercel/assets/9736/f1b1a328-69e0-4d61-b65c-d2739c81f61c">


After:
<img width="684" alt="CleanShot 2023-07-31 at 09 44 43@2x" src="https://github.com/vercel/vercel/assets/9736/e2bb28bf-e3d8-4d89-ad7e-864dd091ec3d">
2023-08-01 15:43:02 +00:00
Trek Glowacki
3d23d1270c [cli] Migrate list command to new structure (#10284)
Before:

<img width="809" alt="CleanShot 2023-07-31 at 09 51 37@2x" src="https://github.com/vercel/vercel/assets/9736/f5ac2ccc-3ff9-4a52-9c93-4a47fe479497">


After:
<img width="836" alt="CleanShot 2023-07-31 at 09 51 48@2x" src="https://github.com/vercel/vercel/assets/9736/48314715-132a-477a-8a66-a5d23c27ee50">
2023-07-31 22:21:11 +00:00
Vercel Release Bot
fde40e731a Version Packages (#10278)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-31 13:31:22 -05:00
Trek Glowacki
f353527421 [cli] Migrate bisect command to new structure (#10276)
Migrating `bisect` to the command structure created in https://github.com/vercel/vercel/pull/10090. Unsure about tests. This is technically a refactor so existing tests should suffice.

Before:
<img width="534" alt="CleanShot 2023-07-31 at 08 14 29@2x" src="https://github.com/vercel/vercel/assets/9736/8ae53672-9b1f-444a-94d3-296ac0fa8d30">

After:
<img width="674" alt="CleanShot 2023-07-31 at 08 15 02@2x" src="https://github.com/vercel/vercel/assets/9736/0ba12f19-fb34-41f3-84fb-0c1498d7a485">
2023-07-31 16:03:13 +00:00
Trek Glowacki
c1cdfb3e75 [cli] Migrate remove command to new structure (#10268)
Migrating `remove` to the command structure created in #10090. Unsure about tests. This is technically a refactor so existing tests should suffice.
2023-07-31 15:42:27 +00:00
Kiko Beats
fc413707d0 fix: move content-type as dependency (#10274)
It's required by `serverless-functions/helpers.js` causing unhandled
error because it's missing.

```
Error: Cannot find module 'content-type'
Require stack:
- /Users/kikobeats/Library/pnpm/global/5/.pnpm/@vercel+node@2.15.6/node_modules/@vercel/node/dist/serverless-functions/helpers.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/kikobeats/Library/pnpm/global/5/.pnpm/@cspotcode+source-map-support@0.8.1/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function.Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/Users/kikobeats/Library/pnpm/global/5/.pnpm/@vercel+node@2.15.6/node_modules/@vercel/node/dist/serverless-functions/helpers.js:6:24)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.require.extensions.<computed> [as .js] (/Users/kikobeats/Library/pnpm/global/5/.pnpm/ts-node@10.9.1_@types+node@14.18.33_typescript@4.9.5/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1119:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/kikobeats/Library/pnpm/global/5/.pnpm/@vercel+node@2.15.6/node_modules/@vercel/node/dist/serverless-functions/helpers.js'
  ]
}
```
2023-07-31 16:11:18 +02:00
Vercel Release Bot
e842a8870e Version Packages (#10261)
# Releases
## vercel@31.2.0

### Minor Changes

- Add a "Global Options" section to help output
([#10250](https://github.com/vercel/vercel/pull/10250))

### Patch Changes

- Updated dependencies
\[[`d1b0dbe3a`](d1b0dbe3a7),
[`4a8622a10`](4a8622a10d),
[`6469ef1b8`](6469ef1b8c)]:
    -   @vercel/remix-builder@1.9.0
    -   @vercel/next@3.9.3

## @vercel/remix-builder@1.9.0

### Minor Changes

- Install `@vercel/remix-run-dev` at build-time instead of using symlink
([#9784](https://github.com/vercel/vercel/pull/9784))

### Patch Changes

- Update `@remix-run/dev` fork to v1.19.1
([#10246](https://github.com/vercel/vercel/pull/10246))

## @vercel/next@3.9.3

### Patch Changes

- fix dynamic not found pages
([#10262](https://github.com/vercel/vercel/pull/10262))
2023-07-28 15:40:19 -07:00
Nathan Rajlich
d1b0dbe3a7 [remix] Install @vercel/remix-run-dev at build-time instead of using symlink (#9784)
Instead of including the fork `@remix-run/dev` package as a regular dependency of `@vercel/remix-builder`, install it at build-time by modifying the project's `package.json` file. The reasons for this are:

* Avoids deprecation warnings from a few packages that currently exist on the `@remix-run/dev` package when installing Vercel CLI (those warnings already show up in the build logs anyways, so nothing new there).
* Allows us to install a version as close as possible to the version specified in the user's `package.json` (similar to how we do when auto-injecting the `@vercel/remix` package). This will be especially important once Remix v2 is released, which will have breaking changes compared to v1.

**Note:** `@vercel/remix-run-dev` is still a _dev_ dependency, so that we can use TypeScript types from it, as well as, at runtime, we use the version in the Builder's `package.json` to determine the maximum versions of `@vercel/remix-run-dev` and/or `@vercel/remix` which can safely be installed.

Fixes #10027.
Fixes #10222.
2023-07-28 20:49:32 +00:00
Chris Barber
d614709308 [codeowners] Add @trek to codeowners (#10267)
Adding Trek so he join in on the code review fun!
2023-07-28 13:28:45 -04:00
Trek Glowacki
d5b588bc06 [cli] Add a "Global Options" section to help output (#10250)
Followup PR to #10090. Some of our commands duplicate global options into their `args` structure e.g. 2661f56347/packages/cli/src/commands/logs.ts (L25-L26)

 Others commands omit it entirely.

This updates the `--help` output for commands migrated to our new structure (so far, only `deploy`) will show a "Global Options" section:

```
▲ vercel deploy [project-path] [options]

Deploy your project to Vercel. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`).

Options

  --archive                    Compress the deployment code into a file before uploading it
  -b, --build-env <key=value>  Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)
  -e, --env <key=value>        Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)
  -f, --force                  Force a new deployment even if nothing has changed
  -m, --meta <key=value>       Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)
  --no-wait                    Don't wait for the deployment to finish
  --prebuilt                   Use in combination with `vc build`. Deploy an existing build
  --prod                       Create a production deployment
  -p, --public                 Deployment is public (`/_src`) is exposed)
  --regions                    Set default regions to enable the deployment on
  --with-cache                 Retain build cache when using "--force"
  -y, --yes                    Use default options to skip all prompts

Global Options

  --cwd <DIR>                Sets the current working directory for a single run of a command
  -d, --debug                Debug mode (default off)
  -Q, --global-config <DIR>  Path to the global ${'`.vercel`'} directory
  -h, --help                 Output usage information
  -A, --local-config <FILE>  Path to the local `vercel.json` file
  --no-color                 No color mode (default off)
  -S, --scope                Set a custom scope
  -t, --token <TOKEN>        Login token
  -v, --version              Output the version number
```

As commands are migrated to this new structure, they'll gain this output automatically.
2023-07-27 20:48:07 +00:00
Zack Tanner
4a8622a10d [next] fix dynamic not found pages (#10262)
This updates `getServerlessPages` to consider `/_not-found` pages (which might opt into dynamic rendering)

- Corresponding Next.js changes https://github.com/vercel/next.js/pull/53231
- [slack x-ref](https://vercel.slack.com/archives/C03S8ED1DKM/p1683763412272429)
2023-07-27 16:18:31 +00:00
Vercel Release Bot
6469ef1b8c [remix] Update @remix-run/dev to v1.19.1 (#10246)
This auto-generated PR updates `@remix-run/dev` to version 1.19.1.
2023-07-26 22:22:21 +00:00
Nathan Rajlich
b8d42a521b [examples] Remove "author" field from hydrogen template (#10253) 2023-07-26 14:48:07 -07:00
Vercel Release Bot
b1e8c9cb6e Version Packages (#10260)
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@31.1.1

### Patch Changes

- Updated dependencies
\[[`7c30b13cc`](7c30b13ccb)]:
    -   @vercel/next@3.9.2

## @vercel/next@3.9.2

### Patch Changes

- Fix pages/404 gsp + i18n case
([#10258](https://github.com/vercel/vercel/pull/10258))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-26 14:50:22 -04:00
JJ Kasper
7c30b13ccb [next] Fix pages/404 gsp + i18n case (#10258)
This ensures we detect the locale prefixed 404 when it uses `getStaticProps` correctly. 

- x-ref: [slack thread](https://vercel.slack.com/archives/C05JTC58AQJ)
- Closes https://github.com/vercel/vercel/pull/10248
2023-07-26 18:41:25 +00:00
Steven
e5e757de34 [tests] fix vary header in next tests (#10249)
Since we run tests against canary, the latest [v13.4.13-canary.0](https://github.com/vercel/next.js/releases/tag/v13.4.13-canary.0) changed the `vary` header in https://github.com/vercel/next.js/pull/52746 so we need to update the tests to match.
2023-07-26 16:52:13 +00:00
Vercel Release Bot
2661f56347 Version Packages (#10227)
# Releases

## vercel@31.1.0

### Minor Changes

- Add 'Environment' column to 'vc list' with new '--environment' filter
and pipe URLs to stdout
([#10239](https://github.com/vercel/vercel/pull/10239))

### Patch Changes

- Update `proxy-agent` to v6.3.0
([#10226](https://github.com/vercel/vercel/pull/10226))

- Use `getNodeBinPaths()` in `vc dev`
([#10225](https://github.com/vercel/vercel/pull/10225))

- Updated dependencies
\[[`b1c14cde0`](b1c14cde03),
[`ce4633fe4`](ce4633fe4d)]:
    -   @vercel/next@3.9.1
    -   @vercel/static-build@1.3.42

## @vercel/frameworks@1.5.0

### Minor Changes

- Add `ignorePackageJsonScript` configuration for Framework command
settings to ignore the `package.json` script.
([#10228](https://github.com/vercel/vercel/pull/10228))

Enable this mode for Storybook's `buildCommand`, since it should not
invoke the "build" script, which is most likely designated for the
frontend app build.

## @vercel/fs-detectors@4.1.1

### Patch Changes

- Updated dependencies
\[[`ce4633fe4`](ce4633fe4d)]:
    -   @vercel/frameworks@1.5.0

## @vercel/next@3.9.1

### Patch Changes

- Fix pages and app router i18n handling
([#10243](https://github.com/vercel/vercel/pull/10243))

## @vercel/static-build@1.3.42

### Patch Changes

- Add `ignorePackageJsonScript` configuration for Framework command
settings to ignore the `package.json` script.
([#10228](https://github.com/vercel/vercel/pull/10228))

Enable this mode for Storybook's `buildCommand`, since it should not
invoke the "build" script, which is most likely designated for the
frontend app build.
2023-07-24 18:02:38 -07:00
JJ Kasper
b1c14cde03 [next] Fix pages and app router i18n handling (#10243)
Ensures app router paths are handled properly when i18n is configured for pages directory. 

x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1687565759424049)
x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1687565759424049)
x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1672781549860349?thread_ts=1671393204.073649&cid=C03KAR5DCKC)

[VCCLI-780](https://linear.app/vercel/issue/VCCLI-780/add-404i18n-invariant-case-in-nextjs-builder)
2023-07-24 23:26:25 +00:00
Chris Barber
8dd6d021df [cli] Add "Environment" column to vc list (#10239)
Also adds a new `--environment=[preview|production]` filter and ability to pipe deployment URLs to `stdout`!

<img width="380" alt="image" src="https://github.com/vercel/vercel/assets/97262/20de0caa-2d63-4112-8213-cc15d23295c7">

```
vc list --environment preview
```

```
vc list --environment production
```

```
vc list --environment preview > preview_deployments.txt
```
2023-07-24 20:02:25 +00:00
Vercel Release Bot
88ec6e69d6 [examples][tests] Upgrade Next.js to version 13.4.12 (#10240)
This auto-generated PR updates 3 packages to Next.js version 13.4.12
2023-07-23 21:51:14 +00:00
Vercel Release Bot
a6f2e7b136 [tests] Upgrade Turbo to version 1.10.9 (#10241)
This auto-generated PR updates Turbo to version 1.10.9
2023-07-23 21:30:01 +00:00
Vercel Release Bot
e906365909 [examples][tests] Upgrade Next.js to version 13.4.11 (#10233)
This auto-generated PR updates 3 packages to Next.js version 13.4.11
2023-07-21 19:01:10 +00:00
Nathan Rajlich
7b01a07394 [cli] Use getNodeBinPaths() in vc dev (#10225)
This allows for the "dev command" of a Project to work better in monorepos, where the dev server might live up the node_modules hierarchy within the repo.
2023-07-19 22:19:43 +00:00
Nathan Rajlich
ce4633fe4d [frameworks][static-build] Add ignorePackageJsonScript configuration for Framework command settings (#10228)
When this property is set to `true`, then the corresponding `package.json` script will not be invoked, allowing for the default setting value will be executed.

This is enabled for Storybook's `buildCommand`, since we do not want the "build" script to be invoked, since that would belong to the frontend application's build instead of Storybook's.
2023-07-19 20:23:51 +00:00
Nathan Rajlich
fdf86fda03 [cli] Update proxy-agent to v6.3.0 (#10226)
This version includes a refactor for proxies specified via PAC files such that it no longer uses the deprecated `vm2` module.

See https://github.com/TooTallNate/proxy-agents/issues/218.
2023-07-18 20:29:37 +00:00
Vercel Release Bot
56178e6a46 Version Packages (#10213)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-18 14:02:19 -05:00
Nathan Rajlich
5439d7c0c9 [remix] Create ensured dependency symlink at the start directory, instead of root of repo (#10224)
When the `ensureResolvable()` function runs in a monorepo, the symlink should be created in the `node_modules` directory within the app subdirectory, rather than the root of the repository. Fixes the following issue:

![image](https://github.com/vercel/vercel/assets/71256/c0171533-881a-425e-85b9-82318ef19032)
2023-07-18 18:27:19 +00:00
Zack Tanner
c670e51712 [next] fix 404 page in edge runtime (#10223)
Fixes Next builder to handle edge runtime on 404 pages

[Related Next.js PR](https://github.com/vercel/next.js/pull/52754)
[slack x-ref](https://vercel.slack.com/archives/C03S8ED1DKM/p1689312606770609)
2023-07-17 19:48:45 +00:00
Kiko Beats
b56639b624 [node] fix: runs edge user code inside IIFE (#10220)
In this way, `self` is isolated and modify it doesn't break some Edge Runtime internals

Originally reported by @jawj at https://github.com/jawj/neon-vercel-zapatos-minimal-crash
2023-07-17 16:45:05 +00:00
Kiko Beats
12bbae098c [codeowners] @vercel/edge-compute → @vercel/compute (#10219) 2023-07-17 14:33:25 +00:00
Nathan Rajlich
9969f0ba18 [cli] Use detectFrameworks() during vc link --repo (#10203)
Allows for multiple frameworks to be detectable within the same root directory. This is basically specifically for Storybook.

<img width="700" alt="Screenshot 2023-07-12 at 6 04 37 PM" src="https://github.com/vercel/vercel/assets/71256/5a240f1e-b000-42ad-b36f-3c151d3cd449">
2023-07-14 18:11:49 +00:00
Vercel Release Bot
24e1e3c3be [examples][tests] Upgrade Next.js to version 13.4.10 (#10215)
This auto-generated PR updates 3 packages to Next.js version 13.4.10
2023-07-14 16:27:44 +00:00
Steven
b61674cb2d [tests] Fix next update cron job (#10214)
This was supposed to be fixed in https://github.com/vercel/vercel/pull/10173 but the file was created after git commit.

This PR makes sure the file is created before git commit.
2023-07-14 16:07:26 +00:00
Florentin / 珞辰
cae60155f3 [next] support maxDuration in Next.js deployments (#10069)
Follow up PR to
8703c55f9f
which reads the newly created function config manifest and patches in
the options for resource creation.

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-07-14 15:27:06 +02:00
Vercel Release Bot
a91bde5287 Version Packages (#10192)
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/fs-detectors@4.1.0

### Minor Changes

- Add `detectFrameworks()` function
([#10195](https://github.com/vercel/vercel/pull/10195))

## @vercel/build-utils@6.8.2

### Patch Changes

- Push back `nodejs16.x` discontinue date to `2024-02-06`
([#10209](https://github.com/vercel/vercel/pull/10209))

## vercel@31.0.3

### Patch Changes

- Fix redeploy target to be undefined when null
([#10201](https://github.com/vercel/vercel/pull/10201))

- Respect forbidden API responses
([#10178](https://github.com/vercel/vercel/pull/10178))

- Update `supports-hyperlinks` to v3
([#10208](https://github.com/vercel/vercel/pull/10208))

- Updated dependencies
\[[`0750517af`](0750517af9)]:
    -   @vercel/build-utils@6.8.2
    -   @vercel/static-build@1.3.40
    -   @vercel/node@2.15.5
    -   @vercel/remix-builder@1.8.17

## @vercel/client@12.6.5

### Patch Changes

- Updated dependencies
\[[`0750517af`](0750517af9)]:
    -   @vercel/build-utils@6.8.2

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

### Patch Changes

- Updated dependencies
\[[`0750517af`](0750517af9)]:
    -   @vercel/build-utils@6.8.2
    -   @vercel/node@2.15.5

## @vercel/node@2.15.5

### Patch Changes

- Updated dependencies
\[[`0750517af`](0750517af9)]:
    -   @vercel/build-utils@6.8.2

## @vercel/remix-builder@1.8.17

### Patch Changes

- Updated dependencies
\[[`0750517af`](0750517af9)]:
    -   @vercel/build-utils@6.8.2

## @vercel/static-build@1.3.40

### Patch Changes

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

## @vercel-internals/types@1.0.5

### Patch Changes

- Updated dependencies
\[[`0750517af`](0750517af9)]:
    -   @vercel/build-utils@6.8.2

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-13 19:17:13 -04:00
Steven
0750517af9 [build-utils] Push back nodejs16.x discontinue date to 2024-02-06 (#10209)
The discontinue date for `nodejs16.x` needs to be pushed back until we can add support for `nodejs20.x`.

Currently `nodejs18.x` can cause problems with native packages that depend on a specific version of glibc so the only solution for that use case is to stay on `nodejs16.x` at this time.


### Related Issues
- https://github.com/orgs/vercel/discussions/3061
- https://github.com/orgs/vercel/discussions/2867
- https://github.com/orgs/vercel/discussions/2258
- https://github.com/orgs/vercel/discussions/2630
- https://github.com/orgs/vercel/discussions/2105
- https://github.com/orgs/vercel/discussions/2596
- https://github.com/orgs/vercel/discussions/2730
2023-07-13 22:47:03 +00:00
Steven
70f6782954 [tests] Add lockfile to 51-puppeteer-build test (#10210)
This test was failing so I'm adding a lockfile to prevent this build error:

```
Running "yarn run build"
--
16:40:10.239 | yarn run v1.22.17
16:40:10.260 | $ node build.js
16:40:40.630 | node:internal/process/promises:288
16:40:40.630 | triggerUncaughtException(err, true /* fromPromise */);
16:40:40.630 | ^
16:40:40.630 |  
16:40:40.630 | TimeoutError: Navigation timeout of 30000 ms exceeded
16:40:40.631 | at /vercel/path1/node_modules/puppeteer/lib/LifecycleWatcher.js:142:21
16:40:40.631 | -- ASYNC --
16:40:40.631 | at Frame.<anonymous> (/vercel/path1/node_modules/puppeteer/lib/helper.js:111:15)
16:40:40.631 | at Page.goto (/vercel/path1/node_modules/puppeteer/lib/Page.js:672:49)
16:40:40.631 | at Page.<anonymous> (/vercel/path1/node_modules/puppeteer/lib/helper.js:112:23)
16:40:40.631 | at /vercel/path1/build.js:10:14
16:40:40.631 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
```
2023-07-13 21:29:51 +00:00
Nathan Rajlich
5f1e37ee16 Update supports-hyperlinks to v3 (#10208)
Enables proper detection for VSCode's terminal emulator, and allows us
to remove the in-house types since v3 includes its own types.
2023-07-13 12:24:30 -07:00
Steven
680d666fdc [tests] Add huozhi to cron job for Next.js (#10205)
This adds Jiachi to the default reviewer list for the Next.js update cron job.
2023-07-13 13:48:27 +00:00
Chris Barber
06a5dccfed [cli] Fix redeploy target to be undefined when null (#10201) 2023-07-12 16:26:33 -05:00
Nathan Rajlich
f85df894c0 [fs-detectors] Add detectFrameworks() (#10195)
Similar to `detectFramework()`, but this version returns all detected frameworks at the given path. It also returns the full `Framework` objects instead of just the slug.

This will be useful for detecting when multiple Projects exist at the same root directory (i.e. Storybook).

**Note:** I rearranged some tests, so probably review with [whitespace changes hidden](https://github.com/vercel/vercel/pull/10195/files?diff=split&w=1).
2023-07-11 20:08:55 +00:00
balazs4
e9ec779f1c [rbac]s show forbidden error in case of missing permission (#10178)
fixes
[iam-941](https://linear.app/vercel/issue/IAM-941/cli-improve-handling-of-insufficient-permissions-no-access)
2023-07-11 12:32:43 +02:00
Vercel Release Bot
4333d1e6b2 [examples][tests] Upgrade Next.js to version 13.4.9 (#10183)
This auto-generated PR updates 3 packages to Next.js version 13.4.9
2023-07-11 07:51:06 +00:00
Vercel Release Bot
493a31091d Version Packages (#10158)
## @vercel/build-utils@6.8.1

### Patch Changes

- Revert "[build-utils] Allow file-ref sema to be controlled through env
flag" ([#10167](https://github.com/vercel/vercel/pull/10167))

## vercel@31.0.2

### Patch Changes

- Allow additional project settings in `createProject()`
([#10172](https://github.com/vercel/vercel/pull/10172))

- Run local Project detection during `vc link --repo`.
([#10094](https://github.com/vercel/vercel/pull/10094))
This allows for creation of new Projects that do not yet exist under the
selected scope.

- Redeploy command no longer redeploys preview deployments to production
([#10186](https://github.com/vercel/vercel/pull/10186))

- Added trailing new line at end of help output
([#10170](https://github.com/vercel/vercel/pull/10170))

- Create new help output and arg parsing for deploy command
([#10090](https://github.com/vercel/vercel/pull/10090))

- [cli] Remove `preinstall` script
([#10157](https://github.com/vercel/vercel/pull/10157))

- Updated dependencies
\[[`7021279b2`](7021279b28),
[`5e5332fbc`](5e5332fbc9),
[`027bce00b`](027bce00b3)]:
    -   @vercel/build-utils@6.8.1
    -   @vercel/node@2.15.4
    -   @vercel/remix-builder@1.8.16
    -   @vercel/static-build@1.3.39

## @vercel/client@12.6.4

### Patch Changes

- Updated dependencies
\[[`7021279b2`](7021279b28)]:
    -   @vercel/build-utils@6.8.1

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

### Patch Changes

- Updated dependencies
\[[`7021279b2`](7021279b28),
[`5e5332fbc`](5e5332fbc9)]:
    -   @vercel/build-utils@6.8.1
    -   @vercel/node@2.15.4

## @vercel/node@2.15.4

### Patch Changes

- [node] fix decompress mismatching
([#10184](https://github.com/vercel/vercel/pull/10184))

- Updated dependencies
\[[`7021279b2`](7021279b28)]:
    -   @vercel/build-utils@6.8.1

## @vercel/remix-builder@1.8.16

### Patch Changes

- Update `@remix-run/dev` fork to v1.18.1
([#10180](https://github.com/vercel/vercel/pull/10180))

- Updated dependencies
\[[`7021279b2`](7021279b28)]:
    -   @vercel/build-utils@6.8.1

## @vercel/static-build@1.3.39

### Patch Changes

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

## @vercel-internals/constants@1.0.4

### Patch Changes

- Create new help output and arg parsing for deploy command
([#10090](https://github.com/vercel/vercel/pull/10090))

## @vercel-internals/types@1.0.4

### Patch Changes

- Updated dependencies
\[[`7021279b2`](7021279b28),
[`718bbd365`](718bbd365a)]:
    -   @vercel/build-utils@6.8.1
    -   @vercel-internals/constants@1.0.4

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-10 15:48:32 -07:00
Nathan Rajlich
8d7206f5b6 [cli] Run local Project detection during vc link --repo (#10094)
Run local Project detection during `vc link --repo`. This allows for creation of new Projects that do not yet exist under the selected scope.
2023-07-10 22:42:13 +00:00
Sean Massa
4bf2ca55ff Revert "Add Changesets "ignore" configuration" (#10189)
Reverts vercel/vercel#10181

This seems to be breaking releases of packages that depend on ignored packages. Example: https://github.com/vercel/vercel/actions/runs/5489491313/jobs/10003713249
2023-07-10 02:17:06 +00:00
Kiko Beats
5e5332fbc9 [node] fix decompress mismatching (#10184)
This PR disabled `node-fetch` default compression handling when the
response is not streamed.

The default behavior in node-fetch is to handle the compression. That's
great if you interact with node-fetch as user, but bad if you use it as
intermediate proxy server, since it's creating a mismatching related
with the body format and length expectations.

Instead, we disable compression, get the buffered response and compress
it again if needed.

---------

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-07-07 12:33:05 -06:00
Ethan Arrowood
281ec776a5 Fix redeploy target (#10186)
This PR fixes customer issue
https://github.com/vercel/customer-issues/issues/1310 which identified
an issue with the `redeploy` command.

`redeploy` should not default the `target` to `'production'` as an
`undefined` target is meant to mean `'preview'`.
2023-07-07 11:50:06 -06:00
Nathan Rajlich
ee8f9292b4 Add Changesets "ignore" configuration (#10181)
These packages already don't get published since they have `private: true`, but adding to the "ignore" configuration also removes them from the selection prompt when executing the `changeset` CLI command.
2023-07-05 22:07:15 +00:00
Vercel Release Bot
027bce00b3 [remix] Update @remix-run/dev to v1.18.1 (#10180)
This auto-generated PR updates `@remix-run/dev` to version 1.18.1.
2023-07-05 21:23:48 +00:00
Vercel Release Bot
ca1f41200a [tests] Upgrade Turbo to version 1.10.7 (#10164)
This auto-generated PR updates Turbo to version 1.10.7
2023-07-05 20:46:59 +00:00
Nathan Rajlich
834b3e652b [cli] Allow additional project settings in createProject() (#10172)
Previously, `createProject()` only allowed a string `name` to be provided, and another API call would need to be done after creation with `updateProject()`. This should not be necessary since the `POST` endpoint can accept additional properties already.
2023-07-03 21:42:00 +00:00
Steven
5c6941d18c [tests] Fix update-next.js cron job to include changeset (#10173)
The cron job script only updates the Next.js example so it should have an empty changeset
2023-07-03 21:03:42 +00:00
Vercel Release Bot
761ede2482 [examples][tests] Upgrade Next.js to version 13.4.8 (#10171)
This auto-generated PR updates 3 packages to Next.js version 13.4.8
2023-07-03 20:22:59 +00:00
Chris Barber
1d01703dc3 [cli] Added line return at end of help output (#10170)
I noticed the help output doesn't render a line return at the end.

<img width="290" alt="image" src="https://github.com/vercel/vercel/assets/97262/8aea6be0-9620-4445-b05d-62b838cefb07">
2023-07-03 16:46:29 +00:00
Andrew Healey
7021279b28 Revert "[build-utils] Allow file-ref sema to be controlled through env flag" (#10167)
Reverts vercel/vercel#8681

We ran an experiment here a while ago but it had flaky results.

This PR cleans up the experiment code, and reverts to the previous behavior.
2023-07-03 15:42:16 +00:00
Ethan Arrowood
28acf50bdf Removes a leftover console.log in the new help method (#10162)
Removes a leftover `console.log` in the new `help` method. Whoops!
2023-06-30 15:50:22 +00:00
Ethan Arrowood
718bbd365a Improve help output UX and DX (#10090)
This PR adds a new utility for generating `help` output for CLI
commands. Backed by a JSON data structure that represents the commands,
this utility uses deterministic functions for generating the different
output sections (such as `options` and `examples`). This change will let
contributor easily add/modify command details. The data structure is
also used by the CLI to generate the args parsing structure for the
`deploy` command. Optimistically, this same data structure can be used
to generate documentation output for `front` such that the online docs
will match the `help` output.

---------

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-06-29 14:08:17 -06:00
Steven
7e791ee080 [cli] Remove preinstall script (#10157)
This will solve two of the warnings from [Socket.dev](https://socket.dev/npm/package/vercel):

<img width="1126" alt="image" src="https://github.com/vercel/vercel/assets/229881/c890c973-4f5a-44d9-9b96-2580a1e40ed0">

This preinstall script isn't necessary to run Vercel CLI, its only used to improve the error message in two cases:

- The system has `node` version prior to 14.x (3 years ago)
- The system still has `now` installed but should be using `vercel` (last shipped 3 years ago)

The usage of `preinstall` scripts have gone out of style due to security audits so we should remove this script now.
2023-06-28 22:30:49 +00:00
Vercel Release Bot
13769106cb Version Packages (#10156)
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@31.0.1

### Patch Changes

- Updated dependencies
\[[`aa734efc6`](aa734efc6c)]:
    -   @vercel/next@3.8.8

## @vercel/next@3.8.8

### Patch Changes

- [next] Ensure RSC paths handle basePath
([#10155](https://github.com/vercel/vercel/pull/10155))
2023-06-28 14:49:14 -07:00
JJ Kasper
aa734efc6c [next] Ensure RSC paths handle basePath (#10155)
This ensures we properly create the `.rsc` variant of outputs when `basePath` is configured and adds a regression test for this. 

x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1687944744404289)
Fixes: https://github.com/vercel/next.js/issues/48305
2023-06-28 21:00:43 +00:00
Vercel Release Bot
acc10e47c7 Version Packages (#10123)
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@31.0.0

### Major Changes

- Update `vc dev` redirect response to match production behavior
([#10143](https://github.com/vercel/vercel/pull/10143))

### Patch Changes

- require `--yes` to promote preview deployment
([#10135](https://github.com/vercel/vercel/pull/10135))

- [cli] Optimize write build result for vc build
([#10154](https://github.com/vercel/vercel/pull/10154))

- Only show relevant Project matches in Project selector
([#10114](https://github.com/vercel/vercel/pull/10114))

- [cli] Fix error message when token is invalid
([#10131](https://github.com/vercel/vercel/pull/10131))

- Updated dependencies
\[[`e4895d979`](e4895d979b),
[`346892210`](3468922108),
[`346892210`](3468922108),
[`a6de052ed`](a6de052ed2)]:
    -   @vercel/next@3.8.7
    -   @vercel/static-build@1.3.38
    -   @vercel/build-utils@6.8.0
    -   @vercel/remix-builder@1.8.15
    -   @vercel/node@2.15.3

## @vercel/build-utils@6.8.0

### Minor Changes

- Add `getNodeBinPaths()` and `traverseUpDirectories()` functions
([#10150](https://github.com/vercel/vercel/pull/10150))

## @vercel/client@12.6.3

### Patch Changes

- Updated dependencies
\[[`346892210`](3468922108)]:
    -   @vercel/build-utils@6.8.0

## @vercel/frameworks@1.4.3

### Patch Changes

- [frameworks] Update `saber.land` to `saber.egoist.dev`
([#10148](https://github.com/vercel/vercel/pull/10148))

## @vercel/fs-detectors@4.0.1

### Patch Changes

- Resolve symlinks in `LocalFileSystemDetector#readdir()`
([#10126](https://github.com/vercel/vercel/pull/10126))

- Updated dependencies
\[[`0867f11a6`](0867f11a6a)]:
    -   @vercel/frameworks@1.4.3

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

### Patch Changes

- Updated dependencies
\[[`346892210`](3468922108)]:
    -   @vercel/build-utils@6.8.0
    -   @vercel/node@2.15.3

## @vercel/next@3.8.7

### Patch Changes

- [next] Update payload flag
([#10147](https://github.com/vercel/vercel/pull/10147))

- Use `getNodeBinPaths()` function to improve monorepo support
([#10150](https://github.com/vercel/vercel/pull/10150))

## @vercel/node@2.15.3

### Patch Changes

- Updated dependencies
\[[`346892210`](3468922108)]:
    -   @vercel/build-utils@6.8.0

## @vercel/remix-builder@1.8.15

### Patch Changes

- Update `@remix-run/dev` fork to v1.18.0
([#10146](https://github.com/vercel/vercel/pull/10146))

- Updated dependencies
\[[`346892210`](3468922108)]:
    -   @vercel/build-utils@6.8.0

## @vercel/static-build@1.3.38

### Patch Changes

- Use `getNodeBinPaths()` function to improve monorepo support
([#10150](https://github.com/vercel/vercel/pull/10150))

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

## @vercel-internals/constants@1.0.3

### Patch Changes

- Updated dependencies
\[[`346892210`](3468922108)]:
    -   @vercel/build-utils@6.8.0

## @vercel-internals/types@1.0.3

### Patch Changes

- Updated dependencies
\[[`346892210`](3468922108)]:
    -   @vercel/build-utils@6.8.0
    -   @vercel-internals/constants@1.0.3
2023-06-28 12:29:31 -07:00
JJ Kasper
6a0e1e0b66 [cli] Optimize write build result for vc build (#10154)
As noticed this is copying all fallback files from output even if they are already on the disk in the build container which should be able to be considered a "pure" environment. This copying can cause disk space/perf issues when there are massive amounts of fallback files generated e.g. 8000 outputs at 200KB/output is already 1.6GB of copying needing to be done that could just be a move operation. 


x-ref: [slack thread](https://vercel.slack.com/archives/C03F2CMNGKG/p1687969734598509?thread_ts=1687963253.178369&cid=C03F2CMNGKG)
x-ref: [slack thread](https://vercel.slack.com/archives/C02SM2K2UM9/p1687970267370669)
x-ref: [slack thread](https://vercel.slack.com/archives/C03DQ3QFV7C/p1687338157228459)
2023-06-28 19:07:52 +00:00
Nathan Rajlich
3468922108 [build-utils] Add getNodeBinPaths() function (#10150)
The `getNodeBinPath()` function is problematic because it assumes that commands are installed in the `node_modules` directory alongside the detected lockfile. This works fine the majority of the time, but ends up not being the case when using a monorepo that uses a package manager in "linked" mode (i.e. pnpm by default).

Consider the following:

```
.
├── pnpm-lock.yaml
├── node_modules
├── blog
│   ├── node_modules
│   │   ├── hexo -> .pnpm/hexo@3.9.0/node_modules/hexo
```

In this setup, adding the root-level `node_modules/.bin` would not make the `hexo` command be visible in the `$PATH`.

To solve this issue, the new `getNodeBinPaths()` function returns an array of all directories up to the specified `root`, which can then be placed into the `$PATH`. It's also more efficient (synchronous) since it does not need to scan for a lockfile anymore (the `root` needs to be specified explicitly).

The new function is being used in `@vercel/next` and `@vercel/static-build`.

The `traverseUpDirectories()` function from CLI was moved to `build-utils` to implement this function. Consequently, that makes the implementations of `walkParentDirs()` and `walkParentDirsMulti()` simpler, since it's using this generator now.
2023-06-28 01:53:34 +00:00
JJ Kasper
e4895d979b [next] Update payload flag (#10147)
x-ref: [slack thread](https://vercel.slack.com/archives/C05E6RJTPJS/p1687898295532579)
2023-06-27 23:34:21 +00:00
Steven
733ff5ed85 [tests] Add x-vercel-id to test error message (#10149)
Including the `x-vercel-id` header when a e2e test fails will help us
debug issues
2023-06-27 19:05:55 -04:00
Steven
0867f11a6a [frameworks] Update saber.land to saber.egoist.dev (#10148)
The website url for Saber changed

x-ref:
[slack](https://vercel.slack.com/archives/C01RUTYJYHW/p1687900208904799)
2023-06-27 15:23:27 -07:00
Vercel Release Bot
a6de052ed2 [remix] Update @remix-run/dev to v1.18.0 (#10146)
This auto-generated PR updates `@remix-run/dev` to version 1.18.0.
2023-06-27 17:32:46 +00:00
Michaël De Boey
f5d48ec3bc [examples] Update remix template (#9846)
Bring in line with latest template
2023-06-26 16:52:24 -07:00
Sean Massa
6ec1180798 require --yes flag to promote preview deployment (#10135)
In order to promote a preview deployment, we want to make sure the user knows that this is not typical. Now the `--yes` flag is required to make this work.
2023-06-26 21:43:48 +00:00
Nathan Rajlich
36db62a491 Delete .changeset/beige-carrots-begin.md (#10144)
We don't want changesets to try and create a release / changelog for the
`examples` dir.
2023-06-26 13:12:21 -07:00
Vercel Release Bot
f9266e069f [tests] Upgrade Turbo to version 1.10.6 (#10140)
This auto-generated PR updates Turbo to version 1.10.6
2023-06-26 20:10:26 +00:00
Nathan Rajlich
8163a153df [cli] Respond with "Redirecting..." to match production behavior (#10143)
Production was recently changed to make redirect responses return the text "Redirecting..." without the destination nor status code in the text.

This caused some tests to start failing, so update `vc dev` to match this new behavior and update the relevant tests.
2023-06-26 19:41:35 +00:00
Steven
c5e6bd1a7a Delete lerna.json (#10133)
We no longer use lerna since switching to changesets so we can delete `lerna.json`

- See https://github.com/vercel/vercel/pull/9914
2023-06-23 16:14:23 +00:00
Steven
c2f1bebd1f [cli] Fix error message when token is invalid (#10131)
This changes the error when a token is invalid or expired from

```
Error: Could not retrieve Project Settings. To link your Project, remove the `.vercel` directory and deploy again.
Learn More: https://vercel.link/cannot-load-project-settings
```

to a better error

```
Error: The specified token is not valid. Use `vercel login` to generate a new token.
```

- This could be considered a follow up to
https://github.com/vercel/vercel/pull/7794
2023-06-23 11:18:58 -04:00
Nathan Rajlich
3138415533 [fs-detectors] Resolve symlinks in LocalFileSystemDetector#readdir() (#10126)
`LocalFileSystemDetector#readdir()` was throwing an error when a symlink was encountered, due to `fs.readdir()` `withFileTypes: true` option performing an lstat instead of a stat operation.

So re-implement the `readdir()` logic to use `fs.stat()` so that the symlink is resolved (only "dir" and "file" types are expected in the result).
2023-06-22 18:19:28 +00:00
Vercel Release Bot
8f6813bb63 [examples][tests] Upgrade Next.js to version 13.4.7 (#10125)
This auto-generated PR updates 3 packages to Next.js version 13.4.7
2023-06-22 00:36:23 +00:00
Nathan Rajlich
734499fc03 [cli] Only show relevant Project matches in Project selector (#10114)
When showing the Project selector and there's more than one Project matched given the current cwd, only show the matched Projects instead of all Projects listed in the `repo.json` file.
2023-06-21 17:22:21 +00:00
Nathan Rajlich
f06988d914 [cli] Add debug logging for repo link root lookup (#10112)
Adds some logging during the root directory resolving logic to help debug any cases where that lookup isn't behaving correctly.
2023-06-20 18:09:40 +00:00
Vercel Release Bot
71ac16220b Version Packages (#10107)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-20 11:42:04 -05:00
Kiko Beats
8b3a4146af [node][edge][cli] upgrade Edge Runtime (#10051)
We avoided to use `undici.WebSocket` because @jawj found a bug in the
implementation.

The [fix was merged](https://github.com/nodejs/undici/pull/2106) in
[undici@5.22.1](https://github.com/nodejs/undici/releases/tag/v5.22.1),
so we can be back to use it.

The latest version of Edge Runtime exposes `undici.WebSocket` compatible
with node.js 14, 16 & 18

---------

Co-authored-by: Sean Massa <endangeredmassa@gmail.com>
2023-06-20 11:06:43 +02:00
Nathan Rajlich
cfea31e6cf Remove .changeset/curvy-stingrays-cheat.md (#10115) 2023-06-16 15:45:52 -07:00
Vercel Release Bot
7090fec110 [examples][tests] Upgrade Next.js to version 13.4.6 (#10111)
This auto-generated PR updates 3 packages to Next.js version 13.4.6
2023-06-16 22:21:41 +00:00
Sean Massa
bc7c80fb9b [cli] do not force auto-assign value on deployments (#10110)
When `vc deploy` happens, it was forcing a `true`/`false` value for `autoAssignCustomDomains`. This overwrites the project setting in some cases, which is not what we want.

If a CLI command or API call explicitly wants to force `autoAssignCustomDomains` on or off, it can. Otherwise, the project setting value should be used.

This PR only sets `autoAssignCustomDomains` to `false` when the `--skip-domain` flag is passed. Otherwise, the value is `undefined` so that the project setting can take effect.
2023-06-15 22:19:34 +00:00
Sean Massa
91406abdb0 [node] add tests to getBodyParser helper (#10109) 2023-06-15 12:31:47 -05:00
Nathan Rajlich
a5af8381ce [fs-detectors] Add test-e2e script (#10103)
Seems we have not been running the `fs-detectors` integration tests.
2023-06-14 19:20:20 +00:00
Nathan Rajlich
2230ea6cc1 [remix] Link to https://vercel.com/help (#10106) 2023-06-14 18:53:14 +00:00
Vercel Release Bot
f057f0421b Version Packages (#10081) 2023-06-14 10:47:10 -07:00
Nathan Rajlich
42c0b32a8d [fs-detectors] Use LocalFileSystemDetector instead of FixtureFilesystem (#10100)
The code for these two are almost identical, so consolidate into one codebase.

Also adjusts the `pnpm test` script to allow for specifying a file name to be executed, instead of running all tests.
2023-06-13 23:30:00 +00:00
Chris Barber
d61a1a7988 [cli] Fix team validation bug where you are apart of a team (#10092)
When consolidating the deployment team validation, a bug was introduced where the command would error if the user was currently using a team. The logic was meant to copy the logic in `getDeploymentByIdOrURL()`: https://github.com/vercel/vercel/blob/main/packages/cli/src/util/deploy/get-deployment-by-id-or-url.ts#L80.
2023-06-12 16:32:01 +00:00
Vercel Release Bot
c438bbb362 [examples][tests] Upgrade Next.js to version 13.4.5 (#10097)
This auto-generated PR updates 3 packages to Next.js version 13.4.5
2023-06-12 15:02:47 +00:00
Vercel Release Bot
cb5eef0eb5 [tests] Upgrade Turbo to version 1.10.3 (#10096)
This auto-generated PR updates Turbo to version 1.10.3
2023-06-11 07:44:11 +00:00
Nathan Rajlich
79dee367cf [cli] Remove findProjectFromPath() (#10093)
Superceded by the `findProjectsFromPath()` function which may return multiple matches, and it was only being used in tests.

The relevant tests have been updated to use the multiple matches version instead, and updated to include the case where multiple matches are returned.

__Note:__ No changeset for this one since it's an internal function being removed, and doesn't need to be referenced in the public changelog.
2023-06-09 22:59:17 +00:00
Nathan Rajlich
dea58dea7e [cli] Add support for vc deploy --prebuilt command with repo link (#10083)
When repo linked, `vc deploy --prebuilt` will change working directory to the Project root directory, instead of the repo root, so that the project's local `.vercel/output` directory is what gets uploaded + deployed.
2023-06-09 09:54:17 +00:00
Steven
fecebfa7fa [cli] vc env pull should add .env*.local to .gitignore (#10085)
This is a follow up to PR #9892 which changed the default to `.env.local`.

Now that we know local files should never be committed to git, we can automatically add `.env*.local` to `.gitignore`. Note that this is the same ignore pattern that ships with create-next-app [as seen here](06abd63489/packages/create-next-app/templates/app/js/gitignore (L28)), so most Next.js users won't see anything change.

See the related [Linear ticket](https://linear.app/vercel/issue/VCCLI-461/)
2023-06-08 00:09:22 +00:00
Nathan Rajlich
94d5612dce [cli] Move readme copy logic to a helper function for vc link (#10084)
ncc has an issue with detecting + rewriting this file path for some reason. Moving to a helper function should work around that issue.

Fixing:

```
Error: ENOENT: no such file or directory, open '/node_modules/vercel/projects/VERCEL_DIR_README.txt'
```
2023-06-07 21:33:47 +00:00
Nathan Rajlich
3eaf58bb74 [cli] Add support for vc dev command with repo link (#10082)
When repo linked, `vc dev` already works fine when run from the root of the repo. This change makes it so that `vc dev` also works as expected when executed within a project subdirectory.
2023-06-07 18:48:28 +00:00
Nathan Rajlich
e63cf40153 [cli] Add support for vc build command with repo link (#10075)
When the repo is linked to Vercel with `vc link --repo`, the `vc build` command should be invoked from the project subdirectory (otherwise the project selector is displayed). The output directory is at `<projectRoot>/.vercel/output` instead of at the repo root.
2023-06-07 08:26:13 +00:00
Sean Massa
709c9509f4 Revert "Revert "[cli] Add support for vc pull command with repo link"" (#10078)
Reverts vercel/vercel#10076

Restores the original PR: https://github.com/vercel/vercel/pull/10071

With the fix from: https://github.com/vercel/vercel/pull/10073
2023-06-07 07:49:45 +00:00
Nathan Rajlich
6107c1ed22 Disable "Enforce Changeset" job for release PRs (#10080)
This job leads to a false-positive for the release PR, so disable it.
2023-06-06 23:27:39 -07:00
Vercel Release Bot
7a0f377afe Version Packages (#10074)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-07 01:23:29 -05:00
Sean Massa
a04bf557fc handle undefined content type in vc dev (#10077)
When no content type header is sent to an API request during `vc dev`, the request fails:

```
/Users/smassa/source/vercel/vercel-2/node_modules/.pnpm/content-type@1.0.4/node_modules/content-type/index.js:108
    throw new TypeError('argument string is required')
          ^
TypeError: argument string is required
...
```

This comes from some runtime type validation happening in the `content-type` package, for which we do not have types, which is why typescript didn't catch this.
2023-06-07 06:20:19 +00:00
Sean Massa
b6736e82cf Clear revert out of changelog (#10079) 2023-06-07 00:46:21 -05:00
Sean Massa
7923056bc0 Revert "[cli] Add support for vc pull command with repo link" (#10076) 2023-06-07 00:35:12 -05:00
Nathan Rajlich
71ff193ea3 [cli] Add support for vc pull command with repo link (#10071)
When the repo is linked to Vercel with `vc link --repo`, the `.vercel` directory will be created at the _project root_ instead of the _repo root_, and will still contain the `project.json`.

The difference is that the `orgId` and `projectId` props will not be present in the `project.json` file when repo linked, since that information is available at the root level `repo.json` file.
2023-06-06 22:01:37 +00:00
Vercel Release Bot
c21d93de44 Version Packages (#10062)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-06 16:34:04 -05:00
Kiko Beats
0039c8b5ce [node] Add isomorphic functions (#9947)
This PR allow using Web APIs in Serverless functions

```js
// api/serverless.js
export const GET = () => {
  return new Response(`new Response('👋 Hello from Serverless Web!)`)
}
```

More about that
https://nextjs.org/docs/app/building-your-application/routing/router-handlers

---------

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-06-06 23:15:10 +02:00
Vercel Release Bot
49c7178567 [remix] Update @remix-run/dev to v1.17.0 (#10072)
This auto-generated PR updates `@remix-run/dev` to version 1.17.0.
2023-06-06 20:31:48 +00:00
Ethan Arrowood
b038b29614 Add vercel.json setting overrides to storybook example for zero-config experience (#10067)
This PR adds necessary configuration overrides to the storybook example so that it can have a zero-config experience.
2023-06-06 00:52:38 +00:00
Nathan Rajlich
7a249a2284 Enforce a changeset file to be present (#10065)
Based off of these setup instructions:

https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md#blocking

If a commit should really not publish a release, you can run `changeset
--empty`.
2023-06-05 15:44:40 -07:00
Nathan Rajlich
a5e32ec31d [cli] Add client.fetchPaginated() async iterator (#10054)
Adds async iterator helper function for interacting with endpoints that have pagination.

Implemented for use with `vc bisect` (fetching deployments) and `vc link --repo` (fetching projects).
2023-06-05 17:06:57 +00:00
Florentin / 珞辰
bc5afe24c4 [node] add maxDuration config support for vc node deployments (#10028)
This PR enables specifying `maxDuration` in `config` for node vc
deployments.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
2023-06-05 10:05:53 +02:00
Vercel Release Bot
5070e3bbbd [tests] Upgrade Turbo to version 1.10.1 (#10059)
This auto-generated PR updates Turbo to version 1.10.1
2023-06-05 03:57:56 +00:00
Vercel Release Bot
4ad1cbbd7d Version Packages (#10058)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-02 19:29:17 -05:00
Chris Barber
4f4e09477d Attempting to publish build-utils and vercel (#10057) 2023-06-02 19:24:32 -05:00
Chris Barber
cd35071f60 Attempting to publish build-utils and vercel (#10057) 2023-06-02 19:22:22 -05:00
Vercel Release Bot
f373c94508 Version Packages (#10055)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-02 16:28:57 -05:00
Chris Barber
553c001eb0 [cli] vc build ignore .env* & ignore files for @vercel/static (#10056)
For projects with static files only (e.g. `@vercel/static` builder), do not copy`.env*`, `.vercelignore`, or `.nowignore` into the BOA output dir.
2023-06-02 21:04:03 +00:00
Chris Barber
f6c3a95783 [cli] Ensure .npmrc does not contain use-node-version (#10049)
When a project has a `.npmrc` containing `use-node-version`, package managers (notably `pnpm`) will download the specified Node.js version. This is not the correct way as it can lead to `pnpm` downloading Node.js 18 or newer which depends on a version of GLIBC that is not present in the current AWS image. The proper way is to set the `"engines"` in the `package.json`.

<img width="468" alt="image" src="https://github.com/vercel/vercel/assets/97262/0974cf05-6a11-4d95-88e8-13affc4aad2a">

Discussion: https://github.com/orgs/vercel/discussions/2436
2023-06-02 15:27:28 +00:00
Sean Massa
c0bcef0ca4 Update CODEOWNERS for .changeset/ (#10053) 2023-06-01 12:07:18 -05:00
Vercel Release Bot
4cd77608e8 Version Packages (#10020)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-01 10:09:24 -05:00
Steven
e6b2980eba [tests] Fix summary workflow to always run (#10048)
### Description
This ensures the Summary job always runs to check if any test failed and
cause itself to fail as well.

This allows us to dynamically add as many concurrent jobs as we want but
only have one (Summary) marked as required.

### Testing
I verified this worked by making a change to `@vercel/static-config`
which is not required and the Summary check failed:

https://github.com/vercel/vercel/actions/runs/5136560652/jobs/9243924596

Then I reverted it so that the test was passing and the Summary check
passed:

https://github.com/vercel/vercel/actions/runs/5137401343/jobs/9245554297
2023-05-31 18:24:54 -04:00
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
JJ Kasper
c63679ea0a Revert "[next] Update rsc content-type test fixtures" (#10040)
Relies on https://github.com/vercel/next.js/pull/50472 this should only be merged after the Next.js PR is released to canary

Reverts vercel/vercel#10023
2023-05-31 15:38:22 +00:00
Damien Simonin Feugas
4280166df4 docs(sveltekit): re-introduce speed insights (#9988) 2023-05-31 09:41:46 +02:00
Nathan Rajlich
18ae78137c Fetch git tags during Release workflow (#10045)
Follow-up to #10044. The git tags need to be present for `changeset tag` to work properly.
2023-05-30 21:10:03 +00:00
Nathan Rajlich
ebe4058073 Use pnpm publish -r and changeset tag to publish packages (#10044)
This is a re-application of #10022 (which was reverted in #10032), but with the addition of `changeset tag` after the `pnpm publish -r` command. This ensures the proper git tags are also created, allowing for the GitHub releases to be published.
2023-05-30 19:25:24 +00:00
Vercel Release Bot
942e76840e [tests] Upgrade Turbo to version 1.9.9 (#10036)
This auto-generated PR updates Turbo to version 1.9.9
2023-05-29 20:31:12 +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
113b8ac87b Revert "Use pnpm publish -r to publish packages (#10022)" (#10032)
This reverts commit 1e47bbf32f.

`changeset publish` also creates git tags, whereas `pnpm publish -r` does not. This causes the GitHub Releases to not be created.
2023-05-26 20:18:49 +00:00
Shohei Maeda
b56ac2717d [next] Pass pageExtensions data to apiLambdaGroups (#10015)
Right now, we can't detect API routes correctly if `pageExtensions` is set:

> WARNING: Unable to find source file for page xxxx with extensions: js, jsx, ts, tsx, this can cause functions config from `vercel.json` to not be applied
2023-05-26 18:01:05 +00:00
Vercel Release Bot
aa8957ab10 [examples][tests] Upgrade Next.js to version 13.4.4 (#10025)
This auto-generated PR updates 3 packages to Next.js version 13.4.4
2023-05-26 10:54:42 -04:00
Shohei Maeda
c6c19354e8 [next] Fix functions config with App Router (#9889)
We added appDir support in https://github.com/vercel/vercel/pull/9811 so that users can customize `memory`/`maxDuration` for routes in appDir.

But since RSC is enabled by default in Next.js 13, `vercel build` still reports some warning messages, such as:

```json
"functions": {
  "app/**/*": {
    "maxDuration": 5,
    "memory": 512
  }
}
```
```
WARNING: Unable to find source file for page hello.js with extensions: ts, tsx, js, jsx, md, mdx, this can cause functions config from `vercel.json` to not be applied
WARNING: Unable to find source file for page index.js with extensions: ts, tsx, js, jsx, md, mdx, this can cause functions config from `vercel.json` to not be applied
```

To suppress these errors and properly apply `functions` setting to those routes, updating the current detection logic to also search `page.${ext}` files.
2023-05-25 21:01:29 +00:00
JJ Kasper
96b2502133 [next] Update rsc content-type test fixtures (#10023)
This updates the tests to the latest expected content-type header for RSC responses. 

x-ref: https://github.com/vercel/next.js/pull/50314
2023-05-25 08:32:53 +00:00
Swarnava Sengupta
2df0262675 [examples] Update preact template to use Node 18 (#10012) 2023-05-24 15:06:01 -07:00
Nathan Rajlich
1e47bbf32f Use pnpm publish -r to publish packages (#10022)
Following the instructions here: https://pnpm.io/using-changesets

This should ensure that packages are published in the correct order (see related issue: https://github.com/changesets/changesets/issues/238).
2023-05-24 21:56:45 +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
Javi Velasco
c7bcea4081 Remove usage of env from Edge Functions and Middleware (#10018)
Co-authored-by: Steven <steven@ceriously.com>
2023-05-24 18:22:43 +02: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
Swarnava Sengupta
1663db7ca3 [examples] Update solid-js template to use Node 18 (#10009) 2023-05-23 11:29:14 -07:00
Nathan Rajlich
e80247fb99 Update to latest version of patrickedqvist/wait-for-vercel-preview (#10008)
The older version we were using is using Node 12, and GH Actions prints this warning:

> Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: patrickedqvist/wait-for-vercel-preview@ae34b392ef. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

The current version of this action uses Node 16.
2023-05-23 15:01:18 +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
Nathan Rajlich
c52a59809e Remove pnpm bootstrap from contributing instructions (#10005)
This script no longer exists.
2023-05-22 22:16:47 +00: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
Swarnava Sengupta
7ff321310f [examples] Update "vue" template to use Node 18 (#10001) 2023-05-22 11:56:21 -07:00
Nathan Rajlich
2da72bc5e4 Fix promoting CLI release to "latest" GH Release (#10003)
The logic to retrieve the latest release was not working correctly, so use the `getLatestRelease()` function instead of assuming that `release[0]` is tagged as the latest.
2023-05-22 18:49:51 +00:00
Vercel Release Bot
46950633f4 Version Packages (#9994) 2023-05-22 10:47:47 -07:00
Vercel Release Bot
44b1dfe7c5 [tests] Upgrade Turbo to version 1.9.8 (#9996)
This auto-generated PR updates Turbo to version 1.9.8
2023-05-22 08:50:23 +00:00
Vercel Release Bot
0278c7b7b9 [examples] Upgrade Next.js to version 13.4.3 (#9980)
This auto-generated PR updates Next.js to version 13.4.3
2023-05-19 21:08:38 +00:00
Sean Massa
761db597be clarify next.js dupe api directory warning (#9979)
In a Next.js app, if you have Node.js Functions in both `api` and `pages/api`, you'll get a warning about moving those `api` functions into `pages/api`. This does specify Node.js Functions already, but a user was confused and tried to move their non-Node.js functions into `pages/api` as well.

This PR tries to make it clearer that you can do both. Note that this still requires a non-ideal local dev setup where you:

- update next config to fall back to the `vc dev` port for `api` handlers
- run `next dev` for the Next.js app on one port
- run `vc dev` for the top-level `api` Functions on another port

---

Example repo: https://github.com/rexfordessilfie/vercel-api-languages
2023-05-19 19:31:32 +00: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
Sean Massa
e94a153b2f add repo details for packages that are missing it (#9990) 2023-05-19 12:02:12 -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
JJ Kasper
f00b08a820 [next] Ensure app functions are detected/separated properly (#9989)
Follow-up to https://github.com/vercel/vercel/pull/9974 this uses the `lambdaAppPaths` as the source of truth instead of the manifest which is more accurate for separating/detecting. Also adds additional test cases for new root and index app functions. 

x-ref: https://github.com/vercel/next.js/issues/49169
2023-05-19 16:22:44 +00: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
Sean Massa
2c950d47ae ensure cleanup after the gatsby plugin runs (#9975)
There is an issue where you can interrupt a gatsby project build and the temporary files are not cleaned up. If you try to build again, it will get stuck in an infinite loop.

This PR adds an exit hook to make sure the cleanup happens.
2023-05-18 19:42:08 +00:00
Sean Massa
71b9f3a94b Deprecate Node.js 14.x and 16.x with warning (#9976)
Node.js 14 and 16 are being deprecated. This PR will cause a warning when they are used today and an error after August 15.
2023-05-18 19:03:01 +00: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
JJ Kasper
ba10fb4dd4 [next] Update handling for react prebundled flag (#9974)
This ensures we properly set the prebundled react flag conditionally for
app and pages ensuring they are kept separate when bundling.

x-ref: https://github.com/vercel/next.js/issues/49169
2023-05-18 06:37:50 -07:00
Nathan Rajlich
18c1c45ce3 Add changeset for @remix-run/dev updater GH Action (#9972)
Adds a changeset file when the GH Action to update `@remix-run/dev`
creates a pull request.
2023-05-17 16:39:09 -07:00
Vercel Release Bot
67e556bc80 [remix] Upgrade @remix-run/dev to version 1.16.1 (#9971)
This auto-generated PR updates @remix-run/dev to version 1.16.1
2023-05-17 19:34:12 +00:00
Sean Massa
7235000181 fix release script (#9959)
The [previous PR](https://github.com/vercel/vercel/pull/9942) used `github.repos`, but I think this needs to be `github.rest.repos`.

- [Docs](https://octokit.github.io/rest.js/v19#repos)
- [Failed GH Action](https://github.com/vercel/vercel/actions/runs/4994578940/jobs/8945329301)
2023-05-17 18:26:30 +00:00
Sean Massa
5124d431ea fix deploy from local (#9969)
Local deployments of this repo would fail because this repo assumes that it's only ever deployed via git connection.
2023-05-17 17:45:28 +00: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
JJ Kasper
6c6f3ce9d2 [next] Ensure un-necessary rsc routes are not added (#9963)
These routes aren't needed for RSC as `_next/data` isn't used for
routing app paths.

x-ref: [slack
thread](https://vercel.slack.com/archives/C058FQFKAGH/p1684272340654679?thread_ts=1684271538.503259&cid=C058FQFKAGH)
2023-05-16 16:33:09 -07:00
Vercel Release Bot
aa83680832 [examples] Upgrade Next.js to version 13.4.2 (#9943)
This auto-generated PR updates Next.js to version 13.4.2
2023-05-16 22:54:10 +00: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
Sean Massa
eb6bb98406 empty push test 2023-05-16 11:49:25 -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
Vercel Release Bot
f57af66dc2 [tests] Upgrade Turbo to version 1.9.4 (#9952)
This auto-generated PR updates Turbo to version 1.9.4
2023-05-16 03:21:01 +00:00
Nathan Rajlich
b2f71d5352 Remove "Required PR Label" workflow (#9958)
Changesets enforces this, so no need for this extra workflow anymore.
2023-05-15 14:38:30 -07: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
Nathan Rajlich
d80732d74f [release] Promote vercel CLI release to "latest" (#9942)
It's possible that changesets will promote a release to latest that is
not the Vercel CLI release. This script ensures that a `vercel@` release
is always the latest after a publish happens.
2023-05-11 13:40:34 -07: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
Sean Massa
924a20a0fc [tests] make prettier ignore .changeset (#9938) 2023-05-11 09:50:14 -05:00
Nathan Rajlich
fc3b74d06f Add id-token: write permissions to enable npm publish provenance (#9936)
Was previously added in https://github.com/vercel/vercel/pull/9583, was
missed in the changesets switchover.
2023-05-10 16:24:28 -07: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
e228cdd373 Add @svitejs/changesets-changelog-github-compact to package.json (#9934)
Forgot to add the package in #9933 :doh:
2023-05-10 14:47:42 -07:00
Nathan Rajlich
9bd92535d6 Use Svelte's changelog generator and don't delete CHANGELOG.md (#9933)
Partial revert of #9932, since apparently [that didn't
work](https://github.com/vercel/vercel/actions/runs/4941266637/jobs/8833725828).

We can investigate that more later, but this gets it working again
properly at least.

Also use Svelte's changelog generator, since it includes the PR numbers
which Sean wanted.
2023-05-10 14:41:19 -07:00
Nathan Rajlich
5825e30700 Create release PR as "Vercel Bot" and remove CHANGELOG.md files (#9932)
* Have changesets create the release PR as "Vercel Bot", so that the
tests run.
* Remove the `CHANGELOG.md` files. They are redundant with the GH
Releases which contain the same information.
2023-05-10 13:58:29 -07:00
Vercel Release Bot
6d5983eaae [remix] Upgrade @remix-run/dev to version 1.16.0-patch.1 (#9930)
This auto-generated PR updates @remix-run/dev to version 1.16.0-patch.1
2023-05-10 20:20:15 +00:00
Nathan Rajlich
2fd59a3b5a Use changesets instead of lerna (#9914)
`changesets` will improve our release workflow, since we will no longer need to manually curate and publish the changelog and GitHub Release. Instead, you simply merge the publish PR that the changesets GH action maintains as we push commits to `main`.
2023-05-10 19:35:17 +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
Chris Barber
fa443035f6 [tests] Add test for set-cookie with multiple cookies (#9916)
This adds the missing test for https://github.com/vercel/vercel/pull/9899.
2023-05-06 10:18:52 +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
Vercel Release Bot
5328bb69e2 [examples] Upgrade Next.js to version 13.4.1 (#9911)
This auto-generated PR updates Next.js to version 13.4.1
2023-05-05 16:25:11 +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
Vercel Release Bot
47d0d4f84a [examples] Upgrade Next.js to version 13.4.0 (#9902)
This auto-generated PR updates Next.js to version 13.4.0
2023-05-04 20:25:08 +00:00
Sean Massa
aba54ee6cf [frameworks] validate getOutputDirName and other missing values on framework entries (#9900)
Covers the validation whole in Framework entries over function properties and other missing holes.
2023-05-03 23:36:26 +00:00
Chris Barber
cd7d3ef1c5 [node] Explicitly set 'set-cookie' header (#9899)
When looping over the response headers returned by `node-fetch`, it will join `set-cookie` header value into a single string. The whatwg calls for a `headers.getSetCookie()` function to handle the `set-cookie` special case, but `node-fetch@2.x` doesn't support it.

As a workaround, we need to grab the raw `set-cookie` header value.
2023-05-03 22:12:45 +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
6c02ae9e36 [frameworks] Add getOutputDirName to Storybook definition (#9898) 2023-05-03 16:19: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
Nathan Rajlich
8088b07abf [remix] Use debug() for warnings when reading config file (#9894)
Follow-up to address this comment: https://github.com/vercel/vercel/pull/9888#discussion_r1182739621
2023-05-03 17:13:59 +00:00
Kiko Beats
5ee4acb23b use ws instead of undici.WebSocket (#9893)
The `WebSocket` constructor exposed by `undici` is not working against some db connections.

That can be considered kind of expected since `undici` docs is saying it's experimental.

We're working into isolate the issue and report at `undici` repository, but for now, let's just use `ws` for all the node versions.
2023-05-02 18:01:40 +00:00
Nathan Rajlich
ff0978593d [remix] Suppress warnings when reading config (#9888)
Currently, any warnings logged when calling `readConfig()` are emitted in build logs _three times_:

1. When initially reading the config before executing the Build Command
2. When the Build Command is executed (`remix build` reads the config)
3. After the build, in the `prepareCache()` function

For the callsites that we are in control of (`1.` and `3.`), we should suppress those warnings and only allow the standard warnings when invoking `remix build` to be emitted to the build logs.
2023-05-02 16:32:39 +00:00
Chris Barber
678e13af53 [cli][fs-detectors][frameworks] Revert Storybook support (#9890) 2023-05-02 10:03:28 -05:00
Vercel Release Bot
ac2457494a [remix] Upgrade @remix-run/dev to version 1.16.0 (#9887)
This auto-generated PR updates @remix-run/dev to version 1.16.0
2023-05-02 09:49:13 +00:00
Vercel Release Bot
8b9a8c0986 [examples] Upgrade Next.js to version 13.3.4 (#9881)
This auto-generated PR updates Next.js to version 13.3.4

Co-authored-by: Steven <steven@ceriously.com>
2023-05-01 17:55:13 -04:00
Nathan Rajlich
603a7d8787 [fs-detectors] Add disableRootMiddleware, bypass ignoreRuntimes for root-level "middleware" files (#9883)
`ignoreRuntimes: ['@vercel/node']` will also disable root-level middleware, which is not intended. So ensure that middleware still work, even for frameworks that have this `ignoreRuntimes` configuration enabled (Remix, RedwoodJS).
2023-05-01 20:53:35 +00: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
Vercel Release Bot
da046d85de [tests] Update Gatsby fixture versions (#9776)
Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`
2023-05-01 04:21:32 +00: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
ec7b1cf80d [next] Return all and auto when those are used (#9877)
The edge function deployment API doesn't accept these in the array
format.
2023-04-30 15:58:07 +02:00
Tim Neutkens
85947b658e Publish Stable
- vercel@29.0.2
 - @vercel/next@3.8.1
2023-04-30 11:47:04 +02:00
Tim Neutkens
7ab86a94fb [next] Fix return value in normalizeRegions (#9876)
Missed that the newRegions wasn't returned. Also added a check for empty
array, e.g. when `home` is not supported and such.
2023-04-30 11:45:28 +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
Tim Neutkens
473f62d141 Add support for home and global as edge function regions (#9869)
Adds `home` and `global` as supported values for `regions` when coming
from Next.js. We'll port these to the build output API at a later time.

Related Next.js changes: https://github.com/vercel/next.js/pull/48959

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-04-29 19:25:25 +02:00
JJ Kasper
cc140d6e28 [node] Fix exposing WebSocket to edge runtime and legacy next tests (#9871)
This ensures we expose WebSocket correctly for edge runtime for Node.js
v16 and v18 properly. This also fixes failing legacy Next.js tests due
to a bad `@babel/compat-data` package publish from 8 hours ago.

x-ref: [slack
thread](https://vercel.slack.com/archives/C04R82GSDBN/p1682709850008189?thread_ts=1682707749.424459&cid=C04R82GSDBN)
x-ref: https://github.com/vercel/next.js/pull/48924
x-ref: https://github.com/vercel/vercel/pull/9860
Closes: https://github.com/vercel/vercel/pull/9870
2023-04-29 10:43:40 +02:00
Kiko Beats
09ac96ae21 [node] expose WebSocket constructor in Edge functions (#9860)
This PR exposes `WebSocket` to be used for Edge Runtime for `vc dev`.

Ideally, that's a thing we should to handle inside `edge-runtime`
dependency.

Unfortunately, that is not as easy as it sounds, since Edge Runtime is
doing a heavy use of vm module and `undici` is using some Node.js APIs
that are not available, or they are hard to make them working inside vm.

Related PR: https://github.com/vercel/edge-runtime/pull/309

While we're finishing that work, in order to don't delay users to start
using `WebSocket`, we can simply expose it directly from `undici` as
dependency.

---------

Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-04-28 23:03:35 +02:00
Nathan Rajlich
ebd1bf41b6 [node] Don't compile "edge" functions with Babel (#9868) 2023-04-28 20:37:26 +00:00
Steven
e1a16b0333 [node] Add log message about compiling ESM to CJS (#9866)
When `@vercel/node` was created 5 or so years ago, Node.js didn't support ESM out of the box. So to create a zero configuration experience, babel was introduce to compile the authored ESM into the runtime CJS.

Today, Node.js supports ESM but you have to opt in using `type: module` in package.json or the `.mjs` file extension.

Indeed `@vercel/node` detects ESM and skips babel compilation. However, there is a case where the source code is ESM and a dependency supports both ESM and CJS via `imports` in package.json. This case will break because `@vercel/nft` traces the source file as ESM and assumes the dependency will be resolved as ESM too. But after `@vercel/nft` traces the source file, `@vercel/node` will compile to CJS and thus the trace will be incorrect and fail at runtime.

So this PR adds a warning when babel compiles ESM to CJS because it is no longer expected in 2023.
2023-04-28 19:58:43 +00:00
Shohei Maeda
ed56822675 [next] support functions property in appDir (#9811)
Currently, `functions` property (i.e., `memory` and `maxDuration`) are
not supported in appDir routes. This PR attempts to add support.

---------

Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-04-28 13:59:23 -05: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
bfebfc28e1 [tests] Update CODEOWNERS for packages/node (#9864)
Right now, @Kikobeats is a required approver on `packages/node`. This change allows them to approve changes to the package without being absolutely required.
2023-04-27 15:53:04 +00:00
Chris Barber
9e183b2e8d [tests] Move allowJs: true to test tsconfig.json (#9862) 2023-04-27 10:27:02 -05: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
Nathan Rajlich
fda76691d1 [gatsby-plugin-vercel-builder] Log validation errors (#9854)
Log state validation errors, because they can be user error.

Example:

```
error "gatsby-node.js" threw an error while running the onPostBuild lifecycle:

Gatsby state validation failed:
  - Expected boolean, got string ("true") at path "/redirects/0/isPermanent"
Please check your Gatsby configuration files, or file an issue at https://vercel.com/help#issues

  3 |
  4 | export const onPostBuild = async ({ store }: { store: any }) => {
> 5 |   await generateVercelBuildOutputAPI3Output({
    |         ^
  6 |     // validated by `pluginOptionSchema`
  7 |     gatsbyStoreState: store.getState(),
  8 |   });
```
2023-04-25 06:31:27 +00:00
Vercel Release Bot
007e48c1cd [tests] Upgrade Turbo to version 1.9.3 (#9844)
This auto-generated PR updates Turbo to version 1.9.3
2023-04-24 23:03:04 -07:00
Nathan Rajlich
954536e681 Use pnpm v8.3.1 (#9853)
Updates our usage of pnpm to version 8.3.1, and updates the lockfile to the newer version 6 format.
2023-04-25 03:53:42 +00:00
Nathan Rajlich
c52220ab72 [next] Update test fixture 00-app-dir-edge to use export const runtime (#9855)
This test has started to fail consistently:

https://github.com/vercel/vercel/actions/runs/4792497815/jobs/8524784756
2023-04-25 03:14:40 +00:00
Nathan Rajlich
545f82603f [remix-entry-server] Delete package (#9852)
The functionality of this package has been moved to the `@vercel/remix` package, so this one is no longer necessary.
2023-04-24 22:17:52 +00:00
Vercel Release Bot
032df14c79 [examples] Upgrade Next.js to version 13.3.1 (#9842)
This auto-generated PR updates Next.js to version 13.3.1
2023-04-24 12:34:13 -04:00
Michaël De Boey
604f3b8d83 fix(remix): update entry.client.react.jsx (#9845)
Bring in line with Remix defaults

https://github.com/remix-run/remix/blob/main/packages/remix-dev/config/defaults/entry.client.react-stream.tsx
2023-04-23 19:35:31 -07:00
Sean Massa
c0380cac5a [node] remove last mention of node-bridge (#9838) 2023-04-21 11:57:19 -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
Gary Borton
a5c3cbcd45 Allow passing of local git meta even with no remote. (#9824)
This enables the CLI to pass locally detected git meta data even when there is no available remote. It requires a corresponding internal change, which is blocking the e2e tests.
2023-04-20 13:11:17 +00:00
Kiko Beats
6dded87426 [node] Add streaming support for vc dev (#9745)
Until now, the user code response it's buffered and serialized. This is
mismatching how Vercel works these days.

This PR enables streaming response in `vc dev` for Edge/Serverless.

As part of the implementation, the `node-bridge` which spawns a process
to consume the user code is not necessary anymore.

Some necessary files (like HTTP server helpers) have been moved to live
in node builder package instead.

---------

Co-authored-by: Ethan Arrowood <ethan.arrowood@vercel.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-04-19 23:56:41 +02:00
Chris Barber
a63b9d960b Publish Stable
- vercel@28.19.0
 - @vercel/client@12.4.10
 - @vercel/edge@0.3.3
 - @vercel/error-utils@1.0.10
 - @vercel/fs-detectors@3.8.11
 - @vercel/gatsby-plugin-vercel-builder@1.2.9
 - @vercel/go@2.5.0
 - @vercel/hydrogen@0.0.63
 - @vercel/next@3.7.5
 - @vercel/node@2.11.0
 - @vercel/python@3.1.59
 - @vercel/remix-builder@1.8.5
 - @vercel/static-build@1.3.24
 - @vercel/static-config@2.0.16
2023-04-19 10:14:58 -05:00
Sean Massa
3cefbb19fe [tests] split next-local tests into chunks (#9774)
The next-local e2e tests where split between middleware (fast) and all other (slow) tests. This meant there was not a good balance of amount of time spent across these test files, making overall test run times as slow as "all other tests" running.

This PR rebalances the split of tests across 2 files. The new run time is ~9-10m.
2023-04-18 20:27:01 +00:00
Sean Massa
f43894ef4e [cli] refactor to use create deployment param type (#9805)
Small refactor to provide type safety to this invocation of `createDeploy`.
2023-04-18 19:29:42 +00:00
Chris Barber
2081f10b22 [node] Move path-to-regexp and ts-morph from dev deps to deps (#9823)
`@vercel/node` uses `ncc` to bundle the `index.js` spawns the dev server entrypoint which does not bundle the required dependencies, thus `path-to-regexp` and `ts-morph` must be moved from dev dependencies to dependencies.

Fixes #9735.
2023-04-18 16:37:09 +00:00
Chris Barber
b52df7a533 [cli] Add vc deploy --no-wait and vc inspect --wait (#9802)
There's a need to allow `vc deploy` to not block and not wait for the deployment to finish, yet return the URL.

```
$ vc deploy --no-wait
Vercel CLI 28.18.5
🔍  Inspect: https://vercel.com/chrisbarber/next13fun/L8X4oxp5LGcmy51yVptXwMK7n4wt [1s]
📝  Note: Deployment is still processing...
  Production: https://next13fun-kecpx6za2-chrisbarber.vercel.app [1s]
```

Normally this deployment takes around 30 seconds, but the `--no-wait` flag causes the command to exit in less than 2 seconds.

The next step is to add the ability for `vc inspect` to wait as well as specify the maximum time to wait (defaults to 3 minutes, same as `vc rollback`).

```
$ vc inspect --wait --timeout 1m https://next13fun-kecpx6za2-chrisbarber.vercel.app
Vercel CLI 28.18.5
> Fetched deployment "next13fun-ov2r4pvdz-chrisbarber.vercel.app" in chrisbarber [23s]

  General

    id		dpl_9VUuV23EGeoqWf7akEeL8rP1c8cb
    name	next13fun
    status	● Ready
    url		https://next13fun-ov2r4pvdz-chrisbarber.vercel.app
    created	Thu Apr 13 2023 12:25:07 GMT-0500 (Central Daylight Time) [24s ago]
<snip>
```

Also added the ability to pipe the URL into `vc inspect`:

```
echo https://next13fun-ov2r4pvdz-chrisbarber.vercel.app | vc inspect
```

Combined, it allows us to support cool things like:

```
$ vc inspect $(vc deploy --prod --no-wait) --wait
```
2023-04-17 15:43:05 +00:00
Vercel Release Bot
ec89436417 [tests] Upgrade Turbo to version 1.9.1 (#9819)
This auto-generated PR updates Turbo to version 1.9.1
2023-04-16 07:18:36 +00:00
Nathan Rajlich
993a404311 [cli] Support pnpm in getUpdateCommand() (#9813)
We're currently showing bad instructions when CLI was installed via pnpm:

![image](https://user-images.githubusercontent.com/71256/232131890-ecc1c2c1-ace6-48b3-bd6f-8631cf7be087.png)

This adds support for it by leveraging our existing `scanParentDirs()` logic from build-utils.
2023-04-14 21:45:35 +00:00
Nathan Rajlich
3e7bcb2073 [cli] Remove a bunch of isCanary checks (#9806)
We no longer publish versions that include `-canary` in the package.json `version` field, so these are dead code. Just doing a little bit of cleanup.
2023-04-14 20:35:56 +00:00
Ethan Arrowood
ed119d6a33 [internals] Refactor @vercel-internals/types enums into constants (#9789)
- Creates new internals package, `@vercel-internals/constants`
- Refactors the `enum`s from `@vercel-internals/types` into `as const` objects, and moves them to `@vercel-intenrals/constants`
- Updates all relevant code within `packages/cli`, including `@vercel-internals/types` imports to be `import type`
2023-04-14 18:08:12 +00:00
Sean Massa
2aeddde7d5 [tests] split python e2e tests into chunks (#9771)
Split python tests into two chunks. They take <10m each.
2023-04-13 22:19:14 +00:00
Dan Stowell
a8eab6beb7 [tests] fetch vercel.com cert before builds and after tests (#9803)
To debug intermittent connection errors when the tests make requests to [api.vercel.com], fetch the SSL certificate before builds and after tests.
2023-04-13 20:47:13 +00:00
Nathan Rajlich
031c182896 [examples] Update Remix template to use v1.15.0 (#9788) 2023-04-13 11:36:59 -07:00
Chris Barber
38eb0bca04 [go] Support 'go.work' file and resolve shared deps relative to work path (#9708)
This PR fixes a few issues related to `vc dev`.

1. Create a default `go.work` file in the cache dir when building the `vercel-dev-server-go` executable
2. Copy the existing `go.mod` file into the cache dir and update any "replace" relative paths
3. Split the "build" logic into separate functions for the legacy "main" package build and the `go.mod` build

Additionally, it fixes:

1. `vc build`: pass in `build.env` from `vercel.json`
2. Fix several tests to work with `vc dev` and `vc build`

Linear: https://linear.app/vercel/issue/VCCLI-638/vc-dev-go-builder-cant-resolve-workspace-dependencies

The user that reported the issue has tested this build and seems to fix their use case: https://github.com/vercel/vercel/issues/9393#issuecomment-1490726785.
2023-04-13 17:59:47 +00:00
Chris Barber
732ac2072c [tests] Update Typescript, Jest, and ts-jest (#9782)
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Swarnava Sengupta <swarnavasengupta@gmail.com>
2023-04-12 08:38:03 -05:00
Nathan Rajlich
64d9cef963 [publish] Trigger update workflow on "api" repo after Publish (#9791)
So that we don't need to trigger it manually and/or wait for the cronjob.
2023-04-12 06:53:46 +00:00
Nathan Rajlich
6b9e274bc7 [cli] Simplify parseRepoUrl() and fix edge case (#9796)
Fixes an edge case in `parseRepoUrl()` when there is a `.com` in the repo name. The code was hard to refactor in its previous form so I refactored it to be simpler as well.
2023-04-12 04:29:29 +00:00
Sean Massa
a2da071755 [tests] re-chunk example tests (#9792)
It turns out that these do take a long time to run when not cached. We do want these chunks.
2023-04-12 00:57:07 +00:00
Dan Stowell
14ece4111a Publish Stable
- vercel@28.18.5
 - @vercel/fs-detectors@3.8.10
 - @vercel/gatsby-plugin-vercel-builder@1.2.8
 - @vercel/static-build@1.3.23
2023-04-11 16:25:20 -05:00
Sean Massa
e302631ded [fs-detectors] check turbo versions to allow for tags like "latest" (#9790)
When a project depends on `turbo` at version `latest`, this code was breaking because `latest` is not a valid range for `semver.intersects`.
2023-04-11 21:22:41 +00:00
Nathan Rajlich
43a57a3a60 [gatsby-plugin-vercel-builder] Ignore assetPrefix completely (#9787)
Before, we were stripping off only the hostname portion of `assetPrefix`, so any pathname was still being "handled" by the plugin.

Instead, we should be ignoring the `assetPrefix` entirely, so that these two configurations are treated differently:

 * `{ assetPrefix: 'http://example.com', pathPrefix: '/foo' }` - Gatsby project is served from `/foo`
 * `{ assetPrefix: 'http://example.com/foo', pathPrefix: undefined }` - Gatsby project is served from the root `/`

Currently, both configuration behave as the first version listed above. This change makes it so they can behave differently, specifically for some proxy configurations.

In both cases, the generated HTML contains the full URL `http://example.com/foo/*` for JS/CSS/etc. assets
2023-04-11 19:52:38 +00:00
Ethan Arrowood
136077ab6f [scripts] Create internal-dependency-trace script package (#9783)
Adds a new package under `scripts/internal-dependency-trace` that can be used to generate a rendering of any internal file dependency graph.

Default configured to generate the directed dependency graph of `packages/cli/src/index.ts`
2023-04-10 21:01:17 +00:00
Lee Robinson
8634f9cd7e [examples] Update Astro example. (#9778)
This demo now showcases:

- `/` - A static page (pre-rendered)
- `/ssr` - A page that uses server-side rendering (through Vercel Edge Functions)
- `/ssr-with-swr-caching` - Similar to the previous page, but also caches the response on the Vercel Edge Network using `cache-control` headers
- `/edge.json` - An Astro API Endpoint that returns JSON data using Vercel Edge Functions

The new example has been deployed to https://astro.vercel.app.
2023-04-10 08:35:00 +00:00
Sean Massa
dc8523998c [tests] combine examples e2e into one chunk (#9772)
We don't need 5 chunks of the very fast examples tests. We spend more time in setup for each one. We are also more likely to hit the [usage limit](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits) with these.

This PR combines them into one test suite.
2023-04-07 23:47:27 +00:00
Sean Massa
925c8ba18c Publish Stable
- @vercel/build-utils@6.7.1
 - vercel@28.18.4
 - @vercel/client@12.4.9
 - @vercel/edge@0.3.2
 - @vercel/error-utils@1.0.9
 - @vercel/frameworks@1.3.4
 - @vercel/fs-detectors@3.8.9
 - @vercel/gatsby-plugin-vercel-analytics@1.0.9
 - @vercel/gatsby-plugin-vercel-builder@1.2.7
 - @vercel/go@2.4.4
 - @vercel/hydrogen@0.0.62
 - @vercel/next@3.7.4
 - @vercel/node-bridge@4.0.1
 - @vercel/node@2.10.3
 - @vercel/python@3.1.58
 - @vercel/redwood@1.1.14
 - @vercel/remix-entry-server@0.1.1
 - @vercel/remix-builder@1.8.4
 - @vercel/routing-utils@2.2.0
 - @vercel/ruby@1.3.75
 - @vercel/static-build@1.3.22
 - @vercel/static-config@2.0.15
2023-04-07 16:43:42 -05:00
Sean Massa
19804b78a9 [routing-utils] add isInternal flag (#9761)
Adds a new Route property called `isInternal` that indicates whether or not this is a project route or a Vercel platform route. Routes with this flag will be hidden from project-specific lists of routes to avoid confusion.

Verified on staging.
2023-04-07 21:24:40 +00:00
Sean Massa
f774d5f7a2 [next] use "Page" instead of "SSR" for operationType (#9770)
Update the `operationType` from "SSR" to "Page" for display in build outputs.
2023-04-07 20:42:36 +00:00
JJ Kasper
9bf8a68685 [next] Update allowQuery test case (#9767) 2023-04-07 15:01:48 -05:00
Nathan Rajlich
294935a9c5 [static-build] Remove Gatsby env var check (#9766)
This feature flag has been fully rolled out for a while now. Removing it makes the plugin work with `vc build` when running locally.
2023-04-07 02:10:51 +00:00
Vercel Release Bot
778c287964 [examples] Upgrade Next.js to version 13.3.0 (#9765)
This auto-generated PR updates Next.js to version 13.3.0
2023-04-07 01:36:55 +00:00
JJ Kasper
7a9a519517 [next] Fix edge runtime for route groups (#9764)
This ensures we use the correct short name when generating edge
functions with route groups from app directory.

Example deployment with fix can be seen here
https://next-debug-edge-runtime-1ar7agbjh-vtest314-ijjk-testing.vercel.app/group-no-layout

Fixes: https://github.com/vercel/next.js/issues/43458
2023-04-06 17:04:58 -07:00
Espen Hovlandsdal
52b2892b80 [build-utils][cli][fs-detectors] Upgrade minimatch to 3.1.2 (#9762)
Minimatch 3.0.4 has a [ReDoS
vulnerability](https://security.snyk.io/vuln/SNYK-JS-MINIMATCH-3050818).
While not likely to be an issue for the packages that use it here, a
simple version bump should prevent the issue and reduce vulnerability
noise on audits. 3.1.2 is the latest version within the 3.x range, so
prevents breaking changes.
2023-04-06 16:18:07 -07:00
Nathan Rajlich
ee4ba6ccbe [all] Use correct "license" field in package.json (#9754)
Follow-up to #9696. Ensures that all packages in this repository have
the correct "license" field in their respective `package.json` files set
to "Apache-2.0", to match the `LICENSE` file at the root of the
repository.

The `LICENSE` file the authoritative source, so the "MIT" value was
incorrect. This change corrects the previous values and is not
considered a relicensing.
2023-04-06 15:33:55 -07:00
Ethan Arrowood
07a09b7880 [cli] refactor pkg.ts into @vercel-internals/get-package-json (#9719)
Extracts the logic from `pkg.ts` into a new utility function
`getPackageJSON` from `@vercel-internals/utils`.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
2023-04-06 12:18:04 -06:00
JJ Kasper
b62c40586a [next] Update allowQuery test (#9758)
These values are now expected to be prefixed so we can isolate them from normal query params. 

x-ref: https://github.com/vercel/vercel/actions/runs/4624385719/jobs/8179201620?pr=9719#step:8:2982
2023-04-06 17:37:24 +00:00
Vercel Release Bot
d07eb34e38 [tests] Update Gatsby fixture versions (#9760)
Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`
2023-04-06 16:14:07 +00:00
Ethan Arrowood
46d0503361 Fix update gatsby fixture cron job (#9725)
This PR fixes the gatsby fixture update script to correctly create pull
requests after it updates the fixtures.
2023-04-06 09:56:04 -06:00
Steven
349df907a8 [tests] Skip broken test temporarily (#9753)
Currently, `next@canary` is broken so we should temporarily skip this
test until it can be fixed


https://github.com/vercel/vercel/actions/runs/4622527617/jobs/8176298610?pr=9719#step:8:1695

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Ethan Arrowood <ethan.arrowood@vercel.com>
2023-04-05 19:10:00 -06:00
Espen Hovlandsdal
e5f5ba0ae8 [frameworks][fs-detectors] Use correct "license" field in package.json (#9696)
Makes the "license" field in these two packages' `package.json` files
be consistent with the LICENSE file in the root of the repository.
2023-04-05 15:04:27 -07:00
Steven
b2ccbf4881 [tests] update pnpm version to 7.31.0 (#9751)
- Closes #9750
2023-04-05 15:17:57 +00:00
Kiko Beats
434c794713 [tests] move test files to subdirectory (#9749)
Some unit tests didn't run since Aug 2022 because they are not included as part of the testing command.

This PR introduce `unit` and `integration` folders for testing, so anything that it's placed there will be run as part of the testing command.
2023-04-04 16:49:41 +00:00
Vercel Release Bot
d8f5052d9a [remix] Upgrade @remix-run/dev to version 1.15.0 (#9740)
This auto-generated PR updates @remix-run/dev to version 1.15.0
2023-03-31 21:49:36 +00:00
Nathan Hammond
10d14488db [fs-detectors] Fix turbo@1.8 all filters are inferred (#9680)
We no longer need to specify the active folder for `turbo` to identify the context correctly.
2023-03-31 21:02:30 +00:00
Sean Massa
c29f2b2fbd [tests] update typescript version used in next fixtures (#9739)
Updates the typescript version in next fixtures to accommodate newer syntax used in types for `next@canary`.
2023-03-31 20:04:02 +00:00
Nathan Rajlich
46348201b4 Publish Stable
- @vercel/build-utils@6.7.0
 - vercel@28.18.3
 - @vercel/client@12.4.8
 - @vercel/fs-detectors@3.8.8
 - @vercel/gatsby-plugin-vercel-builder@1.2.6
 - @vercel/go@2.4.3
 - @vercel/hydrogen@0.0.61
 - @vercel/next@3.7.3
 - @vercel/node@2.10.2
 - @vercel/python@3.1.57
 - @vercel/redwood@1.1.13
 - @vercel/remix-builder@1.8.3
 - @vercel/ruby@1.3.74
 - @vercel/static-build@1.3.21
2023-03-29 12:25:26 -07:00
Nathan Rajlich
509926545e [build-utils] Rename Lambda experimentalResponseStreaming prop to supportsResponseStreaming (#9721) 2023-03-29 12:11:09 -07:00
Sean Massa
70c8b32cf0 [tests] Split CLI integration tests into chunks (#9688)
Welcome to the grand splitting of CLI integration tests:

- replaced `test-cli` test suite with `test-e2e`
- made some small fixes along the way
- split integration tests into 3 files
- moved shared logic to `packages/cli/test/helpers/*`
- simplified `_execa` / `execa` / `execute` usage into `execCli` and `exec`
    - simplified arguments required to make these work
- defaulted `execCLI` to set `NO_COLOR=1` to make assertions simpler in tests that aren't testing color/emoji support
- expanded functionality of `formatOutput` to handle error states
- centralized temp dir handling and cleanup
- enhanced `waitForPrompt` to:
    - more clearly show what it was waiting for
    - support waiting for regex, string, or a function that returns a boolean
    - show what was the most recent thing it saw
    - end early if the process it's monitoring exits
- removed some test pollution where unnecessary, shifted some into `beforeAll`
- renamed unit tests helper from `setupFixture` to `setupUnitFixture` to avoid confusion with the new shared helper `setupE2EFixture`


Some of this could be pulled out into a separate PR, but the feedback cycle is a slog, which this PR is helping to address. I'd be happy to discuss what could be pulled out, but I'd also be happy to get the whole thing through.

---

Wait for prompt failures:

<img width="939" alt="CleanShot 2023-03-27 at 10 24 21@2x" src="https://user-images.githubusercontent.com/41545/227987773-a3582549-32f9-4131-8a35-7be7cc265b66.png">

---

Current Timing:

```
Tests / test-e2e (vercel, 1, ubuntu-latest) (pull_request) Successful in 3m
Tests / test-e2e (vercel, 2, ubuntu-latest) (pull_request) Successful in 8m
Tests / test-e2e (vercel, 3, ubuntu-latest) (pull_request) Successful in 8m
```

---

Before merge, I'll mark the original `CLI` integration test suite as no longer required.
2023-03-29 07:44:42 +00:00
Sean Massa
54514a44af Publish Stable
- @vercel/build-utils@6.6.0
 - vercel@28.18.2
 - @vercel/client@12.4.7
 - @vercel/fs-detectors@3.8.7
 - @vercel/gatsby-plugin-vercel-builder@1.2.5
 - @vercel/go@2.4.2
 - @vercel/hydrogen@0.0.60
 - @vercel/next@3.7.2
 - @vercel/node-bridge@4.0.0
 - @vercel/node@2.10.1
 - @vercel/python@3.1.56
 - @vercel/redwood@1.1.12
 - @vercel/remix-builder@1.8.2
 - @vercel/ruby@1.3.73
 - @vercel/static-build@1.3.20
2023-03-27 22:25:08 -05:00
Ethan Arrowood
0db8fadf74 [build-utils] add pnpm v8 auto detection (#9720)
Adds automatic detection for pnpm v8 based on lockfile v6
2023-03-27 23:07:39 +00:00
Sean Massa
6f01e5ab75 [cli] support build -y shorthand (#9717)
The `build` command wasn't supporting the `-y` shorthand for `--yes`. Now it does.

I looked at the other uses and they all seem fine.
2023-03-27 15:18:16 +00:00
Kiko Beats
78d45f9e7e [node-bridge] add feature flags support (#9713)
This PR allows executing conditional logic based in feature flags.

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-03-26 10:34:12 +02:00
Kiko Beats
22e1a6a9ce [node-bridge]: remove API Gateway normalization (#9711)
We no longer use since a long time ago
2023-03-24 20:12:36 +01:00
Steven
8391734b5e [build-utils] Fix system env var detection for prefixed env vars (#9709)
This PR fixes a bug that was causing too many env vars to be exposed to the frontend by adding the framework `envPrefix`.

Some frameworks, such as CRA, will include all of these in the frontend even if not explicitly used so we must only prefix known [System Environment Variables](https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables).

This PR adds an allowlist to ensure this is handle properly.

- Fixes https://linear.app/vercel/issue/VCCLI-639
2023-03-24 05:45:27 +00:00
Sean Massa
6a7fa1526c Publish Stable
- vercel@28.18.1
 - @vercel/gatsby-plugin-vercel-builder@1.2.4
 - @vercel/next@3.7.1
 - @vercel/node@2.10.0
 - @vercel/remix-builder@1.8.1
 - @vercel/static-build@1.3.19
2023-03-23 14:45:33 -05:00
Nathan Rajlich
64b15d2409 [remix] Fix zero matching on sub catch-all routes (#9707)
Fixes https://github.com/vercel/remix/issues/20.
2023-03-23 12:35:46 -07:00
Gal Schlezinger
40f73e7978 [node] support node:[lib] in vc dev (#9694)
- [node] add edge-node-compat-plugin
- [node] implement edge-handler
2023-03-23 17:48:49 +00:00
Nathan Rajlich
4c9ca27195 [examples] Remove entry.server.tsx file from "remix" template (#9698)
This file is now optional, and a default implementation is used when the
file does not exist.
2023-03-23 11:35:05 -04:00
Steven
a847ef43fd [tests] Try publishing with provenance (#9706)
This is a follow up to #9583 since it didn't work as expected.
2023-03-23 11:34:46 -04:00
JJ Kasper
3b466232a9 [next] Remove extra env variables (#9704)
These env variables were temporarily added to bust turbo/nx cache although this should no longer be needed as a proper fix has been landed in Next.js itself. 

x-ref: [slack thread](https://vercel.slack.com/archives/C04Q0GWSB8W/p1679518040946589)
2023-03-22 21:36:40 +00:00
Chris Barber
efdeea9db2 [tests] Disable Turbo's update notifier (#9302)
Since switching to the canary releases of Turbo, we are seeing the
update notification often. We have a cron job
(https://github.com/vercel/vercel/pull/9301) that will keep this
up-to-date for us, so we don't need to have Turbo notify us of updates.

<img width="587" alt="image"
src="https://user-images.githubusercontent.com/97262/214372374-a2682014-2deb-4942-b694-fd140c26a6ef.png">
2023-03-22 14:39:36 -05:00
Sean Massa
ab9915af32 Publish Stable
- @vercel/build-utils@6.5.0
 - vercel@28.18.0
 - @vercel/client@12.4.6
 - @vercel/fs-detectors@3.8.6
 - @vercel/gatsby-plugin-vercel-builder@1.2.3
 - @vercel/go@2.4.1
 - @vercel/hydrogen@0.0.59
 - @vercel/next@3.7.0
 - @vercel/node@2.9.14
 - @vercel/python@3.1.55
 - @vercel/redwood@1.1.11
 - @vercel/remix-builder@1.8.0
 - @vercel/ruby@1.3.72
 - @vercel/static-build@1.3.18
2023-03-22 12:37:51 -05:00
Chris Barber
d6dc27638c [build-utils][next] Add prerender source path (#9686)
Adds the `sourcePath` for ISR prerender lambdas so that the front end can associate derived pages with the source route.

There's an accompanying `api` PR (https://github.com/vercel/api/pull/17940) which uses this deployment's tarballs to test the functionality. Here's the result:

![image](https://user-images.githubusercontent.com/97262/226947180-a8e6b75e-f6a5-44fa-8034-08bd24569f3f.png)

Linear: https://linear.app/vercel/issue/VCCLI-410/communicate-how-functions-are-bundled
2023-03-22 17:16:44 +00:00
Sean Massa
0fb0601d19 [node] Improve edge-handler-template error handling (#9697) 2023-03-22 11:31:44 -05:00
Nathan Rajlich
ce25dec97d [remix] Inject @vercel/remix package instead of @vercel/remix-entry-server (#9684)
The `handleRequest()` function has been moved to the `@vercel/remix` package, so we can deprecate `@vercel/remix-entry-server` entirely and install `@vercel/remix` in the project instead, when there is no `app/entry.server.tsx` file defined in the project already.
2023-03-22 01:06:14 +00:00
Nathan Rajlich
20bd71ce70 [node][remix] Update nft conditions to include "edge-light" for Edge Functions (#9700) 2023-03-21 23:59:49 +00:00
Sean Massa
4c77dab5cb [tests][cli] convert CLI integration tests to TS (#9672)
Converts the CLI integration tests to TypeScript. This will make it easier to pick apart the test pollution.
2023-03-18 18:21:45 +00:00
Sean Massa
151b0dfb63 [cli] handle BUILD_UTILS_SPAWN_* errors (#9689)
Some condition in the system caused `BUILD_UTILS_SPAWN_1` errors to be thrown for failed deployments. The error handling logic wasn't handling this properly, causing the error message to never show up in the output.

```
Error: Unexpected error. Please try again later. ()
```
2023-03-17 22:12:23 +00:00
Nathan Rajlich
42e9bbea5b [examples] Update "remix" template to use @vercel/remix package (#9683) 2023-03-17 21:47:05 +00:00
Steven
c0471302e9 [cli] Ignore vc build subdirectory warning on vercel (#9685)
This warning is only relevant when running `vc build` locally so we can hide it for Vercel deployments.

I noticed this in the build logs here:

<img width="862" alt="image" src="https://user-images.githubusercontent.com/229881/225774670-9b4aecf5-d020-489f-819f-7b55ce96f877.png">
2023-03-16 23:57:33 +00:00
Nathan Rajlich
b2c68f1301 Publish Stable
- @vercel/build-utils@6.4.0
 - vercel@28.17.0
 - @vercel/client@12.4.5
 - @vercel/frameworks@1.3.3
 - @vercel/fs-detectors@3.8.5
 - @vercel/gatsby-plugin-vercel-builder@1.2.2
 - @vercel/go@2.4.0
 - @vercel/hydrogen@0.0.58
 - @vercel/next@3.6.7
 - @vercel/node@2.9.13
 - @vercel/python@3.1.54
 - @vercel/redwood@1.1.10
 - @vercel/remix-builder@1.7.0
 - @vercel/routing-utils@2.1.11
 - @vercel/ruby@1.3.71
 - @vercel/static-build@1.3.17
 - @vercel/static-config@2.0.14
2023-03-16 12:23:51 -07:00
Vedant
9712640fe3 [go] Add support for Go 1.20 (#9367)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-03-16 14:11:49 -05:00
Chris Barber
0dd3711f63 [go] Go builder improvements (#9576)
This PR fixes a handful of Go builder issues all related to the selected Golang version being used to build the function:

- `go.mod` version ignored for `vc build` and `vc dev`, uses system `PATH` version only
- `vc dev` fails if `go.mod` does not exist
- If the analyze bin doesn’t exist, downloads golang into `.vercel/cache/golang` instead of a global shared dir
- When running `vc dev`, doesn’t reuse go build code/common settings
- go tidy fails when `go.mod` set to 1.19 or 1.20, but 1.18 or older is installed
- `vc build` builds wrong arch on Apple Silicon/arm64
- `vc build` on Windows doesn't properly resolve "builds" in `vercel.json` due to posix separator issue
- `vc build` on Windows fails with `package <pkg/name> is not in GOROOT` due to posix separator issue
- Removed `actions/setup-go` from all test workflows

I added a test that tests the `go tidy` issue.
2023-03-16 19:05:09 +00:00
Chris Barber
4b657debed [cli] Honor --local-config when present during vc build (#9675)
As reported https://github.com/vercel/vercel/discussions/9648, `vc build` does not honor the `--local-config <file>` option.

`vc build` will only load the `vercel.json` (or `now.json`) in the `workPath` which is based on the `rootDirctory`.

If `--local-config` is specified in the command line arguments, then it should take precedence.
2023-03-16 18:31:43 +00:00
Sean Massa
ffdca76155 [gatsby-plugin-vercel-builder] link instead of move (#9673)
When creating the `./vercel/output/static` dir...

**Moving the `public` dir** is what currently happens. This causes Gatsby to believe that the build was not complete:

> info We've detected that the Gatsby cache is incomplete (the .cache directory exists but the public directory does not). As a precaution, we're deleting your site's cache to ensure there's no stale data.

**Copying the `public` dir** is not an option because it can cause a build to run out of space.

**Symlinking the `public` dir** would work, but it would require more changes throughout the system to make sure the symlink was followed properly.

**Hard Linking the `public` dir's files** is the best option. This PR links the directories instead of moving them. We did look for a library that already does the `hardlinkFileTree` thing, but couldn't find one.

---

**Testing**

This was manually tested with real deployments.

---

* paired with @TooTallNate 
* [user report](https://github.com/vercel/vercel/issues/9452#issuecomment-1432858615)
2023-03-16 18:00:56 +00:00
Vladislav Ponomarev
af7b34aa45 [node] Handle multi-protocol in Edge Functions (#9502)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
fix #9501
2023-03-16 11:01:07 -05:00
Sean Massa
e210977a9c [tests] update python tests to use zero config (#9668)
This PR is some cleanup before splitting python e2e tests.

Changes:

- use `probes.json`
- use `/api` autodetection instead of `builds` array

---

I was also trying to figure out why these tests are so much faster when run locally (293s) vs. CI (1099s). I encountered issues trying to view the build logs for the deployments that are made.
2023-03-16 14:41:40 +00:00
Nathan Rajlich
1c2ef37173 [remix] Remove symlink creation warning (#9679)
We're now going to encourage users to use `@vercel/remix` instead of `@remix-run/node`. So switch the symlink warning to a `debug()` call instead.
2023-03-16 09:47:13 +00:00
matamatanot
65bbcd3e62 [Astro example] Replace npm with pnpm (#9662)
Based on lockfile and `.npmrc`, pnpm seems to be correct.
2023-03-14 17:52:04 -07:00
Vercel Release Bot
5caf73380d [remix] Upgrade @remix-run/dev to version 1.14.2 (#9676)
This auto-generated PR updates @remix-run/dev to version 1.14.2
2023-03-15 00:32:54 +00:00
Sean Massa
395929b36a [tests] remove comment (#9671)
We don't need this comment.
2023-03-14 16:18:56 +00:00
Sean Massa
0e235a926a [tests][cli] CLI Integration tests - better failure messages (#9667)
Co-authored-by: Steven <steven@ceriously.com>
2023-03-14 10:48:27 -05:00
Nathan Rajlich
f1bdc0bfd1 [remix] Rename @vercel/remix to @vercel/remix-builder (#9665)
We're changing the name of the Remix Builder to free up the name `@vercel/remix` for user-facing usage within Remix applications.
2023-03-13 22:10:52 +00:00
Amy
59ca86365c [docs] Update issue and discussion templates (#9666)
Updates the existing [issue
template](https://github.com/vercel/vercel/issues/new/choose) and adds
[new discussion
forms](https://docs.github.com/en/discussions/managing-discussions-for-your-community/syntax-for-discussion-category-forms)
to direct Vercel platform questions to
https://github.com/vercel/community/discussions

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-03-13 17:27:50 -04:00
Nathan Rajlich
13d54b2095 [remix] Support optional entry.{server,client}.tsx file (#9620)
Remix v1.14.0 added support for having no `app/entry.server.tsx`/`app/entry.client.tsx` files in a project (there are default versions bundled into `@remix-run/dev`). Projects configured like this are currently failing because we symlink our forked version of the `remix` CLI into the project, so it cannot resolve the necessary modules at build time.

To solve this, instead of relying on the default versions of these files in `@remix-run/dev` package, we'll include our own versions in `@vercel/remix`, and physically copy them into the project dir. This way, the modules used will be properly resolved relative to the project's own `node_modules` dir.

Our default version of `app/entry.server.tsx` is also slightly different then upstream one, because it uses `@vercel/remix-entry-server` to enable isomorphic React streaming on both Node + Edge runtimes. Because of this, if that dependency is not present, then we'll automatically install the dependency at build-time.
2023-03-13 20:47:56 +00:00
Steven
bada86b8d6 [tests] Add prettier check (#9664)
This PR fixes the formatting on several files that were never run through `prettier`.

It also makes sure to run `prettier` in CI to to [fail fast](https://github.com/vercel/vercel/actions/runs/4408442998/jobs/7723453978) when the incorrect formatting is attempted.
2023-03-13 19:55:59 +00:00
Ethan Arrowood
7ec377757d [cli] update monorepo default setting log (#9654)
Updates the `setMonorepoDefaultSetting` log
2023-03-10 19:23:38 +00:00
Vercel Release Bot
8040c8806b [examples] Upgrade Next.js to version 13.2.4 (#9647)
This auto-generated PR updates Next.js to version 13.2.4
2023-03-10 16:34:54 +00:00
Chris Barber
2b1c8d89d4 [docs] Add more info about prepareCache (#9644)
I felt the `prepareCache()` docs could use an additional note and example.
2023-03-10 15:55:13 +00:00
Sean Massa
c5e9ccfacf [tests] convert CLI Integration tests from ava to jest (#9632)
Co-authored-by: Steven <steven@ceriously.com>
2023-03-09 18:34:03 -06:00
Sean Massa
66fe3db888 [tests] add tests to edge handler template (#9528)
The Edge Handler wrapping logic we add during `vc dev` was not testable. This PR refactors it to be testable and adds some basic tests.
2023-03-08 22:56:51 +00:00
Steven
765ec05cea [next] Fix i18n for app dir and sublocales (#9623)
- Applies this fix again #9582
- Applies a test for https://github.com/orgs/vercel/discussions/1714
2023-03-08 20:50:45 +00:00
Chris Barber
413706d72a [tests] Bump test timeouts for slow tests (#9631)
This PR address the following slow tests:

* https://linear.app/vercel/issue/VCCLI-560/flakey-test-login-with-no-color
* https://linear.app/vercel/issue/VCCLI-561/flakey-test-[vercel-dev]-04-create-react-app
* https://linear.app/vercel/issue/VCCLI-563/flakey-test-build-›-should-build-with-vercelnode
* https://linear.app/vercel/issue/VCCLI-574/flakey-test-build-output-api-v1-should-detect-the-output-format
* https://linear.app/vercel/issue/VCCLI-578/flakey-test-importbuilders-›-should-install-and-import-1st-party
* https://linear.app/vercel/issue/VCCLI-580/flakey-test-creategitmeta-›-detects-dirty-commit
2023-03-08 18:44:13 +00:00
Sean Massa
9bc8817f92 [tests] remove eslint from fixture (#9629)
In a previous PR https://github.com/vercel/vercel/pull/9622/files#diff-508a8f08333e1f42e2b2f02e99081c181802b6b2e7baa4e75c18e51e1e703ce4, this fixture was added which contained an eslint config file. We do have these fixtures eslint ignored, but it seems the presence of this config file re-enables it. This causes eslint failures inside the fixture to bubble up and fail lint checks.

This PR removes eslint from the fixture.
2023-03-08 16:42:11 +00:00
Steven
9da41dcafa [tests] Change test-unit to test-lint (#9627)
In a previous PR (#9615) the unit tests were moved to separate jobs in
the `test.yml` workflow. So we can now change the `test-unit.yml`
workflow to simply be `test-lint.yml` to avoid redundancy.

I also checked to see if this would affect code coverage but it turns
out codecov was [disabled a long time
ago](https://app.codecov.io/gh/vercel/vercel).
2023-03-08 10:17:44 -05:00
Steven
f1ab5704f1 [cli] Fix example list api to exclude node_modules (#9626)
<img width="219" alt="image"
src="https://user-images.githubusercontent.com/229881/223744886-e4bf430d-078c-49c4-81c3-0c30dce08f2e.png">
2023-03-08 10:04:33 -05:00
Nathan Rajlich
d8cf3e8831 [remix] Add turborepo monorepo E2E test (#9622)
Adds a Remix E2E test with a Turborepo monorepo configuration.
2023-03-08 06:58:18 +00:00
Steven
c06209901c [tests] Run unit tests concurrently in chunks (#9615)
We can separate each package `test-unit` into a separate job. This will help isolate problems and we can re-run CI for a specific package.
2023-03-07 23:50:21 +00:00
Ethan Arrowood
f20756344e [internals] Initialize @vercel-internals/utils and create @vercel-internals/tsconfig (#9618)
- Creates `@vercel-internals/tsconfig`
- Changes `@vercel-internals/types` to depend on `@vercel-intenrals/tsconfig`
- Creates `@vercel-internals/utils`

Moving these to another PR:
- ~Moves all top level util files from `@vercel/cli` to `@vercel-internals/utils`~
- ~Updates all relevant imports within `@vercel/cli` to use `@vercel-internals/utils`~
2023-03-07 21:52:01 +00:00
Steven
21a440b832 Publish Stable
- @vercel/build-utils@6.3.4
 - vercel@28.16.15
 - @vercel/client@12.4.4
 - @vercel/fs-detectors@3.8.4
 - @vercel/gatsby-plugin-vercel-builder@1.2.1
 - @vercel/go@2.3.11
 - @vercel/hydrogen@0.0.57
 - @vercel/next@3.6.6
 - @vercel/node@2.9.12
 - @vercel/python@3.1.53
 - @vercel/redwood@1.1.9
 - @vercel/remix@1.6.2
 - @vercel/ruby@1.3.70
 - @vercel/static-build@1.3.16
2023-03-07 13:56:14 -05:00
Steven
48d925f105 Publish Stable
- @vercel/build-utils@6.3.3
 - vercel@28.16.14
 - @vercel/client@12.4.3
 - @vercel/fs-detectors@3.8.3
 - @vercel/gatsby-plugin-vercel-builder@1.2.0
 - @vercel/go@2.3.10
 - @vercel/hydrogen@0.0.56
 - @vercel/next@3.6.5
 - @vercel/node@2.9.11
 - @vercel/python@3.1.52
 - @vercel/redwood@1.1.8
 - @vercel/remix@1.6.1
 - @vercel/ruby@1.3.69
 - @vercel/static-build@1.3.15
2023-03-07 13:17:14 -05:00
Steven
011f6ff150 Revert "[next] Fix incorrect 404 when i18n and appDir configured" (#9617)
Reverts vercel/vercel#9582

https://github.com/orgs/vercel/discussions/1714
2023-03-07 13:15:28 -05:00
Sean Massa
cd09a38c19 [tests] skip recent flakey tests (#9613)
This test has been flakey on mac for a long time.
2023-03-07 17:21:53 +00:00
Ethan Arrowood
af239b5fa5 [internals] Create @vercel-internals/types (#9608)
Moves the type file out of the cli package and into its own standalone
package. utilizes `@vercel/style-guide` too for typescript config,
eslint, and prettier.
2023-03-07 08:44:25 -07:00
Chris Barber
38244c8ed6 [next] Populate middlewareRawSrc using middleware originalSource (#9602)
Next.js will pass the original middleware matching routes through to the middleware manifest once https://github.com/vercel/next.js/pull/46753 lands. This PR will take those original values and put them in the middleware route `middlewareRawSrc` property.

NOTE: The tests will need to be updated once the Next.js version is updated in the fixtures.
2023-03-07 06:04:41 +00:00
Nathan Rajlich
57e8ec13cf [remix] Support optional static path segments (#9607)
Fixes https://github.com/orgs/vercel/discussions/1707.
2023-03-07 00:50:37 +00:00
Nathan Rajlich
2e8423e24e [gatsby] Remove "gatsby" dependency, use typebox instead of ajv for validation (#9606)
The "gatsby" dependency is large and relies on native packages ("sharp" specifically, which are error prone because it attempts to download a precompiled binary, of which the CDN has been down before causing us to not be able to merge anything).

The package is only used for TypeScript types, and we've decided that including the package only for those types is not worth the trouble. The existing JSON schemas already validate at runtime that the Gatsby redux store provides the values that we depend on.

`ajv` was ditched in favor of TypeBox types, which provide both JSON Schema and validation using a simpler syntax.
2023-03-06 21:44:23 +00:00
Sean Massa
a92c68e0ff Publish Stable
- vercel@28.16.13
 - @vercel/next@3.6.4
 - @vercel/remix@1.6.0
2023-03-06 13:47:36 -06:00
Vercel Release Bot
84f3a5bc1b [tests] Upgrade Turbo to version 1.8.3 (#9604)
This auto-generated PR updates Turbo to version 1.8.3
2023-03-06 16:26:41 +00:00
JJ Kasper
186bd9bb51 [next] Fix api prefixed app routes serverless streaming (#9603)
Fixes: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1677753703572609)
2023-03-04 01:50:54 +00:00
Nathan Rajlich
9ae84ba05f [remix] Add test for escaped route paths (#9516)
In Remix routes, you can [use bracket notation to escape the filesystem routing behavior](https://remix.run/docs/en/1.14.0/file-conventions/routes-files#escaping-special-characters). For example `app/routes/receipt[.]pdf.tsx` would be available at path `/receipt.pdf` (whereas, unescaped, it would be at `/receipt/pdf`).

This adds an e2e test for that behavior.
2023-03-03 21:33:12 +00:00
Jeemin Choi(최지민)
a638755e95 [cli] change patch-inquirer-legacy to patch-inquirer (#8919)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-03-03 14:27:11 -06:00
Nathan Rajlich
15eb018f84 [remix] Clean up dev symlink upon config error (#9595)
Move the try/catch block to immediately after the symlink call, so that if reading the `remix.config.js` file throws an error or if there's an error parsing the `export const config` in a route, the catch block will clean up after itself properly.

I recommend reviewing with [whitespace changes hidden](https://github.com/vercel/vercel/pull/9595/files?w=1).
2023-03-03 20:02:27 +00:00
Ethan Arrowood
7f89aca52c [tests] Add more remix tests (#9600)
Adds some more tests to the remix project. 

- 05-root-only : tests a remix app with only a `root.jsx` route.
  - https://kentcdodds.com/blog/super-simple-start-to-remix
- 06-v2-routing : tests the remix v2 routing works
2023-03-03 18:18:14 +00:00
Nathan Rajlich
dc9ec1bc6d [remix] Return framework.version in build result (#9596) 2023-03-03 04:29:55 +00:00
Nathan Rajlich
df93b01248 [examples] Run prettier on Remix template (#9594) 2023-03-03 01:58:15 +00:00
Nathan Rajlich
fb37ad22ab [remix] Fix support for optional path params (#9590)
Changes the way that routes with optional params are stored on Vercel to not use `?` in the name, because it's not possible to have a route destination with a `?` that's pointing to a function.

So instead of the function with a name such as `:lang?`, it will be stored on Vercel with a name like `(:lang)`, which can be routed to.
2023-03-02 23:28:26 +00:00
Vercel Release Bot
684f69bc5b [remix] Upgrade @remix-run/dev to version 1.14.0 (#9593)
This auto-generated PR updates @remix-run/dev to version 1.14.0
2023-03-02 20:57:25 +00:00
Ethan Arrowood
ddae78458d Fix remix updater workflow when fetching latest version (#9592) 2023-03-02 11:54:29 -08:00
Nathan Rajlich
fc614a7a92 Publish Stable
- vercel@28.16.12
 - @vercel/remix@1.5.1
2023-03-02 09:00:40 -08:00
Nathan Rajlich
6e4ea0774e [remix] Make symlink logic of @remix-run/dev work in monorepos (#9591)
Utilize `require.resolve()` to determine the correct location of
`@remix-run/dev`, instead of assuming it's in
"node_modules/@remix-run/dev" relative to the project work path.

Fixes https://github.com/orgs/vercel/discussions/1671.

Manually tested with yarn and pnpm on this template:
https://github.com/remix-run/examples/tree/main/turborepo-vercel
2023-03-02 08:58:00 -08:00
Nathan Rajlich
cfc1c9e818 Publish Stable
- vercel@28.16.11
 - @vercel/next@3.6.3
 - @vercel/remix@1.5.0
2023-03-01 17:24:34 -08:00
Vercel Release Bot
62a872fc0e [remix] Upgrade @remix-run/dev to version 1.13.0-patch.2 (#9589)
This auto-generated PR updates @remix-run/dev to version 1.13.0-patch.2
2023-03-02 00:10:12 +00:00
Vercel Release Bot
03b5bfbaa2 [examples] Upgrade Next.js to version 13.2.3 (#9586)
This auto-generated PR updates Next.js to version 13.2.3
2023-03-01 23:34:51 +00:00
Nathan Rajlich
aa305e5c66 [remix] Add better error message when server build directory is missing (#9584)
Show a more helpful message instead of showing a cryptic error messsage:

> Error: ENOENT: no such file or directory, copyfile
'/var/task/node_modules/@vercel/remix/server-node.mjs' ->
'/vercel/path0/packages/web/build/server-node.mjs'

This is probably due to a bad user configuration (i.e. with Turbo), but
tell them to contact support anyways in case there is a different cause
that we would need to address.
2023-03-01 15:08:44 -08:00
Ethan Arrowood
2309c43fce add vercel/remix-run-dev updater workflow (#9588)
Adds a github workflow and javascript updater script that will update
the `@remix-run/dev` version to the latest release of
`@vercel/remix-run-dev`
2023-03-01 13:50:23 -08:00
Nathan Rajlich
0bbb06daa7 [remix] Support "regions", "memory" and "maxDuration" in static config (#9442)
Apply the `regions` configuration (for both Edge and Node) and `memory`/`maxDuration` (only for Node) in a page's static config export, i.e.

```js
export const config = { runtime: 'edge', regions: ['iad1'] }

// or for Node
export const config = { runtime: 'nodejs', regions: ['iad1'], maxDuration: 5, memory: 3008 }
```

Similar to `runtime`, these config values can be inherited from a parent layout route to apply to all sub-routes. Routes with common config settings get placed into a common server bundle, meaning that there may now be more than 2 functions created (previously was one Edge, one Node), allowing for more granularity between the server build bundles.
2023-03-01 21:45:10 +00:00
Nathan Rajlich
61de63d285 [remix] Split Edge and Node server builds using serverBundles config (#9504)
Utilize the [`serverBundles`](https://github.com/remix-run/remix/pull/5479) config option to generate two server bundle builds. One contains only the routes that should run in Node.js, and the other contains only the routes that should run in the Edge runtime. In the future we could update this configuration to generate more than two bundles to be more granular and allow for infinite scalability.

Because the `serverBundles` PR is not yet merged, this PR introduces usage of a forked version of `@remix-run/dev` which incorporates our changes. Hopefully usage of a fork is temporary, but it gets us unblocked for now.
2023-03-01 03:10:42 +00:00
Steven
1ca3704297 [next] Fix incorrect 404 when i18n and appDir configured (#9582)
Fix incorrect 404 when visiting the `/` route with `i18n` and `appDir` configured
2023-03-01 02:02:55 +00:00
Nathan Rajlich
ae4180b287 [tests] Use probes.json instead of vercel.json for e2e tests (#9556)
Makes it easier to test fixtures directly via CLI deployments.

Coincidentally, this also revealed that auto-detection of Remix apps wasn't working correctly if there's a `remix.config.mjs` file. So `@vercel/frameworks` is updated to account for that case as well.
2023-03-01 01:02:43 +00:00
Steven
40081cb319 Publish Stable
- vercel@28.16.10
 - @vercel/remix@1.4.3
2023-02-28 19:12:33 -05:00
Steven
9200be61d2 [tests] Publish with npm@9 (#9583)
https://vercel.slack.com/archives/C04DUD7EB1B/p1676488464681929
2023-03-01 00:09:40 +00:00
Nathan Rajlich
1390f6d2ee [remix] Gracefully handle symlink creation when updating Remix packages (#9569)
Fixes an edge-case error when changing the version of Remix and then making a deployment to Vercel when there is already an existing build cache:

> Error: EEXIST: file already exists, symlink '../.pnpm/@remix-run+server-runtime@1.5.0_biqbaboplfbrettd7655fr4n2y/node_modules/@remix-run/server-runtime' -> '/vercel/path0/node_modules/@remix-run/server-runtime'

This would happen because the symlink was created in a previous run, but no longer points to a valid path because it's a different version. To fix we'll delete the previous symlink when the target value does not match.
2023-02-28 22:51:58 +00:00
Nathan Rajlich
b78cfc9ba5 [remix] Set framework property on Lambda / EdgeFunction (#9579) 2023-02-28 22:16:05 +00:00
Chris Barber
803a9363f9 Publish Stable
- vercel@28.16.9
 - @vercel/gatsby-plugin-vercel-analytics@1.0.8
 - @vercel/gatsby-plugin-vercel-builder@1.1.11
 - @vercel/node-bridge@3.1.14
 - @vercel/node@2.9.10
 - @vercel/static-build@1.3.14
2023-02-28 15:32:23 -06:00
Chris Barber
4a0a3b64a2 [node] Added middlewareRawSrc to BOA route config (#9435)
Blocked by https://github.com/vercel/vercel/pull/9564

The build output's route configuration contains a compiled `src` from the list of `matchers` in middleware config, however we need to also save the original inputs so that we can render something meaningful in the web UI. The new prop added to the route is called `middlewareRawSrc` of type `string[]`.

This PR depends on https://github.com/vercel/api/pull/17231.

Linear: https://linear.app/vercel/issue/VCCLI-411/display-uncompressed-edge-middleware-matcher-show-the-list-of-matches
2023-02-28 21:26:26 +00:00
Mehul Kar
347c2de3a2 [tests] Adopt Workspace Configurations from turbo@1.8 (#9573) 2023-02-28 20:49:28 +00:00
Ethan Arrowood
a05cc11719 [tests] Fix gatsby cron job script - git diff operation (#9577)
as titled
2023-02-28 13:13:57 -07:00
Ethan Arrowood
55b999ea9b [tests] add missing -w option for pnpm in gatsby cron job script (#9575)
as titled
2023-02-28 13:05:31 -07:00
Ethan Arrowood
8babc3694f [tests] Fix gatsby cron job (#9574)
Changes logic so its a single npm call instead of multiple
2023-02-28 11:59:58 -08:00
Ethan Arrowood
6dc0321216 [tests] add missing __dirname from gatsby cron job script (#9572)
as titled
2023-02-28 11:40:05 -08:00
Ethan Arrowood
3df8c05792 [tests] Add cron job to update gatsby fixtures (#9510)
PR to add a cron job and script that automatically updates gatsby
fixture versions.
2023-02-28 11:32:00 -08:00
Sean Massa
e0f8bc9820 Publish Stable
- @vercel/build-utils@6.3.2
 - vercel@28.16.8
 - @vercel/client@12.4.2
 - @vercel/edge@0.3.1
 - @vercel/frameworks@1.3.2
 - @vercel/fs-detectors@3.8.2
 - @vercel/gatsby-plugin-vercel-builder@1.1.10
 - @vercel/go@2.3.9
 - @vercel/hydrogen@0.0.55
 - @vercel/next@3.6.2
 - @vercel/node-bridge@3.1.13
 - @vercel/node@2.9.9
 - @vercel/python@3.1.51
 - @vercel/redwood@1.1.7
 - @vercel/remix@1.4.2
 - @vercel/routing-utils@2.1.10
 - @vercel/ruby@1.3.68
 - @vercel/static-build@1.3.13
2023-02-28 10:26:29 -06:00
Chris Barber
ebd2e1822c [routing-utils] Add missing 'middlewareRawSrc' to route schema (#9564)
Need to add `middlewareRawSrc` to route schema so the build container will accept the new property.

This PR blocks https://github.com/vercel/vercel/pull/9435.

Linear: https://linear.app/vercel/issue/VCCLI-411/display-uncompressed-edge-middleware-matcher-show-the-list-of-matches
2023-02-28 03:59:06 +00:00
Steven
31bc2581f3 [cli] Remove unncessary warning when monorepo setting override (#9565)
This warning is not actionable by the user so this PR removes it.
2023-02-27 16:23:49 -05:00
Steven
96759a9fda [hydrogen] Add missing envPrefix (#9551)
- Follow up to #9326
2023-02-27 20:01:05 +00:00
Jimmy Lai
ad2864bca5 [next] add support for the integration hook file tracing (#9562)
Adds support for bundling properly the dependencies used by the experimental instrumentation hook file, `instrumentation.js`, by adding the generated nft file to the list of server deps

fixes NEXT-631
2023-02-27 18:58:12 +00:00
Sean Massa
40fbc993d7 [tests] extract noisey setup to make test clearer (#9509)
Clarify dev server tests with a small function extraction.
2023-02-27 17:05:27 +00:00
Sean Massa
1f30e56a6d [cli][dev] remove link to 404 FAQ (#9508) 2023-02-27 10:37:57 -06:00
Nathan Rajlich
58d6268899 [frameworks] Check for remix.config.mjs for "remix" auto-detection (#9558)
Moving this to a separate PR based on this comment:
https://github.com/vercel/vercel/pull/9556#discussion_r1117939290

This will need to be merged and released before the relevant E2E test in
#9556 will pass.

Co-authored-by: Steven <steven@ceriously.com>
2023-02-27 10:07:32 -05:00
Nathan Rajlich
4e6659ace7 [remix] Fix sending multiple response headers with the same name with Node.js (#9533)
i.e. `Set-Cookie`. Right now only one will be sent and others will be lost. This update matches the code being used in `@remix-run/vercel`.
2023-02-27 07:19:58 +00:00
Nathan Rajlich
769234b6a6 [remix] Inject Edge entrypoint into @remix-run/vercel during Edge Function creation (#9553)
There's [a PR](https://github.com/remix-run/remix/pull/5537) opened on
Remix to add an Edge compatible entrypoint to `@remix-run/vercel`. This
is only really needed specifically for projects that have a custom
server.js entrypoint file, which is not strictly necessary anymore, but
there are some edge cases where a project might still want to have one.
So this PR is necessary for those kinds of projects to be able to use
Edge runtime.

Even when they merge the PR, it would be good to leave this injection
code around for some time to continue support for older
`@remix-run/vercel` versions in existing projects.
2023-02-25 00:53:30 -08:00
JJ Kasper
53cab61e88 [next] Fix deploying with cached build (#9555)
This leverages the relative app dir field in the required files manifest when available so that we don't rely on absolute paths from a cached build since the cache can be restored in a separate context where the value no longer applies.

x-ref: https://github.com/vercel/next.js/pull/45864
x-ref: https://github.com/vercel/next.js/pull/46393
x-ref: https://github.com/vercel/next.js/discussions/39432#discussioncomment-4914549
x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1675821643786319)
2023-02-25 02:46:06 +00:00
Nathan Rajlich
3a65acfb32 [remix] Don't create output for Pathless Layout Routes without any child routes at the root level (#9539)
Fixes https://github.com/vercel/community/discussions/1587.
2023-02-25 01:17:01 +00:00
Nathan Rajlich
48eed7532a [tests] Properly test for multiple headers with same name in probes (#9538)
Updates the `responseHeaders` probe checks to properly test for multiple headers with the same name.

Previously the probes were using `headers.get()` which concats multiple headers into a single string, which results in the test not really checking if there are in fact multiple headers with the same name. Using `headers.raw()` allows us to properly test for that.

A couple of Python tests that were already checking for multiple `set-cookie` headers needed to be updated to match the full value, since the check now properly validates the full string match of each header (before it was basically just doing a `string.includes()` check).

This is a precursor for https://github.com/vercel/vercel/pull/9533.
2023-02-24 22:07:00 +00:00
Cody Olsen
f09d6fce85 [frameworks] add envPrefix to hydrogen framework (#9326)
Hydrogen uses the `PUBLIC_` env prefix, [it also supports
`VITE_`](8168cd2dd8/packages/hydrogen/src/framework/plugins/vite-plugin-hydrogen-config.ts (L127))
but [the docs only talk about
`PUBLIC_`](https://shopify.dev/custom-storefronts/hydrogen/environment-variables#public-variables).
2023-02-24 15:40:55 -05:00
Chris Barber
cc82c499db [cli] Added fetch dist-tags http status validation (#9549)
If for some reason the `get-latest-worker.js` fails to get the dist-tags, it doesn't check the status code and proceeds to `JSON.parse()` the response. If for example npm returns 401 Unauthorized, you get a cryptic JSON parse error message.
2023-02-24 20:14:53 +00:00
Steven
f0bc207717 [build-utils] Handle error during readConfigFile() (#9542)
This fixes a confusing error:

```
$ vercel build
Vercel CLI 28.16.6
Error: duplicated mapping key in "/vercel/path0/pnpm-lock.yaml" at line 1215, column -164:
      /@react-dnd/asap/4.0.1:
      ^
```
2023-02-24 18:02:35 +00:00
Steven
151c7f99ee [tests] Pass token to cron github actions (#9544)
https://github.com/actions/github-script#using-a-separate-github-token
2023-02-24 11:14:17 -05:00
Steven
61c2c494bf Revert "[tests] Update cron with token in git checkout" (#9543)
Reverts vercel/vercel#9541
2023-02-24 11:07:29 -05:00
Steven
7f49816129 [tests] Update cron with token in git checkout (#9541)
Hopefully this will fix the issue where actions do not run against the
automated PR.
2023-02-24 10:51:03 -05:00
Nathan Rajlich
7845bef826 Publish Stable
- vercel@28.16.7
 - @vercel/edge@0.3.0
 - @vercel/gatsby-plugin-vercel-builder@1.1.9
 - @vercel/next@3.6.1
 - @vercel/node-bridge@3.1.12
 - @vercel/node@2.9.8
 - @vercel/static-build@1.3.12
2023-02-24 04:04:16 -08:00
github-actions[bot]
7acb2e4b07 [examples] Upgrade Next.js to version 13.2.1 (#9536)
This auto-generated PR updates Next.js to version 13.2.1
2023-02-24 11:55:18 +00:00
Gal Schlezinger
abea002e93 [edge] Add RequestContext type (#9526)
Co-authored-by: Kiko Beats <josefrancisco.verdu@gmail.com>
2023-02-24 03:07:16 -08:00
Nathan Rajlich
2db9678bd4 [node-bridge] Fix multiple Set-Cookie headers in streaming mode (#9520)
Multiple `Set-Cookie` headers are being concat'd instead of being sent individually when in streaming mode.

**Non-streaming:**

```
$ curl -v https://01-remix-basics-eqztqyq3y.vercel-support.app/set-cookie 2>&1 | grep cookie
* h2h3 [:path: /set-cookie]
> GET /set-cookie HTTP/2
< set-cookie: foo=bar
< set-cookie: sessionId=38afes7a8
```

**Streaming:**

```
$ curl -v https://01-remix-basics-9b18alizh.vercel-support.app/set-cookie 2>&1 | grep cookie
* h2h3 [:path: /set-cookie]
> GET /set-cookie HTTP/2
< set-cookie: foo=bar,sessionId=38afes7a8
```
2023-02-24 04:03:37 +00:00
JJ Kasper
05f942c53f [tests] Update app-dir integration test (#9532)
The cache heuristic changed so there are now two separate serverless functions expected.
2023-02-24 00:29:34 +00:00
Nathan Rajlich
6c5f0b7aa0 Publish Stable
- vercel@28.16.6
 - @vercel/remix@1.4.1
2023-02-23 15:53:45 -08:00
Nathan Rajlich
fea05383b9 [remix] Ignore serverBuildPath from Remix config (#9531)
We are explicitly overriding `serverBuildPath` so there is no need to use the value that `readConfig()` gives to us.

Fixes #9524.
2023-02-23 23:52:27 +00:00
github-actions[bot]
247f49f765 [examples] Upgrade Next.js to version 13.2.0 (#9529)
This auto-generated PR updates Next.js to version 13.2.0

Co-authored-by: vercel-release-bot <infra+release@vercel.com>
2023-02-23 15:28:38 -05:00
Nathan Rajlich
231714c71b [remix] cd to the project directory during readConfig() (#9518)
Sometimes the `cwd` needs to be properly set for some Remix configurations. This is problematic in monorepos because the default `cwd` is the root of the monorepo, and not the project directory.

So `cd` to the project directory when reading the Remix config file to account for that.

Fixes https://github.com/kiliman/remix-flat-routes/issues/42.
Fixes https://github.com/vercel/vercel/discussions/9478.
2023-02-23 19:18:40 +00:00
Nathan Rajlich
73d6f0d0fa [remix] Update @remix-run/dev dep to v1.13.0 (#9519)
There were some fixes to thier new v2 filesystem routing that this will help with.

Related to https://github.com/remix-run/remix/issues/5322 and https://github.com/remix-run/remix/pull/5228.
2023-02-23 03:44:37 +00:00
Steven
34d199bd49 Publish Stable
- @vercel/build-utils@6.3.1
 - vercel@28.16.5
 - @vercel/client@12.4.1
 - @vercel/fs-detectors@3.8.1
 - @vercel/gatsby-plugin-vercel-builder@1.1.8
 - @vercel/go@2.3.8
 - @vercel/hydrogen@0.0.54
 - @vercel/next@3.6.0
 - @vercel/node@2.9.7
 - @vercel/python@3.1.50
 - @vercel/redwood@1.1.6
 - @vercel/remix@1.4.0
 - @vercel/ruby@1.3.67
 - @vercel/static-build@1.3.11
2023-02-22 20:23:55 -05:00
Steven
1dd421e1f6 [build-utils][next] Add images.contentDispositionType (#9513)
- Related to https://github.com/vercel/next.js/pull/46254
- Depends on https://github.com/vercel/api/pull/17434
2023-02-22 20:13:16 -05:00
Nathan Rajlich
a91690fb8a [tests] Remove watchPaths from remix test fixture (#9517)
Follow-up to https://github.com/vercel/vercel/pull/9512 which is a
revert of the test fixture.

The fixture was actually broken in the previous commit
(https://github.com/vercel/vercel/pull/9506) since it now is trying to
read the config file before running the Build Command. Having a setup
like this will not be able to be supported, especially in order to land
https://github.com/vercel/vercel/pull/9504.
2023-02-22 19:07:37 -05:00
Steven
264437c751 [tests] Increase test timeout from 5s to 10s (#9515)
Fixes this error:

```
@vercel/node:test-unit: FAIL test/dev.test.ts (14.891 s)
@vercel/node:test-unit:   × runs a mjs endpoint (5057 ms)
@vercel/node:test-unit:   × runs a esm typescript endpoint (5122 ms)
@vercel/node:test-unit: 
@vercel/node:test-unit:   ● runs a mjs endpoint
@vercel/node:test-unit: 
@vercel/node:test-unit:     thrown: "Exceeded timeout of 5000 ms for a test.
@vercel/node:test-unit:     Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
```


https://github.com/vercel/vercel/actions/runs/4247588973/jobs/7385801227#step:9:1039
2023-02-22 18:50:25 -05:00
Nathan Rajlich
b8cce66eff [remix] Simplify ESM detection of remix.config.js (#9512)
In a Turborepo setup, there was this in the `remix.config.js` file:

```js
  watchPaths: [require.resolve("ui")],
```

Since we attempt to `require()` the `remix.config.js` file in order to
determine whether or not it is using ESM syntax, this would fail since
the require happens before the Build Command is executed.

To fix, treat any non `ERR_REQUIRE_ESM` error as CJS, instead of
re-throwing the error. If there really is an issue with importing the
config, then that'll happen right after when `remix build` is doing it.
2023-02-22 15:22:18 -08:00
Nathan Rajlich
cbad57d14f [remix] Restore support for a custom server.js entrypoint file (#9506)
When the project defines a custom `server.js` file in `remix.config.js`,
then don't override that with the bundled
`server-node.mjs`/`server-edge.mjs` file. This allows for a custom
`getLoadContext()` function to remain supported.

In order for Edge runtime to be supported, a [companion
PR](https://github.com/remix-run/remix/pull/5537) for
`@remix-run/vercel` adapter has been created with a dedicated entrypoint
for when Edge runtime is being used. In order to support Edge on
previous versions of the adapter, we may end up patching the package to
enable support, but that will happen in a follow-up PR.

Related to https://github.com/orgs/vercel/discussions/1596.

---------

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-02-22 14:19:40 -08:00
Nathan Rajlich
4da176d26f [remix] Allow runtime to be defined from a parent route (#9473)
Make it so that the `export const config = { runtime }` value is "inherited" from a parent route, if it is defined.

For example, "edge" can be defined in `app/root.tsx`, and so all routes will use the Edge runtime by default, unless `"runtime": "nodejs"` is used more specifically in a route deeper in the route hierarchy.
2023-02-22 20:35:12 +00:00
Chris Barber
1f51e04387 [cli] Fix 'vc remove --safe <project>' (#9477)
`vc remove --safe <project>` has a unique code path that queries all deployments by project id. This function calls v4 deployments endpoint and returns the legacy deployment structure.

The problem is the `vc remove` command relies on the new `Deployment` structure defined by the v13 get deployment endpoint.

I've updated the `getDeploymentsByProjectId()` function to transform the legacy structure into the current one.

Fixes #9321 

Linear: https://linear.app/vercel/issue/VCCLI-538/vc-rm-project-safe-is-not-working
2023-02-22 18:02:54 +00:00
Sean Massa
756174714f [cli] fix content type determination logic (#9498)
The logic behind `getMimeType` only works for file names, not file paths. This PR fixes the logic to work regardless and adds a couple tests.
2023-02-22 17:23:12 +00:00
Ethan Arrowood
6e32832f94 [tests] Delete monorepo tests (#9499)
Deletes flaky monorepo tests as the logic is well tested within the fs-detectors repo.
2023-02-22 15:48:21 +00:00
Gal Schlezinger
e682e9cd7d [node] fix TypeScript + ESM in Windows (#9487)
ESM on Windows versions of Node.js require `--loader PATH` to be a `file://` protocol.
This PR allows `vc dev` to be used with both TypeScript and ESM
2023-02-22 05:54:39 +00:00
Sean Massa
b30f000d2a Publish Stable
- vercel@28.16.4
 - @vercel/next@3.5.2
2023-02-21 18:51:33 -06:00
JJ Kasper
f78051ada9 [next] Ensure .rsc outputs are not created for route handlers (#9503) 2023-02-21 16:41:54 -08:00
Don Alvarez
10bc74904c [docs] Improve docs for @vercel/next no pages built message (#9494)
After many hours of debugging, I tracked down that having an old Node
version (eg 14.x) listed in your Vercel project settings can result in
the build step failing with a confusing and unhelpful error message
"`@vercel/next` No Serverless Pages Built". Note that this is a case
where it "can" cause it to fail, including with NextJS 13.1.6 and Vercel
CLI 28.16.2, but it is not guaranteed to fail. I have six NextJS
projects. They have identical next.config.js, tsconfig.json,
eslintrc.js, and .gitignore files, and other than a few seemingly
non-critical dependencies they have identical package.json files. Four
of the six consistently built and deployed in the cloud without issue.
Two consistently failed to build in the cloud. All built successfully
locally including using vercel build locally, and all would vercel
deploy --prebuilt successfully. Switching all the vercel cloud project
settings from Node 14.x to Node 18.x enabled all the projects to build
and deploy successfully in the vercel cloud without needing local vercel
build and local vercel deploy --prebuilt steps.

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-02-21 11:32:03 -05:00
Steven
c8f7a9a874 [cli] Fix global detection for fnm (#9496)
Fix `--global` install detection when
[fnm](https://github.com/Schniz/fnm) was used to install node
2023-02-21 10:11:08 -05:00
Sean Massa
2fd3315221 Publish Stable
- vercel@28.16.3
 - @vercel/next@3.5.1
 - @vercel/remix@1.3.5
2023-02-21 08:53:23 -06:00
JJ Kasper
54ef027cbe [next] Fix rsc routes order (#9493)
This ensures we maintain the correct order for our rsc routes with
reference to middleware so that they match correctly. This also adds a
regression test to ensure it's working as expected.

Fixes: https://github.com/vercel/next.js/issues/45331
x-ref: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1676926522772859?thread_ts=1676926096.412539&cid=C035J346QQL)
2023-02-20 17:54:17 -08:00
Shu Ding
6620c7f600 [next] Add initial vary header to all prerendered pages when RSC is enabled (#9481)
This PR changes the fallback headers that relate to RSC to the defaults that Next.js currently uses. Also, it sets the initial `vary` header to all prerendered routes when RSC is enabled (`routesManifest?.rsc`), even for the pages directory. 

That's because although the pages directory won't return any RSC payload, it can still be used in a project that contains app routes. When the app route requests a page route for RSC data, it's important for the browser to not accidentally cache that result hence we need the `vary` header to set there as well.

More related discussions can be found [here](https://linear.app/vercel/issue/NEXT-382/add-vary-rsc-etc-header-to-all-responses-to-ensure-browser-caching).
2023-02-20 19:35:06 +00:00
JJ Kasper
38f40f1c15 [next] Handle prerender-manifest v4 (#9489)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-02-20 11:41:24 +01:00
Nathan Rajlich
63211b8b89 [remix] Add unit tests (#9469)
Moves parts of the `@vercel/remix` builder into util functions that have isolated unit tests. No functionality changes.
2023-02-17 18:46:33 +00:00
Ikko Eltociear Ashimine
83ee5ea2b8 [cli] Fix typo in get-latest-worker.js (#9470)
persistance -> persistence

Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-02-17 11:45:44 -05:00
Ethan Arrowood
f063645646 [examples] Update remix template (#9472)
Previous PR was merged automatically but need to fix a dependency
version
2023-02-17 09:42:26 -07:00
Ethan Arrowood
4f8c5e344d [examples] update remix template (#9455)
Updates our remix template so that it works with our new Remix changes
2023-02-17 15:10:17 +00:00
Nathan Rajlich
70a53515bd Publish Stable
- vercel@28.16.2
 - @vercel/fs-detectors@3.8.0
 - @vercel/next@3.5.0
 - @vercel/remix@1.3.4
 - @vercel/ruby@1.3.66
 - @vercel/static-build@1.3.10
2023-02-16 15:12:31 -08:00
Sean Massa
4d4f0fa672 [next] Add Operation Types to Next.js Lambdas (#9196)
In order to have Next.js Lambdas show their operation types more specifically in the build output in the dashboard, the builder needs to return the Lambdas with `operationType` set to the appropriate value.

This PR adds those values. This allows the Richer Deployment Outputs to show the different types of serverless functions:
<img width="228" alt="Screenshot 2023-02-03 at 3 49 42 PM" src="https://user-images.githubusercontent.com/41545/216717479-d02fbd4a-fa62-479d-8b65-bd77fdcdb26c.png">
2023-02-16 22:59:14 +00:00
Felix Haus
46c0fd153a [fs-detectors] Remove increments of 64 limit for function memory (#9465)
Missed this occurrence so it still prevents the upload of serverless
functions that have a mem value that is not dividable by 64.
Should be the last place before we can ship the documentation update.

#### Related PRs
- #9440

Co-authored-by: Steven <steven@ceriously.com>
2023-02-16 16:42:42 -05:00
Marc Greenstock
1c8b4717e3 [ruby] fix: HEAD requests (#9436)
When WEBrick receives `HEAD` requests it discards the body (i.e.
`req.body.nil? => true`), this causes Vercel to throw a
`BODY_NOT_A_STRING_FROM_FUNCTION` since it is expecting the serverless
function to respond with a string in the body.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Steven <steven@ceriously.com>
2023-02-16 16:41:56 -05:00
Nathan Rajlich
d52d26eaac [remix] Install Node globals (#9467)
Fixes https://github.com/vercel/community/discussions/1547.
Fixes https://github.com/vercel/community/discussions/1549.
2023-02-16 21:25:19 +00:00
Vincent Voyer
db65728fc4 Publish Stable
- vercel@28.16.1
2023-02-16 15:36:16 +01:00
Vincent Voyer
a788d06f85 [cli]: fix merging of vercel.json and build result crons (#9464)
Ensures that existing crons and crons from vercel.json are merged
together correctly.
2023-02-16 15:34:56 +01:00
Vincent Voyer
3d98d1cdea Publish Stable
- @vercel/build-utils@6.3.0
 - vercel@28.16.0
 - @vercel/client@12.4.0
 - @vercel/fs-detectors@3.7.14
 - @vercel/gatsby-plugin-vercel-builder@1.1.7
 - @vercel/go@2.3.7
 - @vercel/hydrogen@0.0.53
 - @vercel/next@3.4.7
 - @vercel/node@2.9.6
 - @vercel/python@3.1.49
 - @vercel/redwood@1.1.5
 - @vercel/remix@1.3.3
 - @vercel/ruby@1.3.65
 - @vercel/static-build@1.3.9
 - @vercel/static-config@2.0.13
2023-02-16 12:08:50 +01:00
Vincent Voyer
667af829c4 [build-utils][cli][client][node][next][static-config]: forward crons from vercel.json to config.json (#9454)
This PR changes the way cron jobs are being created in the build output
API. This is my first time contributing here. If you see something
unusual, let me know.

 Good for review

Our goal is to:
- Allow creating cron jobs via the `crons` property of `vercel.json` for
end users
- Allow framework authors to create cron jobs on Vercel via the `crons`
property of the Build Output API configuration

---

As you can see, we removed the previous implementation where cron jobs
could be configured at the function code level (export const cron = ""),
on top of vercel.json `functions` property. Here's why:

- All frameworks would have to implement the configure at the function
code level
- Not all frameworks can easily map a path to a specific function
(example: SvelteKit) and would have to bail on bundling functions inside
the same lambda
- Configuring a path + scheduler provides a better mapping of what cron
jobs are as of today: API routes on a schedule and not functions on a
schedule
- Dynamic routes Cron Jobs will be supported:
/api/crons/sync-slack-team/230
- Query parameters will be supported support:
/api/crons/sync-slack-team/230?secret=32k13l2k13lk21 (= securing cron
jobs v0)
- 100% frameworks compatibility from day one

Next.js and other frameworks may choose to implement their own cron jobs
feature that will then need to be configured through the `crons`
property of `config.json` (build output API).

cc @timneutkens @Rich-Harris 

Internal thread:
https://vercel.slack.com/archives/C04DWF5HB6K/p1676366892714349
2023-02-16 11:49:09 +01:00
Nathan Rajlich
1bb7b37e0c Publish Stable
- vercel@28.15.7
 - @vercel/next@3.4.6
 - @vercel/remix@1.3.2
2023-02-15 23:41:25 -08:00
Nathan Rajlich
ca81c133b9 [remix] Fix root-level splat path (#9457)
Fixes https://github.com/orgs/vercel/discussions/1545.
2023-02-16 07:32:53 +00:00
Luba Kravchenko
f332b7856c Adds framework fields to build outputs (#9449)
Adds framework to Lambda and edge build outputs so that we can distinguish which framework they originated from when certain features should be applied to specific frameworks.

This PR adds framework to the outputs. Part 1: https://github.com/vercel/vercel/pull/9448

ticket: ED-131

x-ref: [slack channel](https://vercel.slack.com/archives/C042LHPJ1NX)
2023-02-15 22:56:29 +00:00
Sean Massa
9308a0fda5 Publish Stable
- @vercel/build-utils@6.2.4
 - vercel@28.15.6
 - @vercel/client@12.3.10
 - @vercel/frameworks@1.3.1
 - @vercel/fs-detectors@3.7.13
 - @vercel/gatsby-plugin-vercel-builder@1.1.6
 - @vercel/go@2.3.6
 - @vercel/hydrogen@0.0.52
 - @vercel/next@3.4.5
 - @vercel/node@2.9.5
 - @vercel/python@3.1.48
 - @vercel/redwood@1.1.4
 - @vercel/remix@1.3.1
 - @vercel/routing-utils@2.1.9
 - @vercel/ruby@1.3.64
 - @vercel/static-build@1.3.8
2023-02-15 12:26:53 -06:00
Steven
c2f8a5990a [tests] Fix gh actions cron job to update next/turbo (#9453)
This token should run the tests automatically
2023-02-15 12:11:54 -05:00
JJ Kasper
fc2f0b919b [next] Ensure app routes are handled (#9450) 2023-02-15 10:00:24 +01:00
Luba Kravchenko
a606ab8678 [build-utils] add framework slug and version to build output (#9448)
Adds framework to Lambda and edge build outputs so that we can distinguish which framework they originated from when certain features should be applied to specific frameworks.

Breaking up https://github.com/vercel/vercel/pull/9447 into two parts:
This PR introduces the frameworks type. Part 2: https://github.com/vercel/vercel/pull/9449

ticket: ED-131

x-ref: [slack channel](https://vercel.slack.com/archives/C042LHPJ1NX)
2023-02-15 03:14:21 +00:00
Chris Barber
13062cd47d [routing-utils] Added middlewareRawSrc to RouteWithSrc type (#9443)
This PR adds a new `middlewareRawSrc` prop to the `RouteWithSrc` type which is used for edge middleware routes. The existing `middlewarePath` prop contains a regex of all the middleware `matcher` routes which isn't very user friendly on the front end.

By preserving the original middleware matchers, the front end can display the list in a much more presentable fashion.

This feature blocks 3 other PRs.
1. https://github.com/vercel/api/pull/17231 depends on `Route` type for schema validation and translates `middlewareRawSrc` to `rawMatchers` for front end consumption
2. https://github.com/vercel/vercel/pull/9435 sets the `middlewareRawSrc` in the BOA output
3. https://github.com/vercel/front/pull/19606 displays the `rawMatchers` under the Edge Middleware section for a deployment

Linear: https://linear.app/vercel/issue/VCCLI-411/display-uncompressed-edge-middleware-matcher-show-the-list-of-matches
2023-02-14 23:45:03 +00:00
Chris Barber
bb9faaed99 [test] Use execFileSync() to get processes (#9445)
`spawnSync()` does not throw if the command can't be found in the PATH or if an error occurs. If we use `execFileSync()`, it will throw and that was likely the desired behavior in this test utility function.
2023-02-14 22:59:52 +00:00
Sean Massa
881e43a0e2 Publish Stable
- @vercel/build-utils@6.2.3
 - vercel@28.15.5
 - @vercel/client@12.3.9
 - @vercel/fs-detectors@3.7.12
 - @vercel/gatsby-plugin-vercel-builder@1.1.5
 - @vercel/go@2.3.5
 - @vercel/hydrogen@0.0.51
 - @vercel/next@3.4.4
 - @vercel/node@2.9.4
 - @vercel/python@3.1.47
 - @vercel/redwood@1.1.3
 - @vercel/remix-entry-server@0.1.0
 - @vercel/remix@1.3.0
 - @vercel/ruby@1.3.63
 - @vercel/static-build@1.3.7
2023-02-14 15:38:34 -06:00
Steven
578a7742fe [next] Improve error message when routes-manifest.json not found (#9441)
The dashboard doesn't handle multiline errors very well because other lines are collapsed.

https://vercel.com/changelog/deployment-logs-filtering-now-available

<img width="1237" alt="image" src="https://user-images.githubusercontent.com/229881/218832497-0bcd9404-b4f5-49fe-9edd-bd6de6d8bb8f.png">


We also show the complete error in the top and it doesn't show newlines properly.

<img width="428" alt="image" src="https://user-images.githubusercontent.com/229881/218832603-065e0d4d-ae6e-4b44-b2db-b2fff063da58.png">

The "Learn More" link already has the relevant information so we can reduce this error message to a single line to improve the call to action.
2023-02-14 20:32:18 +00:00
Nathan Rajlich
2d84a64430 [remix-entry-server] Add initial implementation (#9417)
This adds a new package to the monorepo: `@vercel/remix-entry-server`

The purpose of this package is to provide most of the implementation of
the Remix `app/entry.server.tsx` file with proper support for the Vercel
Serverless and Edge runtimes, specifically in regards to React 18
streaming.

The reason that this package is necessary, as opposed to just updating
our Remix template, is due to the fact that Serverless and Edge runtimes
require a different implementation. This is because the
`react-dom/server` package exports different functions for the Node
(`renderToPipeableStream()`) vs. Edge (`renderToReadableStream()`)
bundles, and thus this package also has two different implementations
(by utilizing the `main` and `browser` fields in `package.json`).

Usage of this package in a Remix application's `app/entry.server.tsx`
file looks like:

```tsx
import handleRequest from "@vercel/remix-entry-server";
import { RemixServer } from "@remix-run/react";
import type { EntryContext } from "@remix-run/server-runtime";

export default function (
  request: Request,
  responseStatusCode: number,
  responseHeaders: Headers,
  remixContext: EntryContext
) {
  const remixServer = <RemixServer context={remixContext} url={request.url} />;
  return handleRequest(request, responseStatusCode, responseHeaders, remixServer)
}
```

Once this package is published then we can update our own Remix template
to utilize it, enabling React 18 streaming for both Vercel runtimes.
2023-02-14 10:09:07 -08:00
Felix Haus
200ac99647 [build-utils][cli] Remove 64 increment limit for serverless functions (#9440)
We no longer require the memory to be provided in steps of 64mb for
serverless functions.
Instead the memory can now be chosen freely from `128mb` to `3008mb` in
`1mb increments`.

Updates the `vercel.json` schema to reflect that change.
2023-02-14 13:08:40 -05:00
Felix Haus
1d3f2b5a62 [build-utils][cli] Update link to project-configuration (#9439)
The link to the documentation has changed.
It is now available under https://vercel.com/docs/concepts/projects/project-configuration

This updates:
- link generation `https://vercel.com/docs/configuration#project/*` -> `https://vercel.com/docs/concepts/projects/project-configuration#*`
-  Updates test files
- Updates static references of https://vercel.com/docs/configuration across the repo
2023-02-14 16:44:24 +00:00
Steven
8f49969585 [tests] Update tests script names (#9433)
### Description 

These script names are currently really long and that makes it difficult
to read.

In particular, the most important part (the package name) is often
truncated.

See before/after below.

## Before

<img width="302" alt="image"
src="https://user-images.githubusercontent.com/229881/218588978-b8ed9a7a-f4da-4d58-af3f-2b1a7087737d.png">

## After

<img width="290" alt="image"
src="https://user-images.githubusercontent.com/229881/218596895-65627ad0-2895-4bd7-8506-f5f545a419d3.png">
2023-02-14 10:31:46 -05:00
Steven
cfbfaa7cd0 [tests] Fix memory limit test (#9438)
This error message was adjusted recently
2023-02-14 09:58:10 -05:00
Nathan Rajlich
25747a7621 [remix] Support per-page Edge functions and replace "@remix-run/vercel" (#9375)
Adds support for server-side rendered Remix using Edge Functions. This runtime can be enabled on a per-page basis, by adding the following to a page within the `app/routes` directory:

```js
export const config = {
  runtime: 'edge'
};
```

Additionally, this PR further supersedes the `@remix-run/vercel` runtime adapter, because we will always inject our own server entrypoint. So the logic to ensure that package exists in the project's `package.json` has been removed (so this closes #9011). The only requirement is that the Remix project has `@remix-run/node` as a dependency, which is the case for the vanilla Remix template so I think that's a fair assumption.

To make Edge Functions work, we need to ensure that `remix build` is executed with a few specific configuration values in place, so this change wraps the existing `remix.config.js` file and adds our own to make sure those values are in place (and then cleans itself up after the build command is executed).

Finally, the reading of the Remix config logic was simplified by using the `readConfig()` function from the `@remix-run/dev` package, which also includes the routes manifest, so the hacky `vm` running logic to retrieve the manifest was able to be removed.

Closes #8784.
Closes #9011.

---

# To test this out:

1. Ensure that Remix dependencies are running _at least version `1.5.0`_ (which is when `writeReadableStreamToWritable()` was added to `@remix-run/node`).

2. Add the following line of code to any page in your Remix application’s `app/routes/*` directory:
    
    ```jsx
    export const config = { runtime: 'edge' };
    ```
    
3. Set an Environment Variable on your Vercel Project:
    - Name: `VERCEL_CLI_VERSION`
    - Value: `https://vercel-git-update-remix-edge.vercel.sh/tarballs/vercel.tgz`
    
4. Make a deployment, either by running `vercel deploy` in the CLI, or by pushing a Git commit to your repository which has a Vercel Git integration enabled.
2023-02-14 01:01:46 +00:00
github-actions[bot]
8d635beed7 [tests] Upgrade Turbo to version 1.7.4 (#9431)
This auto-generated PR updates Turbo to version 1.7.4
2023-02-14 00:01:45 +00:00
JJ Kasper
6225f050fa [next] Fix app-dir tests from new content-type (#9434)
x-ref: https://github.com/vercel/vercel/pull/9408
x-ref:
https://github.com/vercel/vercel/actions/runs/4168082693/jobs/7214887847
2023-02-13 18:22:33 -05:00
Steven
30a899bab1 [tests] Add workflow_dispatch to cron workflows (#9430)
This `workflow_dispatch` prop allows manual runs by clicking a button on
https://github.com/vercel/vercel/actions
2023-02-13 16:39:15 -05:00
Sean Massa
a010d8fe8a [cli] add slash before url for edge function errors (#9428)
Edge Functions and Serverless Functions were both updated to show the path of their entry points, but it turns out Serverless Function paths started with a slash and Edge Function paths did not.

The [related code for Serverless Functions](d628880942/packages/node-bridge/helpers.ts) does not need to be updated.

---

Before:

<img width="996" alt="CleanShot 2023-02-13 at 13 23 42@2x" src="https://user-images.githubusercontent.com/41545/218554154-2b112a68-2d68-4968-bae7-acf6e85a72a2.png">

---

After: 

<img width="921" alt="CleanShot 2023-02-13 at 13 20 22@2x" src="https://user-images.githubusercontent.com/41545/218554029-c3dce6b1-b01f-4a78-aa32-f6891ff16e51.png">
2023-02-13 21:37:16 +00:00
Steven
a9ff23fe22 [test] Switch to turbo main release line (#9429)
Per @tknickman, we don't need to be testing every turbo canary in this
repo, that will happen in the turborepo tests
2023-02-13 16:00:42 -05:00
Steven
b60d3f657a [tests] Update CI to Node.js 16 (#9397)
In an effort to speed up CI, we should update the lowest common
denominator to Node.js 16

Note: In April, Node.js 14 will reach EOL so we can update tsconfig
targets and ship a major semver at that time.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-02-13 15:59:05 -05:00
Nathan Rajlich
e7947a1b33 [node] Make NFT resolve "worker"/"browser" exports for Edge Functions (#9377)
This makes `react-dom` work as expected from within Edge Functions. Otherwise, NFT will only select the Node.js version of the files which do not work with react-dom within an Edge Function.
2023-02-13 20:27:37 +00:00
Sean Massa
95a4dcfb33 Publish Stable
- @vercel/build-utils@6.2.2
 - vercel@28.15.4
 - @vercel/client@12.3.8
 - @vercel/fs-detectors@3.7.11
 - @vercel/gatsby-plugin-vercel-builder@1.1.4
 - @vercel/go@2.3.4
 - @vercel/hydrogen@0.0.50
 - @vercel/next@3.4.3
 - @vercel/node-bridge@3.1.11
 - @vercel/node@2.9.3
 - @vercel/python@3.1.46
 - @vercel/redwood@1.1.2
 - @vercel/remix@1.2.13
 - @vercel/ruby@1.3.62
 - @vercel/static-build@1.3.6
2023-02-13 12:47:15 -06:00
Tim Neutkens
124b747b0e Read rscContentType from routes manifest (#9408) 2023-02-13 14:04:54 +01:00
Nathan Rajlich
a735527d8f [build-utils] Filter out files outside of cwd when glob is in "follow" mode (#9412)
Enables `glob()` to operate in "follow" mode, but filters out any values where a symlink points to a target that lives outside of the `cwd.
2023-02-11 20:42:39 +00:00
Sean Massa
d628880942 [cli][node][node-bridge] improve edge/serverless function error messages (#9410)
The error messages shown during `vc dev` when an Edge or Serverless functions returns a promise that ends up being rejected could be better.

Main changes:

- removed "socket hang up" error messages because they were not helpful to the user
- changed serverless function error handling to log explicitly and exit
- changed serverless function error message to include the request path
- changed edge function error message to include request path and a faked (but useful) stack trace

## Current

### In Production

**Serverless Function:** In production, for a serverless function rejected promise, you'll see this in the logs:

```
Unhandled Promise Rejection 	{
  "errorType": "Runtime.UnhandledPromiseRejection",
  "errorMessage": "Error: intentional break!",
  "reason": {
    "errorType": "Error",
    "errorMessage": "intentional break!",
    "stack": [
      "Error: intentional break!",
      "    at handler (/var/task/api/node.js:3:9)",
      "    at Server.<anonymous> (/var/task/___vc/__helpers.js:813:19)",
      "    at Server.emit (node:events:527:28)",
      "    at parserOnIncoming (node:_http_server:956:12)",
      "    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)"
    ]
  },
  "promise": {},
  "stack": [
    "Runtime.UnhandledPromiseRejection: Error: intentional break!",
    "    at process.<anonymous> (file:///var/runtime/index.mjs:1194:17)",
    "    at process.emit (node:events:539:35)",
    "    at process.emit (/var/task/___vc/__sourcemap_support.js:559:21)",
    "    at emit (node:internal/process/promises:140:20)",
    "    at processPromiseRejections (node:internal/process/promises:274:27)",
    "    at processTicksAndRejections (node:internal/process/task_queues:97:32)"
  ]
}
Unknown application error occurred
Runtime.Unknown
```

**Edge Function:** In production, for an edge function rejected promise, you'll see this in the logs:

```
Error: intentional break!
    at (api/edge.js:10:10)
```

In both cases, in the browser, you see the "This Serverless/Edge Function has crashed." template with no error message or stack trace.


### In `vc dev`


**Serverless Function:** In `vc dev`, for a serverless function rejected promise, you'll see this in the output:

```
Unhandled rejection: Error: intentional break!
    at handler (/Users/smassa/source/demo/edge-errors/api/node.js:3:9)
    at Server.<anonymous> (/Users/smassa/source/vercel/vercel/packages/node-bridge/helpers.js:813:19)
    at Server.emit (node:events:513:28)
    at Server.emit (node:domain:489:12)
    at parserOnIncoming (node:_http_server:998:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
Error: Failed to complete request to /api/node: Error: socket hang up
```

**Edge Function:** In `vc dev`, for an edge function rejected promise, you'll see this in the output:

```
Unhandled rejection: intentional break!
Error: Failed to complete request to /api/edge: Error: socket hang up
```

## After Changes

### In `vc dev`


**Serverless Function:** In `vc dev`, for a serverless function rejected promise, you'll see this in the output:

```
Rejected Promise returned from /api/node: Error: intentional break!
    at handler (/Users/smassa/source/demo/edge-errors/api/node.js:3:9)
    at Server.<anonymous> (/Users/smassa/source/vercel/vercel/packages/node-bridge/helpers.js:824:19)
    at Server.emit (node:events:513:28)
    at Server.emit (node:domain:489:12)
    at parserOnIncoming (node:_http_server:998:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
```

**Edge Function:** In `vc dev`, for an edge function rejected promise, you'll see this in the output:

```
Rejected Promise returned from api/edge: intentional break!
    at (api/edge.ts)
```

We can't show the real stack trace for Edge Functions because the bundling + VM execution mangles it. What's rendered here is a fake one, but it's still useful to the user.

If we currently showed the real stack trace for edge functions, it would look like:

```
Rejected Promise returned from api/edge: intentional break!
    at edge (evalmachine.<anonymous>:35:9)
    at FetchEvent.<anonymous> (evalmachine.<anonymous>:87:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async EdgeRuntime.dispatchFetch (evalmachine.<anonymous>:29:7)
    at async Server.handler (/Users/smassa/source/vercel/vercel/node_modules/.pnpm/edge-runtime@2.0.0/node_modules/edge-runtime/src/server/create-handler.ts:46:26)
```

## Follow Up

We'll look into improving the Edge Function error stack traces later.
2023-02-11 00:14:58 +00:00
chloetedder
084125d90f [fs-detectors] Add main to test package.json files (#9416)
Fix flakey tests
2023-02-10 22:56:01 +00:00
Steven
2b483b0fd0 [tests] Fix examples tests with shared util (#9415)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2023-02-10 16:32:45 -06:00
Sean Massa
fdcd86d37c [tests] add missing dep that used to be hoisted (#9413)
It looks like `find-up` was working before because of yarn hoisting, but not anymore. I don't know why this works sometimes and not others, though.

This module is imported from: https://github.com/vercel/vercel/blob/main/packages/cli/test/helpers/setup-fixture.ts#L1

I stuck with version `4.1.0` because that looks like the version being used before.

---

Trying to fix: https://github.com/vercel/vercel/actions/runs/4147054878/jobs/7174327469#step:9:2622
2023-02-10 21:33:38 +00:00
Steven
f5280cb375 [node] Fix incorrect stack trace of TS error (#9409)
### Description

TS has an option, `noEmitOnError`, that is used to either fail the build by throwing when `true` or just print the error and continuing to build when `false`.

This PR fixes the case when `noEmitOnError: false`. Previously showing an error stack trace but now it correctly shows the error message without the stack.

### Before

<img width="1186" alt="image" src="https://user-images.githubusercontent.com/229881/218186616-9e6f04ea-0256-4ed6-8705-50e8dd5090f5.png">

### After

<img width="1195" alt="image" src="https://user-images.githubusercontent.com/229881/218186818-526b2b6a-599e-43e1-aa7b-7f536887730a.png">
2023-02-10 20:29:45 +00:00
Steven
26773daf05 [tests] Add tests for examples (#9403)
These tests will run if one of the conditions is met:

- any change to `./examples`
- any changes to `./packages/frameworks`

The test ensures that examples can build and deploy without errors.

In a future PR, we could improve these tests to make requests to the
test deployment (like we do for probes).
2023-02-09 09:58:37 -05:00
Steven
8087b7804e [tests] Fix app-dir test assertion (#9404)
This was changed in `next@canary`
2023-02-09 09:56:17 -05:00
Chris Barber
c8690190f6 [cli] Update notification redesign (#9392)
This PR does a couple fantastic things:

1. Increases latest version check from once a week to once a day
2. Increases latest version notification from once a week to once every 3 days unless an even newer version is available
3. Update changelog link to all releases and make text an actual link
4. Redesign of the update notification to be more visible by wrapping in a box
5. Replace `boxen` (500KB) (used by `vc bisect`) with slimmed down built-in version (3.4KB)
6. Update notification appears at the end of the command regardless if an error occurred

Regular notification: displayed once every 3 days or sooner if a new release first day:

<img width="438" alt="image" src="https://user-images.githubusercontent.com/97262/217167938-40baa1fe-2ab7-4092-a8a0-c4a968d5fc17.png">

Same as above, but formats the notification to adapt to narrow terminals:

<img width="389" alt="image" src="https://user-images.githubusercontent.com/97262/217170374-b3f23ffc-47cc-45ca-aa0b-1dde4fb1c66c.png">

Whenever any command (aside from `help`) returns a non-zero exit code, show an additional message to encourage updating:

<img width="436" alt="image" src="https://user-images.githubusercontent.com/97262/217172208-b9e24e67-669f-4403-8bf2-29f896b27f06.png">

Linear: https://linear.app/vercel/issue/VCCLI-504/investigate-old-update-notifier-behavior
2023-02-09 05:03:52 +00:00
JJ Kasper
74f6cf31fc Publish Stable
- vercel@28.15.3
 - @vercel/gatsby-plugin-vercel-builder@1.1.3
 - @vercel/next@3.4.2
 - @vercel/static-build@1.3.5
2023-02-08 16:45:16 -08:00
JJ Kasper
abd5310e58 [next] Update env variable for output trace root (#9402)
Since turbo and nx only consider `NEXT_PUBLIC_` prefixed env variables for the cache key this ensures we expose variables that affect the build in that format as well so that an incompatible build cache isn't attempted to be leveraged. No additional tests were added here as this related to build cache which can't be reliably tested here. 

x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1675821643786319)
2023-02-09 00:38:18 +00:00
Steven
f3ef9696d7 [tests] Fix test for functions config (#9401)
This message was recently updated in the API response

- https://github.com/vercel/api/pull/17126

---------

Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-02-08 19:12:53 -05:00
Sean Massa
86eb67c3be [examples] update Vite example lockfile (#9400)
The [Vite example update](https://github.com/vercel/vercel/pull/8362)
looked like it would install dependencies just fine because if you
navigate to `./examples/vite` and run `pnpm i --frozen-lockfile`, it
will work. If instead you copy that example outside of this repo and run
the same command, you'll get an error.

We'll fix that elsewhere, but for now, let's fix the Vite example
itself.

---

* [Failed Deployment with Current
Example](https://vercel.com/endangeredmassa/vite-new-example/5vULFx1U5ob8t7sjuTGGw9AY8xdL)
* [Successful Deployment with Updated
Example](https://vercel.com/endangeredmassa/vite-new-example/4gVTJbUAdR4BmQfoxfhUrLrXpxx5)
2023-02-08 16:41:12 -05:00
MoskalykA
1ec44ee1e3 [examples] Bump Vite.js (#8362)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2023-02-08 11:48:06 -06:00
Nathan Rajlich
e24f42e9bc [gatsby-plugin-vercel-builder] Strip assetPrefix from pathPrefix (#9394)
Removes the `assetPrefix` value from the `pathPrefix` config value,
since Gatsby concats them for some reason.
2023-02-08 10:15:20 -06:00
JJ Kasper
c1c8b454cc Publish Stable
- @vercel/build-utils@6.2.1
 - vercel@28.15.2
 - @vercel/client@12.3.7
 - @vercel/fs-detectors@3.7.10
 - @vercel/gatsby-plugin-vercel-builder@1.1.2
 - @vercel/go@2.3.3
 - @vercel/hydrogen@0.0.49
 - @vercel/next@3.4.1
 - @vercel/node@2.9.2
 - @vercel/python@3.1.45
 - @vercel/redwood@1.1.1
 - @vercel/remix@1.2.12
 - @vercel/ruby@1.3.61
 - @vercel/static-build@1.3.4
2023-02-07 11:51:17 -08:00
JJ Kasper
e2105e47b5 [build-utils] Add passQuery field to Prerender (#9388) 2023-02-06 16:57:17 -08:00
최지민(Jeemin Choi)
76d58673fc [cli] Add --no-color mode (#8826)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-02-06 16:45:17 -06:00
Andy Bitz
a585969dd3 Publish Stable
- @vercel/build-utils@6.2.0
 - vercel@28.15.1
 - @vercel/client@12.3.6
 - @vercel/fs-detectors@3.7.9
 - @vercel/gatsby-plugin-vercel-builder@1.1.1
 - @vercel/go@2.3.2
 - @vercel/hydrogen@0.0.48
 - @vercel/next@3.4.0
 - @vercel/node@2.9.1
 - @vercel/python@3.1.44
 - @vercel/redwood@1.1.0
 - @vercel/remix@1.2.11
 - @vercel/ruby@1.3.60
 - @vercel/static-build@1.3.3
2023-02-06 17:24:54 +01:00
Andy
35eca33b44 [redwood] Consider all Lambda options (#9386) 2023-02-06 15:46:18 +01:00
Andy
d608153961 [next][build-utils] Add support for cron to vercel.json (#9374) 2023-02-06 12:28:41 +01:00
Bishal Shrestha
a4cfc5f943 [docs] Add troubleshooting step for no serverless pages error (#9333) 2023-02-03 15:23:20 -08:00
chloetedder
2eef3e3ddb [fs-detectors] Add fix for if monorepo and proj at root (#9353)
If there is a monorepo that has one project at the root level we want to
return commands without the relative to root prefixes

---------

Co-authored-by: Chris Barber <chris.barber@vercel.com>
2023-02-03 16:56:22 -06:00
Swarnava Sengupta
8120fd3d7a [examples] Update Astro example to v2 (#9371) 2023-02-03 14:12:29 -05:00
Andy McKay
ba498f3a8e [python] Cope with duplicate header values (#9205)
There are times when a request can arrive for a Python function with headers as a list. One of those examples is this header `x-vercel-proxied-for` which apparently is set twice. Example:

`[b'x-vercel-proxied-for', [b'207.81.134.243', b'172.71.147.74']]`

I took a quick scan through the other Python server implementations and I don't think any of them manipulate the value of the HTTP headers, the way the ASGI one does so I think we are good there.

To reproduce:

`curl https://..../ -H "foo: bar" -H "foo: bar"`

Will fail.

Fixes: https://github.com/vercel/vercel/issues/9132
2023-02-03 17:01:02 +00:00
Steven
b5a9408272 [node] Add log for unused config runtime (#9373)
Both `runtime: undefined` and `runtime: nodejs` have the same behavior
but we want to change that in the future.

The first step is to see if `runtime: nodejs` is currently used at all.
2023-02-03 10:46:18 -05:00
Nathan Rajlich
946f7f0bfc [remix] Remove render path (#9365)
Instead of outputting a single SSR function at `/render` path, scan the
build manifest file to determine the proper paths to output the SSR
function at.
2023-02-02 14:29:52 -08:00
Ethan Arrowood
804a3863e7 [cli] add charset to content-type headers for vc dev (#9364)
Adds `charset: utf8` to the `content-type` header
2023-02-02 01:07:08 +00:00
Andy Bitz
a4d16c681a Publish Stable
- @vercel/build-utils@6.1.0
 - vercel@28.15.0
 - @vercel/client@12.3.5
 - @vercel/fs-detectors@3.7.8
 - @vercel/gatsby-plugin-vercel-builder@1.1.0
 - @vercel/go@2.3.1
 - @vercel/hydrogen@0.0.47
 - @vercel/next@3.3.21
 - @vercel/node@2.9.0
 - @vercel/python@3.1.43
 - @vercel/redwood@1.0.54
 - @vercel/remix@1.2.10
 - @vercel/ruby@1.3.59
 - @vercel/static-build@1.3.2
 - @vercel/static-config@2.0.12
2023-02-01 23:26:52 +01:00
Andy
61bbd4f98b [cli] Add crons to build output (#9360)
Co-authored-by: George Karagkiaouris <gkaragkiaouris2@gmail.com>
Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
2023-02-01 22:47:55 +01:00
Nathan Rajlich
fedf264862 [cli] Merge build output contents instead of copying (#9358)
When Root Directory setting is used, and/or `vc build --output` is used,
do an intelligent "merge" (move) operation rather than copying the
contents of the build output directory to the destination. This should
overall be faster and avoid disk space issues for larger projects.
2023-02-01 12:27:36 -08:00
Nathan Rajlich
6420e54b35 [gatsby-plugin-vercel-builder] Use pathPrefix from BuildArgs (#9362)
Instead of using `pathPrefix` from the Redux store, grab the value
directly from the "BuildArgs" passed to `onPostBuild()`. This value
seems to properly reflect whether or not `--prefix-path` mode was
enabled during the Gatsby build process.
2023-02-01 13:27:24 -07:00
Nathan Rajlich
aa6b957b23 [gatsby-plugin-vercel-builder] Move "public" dir instead of copying (#9356)
We are getting reports of some larger Gatsby projects running out of
disk space during build which seem to be the result of copying the
static directory multiple times.

So move instead of copying, which doesn't fully solve the problem, but
it does kick the can down the road a bit. Very large projects would
probably still hit the disk limit at some point. Anyways, moving is
faster than copying so this is still a net positive.
2023-02-01 11:05:45 -08:00
Nathan Rajlich
c6717a1492 [static-build] Add Gatsby GENERATED_FILE_COMMENT for non-existing config file cases (#9354)
Follow-up to #9312 which missed these two cases.
2023-01-31 18:57:06 -08:00
Steven
0b33c1c3e7 [tests] Remove actions/cache since its actually slower than no cache (#9359)
This PR removes `actions/cache` since it is actually **slower** than no cache.

## ubuntu-latest
- [with cache](https://github.com/vercel/vercel/actions/runs/4059017971/jobs/6986950123): 21s + 3s + 1m4s = 88s
- [without cache](https://github.com/vercel/vercel/actions/runs/4059216913/jobs/6987026470): 44s

## macos-latest
- [with cache](https://github.com/vercel/vercel/actions/runs/4059017971/jobs/6986950275): 2m55s + 8s + 3m20s = 383s
- [without cache](https://github.com/vercel/vercel/actions/runs/4059216913/jobs/6987026554): 2m21s = 141s

## windows-latest
- [with cache](https://github.com/vercel/vercel/actions/runs/4059017971/jobs/6986950359): 1m10s + 6s + 3m29s = 285s
- [without cache](https://github.com/vercel/vercel/actions/runs/4059216913/jobs/6987026661): 1m25s = 85s
2023-01-31 23:58:43 +00:00
Steven
dbea973546 [build-utils][cli] Add env vars for VERCEL_PROJECT_SETTINGS_ (#9332)
This PR adds a few new environment variables for project settings.

This allows frameworks targeting the [Build Output API](https://vercel.com/docs/build-output-api/v3) to read data that is normally only available in through the `config` object when developing a [Builder/Runtime](https://github.com/vercel/vercel/blob/main/DEVELOPING_A_RUNTIME.md).

This will also solve the problem of old Builders/Runtimes that never passed the `config` through to `getNodeVersion()`.

- Related to https://github.com/unjs/nitro/pull/879
2023-01-31 23:27:36 +00:00
Nathan Rajlich
8ac4814702 [cli] Remove .vercel/output during vc build --output (#9357)
The `.vercel/output` directory gets wiped away when `--output` is _not_ being used, but it should be deleted even when the flag is being used so that build scripts targeting Build Output API directly always start with a fresh slate.
2023-01-31 22:10:40 +00:00
github-actions[bot]
c84d6c4355 [examples] Upgrade Next.js to version 13.1.6 (#9334)
This auto-generated PR updates Next.js to version 13.1.6

Co-authored-by: vercel-release-bot <infra+release@vercel.com>
Co-authored-by: Steven <steven@ceriously.com>
2023-01-31 12:20:53 -05:00
Steven
61b6e87987 [tests] Add labels to cron-update-next (#9351)
See example PR: https://github.com/vercel/vercel/pull/9334
2023-01-31 17:06:44 +00:00
chloetedder
ada9a48d57 Publish Stable
- @vercel/build-utils@6.0.1
 - vercel@28.14.1
 - @vercel/client@12.3.4
 - @vercel/fs-detectors@3.7.7
 - @vercel/gatsby-plugin-vercel-builder@1.0.3
 - @vercel/go@2.3.0
 - @vercel/hydrogen@0.0.46
 - @vercel/next@3.3.20
 - @vercel/node@2.8.17
 - @vercel/python@3.1.42
 - @vercel/redwood@1.0.53
 - @vercel/remix@1.2.9
 - @vercel/ruby@1.3.58
 - @vercel/static-build@1.3.1
2023-01-30 15:19:54 -07:00
chloetedder
31f3daa5b4 [fs-detectors] getMonorepoDefaultSettings: Fix settings (#9315)
1. `commandForIgnoringBuildStep` should be run at the project directory level not the monorepo root level
2. Simplifying the `installCommand` because doesn't need the relative root unless it is `npm`
2023-01-30 18:35:42 +00:00
Steven
fdf7fd6784 [go] Add support for Go 1.19 (#9343)
![image](https://user-images.githubusercontent.com/229881/215526900-fef3e4e0-d1a6-4327-b68f-d8bb9068e2a0.png)
2023-01-30 17:08:10 +00:00
Bryan Eaton
db216f903f [tests] Fix github action restore cache timeout (#9342)
Github Action for actions/cache has an issue that could cause it to take
1 hour and then timeout while trying to restore the cache.

Since `actions/setup-node` is no longer used to restore the pnpm cache,
the `timeout-minutes: 5` doesn't do anything for this action.

Instead we need to put an env variable on the `actions/cache` Github
Action to actually set the restore cache timeout.

```
env:
  SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 # See https://github.com/actions/cache/issues/810
```

- See discussion here https://github.com/vercel/vercel/discussions/9340
- Related to actions/cache#810
- Follow up to #8639
2023-01-30 10:42:00 -05:00
Nathan Rajlich
40a55b11d5 [gatsby-plugin-vercel-builder] Downgrade esbuild to v0.14.47 (#9329)
So that there will only be one copy in the dependency tree between `@vercel/node` and `@vercel/gatsby-plugin-vercel-builder`
2023-01-28 17:03:27 +00:00
Nathan Rajlich
5da537124c [static-build] Add integration test for Gatsby Function (#9330) 2023-01-27 14:00:29 -08:00
JJ Kasper
54aaab83aa [docs] Replace references to @now/next in error docs (#9331)
It's been long enough I think we can change these to refer to
`@vercel/next` instead.

x-ref: [slack
thread](https://vercel.slack.com/archives/C03DQ3QFV7C/p1674849801196389)
2023-01-27 16:59:42 -05:00
Chris Barber
7110cb449b [go] Improved 'go build' error handling (#9320)
The `go` builder doesn't properly handle when `go build` fails. There are 2 failure scenarios:

1. The `go` binary is not found in the `PATH`. There is no message that the `go` executable was not found. Worse, the builder continues and fails trying to run the compiled executable:

![image](https://user-images.githubusercontent.com/97262/214765157-f5244467-7bc8-48e8-8fcf-385efc32b283.png)

The solution is to switch from `spawnSync()` to `execFileSync()` so that if `go` is not found, it will throw like this:

<img width="507" alt="image" src="https://user-images.githubusercontent.com/97262/214765388-792ce59a-79f5-4bc8-8088-472969729558.png">
Note: I temporarily changed the code to spawn `gooooo` to simulate `go` not being found. Either way, `execFileSync()` will throw and we get a helpful message.

2. The `go build` fails due to some actual build error. This should never happen, but better safe than sorry.

The solution here is to allow `go build` to inherit stdout/stderr and if `go build` should fail, we can see the output:

<img width="574" alt="image" src="https://user-images.githubusercontent.com/97262/214765614-c414f160-ad8e-4bd2-a628-b5a91dcc88d8.png">
2023-01-27 20:07:03 +00:00
Chris Barber
89a15681d5 [build-utils] Rewrite rename() to be more efficient (#9322)
Around 6 months ago, @styfle brought to my attention how `rename()` in build-utils used `reduce()` and could be written better. So, I rewrote it.

Before, the code would create a new `Files` object and copy the contents of the previous `Files` object. This caused heavy garbage collection and memory thrashing.

Instead, I created a single `Files` object, then add the files to it.

Results:

| # Files | Before | After |
|---|---|---|
| 1,000 | 75 ms | 1 ms |
| 10,000 | 10.6 s | 7 ms |
| 20,000 | 44.6 s | 16 ms |
| 30,000 | 105.5 s | 22 ms |
| 100,000 | Too long | 73 ms |
2023-01-27 18:21:59 +00:00
Ethan Arrowood
9317543c48 Publish Stable
- vercel@28.14.0
 - @vercel/gatsby-plugin-vercel-builder@1.0.2
 - @vercel/static-build@1.3.0
2023-01-27 10:12:32 -07:00
Nathan Rajlich
e3f326f714 [gatsby-plugin-vercel-builder] Don't delete .vercel/output (#9327)
`.vercel/output` is already made fresh when running `vc build`, so the
plugin should not be doing this. In fact, it makes the `builds.json`
file be wiped away, which we don't want to happen.
2023-01-27 09:08:22 -08:00
Ethan Arrowood
eed6a377f1 [static-build] Cleanup gatsby file changes after static-build completes (#9312)
Adds a new function that restores the user's `gatsby-config.(j|t|mj)s` and `gatsby-node.(j|t|mj)s` files
2023-01-27 16:23:02 +00:00
Nathan Rajlich
c16d9e6784 [static-build] Include Gatsby plugins as regular dependencies (#9313)
Right now, static-build will add the necessary Gatsby plugins to the project's `package.json` at build-time, which has been bothersome for package managers when using a frozen lockfile.

Another issue with it is that we install `latest` version of the plugin, so the version used becomes disjointed from the CLI version itself, which leads to unpredictability when trying to debug issues or help users roll back to a previous behavior if something breaks.

So instead of patching `package.json` directly, include the plugins as deps of static-build itself, and create symlinks to those paths into the project's `node_modules` directory.
2023-01-26 20:15:58 +00:00
Steven
25f6595d36 Publish Stable
- @vercel/build-utils@6.0.0
 - vercel@28.13.2
 - @vercel/client@12.3.3
 - @vercel/edge@0.2.7
 - @vercel/frameworks@1.3.0
 - @vercel/fs-detectors@3.7.6
 - @vercel/gatsby-plugin-vercel-builder@1.0.1
 - @vercel/go@2.2.31
 - @vercel/hydrogen@0.0.45
 - @vercel/next@3.3.19
 - @vercel/node@2.8.16
 - @vercel/python@3.1.41
 - @vercel/redwood@1.0.52
 - @vercel/remix@1.2.8
 - @vercel/ruby@1.3.57
 - @vercel/static-build@1.2.1
2023-01-26 11:19:03 -05:00
JJ Kasper
e8385566fa [next] Ensure we warn when leveraging next export (#9319)
We currently don't make it obvious when `next export` is being leveraged which de-opts features like `middleware`, `rewrites`, `redirects`, etc. so this adds a notice to let users know when we are using `next export` output.
2023-01-26 04:54:24 +00:00
Ethan Arrowood
52ca35252a [tests] add gatsby related unit tests to static-build (#9318)
Adds some unit tests for the gatsby injection logic. 

These are net new since we've heavily changed the injection logic. The tests and fixtures in `build-fixtures` and `builds.test.js` are seemingly not executed. We may delete those here too.
2023-01-26 03:33:18 +00:00
Steven
2004e3d734 [tests] Fix jest-haste-map: Haste module naming collision (#9317)
```
jest-haste-map: Haste module naming collision: app-three
The following files share their name; please adjust your hasteImpl:
  * <rootDir>/test/fixtures/33-hybrid-monorepo/backend/app-three/package.json
  * <rootDir>/test/fixtures/34-monorepo-no-workspaces/backend/app-three/package.json
```
2023-01-26 00:59:39 +00:00
Steven
49b4394c44 [next] Remove hardcoded NODE_OPTIONS (#9314)
The `NODE_OPTIONS` env var value is wrong here and we shouldn't be overriding the user's setting to begin with.

Typically, it will be assigned in a build container or project settings.
2023-01-25 22:53:06 +00:00
Steven
08cdfa2a05 [tests] Fix turbo config and bump to latest version (#9307)
We had Turborepo miscofigured. The `dependsOn: ["^build"]` means run all dependencies' build script, but it doesn't mean the package's build script will run first. For tests, it should always `dependsOn: ["build"]` (without the upcaret) instead to ensure its own build is complete before testing. I also learned that `outputs: []` can be dropped now since thats the default behavior.
2023-01-25 20:45:56 +00:00
Nathan Rajlich
f18fa8546f [static-build] Patch the gatsby-node config file to invoke @vercel/gatsby-plugin-vercel-builder (#9308)
We need to ensure that `@vercel/gatsby-plugin-vercel-builder` is executed as the very last plugin, which Gatsby itself doesn't really support in the plugins listing. So instead we'll patch the `gatsby-node` file to invoke the plugin in the project's own `onPostBuild()` hook, which does get executed last. The patching is similar to how is done with the `gatsby-config` file.
2023-01-25 19:07:04 +00:00
Swarnava Sengupta
025344c4a7 [examples] Update Parcel version to support Node 18 (#9310)
Looks like our Parcel examples are currently failing in Node 18.x.
Updating the version which also Support Node 18.x

<img width="814" alt="image"
src="https://user-images.githubusercontent.com/1162991/214491854-92dc39a4-d7b7-442a-a16c-88621b52621a.png">
2023-01-25 10:08:45 -05:00
Chris Swithinbank
8b036e97ea [frameworks] Add default immutable cache path for Astro v2 (#9305)
Astro v2 was released today. It includes [improved support for caching
all hashed build
assets](https://docs.astro.build/en/guides/upgrade-to/v2/#changed-_astro-folder-for-build-assets)
by gathering these all in a single `_astro` directory in build output
(previously these ended up in a number of different places).

This PR updates the Vercel frameworks config to provide out-of-the-box
immutable caching for these assets.

Co-authored-by: Steven <steven@ceriously.com>
2023-01-24 19:05:13 -05:00
Ethan Arrowood
a4240e89e1 [gatsby-plugin-vercel-builder] add support for pathPrefix (#9294)
This pr adds support for the gatsby `pathPrefix`  properties
2023-01-24 23:37:03 +00:00
Nathan Rajlich
0863ae0c6f [gatsby-plugin-vercel-builder] Get rid of the _ssr function (#9304)
Right now we create the SSR serverless function at path `_ssr`, and then symlink all the other pages to that function.

Instead just make the first page encountered be the "real" function, and symlink all the other pages to that endpoint.
2023-01-24 22:10:43 +00:00
github-actions[bot]
e09d3d5928 [examples] Upgrade Next.js to version 13.1.5 (#9288)
This auto-generated PR updates Next.js to version 13.1.5
2023-01-24 21:52:38 +00:00
Nathan Rajlich
f5f544ffd2 [gatsby-plugin-vercel-builder] Merge SSR and page-data into single Serverless Function (#9292)
Previously, the page-data Serverless Function and SSR Serverless Function were two distinct functions. They had almost identical file contents and just slightly different handler logic. So here we merge the handler logic into a single function and re-use the same Serverless Function for both page-data and SSR.

This simplifies the output quite a bit and deletes a good amount of code, and helps with build output size, cold boot times, etc.
2023-01-24 19:36:47 +00:00
Lee Robinson
4eb1ff8730 chore: Update Gatsby example README (#9300) 2023-01-24 18:48:04 +00:00
Chris Barber
d4b604f05c [tests] Added cron workflow to update turbo (#9301)
Linear: https://linear.app/vercel/issue/VCCLI-450/add-cron-update-turbo-workflow

Based on the Next.js update script, this PR adds a cron job that checks for the latest Turbo canary release, then updates the `package.json` and `pnpm-lock.yaml` files.
2023-01-24 18:17:39 +00:00
Sean Massa
a3cf05af06 [tests] Update CODEOWNERS (#9277) 2023-01-24 09:20:03 -06:00
Steven
df2bcec830 [edge] Add missing metadata to package.json (#9293)
I noticed this was missing when visiting https://www.npmjs.com/package/@vercel/edge
2023-01-24 09:11:14 +00:00
Nathan Rajlich
f5e81273af [static-build] Add Gatsby plugins as dev dependencies (#9298)
So that the test runs get invalidated by Turbo when code changes within one of the plugin files. This is to avoid a PR breaking something in a plugin, but we don't notice it because the static-build tests still "pass" due to cache hit.
2023-01-24 05:32:03 +00:00
Nathan Rajlich
e75d900eaf [static-build] Use tarball URLs for Gatsby plugin E2E tests (#9297)
When running the static-build integration tests, use the tarball URL for the Gatsby plugins, so that any changes made to the plugin(s) in the PR will be reflected in the test deployments without having to publish to npm first.

Example screenshots of a deployment's build logs before I removed the debugging:

<img width="1045" alt="Screenshot 2023-01-23 at 7 35 32 PM" src="https://user-images.githubusercontent.com/71256/214207250-24695a11-051d-4abb-a132-729ab0ab167a.png">
<img width="517" alt="Screenshot 2023-01-23 at 7 35 41 PM" src="https://user-images.githubusercontent.com/71256/214207254-74265e05-ed17-4fbb-b54d-9edc2234a3e4.png">
2023-01-24 04:43:07 +00:00
Chris Barber
1a4f185045 [build-utils] Removed unused execAsync() function (#9200)
This function can sometimes give a TypeScript error if @types/node says 'code' should be a `number | null` and yet the code is returns as a `number`:

```
@vercel/build-utils:build: src/fs/run-user-scripts.ts(140,13): error TS2322: Type 'number \| null' is not assignable to type 'number'.
@vercel/build-utils:build:   Type 'null' is not assignable to type 'number'.
```

I'm not sure if there are any other projects that depend on `@vercel/build-utils`, but it doesn't appear that the Vercel CLI nor the build container use this `execAsync()` function. If I'm mistaken, feel free to close this PR.

As this removal is a breaking change, setting the semver to major and not auto-merging unless others are in agreement.
2023-01-24 01:05:44 +00:00
Steven
35cc7db1a7 [cli] add missing deprecation warnings for builders/runtimes (#9289)
We used to print deprecations on the old build pipeline but this was lost when switching to `vercel build`.

This PR ensures that `vercel build` prints deprecation warnings if available.

## Example

https://npmjs.com/package/@now/node

<img width="751" alt="image" src="https://user-images.githubusercontent.com/229881/214143779-f71c88c8-6ee3-47ce-b459-a86154474991.png">
2023-01-23 23:51:58 +00:00
Nathan Rajlich
f535a20aad [gatsby-plugin-vercel-builder] Remove vercel.config.js file handling (#9290) 2023-01-23 21:31:49 +00:00
Ethan Arrowood
fcea36bf04 Publish Stable
- vercel@28.13.1
 - @vercel/gatsby-plugin-vercel-analytics@1.0.7
 - @vercel/gatsby-plugin-vercel-builder@1.0.0
2023-01-23 12:22:45 -07:00
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
github-actions[bot]
72265aa9a1 [examples] Upgrade Next.js to version 13.1.4 (#9279)
This auto-generated PR updates Next.js to version 13.1.4

Co-authored-by: vercel-release-bot <infra+release@vercel.com>
2023-01-20 19:23:59 -05:00
Felix Haus
6ee5eb137b [examples] Restrict node version for gridsome example (#9275)
Gridsome was not updated for [more than 2 years](https://www.npmjs.com/package/gridsome) and still relies on Webpack 4 what makes it incompatible with >= Node.js 17.
To make the example still deployable on Vercel, this adds an engine restriction to the `package.json` for that example.

Same as #9007.
2023-01-20 23:32:04 +00:00
Ethan Arrowood
c4f1c2f5ed [gatsby-plugin-vercel-analytics] add build script (#9260)
Adds the previously omitted build script. Includes necessary changes to turbo.json too
2023-01-20 22:31:41 +00:00
Ethan Arrowood
f35a77c292 [gatsby-plugin-vercel-builder] support trailingSlash configuration (#9278)
Connects the gatsby trailingslash configuration property to our BOA3
trailingslash property
2023-01-20 14:15:58 -07: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
github-actions[bot]
62c991f25e [examples] Upgrade Next.js to version 13.1.3 (#9271)
This auto-generated PR updates Next.js to version 13.1.3
2023-01-20 20:39:26 +00:00
Nathan Rajlich
6ea2db4ae9 [gatsby-plugin-vercel-builder] Various fixes and refactoring (#9268)
* Sets a valid number of seconds for DSG expiration (10 minutes - do we want to make that configurable somehow?)
* Sets the `group` of DSG pages, so that the page-data and SSR pages are associated
* Outputs SSR/DSG pages with `/index.html` suffix so that those paths are accessible
* Updates SSR and page-data functions URL path parsing logic to handle querystrings and the `index.html` scenario
* Remove the unnecessary `rewrite` related to page-data URL paths
* Remove the page-data function static file fallback handling (they are accessible as just regular static files)
* Correct the path for the page-data endpoing when the root-level index page is SSR/DSG
2023-01-20 18:49:44 +00:00
Ethan Arrowood
1943b1ecc0 [gatsby-plugin-vercel-builder] add documentation to README (#9264)
Adds some basic documentation to the plugin
2023-01-20 18:07:25 +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
JJ Kasper
ed6ce1149a [next] Ensure outputDirectory is normalized (#9269)
This ensures we normalize an absolute `outputDirectory` passed into the Next.js builder as this can cause incorrect resolving. We should probably normalize this higher up as well but this is a starting point. 

Fixes: [slack thread](https://vercel.slack.com/archives/C0289CGVAR2/p1674176040821579?thread_ts=1674168748.257019&cid=C0289CGVAR2)
2023-01-20 17:08:32 +00:00
Ethan Arrowood
fc3611fb80 [static-build] add gatsby v5 fixture (#9267)
Adds a gatsby v5 fixture using ssr and dsg to demonstrate plugin works

Co-authored-by: Nathan Rajlich <n@n8.io>
2023-01-20 03:02:26 -08:00
Nathan Rajlich
ed33c2b27c [gatsby-plugin-vercel-builder] Remove some leftover console.log calls (#9265) 2023-01-19 16:05:48 -08:00
Nathan Rajlich
a7a5bf1a12 [tests] Pass in builder to runBuildLambda() (#9262)
Removes the need for `next`/`static-build` to be present in the root `package.json` file.
2023-01-19 15:10:06 -08:00
JJ Kasper
cc687b3880 [next] Correct RSC route for app dir with trailingSlash (#9263) 2023-01-19 15:03:58 -08:00
Nathan Rajlich
053ec92d5f [node] Add build logs probe for TypeScript usage messages (#9261)
Follow-up to https://github.com/vercel/vercel/pull/9258, even though that issue seemed to only happen when linked to the monorepo locally. In any case, this test will ensure those log messages are intact for any other change around that part of the codebase in the future.
2023-01-19 21:39:27 +00:00
Ethan Arrowood
4838dc336a [static-build] run pnpm install --lockfile-only after injecting gatsby plugins (#9259)
Fixes a bug where after injecting plugins and modifying the users package.json, pnpm would fail normal install
2023-01-19 20:07:53 +00:00
Nathan Rajlich
eae45f4019 [node] Fix TypeScript built-in compiler log message check (#9258)
This check started breaking probably after the pnpm switch, so switch to a simpler solution that doesn't require comparing the paths.
2023-01-19 13:12:31 +00:00
Ethan Arrowood
02feb564a7 [static-build][fs-detectors] add gatsby builder plugin injection (#9252)
Modifies the `@vercel/static-build` injection logic in order to now inject both the analytics and builder gatsby plugins.
2023-01-19 03:34:47 +00: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
Nathan Rajlich
de034943af [gatsby-plugin-vercel-builder] Fix turbo cache outputs configuration (#9257)
The published version on npm was missing the compiled code because Turbo
was not configured to cache them properly.
2023-01-18 15:10:28 -08:00
JJ Kasper
b3862271a5 [next] Fix normalize route with middleware and basePath (#9255)
This ensures we properly match the index route when normalizing routes with `x-nextjs-data` for middleware. 

x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1674034533265989)
2023-01-18 21:30:30 +00:00
Steven
aaceeef604 [tests] Add test for ./examples/remix (#9251)
- Related to #9249
2023-01-18 19:13:55 +00: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
Nathan Rajlich
02ff265074 [remix] Fix config file dynamic import (#9249)
Follow-up to https://github.com/vercel/vercel/pull/8793, which breaks dynamic import of the config file, causing some issues for remix users: https://github.com/orgs/vercel/discussions/1282

The underlying error is `MODULE_NOT_FOUND`.

`import()` should work with `file://` URIs, however, since it's using typescript, the `import` gets compiled to `require()`, which does not support `file://` protocol scheme.

Supersedes https://github.com/vercel/vercel/pull/9248.
2023-01-18 11:24:42 +00:00
Ethan Arrowood
ae89b8b8be [gatsby-plugin-vercel-builder] Implement @vercel/gatsby-plugin-vercel-builder (#9218)
<picture data-single-emoji=":gatsby:" title=":gatsby:"><img class="emoji" src="https://single-emoji.vercel.app/api/emoji/eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..Dli3tTuity9MEBnK.YyaiT9ASg3XvFmlx5q0Ovkdbkto2fgJGjIJhsLcraR_hqYG0DAC6CcBMiaARcI_hF0502EnqhkrHQLeYfEoxfomLi9iKk4WBAe-oSfsENsG9oAwzYdH4LA.VMtHCMaOXNOqpB2xvph3Kg" alt=":gatsby:" width="20" height="auto" align="absmiddle"></picture> 

Implement the Build Output API v3 Gatsby plugin for use within `@vercel/static-build`.

Supersedes https://github.com/vercel/vercel/pull/8259.
2023-01-18 02:24:32 +00: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
Nathan Rajlich
22d3ee160b [build-utils] Add includeDirectories option to glob() (#9245)
Instead of always including empty directories in `glob()`, make it an
opt-in behavior because technically it's a breaking change to include
them by default.
2023-01-17 19:21:40 -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
Nathan Rajlich
522565f6e5 [node-bridge] Add missing lazy dependencies (#9231)
These were missing from the compiled ncc build of `helpers.ts`, and thus causing an error at runtime because the deps are not available within the Serverless Function.
2023-01-14 01:41:50 +00:00
Steven
07bf81ab10 [client] Add sliding window delay when polling deployment complete (#9222)
The previous delay of 1500ms was causing some users to hit the API rate limits. This doesn't normally happen with a single deployment, but it can happen with several concurrent deployments (for example a monorepo with many projects).

We don't need to be polling so often, so this PR changed the polling delay to the following:

- During 0s-15s: check every 1 second
- During 15s-60s: check every 5 seconds
- During 1m-5m: check every 15 seconds
- During 5m-10m: check every 30 seconds
2023-01-14 00:27:14 +00: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
c1df9bca19 [tests] skip private packages (#9229) 2023-01-13 17:24:50 -06:00
Nathan Rajlich
4c1cdd1f0f [client] Send empty directory entries to POST create deployment (#9118)
Update `@vercel/client` to send empty directory entries to the `POST` create deployment endpoint. This makes it so that CLI deployments will have empty directories re-populated in the build-container when doing `vc deploy`.

Follow-up to #9103.
2023-01-13 22:24:31 +00: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
a066bedf95 add the lockfile before commit 2023-01-13 15:06:16 -06:00
Sean Massa
09b23e53ba update lockfile because lerna did not do its job 2023-01-13 15:05:29 -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
31dd354b3a remove unnecessary checkout 2023-01-13 15:00:52 -06:00
Sean Massa
529ff3b2d7 add "version" lifecycle hook for lerna to update lockfile before commit 2023-01-13 14:59:49 -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
Ethan Arrowood
8c16e765ee [tests] adjust root and api deps to use worskpace:* (#9223) 2023-01-13 14:29:23 -06:00
Ethan Arrowood
a008c9c7fe [build-utils] Support empty directory entries for glob() and download() (#9164)
Reopening #9103 since it was reverted.
2023-01-13 12:01:37 -08: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
Sean Massa
7c50f2916e [frameworks] update framework detectors with packages (#9167)
In [a different PR](https://github.com/vercel/vercel/pull/9009), detecting frameworks by package name will also provide framework version metadata to the build. Should we update these framework detectors to look up their respective packages or were they not doing that already for a reason?

I left the old detectors in place as fallbacks, which looks like:

```
some: [
  {
    path: 'package.json',
    matchContent:
      '"(dev)?(d|D)ependencies":\\s*{[^}]*"remix":\\s*".+?"[^}]*}',
  },
  {
    path: 'remix.config.js',
  },
],
```

Please review carefully.
2023-01-13 19:04:59 +00:00
github-actions[bot]
a521dadafb [examples] Upgrade Next.js to version 13.1.2 (#9217)
This auto-generated PR updates Next.js to version 13.1.2

Co-authored-by: vercel-release-bot <infra+release@vercel.com>
2023-01-13 13:26:57 -05:00
Steven
1efb5d6c0d [fs-detectors] Add support for api/**/*.tsx zero config detection (#9216)
There are cases where you would want to use `.tsx` with Serverless Functions, such as OG Image Generation.

This PR adds zero config detection for `.tsx` file extensions and also consolidates the glob pattern into a single string matching all valid `@vercel/node` cases.

https://twitter.com/hasparus/status/1593136849404694528

https://linear.app/vercel/issue/VCCLI-322
2023-01-13 17:59:49 +00:00
Sean Massa
72df5ce8f6 [examples][frameworks] add tests for all examples being detected (#9197)
This PR adds tests (under `packages/fs-detectors`) that ensure are `./examples` get detected as the appropriate framework.
2023-01-13 17:24:00 +00: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
Logan McAnsh
74c0b3e1bb [remix] Add support for .cjs and .mjs extensions for "remix.config" (#8793)
Adds support for `remix.config.mjs` and `remix.config.cjs` and
also updates the example/fixtures to the latest version of Remix.

See: https://github.com/remix-run/remix/pull/3675
2023-01-12 19:26:52 -08: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
Ethan Arrowood
16a5867f6b [fs-detectors] use project path instead of name for turbo filter (#9210)
Fixes: https://github.com/orgs/vercel/discussions/1218
2023-01-12 18:01:38 +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
JJ Kasper
3f47587a8b [next] fix lambda creation when using edge runtime (#9204)
Co-authored-by: remorses <beats.by.morse@gmail.com>
2023-01-11 09:35:21 -08:00
Nathan Rajlich
84f93d8af4 [build-utils] Support directory entries in Lambda#createZip() (#9201)
Adds support for empty directory entries in the Lambda `createZip()` function.
2023-01-11 10:21:42 +00: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
JJ Kasper
0857352967 [next] Fix dynamic routes order for app dir (#9202)
This ensures the RSC dynamic routes come before the HTML route as it's more specific and the HTML route can end up matching first unexpectedly. 

Test deployment with fix: https://discord-gmki6w031-vtest314-ijjk-testing.vercel.app/

Fixes: https://github.com/vercel/next.js/issues/44728
2023-01-11 00:24:28 +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
Steven
427a2a58cf [tests] Update turbo to 1.7.0-canary.9 (#9193)
Let's try out turbo canary

Co-authored-by: tknickman <tom.knickman@vercel.com>
2023-01-10 12:51:12 -05:00
Ethan Arrowood
ccb5f301ad [static-build] @vercel/static-build to use @vercel/gatsby-plugin-vercel-analytics (#9194)
Updates the `static-build` injector to use the new plugin.

Still need to verify somehow that the newly published plugin is working as expected. It should be fine since it was a copy-paste from the previous plugin repo, but always good to verify before we break everything! 

This PR also updates the README in `@vercel/gatsby-plugin-vercel-analytics`
2023-01-10 15:22:31 +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
3c8f20047f Migrate gatsby-plugin-vercel to @vercel/gatsby-plugin-vercel-analytics (#9191)
This PR migrates https://github.com/vercel/gatsby-plugin-vercel to this
repo so that we can eventually integrate into our monorepo tooling.

Since it currently requires Node.js v12 to be built, I've manually
built, copied, and committed the package as it exists now so that we can
publish a stable v1 of `@vercel/gatsby-plugin-vercel-analytics`.

After work completes on adding support for Gatsby v4, I will come back
to this package and update it to Node.js v16 so that it can be
integrated properly into the repository's tooling.

🚨 DO NOT SQUASH MERGE 🚨
2023-01-09 15:30:28 -07:00
Ethan Arrowood
f15988418d migrate gatsby-plugin-vercel to @vercel/gatsby-plugin-vercel-analytics 2023-01-09 15:03:22 -07:00
Ethan Arrowood
5b88f673f8 Add 'packages/gatsby-plugin-vercel-analytics/' from commit 'afa64cb2086ff1caa739eb4b585b50ed08ae8941'
git-subtree-dir: packages/gatsby-plugin-vercel-analytics
git-subtree-mainline: e28c5f9733
git-subtree-split: afa64cb208
2023-01-09 14:56:25 -07:00
Ethan Arrowood
e28c5f9733 [static-build] add support for gatsby esm config (#9183)
Adds support for auto injection into Gatsby's new ESM config format. Only injects if the `gatsby-config.mjs` is present, and continues to default generation of `gatsby-config.js`
2023-01-09 20:59:29 +00:00
Tobias Lins
afa64cb208 ci: use elevated npm token (#12) 2023-01-09 16:27:44 +00:00
Douglas Parsons
8572cc653a fix: run prettier + force new version (#11) 2023-01-09 16:10:53 +01:00
Tobias Lins
10841e8b06 Use GITHUB_TOKEN instead of GH_TOKEN (#10)
* Use GITHUB_TOKEN instead of GH_TOKEN

* ci: use GITHUB_TOKEN instead of GH_TOKEN
2023-01-09 15:03:36 +00:00
Mitchell Nally
1e13a6ca48 [build-utils] Add fix for windows git bash to check path is set (#9163)
Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: Steven <steven@ceriously.com>
2023-01-06 18:55:54 -05: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
82d21f2ac8 [tests] Update bot username/email of cron job (#9179)
Related to https://github.com/vercel/front/pull/18685
2023-01-06 20:22:16 +00:00
Grace Yun
f145540fe6 [frameworks] Update screenshot for Next.js example (#9177)
Related issue: https://vercel.slack.com/archives/C017QMYC5FB/p1673025728939139

Updates the screenshot used for the Next.js template that shows up on the import/new project flow. The asset has been updated on Cloudinary (`/front/import/nextjs`) and this PR updates the version # of the url.
2023-01-06 20:04:50 +00:00
Tobias Lins
02d15eb0c4 ci: bump node to 16 (#8) 2023-01-06 14:44:48 +00:00
Douglas Parsons
0088873a6e Upgrade semantic-release to latest (#6)
Hoping this fixes the CI failure.
2023-01-06 15:30:56 +01: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
9c8f6aa70f [tests] Replace ::set-output with >> $GITHUB_OUTPUT in gh actions (#9170)
This PR fixes a deprecation warning we have been seeing in GitHub Actions for a few months. See [example](https://github.com/vercel/vercel/actions/runs/3849500423/jobs/6558559310#step:7:453).

> Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-01-05 20:37:57 +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
6215c516e7 [tests] Turbo should use full logs when listing tests (#9172)
In PR #9168, the output mode was changed so it doesnt print logs when the result is cached. However, we need the output for the dry run where we list all relevant tests. So the flag was added to that one script only to avoid this skipped problem:

![skipped](https://user-images.githubusercontent.com/229881/210870102-a597d1b9-f007-41ba-8e1d-f53aa765b740.png)
2023-01-05 15:12:59 -05:00
Steven
ada1ad3840 [tests] Bump turbo and update turbo.json (#9168)
This PR does a few things
- Revert https://github.com/vercel/vercel/pull/8264 because it was causing some tests not to run (for example, modifying `@vercel/build-utils` should run tests for all packages)
- Bump `turbo` to version 1.6.3
- Update [`outputMode`](https://turbo.build/repo/docs/reference/configuration#outputmode) to new-only
- Update [`dependsOn`](https://turbo.build/repo/docs/reference/configuration#dependson) to `^` to ensure all dependencies are considered
2023-01-05 18:02:05 +00:00
Sean Massa
fe184618f4 [frameworks] fix blitzjs detection (#9166)
The framework detectors do not support this syntax:

```
path: 'blitz.config.(js|ts)',
```

This PR fixes framework detection for "Blitz.js (Legacy)".
2023-01-05 16:29:39 +00:00
Tobias Lins
de21cf9b62 Track data also when page name cant be resolved (#5) 2023-01-05 07:00:58 -06:00
Kiko Beats
c9c5e148f7 [tests] use assert.strictEqual (#9162)
assert.equal is deprecated
2023-01-04 13:23:01 +00:00
Andy McKay
8115582e25 [frameworks] Fix vitepress screenshot (#9158)
When you are on this page, creating a project the image here is the screenshot of an example project in the `Vercel Examples` enterprise. However that was not working:

<img width="1060" alt="Screen Shot 2023-01-03 at 2 26 58 PM" src="https://user-images.githubusercontent.com/74699/210451850-8208f42b-de43-4ac4-a1fe-b90d88fe86d8.png">

It does this by hitting the API. In this case the problem is that there is a trailing slash on the domain name, causing the API to fail:

<img width="477" alt="Screen Shot 2023-01-03 at 2 29 48 PM" src="https://user-images.githubusercontent.com/74699/210452032-2e32ae61-df29-48b4-b79f-93f5bcf299d3.png">

So this removes that trailing, but I'll see if I can tighten this up as well so in the future it doesn't matter if there is a `/` there.

FYI: this passes unit tests in framework, because it passes the URL in demo through to `URL` and grabs the hostname, which strips out the `protocol` and trailing `/`. Perhaps we should do the same on front.
2023-01-04 04:11:08 +00:00
JJ Kasper
3e3f92e6d3 [next] Lock test fixture dependency (#9159)
This locks the test dependency down for this fixture since the version of Next.js doesn't support the `node:` prefixed imports added in the latest version of `isomorphic-unfetch`. 

Fixes: https://github.com/vercel/vercel/actions/runs/3833489157/jobs/6525280122#step:9:6013
2023-01-04 01:26:50 +00: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
Sean Massa
3a68c73496 [build-utils] Revert "Support empty directory entries for glob() and download()" (#9157)
Reverts vercel/vercel#9103

We believe the original PR is the cause of errors like:

> Error: EISDIR: illegal operation on a directory, read
2023-01-03 17:29:27 -05:00
Ikko Ashimine
1c21ba52ce [docs] fix typo in DEVELOPING_A_RUNTIME.md (#9138)
specifc -> specific
2022-12-27 12:53:17 -05:00
github-actions[bot]
6e55e72498 [examples] Upgrade Next.js to version 13.1.1 (#9125)
This auto-generated PR updates Next.js to version 13.1.1

Co-authored-by: Vercel Team Bot <team@zeit.co>
2022-12-24 15:28:11 -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
github-actions[bot]
5ba2d61c77 [examples] Upgrade Next.js to version 13.1.0 (#9117)
This auto-generated PR updates Next.js to version 13.1.0

Co-authored-by: Vercel Team Bot <team@zeit.co>
2022-12-22 19:31:42 -05:00
Chris Barber
879096fff3 [frameworks] Fix vitepress output directory (#9115)
In July 2022, VitePress changed (https://github.com/vuejs/vitepress/pull/931) the output directory from `.vitepress/dist` to `docs/.vitepress/dist`, however the framework detector was still referencing the old .vitepress/dist` output directory.
2022-12-21 21:09:12 +00:00
Nathan Rajlich
99e40272cf [build-utils] Support empty directory entries for glob() and download() (#9103)
There are some edge-case situations where a dependency or build process is expecting an empty directory to exist, and this expectation would fail currently because `glob()` does not return directory entries.

So update `glob()` to return entries for empty directories, which are also re-created properly when passed to the `download()` function.
2022-12-21 20:06:14 +00: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
JJ Kasper
6f21f1081d [next] Ensure updated path is specific (#9112)
Follow-up to https://github.com/vercel/vercel/pull/9111
2022-12-21 09:39:45 +00:00
JJ Kasper
d806c9f846 [next] Handle output location (#9111)
Ensures output location is handled x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1671473159350219?thread_ts=1671467623.309669&cid=C04DUD7EB1B)
2022-12-21 00:30:48 +00:00
Steven
71cc4ca865 [next] Disable Image Optimization API when next.config.js has unoptimized: true (#9110)
- Related to https://github.com/vercel/next.js/pull/44205
2022-12-21 00:07:07 +00: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
Andy McKay
2a492fa7ec Delete comment-on-pr.yml 2022-12-19 11:20:10 -08:00
Andy McKay
f8ca24b226 Create comment-on-pr.yml 2022-12-19 11:19:53 -08: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
Simon He
6180701f8d [tests] add eslintcache (#8993)
Co-authored-by: Steven <steven@ceriously.com>
2022-12-19 11:58:42 -05:00
github-actions[bot]
b1c7ca8e91 [examples] Upgrade Next.js to version 13.0.7 (#9082)
This auto-generated PR updates Next.js to version 13.0.7
2022-12-16 23:27:31 +00:00
Sean Massa
dbc00a7c3e [admin] Update CODEOWNERS for edge (#9084)
The CODEOWNERS file had an error referencing the `@vercel/edge-function` team, which does not exist. I assume this is supposed to be `@vercel/edge-compute`, but please confirm.

There are a [few edge-related teams](https://github.com/orgs/vercel/teams?query=edge).
2022-12-15 19:03:27 +00:00
Sean Massa
5ae7c2f452 Publish Stable
- @vercel/edge@0.2.0
2022-12-15 12:32:53 -06:00
Sean Massa
0cbc676a6f [edge] publish process.env types for edge functions (#9083) 2022-12-15 12:00:53 -06:00
Damien Simonin Feugas
61e588cd63 feat(edge): adds json() response helper (#9081)
### 🔖 What's in there?

Because Typescript's `libdom` does not have [`static Response.json()`](https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1444) (which modern browsers and edge runtimes are supporting), Typescript users can't use easily use it.

This helper fills the gap.

### 🧪 How to test?

It's covered with unit tests
2022-12-15 11:01:02 +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
S. Elliott Johnson
0e4c7fa74a [examples] Upgrade SvelteKit template to 1.0.0 (#9070)
🎉 Kit is live! 🎉 

Merge prior to #9030. Manually updates Kit to latest (will need to have
a commit pushed after 1.0 goes live on NPM).

Co-authored-by: Steven <steven@ceriously.com>
2022-12-14 16:18:20 -05:00
Chris Barber
363dfef68c [frameworks] Add quotes to match vitepress dep (#9077)
Added quotes to get the `vitepress` detector to correctly detect the dependency.
2022-12-13 18:05:30 +00:00
Kiko Beats
37bace7875 [next] Use MIB for Lambda constants (#8991)
According to AWS Lambda official documentation:

> The Lambda documentation, log messages, and console use the abbreviation MB (rather than MiB) to refer to 1024 KB.

https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html

This is also a convenient thing for us since CF Limits are in base-2 (even they are printed as base-10).
2022-12-13 05:27:58 +00: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
Steven
142c2cede0 [tests] Update to use actions/cache@v3 (#9056)
Use `actions/cache` directly instead of relying on `actions/setup-node` to see if this solves [the hanging restore](https://github.com/vercel/vercel/actions/runs/3660219547/jobs/6187125554).

- Related to https://github.com/actions/cache/issues/810
- Related to https://github.com/Azure/azure-sdk-for-js/issues/22321


This also shaves a minute off cache restore time since we are caching 250MB instead of multiple GB.
2022-12-10 22:52:56 +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
Ethan Arrowood
8e2226ad2a [tests] Create label-feature-request.yml (#9051)
Adds a workflow that auto replies to issues labeled with `triaged: feature request`
2022-12-09 17:52:53 +00:00
Andy McKay
1fe9a6c108 [tests] Create label-triaged.yml (#9050)
Add in a message for when an issue is labeled `triaged: bug`. cc @Ethan-Arrowood
2022-12-08 23:13:17 +00:00
Steven
a95e477ed3 [docs] Delete duplicate security.md (#9048)
This file is redundant because it is already [inherited from the
org](https://github.com/vercel/.github/blob/main/SECURITY.md).

This will allow us to manage the security policy in one place for all
repos.

See [the
docs](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file)
for more info.
2022-12-08 13:55:53 -05: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
aaronbrown-vercel
3a4d221fde [docs] modify responsible disclosure email (#9045)
Quick update on the responsible disclosure email.
2022-12-07 23:27:23 +00:00
Sean Massa
e65af715de Revert "testing a theory in CI" (#9044)
Reverts vercel/vercel#9041
2022-12-07 18:04:27 -05:00
Steven
5b802f7f90 [docs] Add security.md (#9043)
This is a copy of
https://github.com/vercel/next.js/blob/canary/SECURITY.md
2022-12-07 18:03:14 -05:00
Sean Massa
beee71cfe3 testing a theory in CI (#9041)
DO NOT MERGE
2022-12-07 22:52:28 +00:00
Andy McKay
6228d55d1c Automate support label
Add in a workflow file to automate labelling and closing support issues.
2022-12-07 16:27:23 -06:00
Steven
f0a28287c3 [docs] Delete pull_request_template.md (#9040)
This template is no longer used
2022-12-07 13:23:09 -08: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
github-actions[bot]
cd487bc604 [examples] Upgrade Next.js to version 13.0.6 (#8998)
This auto-generated PR updates Next.js to version 13.0.6

Co-authored-by: Vercel Team Bot <team@zeit.co>
Co-authored-by: Steven <steven@ceriously.com>
2022-12-05 16:00:42 -05:00
Felix Haus
f2f6cc93bb [examples] Restrict node version for umi example (#9007)
The umi example currently uses `umi@2` which uses `webpack@4` under the hood to build.
Because of this issue https://github.com/webpack/webpack/issues/14532 Webpack@4 is no longer able to run on Node.js 17+.
Since we use [Node.js 18 as default](https://vercel.com/changelog/node-js-18-lts-is-now-available) for new projects, this example currently breaks when it gets deployed.

Temporary fix is here to ensure that a Node.js version below 17 is used in the meantime.
2022-12-05 18:08:13 +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
Sean Massa
01ad4c4c8e [build-utils] expand build result type for framework version (#8984)
Augments the `BuildResultV2Typical` type to support `framework` and `frameworkVersion` for use in Richer Deployment Outputs.

I added this to a new `meta` object because it contains data about the result, not really part of the result.

---

Supports a related builder container update.
2022-12-02 19:54:24 +00: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
Steven
d649a3c931 [node] Add caching for TS compile per file (#8987)
As a follow up to #8986, we can reduce the TS compile time even more by caching TS compile per file so we never compile the same file twice.  This brings down the total deployment time of a large app with many `api/*.ts` from 7 min to 5 min.

Note: review this PR with [whitespace disabled](https://github.com/vercel/vercel/pull/8987/files?w=1).

- Related to https://github.com/vercel/customer-issues/issues/925
2022-12-01 18:34:56 +00: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
Kiko Beats
fc8b68eda2 edge: format MB with sepace separator (#8990)
The Edge Function size limit is declared in KiB, not in KB:


d7654e2252/packages/next/src/edge-function-source/constants.ts (L8)

And `pretty-bytes` doesn't support base-2 as input:

```js
require('pretty-bytes')(1024 * 1024* 4) // => '4.19 MB' :(
```

Instead, `bytes` is used:

```js
require('bytes')(1024 * 1024* 4, { unitSeparator: ' ' }) // => '4 MB' 🙂
```
2022-11-30 17:38:29 +01:00
Kiko Beats
9ecc89a3c7 [next] increase edge functions limit to 4MB (#8989)
Roll-up x4 more user code size for Edge Functions 🙂
2022-11-30 00:32:11 +00:00
Luc Leray
2a4e066163 [frameworks] Fix astro default routes since it is not SPA (#8200)
The default routes for Astro are redirecting all non-existing files to
`index.html`, which means that the `404.html` page is not used, and
instead `index.html` is shown for all not found pages.

Astro outputs files for each page (ie. `about.html`, `blog.html`, ...)
so the `{handle: 'filesystem'}` route should be enough to route all
existing pages correctly.

The missing part to ship this fix is to answer the following question:
can we safely assume that Astro will always output a `404.html` file?

Internal ref: https://github.com/vercel/customer-issues/issues/638

Co-authored-by: Okiki Ojo <okikio.dev@gmail.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Steven <steven@ceriously.com>
2022-11-29 15:05:31 -05:00
Sean Massa
a19447f9cd Publish Stable
- @vercel/build-utils@5.6.0
 - vercel@28.6.0
 - @vercel/client@12.2.20
 - @vercel/frameworks@1.1.13
 - @vercel/fs-detectors@3.5.3
 - @vercel/go@2.2.18
 - @vercel/hydrogen@0.0.32
 - @vercel/next@3.3.0
 - @vercel/node@2.7.0
 - @vercel/python@3.1.28
 - @vercel/redwood@1.0.38
 - @vercel/remix@1.1.0
 - @vercel/ruby@1.3.44
 - @vercel/static-build@1.0.40
2022-11-29 10:13:02 -06:00
JJ Kasper
dd032e8efa [next] Update matching priority for middleware/rsc (#8978)
### Related Issues

Fixes: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1669508061056179)

### 📋 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-28 17:08:06 -08:00
Jiachi Liu
b8079b8521 [next] Fix incorrect 404.html path when app directory is present with pages folder (#8988)
### Related Issues


Fixes https://github.com/vercel/next.js/issues/43357

### 📋 Checklist

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

#### Tests

- [x] 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-28 16:45:17 -08:00
Steven
f875825893 [node] Add caching to TS compile (#8986)
Since introducing `vc build`, we no longer have isolated builds. This means we can share the cache across builds and improve TS compile across multiple builds.

For example, `api/foo.js` and `api/bar.js` are two different builds but they will likely share the same `tsconfig.json`. So this PR caches the initialization used before running the TS compiler so that it can be shared between builds of the same deployment.

In one customer build, we saw deployment time drop from 14 min to 7 min.

- Related to https://github.com/vercel/customer-issues/issues/925
2022-11-28 23:24:58 +00:00
Andy McKay
3ac4540202 [dev] Update the templates to get closer to production (#8976)
### Related Issues

Update the templates so that `vc dev` is closer to production visually.
The two are different and on production there are a large number of
error conditions that `vc dev` does not handle, so this handles a few
more of the more common situations. There's probably more we could do
here.

I have a test application here:
https://testing-errors-andymckay.vercel.app/ so here's a list of
screenshots and URLs.

*404*
Example url: https://testing-errors-andymckay.vercel.app/api/not-found

`vc dev` before:

<img width="731" alt="Screen Shot 2022-11-25 at 3 50 54 PM"
src="https://user-images.githubusercontent.com/74699/204063815-b0fa0e74-c397-4ce7-8c69-10df4af7b956.png">

Production:

<img width="664" alt="Screen Shot 2022-11-25 at 3 05 13 PM"
src="https://user-images.githubusercontent.com/74699/204063305-e3b5fbee-9784-457f-a029-65a3c66d003e.png">

`vc dev` after:

<img width="672" alt="Screen Shot 2022-11-25 at 3 05 29 PM"
src="https://user-images.githubusercontent.com/74699/204063301-39b87612-5e9b-453a-8e19-47d4c2309b89.png">

This is pretty much the same. The link goes to [this
page](https://vercel.com/docs/concepts/edge-network/frequently-asked-questions#why-do-i-see-a-404-error-when-accessing-my-deployment)
which I thought was useful in local development.

*500: Serverless error*
Example url: https://testing-errors-andymckay.vercel.app/api/500

`vc dev` before:

<img width="753" alt="Screen Shot 2022-11-25 at 3 52 31 PM"
src="https://user-images.githubusercontent.com/74699/204063860-b6bdbd34-cff5-4398-8c30-6020bea8479d.png">

(trimmed the powered by bit at the bottom)

Production:

<img width="800" alt="Screen Shot 2022-11-25 at 3 04 55 PM"
src="https://user-images.githubusercontent.com/74699/204063365-110416e2-a402-4214-ac6a-7472c7c0d279.png">

`vc dev` after:

<img width="815" alt="Screen Shot 2022-11-25 at 3 33 00 PM"
src="https://user-images.githubusercontent.com/74699/204063375-85913e95-dd3c-4e78-b8da-5c5f9dadb31d.png">

Rather than pointing to logs, it refers a user to check their terminal.
The message about connection and vercel working correctly seemed not
relevant in a local situation.

*500: Edge error*
Example url:
https://testing-errors-andymckay.vercel.app/api/middleware-error

`vc dev` before:

<img width="655" alt="Screen Shot 2022-11-25 at 3 51 58 PM"
src="https://user-images.githubusercontent.com/74699/204063832-09c1b24a-e3f4-4574-8d2b-e4b84044217e.png">

Production:

<img width="850" alt="Screen Shot 2022-11-25 at 3 05 06 PM"
src="https://user-images.githubusercontent.com/74699/204063410-9413f327-4c16-4f84-a508-152de5b767a8.png">

`vc dev`:

<img width="848" alt="Screen Shot 2022-11-25 at 3 33 11 PM"
src="https://user-images.githubusercontent.com/74699/204063430-2985f835-57aa-427e-8d35-cee790c9f4f3.png">

Rather than pointing to logs, it refers a user to check their terminal.
The message about connection and vercel working correctly seemed not
relevant in a local situation.

*502: Error*

I couldn't reproduce this on production, yet. Or really in `vc dev`,
yet. But it will look very similar to the 500 error but with the
appropriate error code and no "blame" assigned above it.

I have removed the `Powered by Vercel` at the bottom.

### 📋 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-28 11:41:45 -08:00
Sean Massa
0bbf826213 [build-utils] make lambda optional in Prerender constructor (#8965)
It turns out that there is [a logic flow](https://github.com/vercel/api/pull/15237/files#diff-54171844caccedbadf06e6f6f408676d4cd200358b55b62ca6f9818e113aeabbL144) in the build container that will not populate `Prerender#lambda` right away. The type error was being ignored with `@ts-expect-error`.

The `Prerender` class needs to handle this case.

---

This will be used in https://github.com/vercel/api/pull/15237
2022-11-28 16:32:50 +00:00
github-actions[bot]
f7dd553239 [examples] Upgrade Next.js to version 13.0.5 (#8966)
This auto-generated PR updates Next.js to version 13.0.5
2022-11-27 01:25:20 +00:00
Andy McKay
71b9ac6976 Fix up some missing URLs (#8975)
### Related Issues

This fixes up a few links that had errors I found when scanning through
the code.

### 📋 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-25 10:47:11 -08:00
Lydia Hallie
191f63d03b [frameworks] Add VuePress and VitePress (#7815)
This PR adds [VuePress](https://vuepress.vuejs.org/) and [VitePress](https://vitepress.vuejs.org/)  the list of supported frameworks.

- https://vuepress-starter-template.vercel.app
- https://vitepress-starter-template.vercel.app

#### 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`
2022-11-23 22:52:43 +00:00
Sean Massa
b11210e9ed [docs] make yarn dev usage clearer (#8964) 2022-11-23 16:22:52 -06:00
Sean Massa
164d392f56 [build-utils][node][next][remix] add operationType to Lambda (#8887) 2022-11-23 15:50:34 -06:00
Nathan Rajlich
9b1c30913f [cli] Fix vc build --cwd with a relative path (#8949)
`--cwd` is handled globally in the CLI entrypoint file, so if a relative path is used then it would be applied twice in `vc build` since it was _also_ handling `--cwd`. So remove `vc build`'s logic for it.

Fixes https://github.com/vercel/vercel/discussions/8948.
2022-11-23 21:18:37 +00:00
Chris Barber
5d387517b1 [cli] Move json5 dependency to dev dependencies (#8935)
`json5` can be moved to a dev dependency since `ncc` bundles it into the output.

### 📋 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
- [x] 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-23 18:11:29 +00:00
Sean Massa
97e0eb370e [docs] add more details on local development (#8960) 2022-11-23 11:43:30 -06:00
Sean Massa
fa154098c8 [tests] Fix CI after Node 18 updates (#8959)
There are some more test failures after the node 18 updates rolled out. This PR fixes all of them.
2022-11-23 17:40:51 +00:00
Dillon Raphael
6405a20dd3 [frameworks] Update "blitz" properties to match legacy detection (#8432)
A simple update to the framework array, updating the blitz properties to
match the legacy framework. This PR detects a `blitz.config.(ts|js)`
file which is specific to the legacy framework. With the blitz 2.0
update the framework detection should automatically be next.js.
2022-11-22 18:52:21 -08:00
Nathan Rajlich
7003531d5d Publish Stable
- @vercel/build-utils@5.5.9
 - vercel@28.5.6
 - @vercel/client@12.2.19
 - @vercel/go@2.2.17
 - @vercel/hydrogen@0.0.31
 - @vercel/next@3.2.13
 - @vercel/node@2.6.4
 - @vercel/python@3.1.27
 - @vercel/redwood@1.0.37
 - @vercel/remix@1.0.37
 - @vercel/ruby@1.3.43
 - @vercel/static-build@1.0.39
2022-11-21 11:46:27 -08:00
Nathan Rajlich
13bfc29cec [cli] Fix failing tests after Node 18 default change (#8950) 2022-11-21 11:39:32 -08:00
github-actions[bot]
26ea6b8860 [examples] Upgrade Next.js to version 13.0.4 (#8946) 2022-11-18 15:26:58 -08:00
Lee Robinson
0ecc356103 [examples] Move some framework templates to pnpm. (#8883)
`pnpm` is our package manager of choice. This repository contains
framework starter templates, which check-in lockfiles to speed up clone
& deploy time. This PR updates a few frameworks to use `pnpm` instead of
`yarn` or `npm`.

- Updates Gatsby to Gatsby 5 given Node.js 18 support
- Updates to latest Nuxt 3 template for stable version
- Updates Astro to latest stable version, previously on RC
- Updates Angular to v15, previously on v13
2022-11-18 13:58:07 -06:00
Nathan Rajlich
e200bf2ddc [build-utils] Remove Node 18 env var check (#8947)
Node 18 is the new default.
2022-11-18 19:23:25 +00:00
Chris Barber
1542aff9ec [cli][next] Removed --forceExit from jest args (#8718)
Remove `--forceExit` and wait for the child `vc dev` process to close
before continuing.

Listen to the `'close'` event instead of `'exit'` to ensure stdio has
been flushed and closed before continuing.

Some tests cause `vc dev` to spawn child processes that in turn spawn
nested child processes that do not exit when the parent exits, so a
`nukeProcessTree()` helper was added to ensure all spawned processes are
cleaned up. Furthermore, some of the nested child processes don't
respond well to `SIGTERM` and we need to use `SIGKILL` if `SIGTERM`
doesn't do the job.

I uncovered a larger issue exposed by removing the `--forceExit` flag.
The go builder uses `go run` to build and run the go-based serverless
function. Turns out that `go run` will build the executable, then spawn
it with a parent process id (ppid) of `1` (launchd) on macOS. This means
that the go serverless function executable is not detected as a child
process of `vc dev` and won't be cleaned up, yet has inherited `stdout`
and `stderr` keeping Jest alive. The solution is to explicitly `go
build` the serverless executable, then run it.

### 📋 Checklist

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

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

- [ ] This PR has a concise title and thorough description useful to a
reviewer
- [ ] Issue from task tracker has a link to this PR

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2022-11-18 11:26:53 -06:00
Ethan Arrowood
6796fd721d Publish Stable
- vercel@28.5.5
2022-11-17 14:48:37 -07:00
Ethan Arrowood
15e9562970 [cli] Add more guards to vc build monorepo support feature (#8939)
### Related Issues

Includes a guard checking for `vercel-build` and a LD flag to control
rollout.

### 📋 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-17 14:47:52 -07:00
Steven Tey
2cafcdab9d [examples] Updated Nuxt starter to v3 stable (#8928) 2022-11-17 14:27:02 -06:00
Ethan Arrowood
bef3a4bef2 Publish Stable
- vercel@28.5.4
 - @vercel/fs-detectors@3.5.2
2022-11-17 07:34:31 -07:00
Ethan Arrowood
9be16605ec [cli] support package.json based turbo config in vc build automatic build/install command feature (#8926)
### Related Issues

Adds support for package.json based turbo configuration. 

Includes test.

Confirmed with Turbo that `turbo.json` takes precedence over
`package.json` based config so that is how it is processed here.

### 📋 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-16 16:01:30 -07:00
Rich Harris
759744144a [cli] fix typo: configuarion -> configuration (#8925)
### Related Issues

No related issue, this is a drive-by fix

### 📋 Checklist

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

#### 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
- [ ] Issue from task tracker has a link to this PR
2022-11-16 21:33:51 +00:00
Nathan Rajlich
896dd04cd7 [fs-detectors] Don't add "api/*" 404 route when only a middleware is present (#8920)
This route should not be added when there are no explicit builds under
the "api" directory.

Fixes https://github.com/sveltejs/kit/issues/6777.
2022-11-16 09:33:17 -08:00
Nathan Rajlich
2dae293c1e [fs-detectors] Remove limitedRoutes (#8921)
These were only used for FS API v2, and are no longer needed.
2022-11-16 17:21:45 +00:00
Sean Massa
4159b498b9 Publish Stable
- vercel@28.5.3
 - @vercel/static-build@1.0.38
2022-11-15 16:43:09 -06:00
Douglas Parsons
feabd64d5e [static-build] support gatsby-config as typescript (#8894)
### Related Issues

A customer issue was raised that web-vitals analytics were not working for their Gatsby application, even though this is meant to be zero config. 

It turns out the issue is due to their `gatsby-config` file being declared as a `ts` file, rather than `js`. This is perfectly valid and supported in Gatsby. 

However, the static-build modifications that are made to automatically add the `gatsby-plugin-vercel` only apply to existing `js` files. 

This lead to their deployments containing both a `js` and `ts` version of `gatsby-config`. Luckily, the `ts` version has higher precedence, so _only_ web-vitals were affected. 

Closes https://linear.app/vercel/issue/FLA-364/investigate-gatsby-and-nuxt-data-issues

#### 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-11-15 22:37:18 +00:00
Ethan Arrowood
74593e4d81 Publish Stable
- @vercel/build-utils@5.5.8
 - vercel@28.5.2
 - @vercel/client@12.2.18
 - @vercel/go@2.2.16
 - @vercel/hydrogen@0.0.30
 - @vercel/next@3.2.12
 - @vercel/node@2.6.3
 - @vercel/python@3.1.26
 - @vercel/redwood@1.0.36
 - @vercel/remix@1.0.36
 - @vercel/ruby@1.3.42
 - @vercel/static-build@1.0.37
2022-11-15 14:56:46 -07:00
Ethan Arrowood
3770b84999 [cli] add support for JSON5 and skip when no rootDirectory (#8913)
### Related Issues

Adds support for comments in JSON configs and skips operation when root directory is null or `'.'`

### 📋 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-15 21:00:40 +00:00
Nathan Rajlich
91bc2e693b [cli] Remove readOutputStream() helper function for tests (#8889)
The `readOutputStream()` module was counting "data" events, not lines specifically, and was failing for me locally. So that was removed, and updated the tests that were using it to use the `line-async-iterator` module instead to be more explicit and be able to perform assertions on a per-line basis.
2022-11-15 19:37:18 +00:00
Nathan Rajlich
898a5621f1 [build-utils] Fix runNpmInstall() error when install fails (#8909)
Fixes a regression where the thrown error was not propagated to the caller when npm deps failed to install.
2022-11-15 08:25:21 +00:00
Sean Massa
4e41c0e0a6 Publish Stable
- vercel@28.5.1
 - @vercel/fs-detectors@3.5.1
2022-11-14 14:24:34 -06:00
Ethan Arrowood
a8822170d6 [fs-detectors] restore rush support in fs-detectors (#8907)
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2022-11-14 14:23:12 -06:00
Sean Massa
7d87f66f5d [cli] update yarn.lock (#8905) 2022-11-14 14:07:50 -06:00
Sean Massa
8d2c0fec89 Publish Stable
- vercel@28.5.0
 - @vercel/edge@0.1.2
 - @vercel/fs-detectors@3.5.0
 - @vercel/python@3.1.25
2022-11-14 12:53:42 -06:00
Ethan Arrowood
0663524cd7 [cli][fs-detectors] Improve vc build monorepo support (#8742)
### Related Issues

Improves how `vc build` handles monorepos. In short, this introduces
monorepo manager detection logic and then some helpful defaults so users
don't have to manually specify a `buildCommand` or `installCommand` when
linking a project within a monorepo.

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

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-14 10:23:33 -07:00
Chris Barber
f283b3b106 [cli] Add node_modules/.bin to PATH instead of running npx/yarn run (#8890)
`runDevCommand()` assumes the dev command is an npm package and thus uses `npx` or `yarn run` to execute it. In the case of a Hugo-based app, there is no npm package, so we want spawn to find Hugo in the `PATH`. Then for Node-based apps, instead of `npx`, spawn should find the command since `node_modules/.bin` has been added to the `PATH`.

### Related Issues

> https://github.com/vercel/customer-issues/issues/871

Note: This PR is a recreation of https://github.com/vercel/vercel/pull/8864 because prettier changed a bunch of Hugo files, which was bloating the original PR.

### 📋 Checklist

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

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

- [ ] 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-14 15:26:27 +00:00
github-actions[bot]
b572ef5d71 [examples] Upgrade Next.js to version 13.0.3 (#8891) 2022-11-11 14:38:57 -08:00
Chris Barber
71e233ce7f [python] Explicitly bind HTTP server to localhost (#8880)
On Windows, Python 3 is unable to listen on `0.0.0.0` and errors with:

```
[WinError 10049] The requested address is not valid in its context
```

The only solution I found is to bind to `127.0.0.1` or `localhost`. I've run into issues before with using `localhost`, so I chose to go with `127.0.0.1` and Windows (and macOS) seems to be happy.

### 📋 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
- [x] 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-11 02:33:31 +00:00
Nathan Rajlich
5669fad6bc [cli] Remove --runInBand from Jest (#8888) 2022-11-11 02:25:38 +00:00
Dominik Ferber
c294409f5b [edge] fix broken link on npmjs.org (#8848)
Before this change clicking on "follow the documentation" from
https://www.npmjs.com/package/@vercel/edge would lead to a 404 as the
docs link is relative.
2022-11-10 13:30:27 -08:00
Andy McKay
686f78a86e [cli] Add in a message for deployment-error message (#8865)
We have a link to an error page here:
https://github.com/vercel/vercel/blob/main/packages/cli/src/commands/deploy/index.ts#L873,
however that page is currently a 404.

This is an attempt to explain the error a bit more. Because there are
many possible causes of a deployment error, this mostly focuses on
explaining how to get to the logs.

### Related Issues

Fixes https://github.com/vercel/vercel/issues/1732. 

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

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Chris Barber <chris.barber@vercel.com>
2022-11-10 11:40:57 -06:00
Josh Thomas
c6ed021d2e [examples] Add Vercel Analytics to Astro template (#8472)
Co-authored-by: Lee Robinson <lrobinson2011@gmail.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2022-11-10 09:24:20 -06:00
Ryan Carniato
f8cdc943ca [examples] update SolidStart example (#8707)
Updates the SolidStart example to the latest in anticipation of the
upcoming beta release.
2022-11-09 23:27:24 -08:00
Nathan Rajlich
d8d30b59ec [examples] Remove ENABLE_VC_BUILD env var from Solidstart template (#8875)
Env var is no longer required.
2022-11-09 00:43:42 -08:00
Nathan Rajlich
a93383cf2e Remove ENABLE_VC_BUILD from Vercel deployment (#8876)
This env var is no longer necessary.
2022-11-09 07:29:05 +00:00
Lee Robinson
49dac4c229 [examples] Update Remix template for latest. (#8857)
From `create-remix`
2022-11-08 22:22:58 -06:00
JJ Kasper
1b211f28df Publish Stable
- vercel@28.4.17
 - @vercel/client@12.2.17
 - @vercel/frameworks@1.1.12
 - @vercel/fs-detectors@3.4.9
 - @vercel/next@3.2.11
 - @vercel/redwood@1.0.35
 - @vercel/routing-utils@2.1.3
 - @vercel/static-build@1.0.36
2022-11-08 16:21:25 -08:00
JJ Kasper
c2d0887b94 [next][routing-utils] Add missing matcher support (#8874)
### Related Issues

This adds handling to ensure we pass through the `missing` route field
correctly for custom routes and middleware matchers. Tests are also
added in the complimentary Next.js PR for this, example deployment can
be seen here
https://vtest314-e2e-tests-jj4-vtest314-next-e2e-tests.vercel.app/

x-ref: [slack
thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1667935428788529?thread_ts=1667850697.542269&cid=C03S8ED1DKM)
x-ref: https://github.com/vercel/next.js/pull/42660

### 📋 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-08 16:17:34 -08:00
JJ Kasper
fbb8bba4cf Publish Stable
- vercel@28.4.16
 - @vercel/next@3.2.10
2022-11-08 11:03:01 -08:00
JJ Kasper
56cc87fe9d [next] Handle skip normalize flag for middleware (#8873)
### Related Issues

x-ref: [slack
thread](https://vercel.slack.com/archives/C01224Q5M99/p1667927545637489?thread_ts=1664536480.045539&cid=C01224Q5M99)

### 📋 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-08 10:31:02 -08:00
JJ Kasper
0027ffa65b [next] Ensure rsc dynamic routes are correct (#8866)
### Related Issues

This ensures we properly route dynamic routes with segments in the
middle of the path for rsc paths and also ensures we normalize the
header values from the routes-manifest correctly.

x-ref: https://github.com/vercel/next.js/issues/42364
x-ref:
https://github.com/vercel/next.js/actions/runs/3415662540/jobs/5685787894

### 📋 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-08 07:24:32 -08:00
JJ Kasper
0964be1710 Publish Stable
- vercel@28.4.15
 - @vercel/client@12.2.16
 - @vercel/error-utils@1.0.3
 - @vercel/frameworks@1.1.11
 - @vercel/fs-detectors@3.4.8
 - @vercel/hydrogen@0.0.29
 - @vercel/next@3.2.9
 - @vercel/node-bridge@3.1.2
 - @vercel/node@2.6.2
 - @vercel/redwood@1.0.34
 - @vercel/remix@1.0.35
 - @vercel/routing-utils@2.1.2
 - @vercel/static-build@1.0.35
 - @vercel/static-config@2.0.6
2022-11-07 12:46:03 -08:00
JJ Kasper
9618ffe05f [next] Update rsc header handling (#8862)
### Related Issues

Required for https://github.com/vercel/next.js/pull/42482

### 📋 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-07 12:42:26 -08:00
github-actions[bot]
832ba3fe23 [examples] Upgrade Next.js to version 13.0.2 (#8847)
This auto-generated PR updates Next.js to version 13.0.2
2022-11-04 16:18:30 -07:00
Ethan Arrowood
253b4fd1d2 [cli][client][error-utils][frameworks][fs-detectors][hydrogen][next][node-bridge][node][redwood][remix][routing-utils][static-config] update @types/node to v14 across repo (#8842)
### Related Issues

Updates @types/node to the latest version within the v14 major (based on `npm view @types/node`)

```
❯ npm view @types/node@'>=14.0.0 <15.0.0' version | tail -1
@types/node@14.18.33 '14.18.33'
```

This PR also fixes the various necessary type changes

### 📋 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-04 20:21:13 +00:00
Nathan Rajlich
9e5f17b3c6 [cli] Allow vc link to overwrite existing link (#8845)
There was a regression in #8670 which caused `vc link` to be a no-op
when there was already a link to a Vercel project in the `.vercel`
directory.
2022-11-04 12:12:37 -07:00
Ethan Arrowood
39d0f8dbfc [cli] fix broken integration test (#8844)
### Related Issues

https://github.com/vercel/api/pull/15009 broke one of our integration tests. This PR fixes it.

### 📋 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-04 00:12:56 +00:00
Andy McKay
a567d047d1 Publish Stable
- @vercel/build-utils@5.5.7
 - vercel@28.4.14
 - @vercel/client@12.2.15
 - @vercel/edge@0.1.1
 - @vercel/error-utils@1.0.2
 - @vercel/frameworks@1.1.10
 - @vercel/fs-detectors@3.4.7
 - @vercel/go@2.2.15
 - @vercel/hydrogen@0.0.28
 - @vercel/next@3.2.8
 - @vercel/node-bridge@3.1.1
 - @vercel/node@2.6.1
 - @vercel/python@3.1.24
 - @vercel/redwood@1.0.33
 - @vercel/remix@1.0.34
 - @vercel/routing-utils@2.1.1
 - @vercel/ruby@1.3.41
 - @vercel/static-build@1.0.34
 - @vercel/static-config@2.0.5
2022-11-02 13:14:37 -07:00
Steven
fdfb3a385e [error-utils] Allow publishing to npm (#8839)
> If you set "private": true in your package.json, then npm will refuse
to publish it.


https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private
2022-11-02 16:12:09 -04:00
Lee Robinson
b69196ab38 docs: update README 2020-11-04 14:00:08 -06:00
Lee Robinson
109b676fdd docs: update README 2020-11-02 16:49:27 -06:00
Joe Haddad
4685d8f8eb fix: correctly extract page name from initial markup (#2) 2020-11-02 11:21:49 -06:00
Lee Robinson
c854cd923c Merge pull request #1 from vercel/feat/read-env
fix: automatically configure analyticsId on Vercel
2020-11-02 11:09:43 -06:00
Joe Haddad
5a5b76e94a fix: automatically configure analyticsId on Vercel 2020-11-02 12:08:08 -05:00
Lee Robinson
9d89ce7dc2 fix: require forwarding the project ID in the config 2020-10-31 11:30:20 -05:00
Joe Haddad
47ea7b4063 fix: metrics should still be sent when debug is enabled 2020-10-31 12:08:20 -04:00
Joe Haddad
be7a40231b ci: configure semantic-release branch 2020-10-31 12:03:23 -04:00
Joe Haddad
03d424dc12 ci: fix action branch name 2020-10-31 12:00:34 -04:00
Joe Haddad
2f65e9fd45 ci: configure automatic publishes 2020-10-31 11:58:45 -04:00
Lee Robinson
9ad6d46628 0.0.0-canary.0 2020-10-31 10:43:23 -05:00
Lee Robinson
9b0b84ed8a Reset version. 2020-10-31 10:43:09 -05:00
Lee Robinson
3bb4d28e8d Update keywords. 2020-10-31 09:21:39 -05:00
Lee Robinson
88de719932 Update keywords. 2020-10-31 09:21:18 -05:00
Lee Robinson
9d0868a0b9 Add keywords. 2020-10-31 09:14:56 -05:00
Lee Robinson
3e40438c81 Update README. 2020-10-31 08:40:51 -05:00
Lee Robinson
ecb5455dba Add inspiration. 2020-10-31 08:40:09 -05:00
Lee Robinson
a5f53466ea Default project ID to env var. 2020-10-30 17:55:07 -05:00
Lee Robinson
d3fbddeae7 Start plugin. 2020-10-30 17:35:57 -05:00
Lee Robinson
0ef9278785 First commit. 2020-10-30 17:04:54 -05:00
4047 changed files with 1555507 additions and 415947 deletions

8
.changeset/README.md Normal file
View File

@@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

14
.changeset/config.json Normal file
View File

@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "vercel/vercel" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}

View File

@@ -26,12 +26,6 @@ packages/hydrogen/edge-entry.js
packages/next/test/integration/middleware
packages/next/test/integration/middleware-eval
# node-bridge
packages/node-bridge/bridge.js
packages/node-bridge/launcher.js
packages/node-bridge/helpers.js
packages/node-bridge/source-map-support.js
# middleware
packages/middleware/src/entries.js
@@ -42,3 +36,9 @@ packages/static-build/test/cache-fixtures
# redwood
packages/redwood/test/fixtures
# remix
packages/remix/test/fixtures
# gatsby-plugin-vercel-analytics
packages/gatsby-plugin-vercel-analytics

28
.github/CODEOWNERS vendored
View File

@@ -1,20 +1,18 @@
# Documentation
# https://help.github.com/en/articles/about-code-owners
* @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood
/.github/workflows @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/cli/src/commands/domains @mglagola @anatrajkovska
/packages/cli/src/commands/certs @mglagola @anatrajkovska
/packages/cli/src/commands/env @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood
/packages/fs-detectors @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @agadzik @chloetedder
/packages/middleware @gdborton @vercel/edge-function
/packages/node-bridge @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/next @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/routing-utils @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
/packages/edge @vercel/edge-function
# Restricted Paths
* @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek
/.github/workflows @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @ijjk
/packages/fs-detectors @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @agadzik @chloetedder
/packages/next @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @ijjk @ztanner
/packages/routing-utils @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @ijjk
/packages/static-build @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek
/packages/edge @vercel/compute @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek
/examples @leerob
/examples/create-react-app @Timer
/examples/nextjs @timneutkens @ijjk @styfle
/examples/hugo @styfle
/examples/jekyll @styfle
/examples/zola @styfle
/examples/nextjs @timneutkens @ijjk @ztanner @huozhi
/packages/node @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @Kikobeats
# Unrestricted Paths
.changeset/

View File

@@ -6,7 +6,7 @@ Please read our [Code of Conduct](CODE_OF_CONDUCT.md) and follow it in all your
## Local development
This project is configured in a monorepo, where one repository contains multiple npm packages. Dependencies are installed and managed with `yarn`, not `npm` CLI.
This project is configured in a monorepo, where one repository contains multiple npm packages. Dependencies are installed and managed with `pnpm`, not `npm` CLI.
To get started, execute the following:
@@ -14,21 +14,31 @@ To get started, execute the following:
git clone https://github.com/vercel/vercel
cd vercel
corepack enable
yarn install
yarn bootstrap
yarn build
yarn lint
yarn test-unit
pnpm install
pnpm build
pnpm lint
pnpm test-unit
```
Make sure all the tests pass before making changes.
### Running Vercel CLI Changes
You can use `pnpm dev` from the `cli` package to invoke Vercel CLI with local changes:
```
cd ./packages/cli
pnpm dev <cli-commands...>
```
See [CLI Local Development](../packages/cli#local-development) for more details.
## Verifying your change
Once you are done with your changes (we even suggest doing it along the way), make sure all the tests still pass by running:
```
yarn test-unit
pnpm test-unit
```
from the root of the project.
@@ -91,7 +101,7 @@ When you run this script, you'll see all the imported files. If anything file is
Sometimes you want to test changes to a Builder against an existing project, maybe with `vercel dev` or actual deployment. You can avoid publishing every Builder change to npm by uploading the Builder as a tarball.
1. Change directory to the desired Builder `cd ./packages/node`
2. Run `yarn build` to compile typescript and other build steps
2. Run `pnpm build` to compile typescript and other build steps
3. Run `npm pack` to create a tarball file
4. Run `vercel *.tgz` to upload the tarball file and get a URL
5. Edit any existing `vercel.json` project and replace `use` with the URL

12
.github/DISCUSSION_TEMPLATE/general.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for discussions related to Vercel CLI or Runtimes.
If you post in this repository seeking help with other Vercel tools and features, it may be missed by our support team. For help with topics other than the CLI and Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions).
- type: textarea
attributes:
label: Description
validations:
required: true

12
.github/DISCUSSION_TEMPLATE/help.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for discussions related to Vercel CLI or Runtimes.
If you post in this repository seeking help with other Vercel tools and features, it may be missed by our support team. For help with topics other than the CLI and Runtimes, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions).
- type: textarea
attributes:
label: Question
validations:
required: true

12
.github/DISCUSSION_TEMPLATE/ideas.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for sharing ideas related to Vercel CLI or Runtimes.
Please visit the [Vercel Community](https://github.com/orgs/vercel/discussions) to share ideas for other Vercel tools and features.
- type: textarea
attributes:
label: Idea
validations:
required: true

View File

@@ -0,0 +1,12 @@
body:
- type: markdown
attributes:
value: |
**Note**: This category is intended for discussions related to Vercel CLI or Runtimes.
For topics related to other Vercel features, please visit the [Vercel Community](https://github.com/orgs/vercel/discussions).
- type: textarea
attributes:
label: Description
validations:
required: true

View File

@@ -4,8 +4,8 @@ contact_links:
url: https://vercel.com/support/request
about: Report a bug using the Vercel support form
- name: Feature Request
url: https://github.com/vercel/vercel/discussions/new?category=ideas
url: https://github.com/orgs/vercel/discussions/new?category=ideas
about: Share ideas for new features
- name: Ask a Question
url: https://github.com/vercel/vercel/discussions/new?category=help
url: https://github.com/orgs/vercel/discussions/new?category=help
about: Ask the community for help

View File

@@ -1,20 +0,0 @@
### Related Issues
> Fixes #1
> Related to #2
### 📋 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

View File

@@ -0,0 +1,34 @@
name: Cron Update Gatsby Fixtures
on:
# Allow manual runs
workflow_dispatch:
# Run once a week https://crontab.guru/once-a-week
schedule:
- cron: '0 0 * * 0'
jobs:
update-gatsby-fixtures:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# 0 means fetch all commits so we can commit and push in the script below
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Enable corepack
run: corepack enable pnpm
- name: Update Gatsby Fixtures
uses: actions/github-script@v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-gatsby-fixtures.js')
await script({ github, context })

View File

@@ -1,6 +1,8 @@
name: Cron Update Next
on:
# Allow manual runs
workflow_dispatch:
# Run every 4 hours https://crontab.guru/every-4-hours
schedule:
- cron: '0 */4 * * *'
@@ -14,12 +16,16 @@ jobs:
# 0 means fetch all commits so we can commit and push in the script below
with:
fetch-depth: 0
- name: Enable corepack
run: corepack enable pnpm
- name: Create Pull Request
uses: actions/github-script@v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-next.js')
await script({ github, context })

31
.github/workflows/cron-update-turbo.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Cron Update Turbo
on:
# Allow manual runs
workflow_dispatch:
# Run every week https://crontab.guru/every-week
schedule:
- cron: '0 0 * * 0'
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# 0 means fetch all commits so we can commit and push in the script below
with:
fetch-depth: 0
- name: Enable corepack
run: corepack enable pnpm
- name: Create Pull Request
uses: actions/github-script@v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-turbo.js')
await script({ github, context })

View File

@@ -0,0 +1,22 @@
name: 🤖 Issue labeler - Feature Request
on:
issues:
types:
- labeled
jobs:
add-comment:
if: "github.event.label.name == 'triaged: feature request'"
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808
with:
issue-number: ${{ github.event.issue.number }}
body: |
Thank you for taking the time to created this request!
We added it to our backlog but need to discuss design/architecture before we can accept a PR.
Please let us know if you would be interested in sending a PR once we approve the design.

24
.github/workflows/label-support.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: 🤖 Issue labeler - Support
on:
issues:
types:
- labeled
jobs:
add-comment:
if: github.event.label.name == 'support'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
uses: peter-evans/close-issue@v2
with:
issue-number: ${{ github.event.issue.number }}
comment: |
Thank you so much for filing this issue.
We do try to keep issues in this repository focused on the vercel command line and related code.
At this point we think that this issue is best handled by our friendly Vercel support team. They can be found by contacting them at: https://vercel.com/help#issues
If you think closing of this is a mistake, then please re-open this issue and we'll take another look :bow:

24
.github/workflows/label-triaged.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: 🤖 Issue labeler - Triaged
on:
issues:
types:
- labeled
jobs:
add-comment:
if: "github.event.label.name == 'triaged: bug'"
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808
with:
issue-number: ${{ github.event.issue.number }}
body: |
Thank you for taking the time to file this issue!
We have confirmed this is a bug and added it to our backlog.
We don't have a timeline for when this issue will be fixed, but we will accept a Pull Request with a fix and a test.
See the [contributing guidelines](https://github.com/vercel/vercel/blob/main/.github/CONTRIBUTING.md) for more info.

View File

@@ -1,61 +0,0 @@
name: Publish
on:
push:
branches:
- main
tags:
- '!*'
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check Release
id: check-release
run: |
tag="$(git describe --tags --exact-match 2> /dev/null || :)"
if [[ -z "$tag" ]];
then
echo "::set-output name=IS_RELEASE::false"
else
echo "::set-output name=IS_RELEASE::true"
fi
- name: Setup Go
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/setup-go@v3
with:
go-version: '1.13.15'
- name: Setup Node
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
uses: actions/setup-node@v3
timeout-minutes: 5 # See https://github.com/actions/cache/issues/810
with:
node-version: 14
cache: 'yarn'
- name: Install
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
run: yarn install --check-files --frozen-lockfile --network-timeout 1000000
- name: Build
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
run: yarn build
env:
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Publish
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
run: yarn publish-from-github
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

78
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,78 @@
name: Release
on:
push:
branches:
- main
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: install npm@9
run: npm i -g npm@9
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Packages
run: pnpm build
env:
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
NPM_CONFIG_PROVENANCE: 'true'
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Trigger Update (if a Publish Happened)
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/trigger-update-workflow.js')
await script({ github, context })
- name: Set latest Release to `vercel` (if a Publish Happened)
if: steps.changesets.outputs.published == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-latest-release.js')
await script({ github, context })

View File

@@ -1,26 +0,0 @@
name: Required PR Label
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Check PR Labels
uses: actions/github-script@v6
with:
script: |
let missing = false;
const labels = context.payload.pull_request.labels.map(l => l.name);
if (labels.filter(l => l.startsWith('area:')).length === 0) {
console.error('::error::Missing label: Please add at least one "area" label.');
missing = true;
}
if (labels.filter(l => l.startsWith('semver:')).length !== 1) {
console.error('::error::Missing label: Please add exactly one "semver" label.');
missing = true;
}
if (missing) {
process.exit(1);
}
console.log('::notice::Success: This pull request has correct labels, thanks!');

View File

@@ -1,47 +0,0 @@
name: CLI
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: CLI
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-go@v3
with:
go-version: '1.13.15'
- uses: actions/setup-node@v3
timeout-minutes: 5 # See https://github.com/actions/cache/issues/810
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- run: yarn install --network-timeout 1000000 --frozen-lockfile
- run: yarn run build
- run: yarn test-integration-cli
env:
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}

54
.github/workflows/test-lint.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Lint
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
NODE_VERSION: '16'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
enforce-changeset:
name: Enforce Changeset
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.title != 'Version Packages'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- run: git fetch origin ${{ github.event.pull_request.head.sha }}:pr-${{ github.event.pull_request.number }}
- run: git checkout pr-${{ github.event.pull_request.number }}
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- run: pnpm install
# Enforce a changeset file to be present
- run: pnpm exec changeset status --since=main
test:
name: Lint
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- run: pnpm install
- run: pnpm run lint
- run: pnpm run prettier-check
- run: pnpm run build
- run: pnpm run type-check

View File

@@ -1,50 +0,0 @@
name: Unit
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
env:
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: Unit
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.13.15'
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
timeout-minutes: 5 # See https://github.com/actions/cache/issues/810
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- run: yarn install --network-timeout 1000000 --frozen-lockfile
- run: yarn run build
- run: yarn run lint
if: matrix.os == 'ubuntu-latest' && matrix.node == 14 # only run lint once
- run: yarn run test-unit
- run: yarn workspace vercel run coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 14 # only run coverage once
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -3,13 +3,13 @@ name: Tests
on:
push:
branches:
- main
- main
tags:
- '!*'
- '!*'
pull_request:
env:
NODE_VERSION: '14'
NODE_VERSION: '16'
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
@@ -29,28 +29,24 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-go@v3
with:
go-version: '1.13.15'
- uses: actions/setup-node@v3
timeout-minutes: 5 # See https://github.com/actions/cache/issues/810
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- run: yarn install --network-timeout 1000000 --frozen-lockfile
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- run: pnpm install
- id: set-tests
run: |
TESTS_ARRAY=$(node utils/chunk-tests.js $SCRIPT_NAME)
echo "Files to test:"
echo "$TESTS_ARRAY"
echo "::set-output name=tests::$TESTS_ARRAY"
- uses: patrickedqvist/wait-for-vercel-preview@ae34b392ef30297f2b672f9afb3c329bde9bd487
echo "tests=$TESTS_ARRAY" >> $GITHUB_OUTPUT
- uses: patrickedqvist/wait-for-vercel-preview@bfdff514ff78a669f2536e9f4dd4ef5813a704a2
id: waitForTarball
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 360
check_interval: 5
test:
timeout-minutes: 120
runs-on: ${{ matrix.runner }}
@@ -66,39 +62,73 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-go@v3
with:
go-version: '1.13.15'
- uses: actions/setup-node@v3
timeout-minutes: 5 # See https://github.com/actions/cache/issues/810
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
node-version: ${{ matrix.nodeVersion || env.NODE_VERSION }}
- name: Install Hugo
if: matrix.runner == 'macos-latest'
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/cli/test/dev/fixtures/08-hugo/
- run: yarn install --network-timeout 1000000
# yarn 1.22.21 introduced a Corepack bug when running tests.
# this can be removed once https://github.com/yarnpkg/yarn/issues/9015 is resolved
- name: install yarn@1.22.19
run: npm i -g yarn@1.22.19
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- run: pnpm install
- name: fetch ssl certificate before build (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: Build ${{matrix.packageName}} and all its dependencies
run: node utils/gen.js && node_modules/.bin/turbo run build --cache-dir=".turbo" --scope=${{matrix.packageName}} --include-dependencies --no-deps
run: node utils/gen.js && node_modules/.bin/turbo run build --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --include-dependencies --no-deps
env:
FORCE_COLOR: '1'
- name: Test ${{matrix.packageName}}
run: node utils/gen.js && node_modules/.bin/turbo run test --cache-dir=".turbo" --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
run: node utils/gen.js && node_modules/.bin/turbo run test --summarize --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
shell: bash
env:
JEST_JUNIT_OUTPUT_FILE: ${{github.workspace}}/.junit-reports/${{matrix.scriptName}}-${{matrix.packageName}}-${{matrix.chunkNumber}}-${{ matrix.runner }}.xml
VERCEL_CLI_VERSION: ${{ needs.setup.outputs.dplUrl }}/tarballs/vercel.tgz
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
- name: 'Determine Turbo HIT or MISS'
if: ${{ !cancelled() }}
id: turbo-summary
shell: bash
run: |
TURBO_MISS_COUNT=`node utils/determine-turbo-hit-or-miss.js`
echo "MISS COUNT: $TURBO_MISS_COUNT"
echo "misses=$TURBO_MISS_COUNT" >> $GITHUB_OUTPUT
- name: fetch ssl certificate after tests (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: 'Upload Test Report to Datadog'
if: ${{ steps['turbo-summary'].outputs.misses != '0' && !cancelled() }}
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
env:
DATADOG_API_KEY: ${{secrets.DATADOG_API_KEY_CLI}}
DD_ENV: ci
conclusion:
summary:
name: Summary
runs-on: ubuntu-latest
timeout-minutes: 5
if: always()
needs:
- test
runs-on: ubuntu-latest
name: E2E
steps:
- name: Done
run: echo "Done."
- name: Check All
run: |-
for status in ${{ join(needs.*.result, ' ') }}
do
if [ "$status" != "success" ] && [ "$status" != "skipped" ]
then
echo "Some checks failed"
exit 1
fi
done

View File

@@ -0,0 +1,30 @@
name: Update @remix-run/dev
on:
workflow_dispatch:
inputs:
new-version:
type: string
description: 'Optional version to update @remix-run/dev to inside of @vercel/remix-builder'
jobs:
update-remix-run-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Enable corepack
run: corepack enable pnpm
- name: Update @remix-run/dev
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-remix-run-dev.js')
await script({ github, context }, "${{ inputs.new-version }}")

3
.gitignore vendored
View File

@@ -19,6 +19,7 @@ packages/cli/test/dev/fixtures/**/dist
packages/cli/test/dev/fixtures/**/public
packages/cli/test/dev/fixtures/**/.now
packages/cli/test/dev/fixtures/**/.vercel
!packages/cli/test/fixtures/unit/commands/build/monorepo-detection/**/yarn.lock
packages/cli/test/fixtures/integration
test/lib/deployment/failed-page.txt
.DS_Store
@@ -28,4 +29,6 @@ test/lib/deployment/failed-page.txt
__pycache__
.vercel
.turbo
.eslintcache
turbo-cache-key.json
junit.xml

View File

@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn pre-commit
pnpm pre-commit

1
.node_version Normal file
View File

@@ -0,0 +1 @@
v16.20.2

6
.npmrc Normal file
View File

@@ -0,0 +1,6 @@
provenance=true
save-exact=true
hoist-pattern[]=!"**/@types/**"
hoist-pattern[]=!"**/typedoc"
hoist-pattern[]=!"**/typedoc-plugin-markdown"
hoist-pattern[]=!"**/typedoc-plugin-mdn-links"

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
16.20.2

View File

@@ -3,3 +3,33 @@
# ignore these files with an intentional syntax error
packages/cli/test/dev/fixtures/edge-function-error/api/edge-error-syntax.js
packages/cli/test/fixtures/unit/commands/build/node-error/api/typescript.ts
examples/sveltekit-1
# gatsby-plugin-vercel-analytics
packages/gatsby-plugin-vercel-analytics
# ignore directories that are not source code
node_modules
dist
pnpm-lock.yaml
.changeset
.vscode
.DS_Store
.next
.vercel
.turbo
.eslintcache
.output
.vercel_build_output
.vercel
coverage
turbo-cache-key.json
/examples
/public
packages/*/dist
packages/*/node_modules
packages/**/test/fixtures
packages/**/test/dev/fixtures
packages/**/test/build-fixtures
packages/**/test/cache-fixtures
packages/cli/src/util/dev/templates/*.ts

View File

@@ -1 +0,0 @@
save-prefix ""

View File

@@ -28,7 +28,7 @@ Official Runtimes are published to [the npm registry](https://npmjs.com) as a pa
> **Note:** The `use` property in the `builds` array will work with any [npm
> install argument](https://docs.npmjs.com/cli/install) such as a git repo URL,
> which is useful for testing your Runtime. Alternatively, the `functions` property
> requires that you specify a specifc tag published to npm, for stability purposes.
> requires that you specify a specific tag published to npm, for stability purposes.
See the [Runtimes Documentation](https://vercel.com/docs/runtimes) to view example usage.
@@ -79,18 +79,23 @@ project. An example use-case is that `@vercel/node` uses this function to cache
the `node_modules` directory, making it faster to install npm dependencies for
future builds.
> Note: Only files within the repo root directory can be cached.
**Example:**
```typescript
import { PrepareCacheOptions } from '@vercel/build-utils';
import { relative } from 'path';
import { glob, PrepareCache } from '@vercel/build-utils';
export async function prepareCache(options: PrepareCacheOptions) {
export const prepareCache: PrepareCache = async ({
workPath,
repoRootPath,
}) => {
// Create a mapping of file names and `File` object instances to cache here…
return {
'path-to-file': File,
};
}
const rootDirectory = relative(repoRootPath, workPath);
const cache = await glob(`${rootDirectory}/some/dir/**`, repoRootPath);
return cache;
};
```
### `shouldServe()`
@@ -216,7 +221,7 @@ If a custom runtime is based on one of these Lambda runtimes, large environment
support will be available without further configuration. Custom runtimes based on
other Lambda runtimes, including those that provide the runtime via `provided` and
`provided.al2`, must implement runtime wrapper support and indicate it via the
`supportsWrapper` flag when calling [`createLambda`](#createlambda()).
`supportsWrapper` flag when calling [`createLambda`](<#createlambda()>).
To add support for runtime wrappers to a custom runtime, first check the value of the
`AWS_LAMBDA_EXEC_WRAPPER` environment variable in the bootstrap script. Its value is
@@ -264,7 +269,7 @@ This is achieved by using `exec` in `bash` to replace the running process with t
maintaining the same PID and environment.
Once support for runtime wrappers is included, ensure `supportsWrapper` is set to
`true` in the call to [`createLambda`](#createlambda()). This will inform the build
`true` in the call to [`createLambda`](<#createlambda()>). This will inform the build
process to enable large environment support for this runtime.
### Utilities as peerDependencies
@@ -380,15 +385,16 @@ This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
- `nodejs20.x`
- `nodejs18.x`
- `nodejs16.x`
- `nodejs14.x`
- `go1.x`
- `java11`
- `python3.9`
- `dotnet6`
- `dotnetcore3.1`
- `ruby2.7`
- `provided.al2`
- `provided.al2023`
## `@vercel/build-utils` Helper Functions

View File

@@ -19,9 +19,7 @@
## Vercel
Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.
We enable teams to iterate quickly and develop, preview, and ship delightful user experiences. Vercel has zero-configuration support for 35+ frontend frameworks and integrates with your headless content, commerce, or database of choice.
Vercels Frontend Cloud provides the developer experience and infrastructure to build, scale, and secure a faster, more personalized Web.
## Deploy
@@ -33,6 +31,14 @@ For details on how to use Vercel, check out our [documentation](https://vercel.c
## Contributing
This project uses [pnpm](https://pnpm.io/) to install dependencies and run scripts.
You can use the `dev` script to run local changes as if you were invoking Vercel CLI. For example, `vercel deploy --cwd=/path/to/project` could be run with local changes with `pnpm dev deploy --cwd=/path/to/project`.
See the [Contributing Guidelines](./.github/CONTRIBUTING.md) for more details.
## Reference
- [Code of Conduct](./.github/CODE_OF_CONDUCT.md)
- [Contributing Guidelines](./.github/CONTRIBUTING.md)
- [Apache 2.0 License](./LICENSE)

7
api/CHANGELOG.md Normal file
View File

@@ -0,0 +1,7 @@
# api
## 0.0.1
### Patch Changes
- fix RSC matching behavior & 404 status code on `fallback: false` ([#10388](https://github.com/vercel/vercel/pull/10388))

View File

@@ -51,8 +51,11 @@ export async function getGitHubRepoInfo(repo: Repo) {
data.subdir = repo.path.slice(subdirPath.length).split('/');
}
if (data.id === 'vercel/vercel' && data.subdir && data.subdir[0] === 'examples') {
if (
data.id === 'vercel/vercel' &&
data.subdir &&
data.subdir[0] === 'examples'
) {
// from our examples, add `homepage` and `description` fields
const example = data.subdir[1];
const exampleList = await getExampleList();

View File

@@ -33,7 +33,12 @@ async function main() {
});
const existingExamples = exampleDirs
.filter(dir => dir.isDirectory())
.filter(
dir =>
dir.isDirectory() &&
dir.name !== 'node_modules' &&
dir.name !== '__tests__'
)
.map(dir => ({
name: dir.name,
visible: true,

View File

@@ -13,6 +13,8 @@ function initSentry() {
sentryInitDone = true;
init({
// Cannot figure out whats going wrong here. VSCode resolves this fine. But when we build it blows up.
// @ts-ignore
dsn: assertEnv('SENTRY_DSN'),
environment: process.env.NODE_ENV || 'production',
release: `${serviceName}`,

View File

@@ -1,12 +1,10 @@
{
"name": "api",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"description": "API for the vercel/vercel repo",
"main": "index.js",
"scripts": {
"//TODO": "We should add this pkg to yarn workspaces"
},
"scripts": {},
"dependencies": {
"@sentry/node": "5.11.1",
"got": "10.2.1",
@@ -16,9 +14,8 @@
"unzip-stream": "0.3.0"
},
"devDependencies": {
"@types/node": "13.1.4",
"@types/node": "16.18.11",
"@types/node-fetch": "2.5.4",
"@vercel/node": "1.9.0",
"typescript": "3.9.6"
"@vercel/node": "*"
}
}

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2020",
"target": "ES2021",
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
@@ -12,5 +12,5 @@
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["examples", "frameworks.ts"]
"include": ["examples", "frameworks.ts", "_lib"]
}

View File

@@ -1,524 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@sentry/apm@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.11.1.tgz#cc89fa4150056fbf009f92eca94fccc3980db34e"
integrity sha512-4iZH11p/7w9IMLT9hqNY1+EqLESltiIoF6/YsbpK93sXWGEs8VQ83IuvGuKWxajvHgDmj4ND0TxIliTsYqTqFw==
dependencies:
"@sentry/browser" "5.11.1"
"@sentry/hub" "5.11.1"
"@sentry/minimal" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/browser@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.11.1.tgz#337ffcb52711b23064c847a07629e966f54a5ebb"
integrity sha512-oqOX/otmuP92DEGRyZeBuQokXdeT9HQRxH73oqIURXXNLMP3PWJALSb4HtT4AftEt/2ROGobZLuA4TaID6My/Q==
dependencies:
"@sentry/core" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/core@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.11.1.tgz#9e2da485e196ae32971545c1c49ee6fe719930e2"
integrity sha512-BpvPosVNT20Xso4gAV54Lu3KqDmD20vO63HYwbNdST5LUi8oYV4JhvOkoBraPEM2cbBwQvwVcFdeEYKk4tin9A==
dependencies:
"@sentry/hub" "5.11.1"
"@sentry/minimal" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/hub@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.11.1.tgz#ddcb865563fae53852d405885c46b4c6de68a91b"
integrity sha512-ucKprYCbGGLLjVz4hWUqHN9KH0WKUkGf5ZYfD8LUhksuobRkYVyig0ZGbshECZxW5jcDTzip4Q9Qimq/PkkXBg==
dependencies:
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/minimal@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.11.1.tgz#0e705d01a567282d8fbbda2aed848b4974cc3cec"
integrity sha512-HK8zs7Pgdq7DsbZQTThrhQPrJsVWzz7MaluAbQA0rTIAJ3TvHKQpsVRu17xDpjZXypqWcKCRsthDrC4LxDM1Bg==
dependencies:
"@sentry/hub" "5.11.1"
"@sentry/types" "5.11.0"
tslib "^1.9.3"
"@sentry/node@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.11.1.tgz#2a9c18cd1209cfdf7a69b9d91303413149d2c910"
integrity sha512-FbJs0blJ36gEzE0rc2yBfA/KE+kXOLl8MUfFTcyJCBdCGF8XMETDCmgINnJ4TyBUJviwKoPw2TCk9TL2pa/A1w==
dependencies:
"@sentry/apm" "5.11.1"
"@sentry/core" "5.11.1"
"@sentry/hub" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
cookie "^0.3.1"
https-proxy-agent "^4.0.0"
lru_map "^0.3.3"
tslib "^1.9.3"
"@sentry/types@5.11.0":
version "5.11.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.11.0.tgz#40f0f3174362928e033ddd9725d55e7c5cb7c5b6"
integrity sha512-1Uhycpmeo1ZK2GLvrtwZhTwIodJHcyIS6bn+t4IMkN9MFoo6ktbAfhvexBDW/IDtdLlCGJbfm8nIZerxy0QUpg==
"@sentry/utils@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.11.1.tgz#aa19fcc234cf632257b2281261651d2fac967607"
integrity sha512-O0Zl4R2JJh8cTkQ8ZL2cDqGCmQdpA5VeXpuBbEl1v78LQPkBDISi35wH4mKmLwMsLBtTVpx2UeUHBj0KO5aLlA==
dependencies:
"@sentry/types" "5.11.0"
tslib "^1.9.3"
"@sindresorhus/is@^1.0.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-1.2.0.tgz#63ce3638cb85231f3704164c90a18ef816da3fb7"
integrity sha512-mwhXGkRV5dlvQc4EgPDxDxO6WuMBVymGFd1CA+2Y+z5dG9MNspoQ+AWjl/Ld1MnpCL8AKbosZlDVohqcIwuWsw==
"@szmarczak/http-timer@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.0.tgz#309789ccb7842ff1e41848cf43da587f78068836"
integrity sha512-3yoXv8OtGr/r3R5gaWWNQ3VUoQ5G3Gmo8DXX95V14ZVvE2b7Pj6Ide9uIDON8ym4D/ItyfL9ejohYUPqOyvRXw==
dependencies:
defer-to-connect "^1.1.1"
"@types/cacheable-request@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976"
integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==
dependencies:
"@types/http-cache-semantics" "*"
"@types/keyv" "*"
"@types/node" "*"
"@types/responselike" "*"
"@types/http-cache-semantics@*":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a"
integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A==
"@types/keyv@*":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7"
integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==
dependencies:
"@types/node" "*"
"@types/node-fetch@2.5.4":
version "2.5.4"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.4.tgz#5245b6d8841fc3a6208b82291119bc11c4e0ce44"
integrity sha512-Oz6id++2qAOFuOlE1j0ouk1dzl3mmI1+qINPNBhi9nt/gVOz0G+13Ao6qjhdF0Ys+eOkhu6JnFmt38bR3H0POQ==
dependencies:
"@types/node" "*"
"@types/node@*", "@types/node@13.1.4":
version "13.1.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.4.tgz#4cfd90175a200ee9b02bd6b1cd19bc349741607e"
integrity sha512-Lue/mlp2egZJoHXZr4LndxDAd7i/7SQYhV0EjWfb/a4/OZ6tuVwMCVPiwkU5nsEipxEf7hmkSU7Em5VQ8P5NGA==
"@types/responselike@*":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29"
integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==
dependencies:
"@types/node" "*"
"@vercel/node@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.9.0.tgz#6b64f3b9a962ddb1089276fad00f441a1f4b9cf0"
integrity sha512-Vk/ZpuY4Cdc8oUwBi/kf8qETRaJb/KYdFddVkLuS10QwA0yJx+RQ11trhZ1KFUdc27aBr5S2k8/dDxK8sLr+IA==
dependencies:
"@types/node" "*"
ts-node "8.9.1"
typescript "3.9.3"
agent-base@5:
version "5.1.1"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c"
integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
binary@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79"
integrity sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=
dependencies:
buffers "~0.1.1"
chainsaw "~0.1.0"
bl@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bl/-/bl-3.0.0.tgz#3611ec00579fd18561754360b21e9f784500ff88"
integrity sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==
dependencies:
readable-stream "^3.0.1"
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
buffers@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb"
integrity sha1-skV5w77U1tOWru5tmorn9Ugqt7s=
cacheable-lookup@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-0.2.1.tgz#f474ae2c686667d7ea08c43409ad31b2b31b26c2"
integrity sha512-BQ8MRjxJASEq2q+w0SusPU3B054gS278K8sj58QCLMZIso5qG05+MdCdmXxuyVlfvI8h4bPsNOavVUauVCGxrg==
dependencies:
keyv "^3.1.0"
cacheable-request@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.0.tgz#12421aa084e943ec81eac8c93e56af90c624788a"
integrity sha512-UVG4gMn3WjnAeFBBx7RFoprgOANIAkMwN5Dta6ONmfSwrCxfm0Ip7g0mIBxIRJZX9aDsoID0Ry3dU5Pr0csKKA==
dependencies:
clone-response "^1.0.2"
get-stream "^5.1.0"
http-cache-semantics "^4.0.0"
keyv "^3.0.0"
lowercase-keys "^2.0.0"
normalize-url "^4.1.0"
responselike "^2.0.0"
chainsaw@~0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98"
integrity sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=
dependencies:
traverse ">=0.3.0 <0.4"
chownr@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142"
integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==
clone-response@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=
dependencies:
mimic-response "^1.0.0"
cookie@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=
debug@4:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
dependencies:
ms "^2.1.1"
decompress-response@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-5.0.0.tgz#7849396e80e3d1eba8cb2f75ef4930f76461cb0f"
integrity sha512-TLZWWybuxWgoW7Lykv+gq9xvzOsUjQ9tF09Tj6NSTYGMTCHNXzrPnD6Hi+TgZq19PyTAGH4Ll/NIM/eTGglnMw==
dependencies:
mimic-response "^2.0.0"
defer-to-connect@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.1.tgz#88ae694b93f67b81815a2c8c769aef6574ac8f2f"
integrity sha512-J7thop4u3mRTkYRQ+Vpfwy2G5Ehoy82I14+14W4YMDLKdWloI9gSzRbV30s/NckQGVJtPkWNcW4oMAUigTdqiQ==
diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
end-of-stream@^1.1.0, end-of-stream@^1.4.1:
version "1.4.4"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
dependencies:
once "^1.4.0"
fs-constants@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
get-stream@^5.0.0, get-stream@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9"
integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==
dependencies:
pump "^3.0.0"
got@10.2.1:
version "10.2.1"
resolved "https://registry.yarnpkg.com/got/-/got-10.2.1.tgz#7087485482fb31aa6e6399fd493dd04639da117b"
integrity sha512-IQX//hGm5oLjUj743GJG30U2RzjS58ZlhQQjwQXjsyR50TTD+etVMHlMEbNxYJGWVFa0ASgDVhRkAvQPe6M9iQ==
dependencies:
"@sindresorhus/is" "^1.0.0"
"@szmarczak/http-timer" "^4.0.0"
"@types/cacheable-request" "^6.0.1"
cacheable-lookup "^0.2.1"
cacheable-request "^7.0.0"
decompress-response "^5.0.0"
duplexer3 "^0.1.4"
get-stream "^5.0.0"
lowercase-keys "^2.0.0"
mimic-response "^2.0.0"
p-cancelable "^2.0.0"
responselike "^2.0.0"
to-readable-stream "^2.0.0"
type-fest "^0.8.0"
http-cache-semantics@^4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz#495704773277eeef6e43f9ab2c2c7d259dda25c5"
integrity sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew==
https-proxy-agent@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b"
integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==
dependencies:
agent-base "5"
debug "4"
inherits@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
json-buffer@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=
keyv@^3.0.0, keyv@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==
dependencies:
json-buffer "3.0.0"
lowercase-keys@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
lru_map@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd"
integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
mimic-response@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
mimic-response@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.0.0.tgz#996a51c60adf12cb8a87d7fb8ef24c2f3d5ebb46"
integrity sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==
minimist@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
dependencies:
minimist "0.0.8"
ms@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
node-fetch@2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
normalize-url@^4.1.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129"
integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==
once@^1.3.1, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
p-cancelable@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e"
integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg==
parse-github-url@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395"
integrity sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==
pump@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
dependencies:
end-of-stream "^1.1.0"
once "^1.3.1"
readable-stream@^3.0.1, readable-stream@^3.1.1:
version "3.4.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc"
integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==
dependencies:
inherits "^2.0.3"
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
responselike@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723"
integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==
dependencies:
lowercase-keys "^2.0.0"
safe-buffer@~5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519"
integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==
source-map-support@^0.5.17:
version "0.5.19"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map@^0.6.0:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
string_decoder@^1.1.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
dependencies:
safe-buffer "~5.2.0"
tar-fs@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.0.tgz#677700fc0c8b337a78bee3623fdc235f21d7afad"
integrity sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==
dependencies:
chownr "^1.1.1"
mkdirp "^0.5.1"
pump "^3.0.0"
tar-stream "^2.0.0"
tar-stream@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.0.tgz#d1aaa3661f05b38b5acc9b7020efdca5179a2cc3"
integrity sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==
dependencies:
bl "^3.0.0"
end-of-stream "^1.4.1"
fs-constants "^1.0.0"
inherits "^2.0.3"
readable-stream "^3.1.1"
to-readable-stream@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-2.1.0.tgz#82880316121bea662cdc226adb30addb50cb06e8"
integrity sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w==
"traverse@>=0.3.0 <0.4":
version "0.3.9"
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9"
integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=
ts-node@8.9.1:
version "8.9.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.9.1.tgz#2f857f46c47e91dcd28a14e052482eb14cfd65a5"
integrity sha512-yrq6ODsxEFTLz0R3BX2myf0WBCSQh9A+py8PBo1dCzWIOcvisbyH6akNKqDHMgXePF2kir5mm5JXJTH3OUJYOQ==
dependencies:
arg "^4.1.0"
diff "^4.0.1"
make-error "^1.1.1"
source-map-support "^0.5.17"
yn "3.1.1"
tslib@^1.9.3:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
type-fest@^0.8.0:
version "0.8.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
typescript@3.9.3:
version "3.9.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.3.tgz#d3ac8883a97c26139e42df5e93eeece33d610b8a"
integrity sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==
typescript@3.9.6:
version "3.9.6"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a"
integrity sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==
unzip-stream@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/unzip-stream/-/unzip-stream-0.3.0.tgz#c30c054cd6b0d64b13a23cd3ece911eb0b2b52d8"
integrity sha512-NG1h/MdGIX3HzyqMjyj1laBCmlPYhcO4xEy7gEqqzGiSLw7XqDQCnY4nYSn5XSaH8mQ6TFkaujrO8d/PIZN85A==
dependencies:
binary "^0.3.0"
mkdirp "^0.5.1"
util-deprecate@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==

View File

@@ -1,10 +0,0 @@
codecov:
require_ci_to_pass: yes
coverage:
status:
project: off
patch: off
fixes:
- "::packages/cli/" # move root e.g., "path/" => "after/path/"

View File

@@ -0,0 +1,13 @@
# Deployment failed
## Why This Error Occurred
When deploying this project, there was not a successful deployment into the `READY` state.
## How to Fix It
This is a generic error to catch problems in the deployment. The error is likely to vary depending on the deployment and the conditions at the time.
Try looking in the logs for information about the deployment and the failure, this could be done at (vercel.com)[https://vercel.com]. You can also use the `vc logs` command to display the build logs for the deployment.
This might not be a permanent error and retrying the deployment might also resolve it.

View File

@@ -4,7 +4,7 @@
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/concepts/projects/environment-variables).
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env.local`.
We require this to ensure your app works as you intend it to, in the development environment, and to provide you with a way to mirror or separate private environment variables within your applications, for example when connecting to a database.
@@ -12,11 +12,11 @@ Read below for how to address this error.
#### Possible Ways to Fix It
The error message will list environment variables that are required and which file they are required to be included in `.env`.
The error message will list environment variables that are required and which file they are required to be included in `.env.local`.
If the file does not exist yet, please create the file that the error message mentions and insert the missing environment variable into it.
For example, if the error message shows that the environment variable `TEST` is missing from `.env`, then the `.env` file should look like this:
For example, if the error message shows that the environment variable `TEST` is missing from `.env.local`, then the `.env.local` file should look like this:
```
TEST=value

View File

@@ -11,4 +11,4 @@ Remove the `functions` config from your `now.json` or `vercel.json` to take adva
### Useful Links
- [Functions Config Documentation](https://vercel.com/docs/configuration?query=functions#project/functions)
- [Functions Config Documentation](https://vercel.com/docs/concepts/projects/project-configuration#functions)

View File

@@ -11,6 +11,6 @@ Migrate from using legacy `routes` to the new `rewrites`, `redirects`, and `head
### Useful Links
- [Rewrites Documentation](https://vercel.com/docs/configuration?query=rewrites#project/rewrites)
- [Redirects Documentation](https://vercel.com/docs/configuration?query=rewrites#project/redirects)
- [Headers Documentation](https://vercel.com/docs/configuration?query=rewrites#project/headers)
- [Rewrites Documentation](https://vercel.com/docs/concepts/projects/project-configuration#rewrites)
- [Redirects Documentation](https://vercel.com/docs/concepts/projects/project-configuration#redirects)
- [Headers Documentation](https://vercel.com/docs/concepts/projects/project-configuration#headers)

View File

@@ -1,8 +1,8 @@
# `@now/next` Legacy Mode
# `@vercel/next` Legacy Mode
#### Why This Warning Occurred
`@now/next` has two modes: `legacy` and `serverless`. You will always want to use the `serverless` mode. `legacy` is to provide backwards compatibility with previous `@now/next` versions.
`@vercel/next` has two modes: `legacy` and `serverless`. You will always want to use the `serverless` mode. `legacy` is to provide backwards compatibility with previous `@vercel/next` versions.
The differences:
@@ -27,7 +27,7 @@ Serverless:
- Runs `npm run now-build`
- Does not run `npm install --production` as the output from the build is all that's needed to bundle lambdas.
- No runtime dependencies, meaning smaller lambda functions
- Optimized for fast [cold start](https://vercel.com/blog/serverless-ssr#cold-start)
- Optimized for fast cold start
#### Possible Ways to Fix It
@@ -63,7 +63,7 @@ module.exports = {
```js
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
"builds": [{ "src": "package.json", "use": "@vercel/next" }]
}
```

View File

@@ -1,4 +1,4 @@
# `@now/next` No Serverless Pages Built
# `@vercel/next` No Serverless Pages Built
#### Why This Error Occurred
@@ -14,7 +14,9 @@ In order to create the smallest possible lambdas Next.js has to be configured to
npm install next --save
```
2. Add the `now-build` script to your `package.json`
2. Check [Node.js Version](https://vercel.link/node-version) in your Project Settings. Using an old or incompatible version of Node.js can cause the Build Step to fail with this error message.
3. Add the `now-build` script to your `package.json` [deprecated]
```json
{
@@ -24,7 +26,7 @@ npm install next --save
}
```
3. Add `target: 'serverless'` to `next.config.js`
4. Add `target: 'serverless'` to `next.config.js` [deprecated]
```js
module.exports = {
@@ -33,13 +35,15 @@ module.exports = {
};
```
4. Remove `distDir` from `next.config.js` as `@now/next` can't parse this file and expects your build output at `/.next`
5. Remove `distDir` from `next.config.js` as `@vercel/next` can't parse this file and expects your build output at `/.next`
5. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
6. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
```js
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
"builds": [{ "src": "package.json", "use": "@vercel/next" }]
}
```
6. Make sure you have the correct Node.js version selected for your build step in your project settings (`https://vercel.com/[username]/[project]/settings`)

View File

@@ -2,15 +2,15 @@
#### Why This Error Occurred
This could be caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
This error is often caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
#### Possible Ways to Fix It
In the Vercel dashboard, open your "Project Settings" and draw attention to "Build & Development Settings":
1. Ensure that the "Build Command" setting is not changed, or that it calls `next build`. If this command is not changed but you are seeing this error, double check that your `build` script in `package.json` calls `next build`.
2. Ensure that the "Output Directory" setting is not changed. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`.
3. For `next export` users: **do not override the "Output Directory"**. Next.js automatically detects what folder you outputted `next export` to.
1. Ensure that the "Build Command" setting is not overridden, or that it calls `next build`. If this command is not overridden but you are seeing this error, double check that your `build` script in `package.json` calls `next build`. If `buildCommand` exists in `vercel.json`, make sure it calls `next build`.
2. Ensure that the "Output Directory" setting is not overridden. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`. If `outputDirectory` exists in `vercel.json`, remove that property.
3. For `next export` users: **do not override the "Output Directory"**, even if you customized the `next export` output directory. It will automatically detects the correct output.
In rare scenarios, this error message can also be caused by a Next.js build failure (if your "Build Command" accidentally returns an exit code that is not 0).
Double check for any error messages above the Routes Manifest error, which may provide additional details.

13
examples/CHANGELOG.md vendored Normal file
View File

@@ -0,0 +1,13 @@
# examples
## null
### Patch Changes
- chore: update Nuxt example ([#10869](https://github.com/vercel/vercel/pull/10869))
## null
### Patch Changes
- update examples to use at least node@16 ([#10395](https://github.com/vercel/vercel/pull/10395))

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy angular', async () => {
await deployExample('angular');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy astro', async () => {
await deployExample('astro');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy blitzjs', async () => {
await deployExample('blitzjs');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy brunch', async () => {
await deployExample('brunch');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy create-react-app', async () => {
await deployExample('create-react-app');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy docusaurus-2', async () => {
await deployExample('docusaurus-2');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy docusaurus', async () => {
await deployExample('docusaurus');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy dojo', async () => {
await deployExample('dojo');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy eleventy', async () => {
await deployExample('eleventy');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy ember', async () => {
await deployExample('ember');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy gatsby', async () => {
await deployExample('gatsby');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy gridsome', async () => {
await deployExample('gridsome');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hexo', async () => {
await deployExample('hexo');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hugo', async () => {
await deployExample('hugo');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hydrogen-2', async () => {
await deployExample('hydrogen-2');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy hydrogen', async () => {
await deployExample('hydrogen');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy ionic-angular', async () => {
await deployExample('ionic-angular');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy ionic-react', async () => {
await deployExample('ionic-react');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy jekyll', async () => {
await deployExample('jekyll');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy middleman', async () => {
await deployExample('middleman');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy nextjs', async () => {
await deployExample('nextjs');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy node_modules', async () => {
await deployExample('node_modules');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy nuxtjs', async () => {
await deployExample('nuxtjs');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy parcel', async () => {
await deployExample('parcel');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy polymer', async () => {
await deployExample('polymer');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy preact', async () => {
await deployExample('preact');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy redwoodjs', async () => {
await deployExample('redwoodjs');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy remix', async () => {
await deployExample('remix');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy saber', async () => {
await deployExample('saber');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sanity', async () => {
await deployExample('sanity');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sapper', async () => {
await deployExample('sapper');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy scully', async () => {
await deployExample('scully');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy solidstart', async () => {
await deployExample('solidstart');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy stencil', async () => {
await deployExample('stencil');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy storybook', async () => {
await deployExample('storybook');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy svelte', async () => {
await deployExample('svelte');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sveltekit-1', async () => {
await deployExample('sveltekit-1');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy sveltekit', async () => {
await deployExample('sveltekit');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy umijs', async () => {
await deployExample('umijs');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vite', async () => {
await deployExample('vite');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vitepress', async () => {
await deployExample('vitepress');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vue', async () => {
await deployExample('vue');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy vuepress', async () => {
await deployExample('vuepress');
});

View File

@@ -0,0 +1,4 @@
import { deployExample } from '../test-utils';
it('[examples] should deploy zola', async () => {
await deployExample('zola');
});

View File

@@ -0,0 +1,27 @@
import { basename, join } from 'path';
import { lstatSync, readdirSync } from 'fs';
export async function deployExample(filename: string) {
const { testDeployment } = require('../../test/lib/deployment/test-deployment.js');
const example = basename(filename).replace(/\.test\.ts$/, '');
await testDeployment(join(filename, '..', '..', '..', example));
}
export function getExamples() {
const dirname = join(__dirname, '..');
const examples = readdirSync(dirname)
.map(example =>
({
exampleName: example,
examplePath: join(dirname, example),
testPath: join(dirname, '__tests__', 'integration', `${example}.test.ts`),
})
)
.filter(o =>
!o.exampleName.startsWith('.') &&
!o.exampleName.startsWith('_') &&
o.exampleName !== 'node_modules' &&
lstatSync(o.examplePath).isDirectory()
);
return examples;
}

View File

@@ -0,0 +1,8 @@
import { existsSync } from 'fs';
import { getExamples } from '../test-utils';
describe('should have test for each example', () => {
it.each(getExamples())('should exist $exampleName', async ({testPath}) => {
expect(existsSync(testPath)).toBeTruthy();
});
});

View File

@@ -1,16 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR

View File

@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false

View File

@@ -41,3 +41,4 @@ testem.log
.DS_Store
Thumbs.db
.vercel
.angular

View File

@@ -14,7 +14,7 @@ _Live Example: https://angular-template.vercel.app_
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Code scaffolding

Some files were not shown because too many files have changed in this diff Show More