Compare commits

...

220 Commits

Author SHA1 Message Date
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
2039 changed files with 1118373 additions and 258439 deletions

20
.github/CODEOWNERS vendored
View File

@@ -2,19 +2,17 @@
# https://help.github.com/en/articles/about-code-owners
# Restricted Paths
* @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek
/.github/workflows @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @ijjk
/packages/fs-detectors @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @agadzik @chloetedder
/packages/next @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @ijjk
/packages/routing-utils @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @ijjk
/packages/edge @vercel/compute
* @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
/packages/node @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @trek @Kikobeats
/examples/nextjs @timneutkens @ijjk @ztanner @huozhi
/packages/node @TooTallNate @EndangeredMassa @cb1kenobi @Ethan-Arrowood @trek @Kikobeats
# Unrestricted Paths
.changeset/

View File

@@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
- name: Enable corepack
run: corepack enable pnpm
- name: Update Gatsby Fixtures

View File

@@ -49,3 +49,5 @@ jobs:
- run: pnpm install
- run: pnpm run lint
- run: pnpm run prettier-check
- run: pnpm run build
- run: pnpm run type-check

View File

@@ -64,7 +64,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
node-version: ${{ matrix.nodeVersion || env.NODE_VERSION }}
- name: Install Hugo
if: matrix.runner == 'macos-latest'
@@ -83,7 +83,7 @@ jobs:
env:
FORCE_COLOR: '1'
- name: Test ${{matrix.packageName}}
run: node utils/gen.js && node_modules/.bin/turbo run test --cache-dir=".turbo" --log-order=stream --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
@@ -91,13 +91,19 @@ jobs:
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: always()
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}}

View File

@@ -17,6 +17,8 @@ jobs:
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

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

@@ -1,7 +1,7 @@
{
"name": "api",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"description": "API for the vercel/vercel repo",
"main": "index.js",
"scripts": {},

7
examples/CHANGELOG.md vendored Normal file
View File

@@ -0,0 +1,7 @@
# examples
## null
### Patch Changes
- update examples to use at least node@16 ([#10395](https://github.com/vercel/vercel/pull/10395))

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy angular', async () => {
await deployExample('angular');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy astro', async () => {
await deployExample('astro');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy blitzjs', async () => {
await deployExample('blitzjs');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy brunch', async () => {
await deployExample('brunch');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy create-react-app', async () => {
await deployExample('create-react-app');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy docusaurus-2', async () => {
await deployExample('docusaurus-2');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy docusaurus', async () => {
await deployExample('docusaurus');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy dojo', async () => {
await deployExample('dojo');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy eleventy', async () => {
await deployExample('eleventy');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy ember', async () => {
await deployExample('ember');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy gatsby', async () => {
await deployExample('gatsby');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy gridsome', async () => {
await deployExample('gridsome');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy hexo', async () => {
await deployExample('hexo');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy hugo', async () => {
await deployExample('hugo');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy hydrogen-2', async () => {
await deployExample('hydrogen-2');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy hydrogen', async () => {
await deployExample('hydrogen');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy ionic-angular', async () => {
await deployExample('ionic-angular');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy ionic-react', async () => {
await deployExample('ionic-react');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy jekyll', async () => {
await deployExample('jekyll');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy middleman', async () => {
await deployExample('middleman');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy nextjs', async () => {
await deployExample('nextjs');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy node_modules', async () => {
await deployExample('node_modules');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy nuxtjs', async () => {
await deployExample('nuxtjs');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy parcel', async () => {
await deployExample('parcel');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy polymer', async () => {
await deployExample('polymer');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy preact', async () => {
await deployExample('preact');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy redwoodjs', async () => {
await deployExample('redwoodjs');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy remix', async () => {
await deployExample('remix');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy saber', async () => {
await deployExample('saber');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy sanity', async () => {
await deployExample('sanity');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy sapper', async () => {
await deployExample('sapper');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy scully', async () => {
await deployExample('scully');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy solidstart', async () => {
await deployExample('solidstart');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy stencil', async () => {
await deployExample('stencil');
});

View File

@@ -1,4 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy storybook', async () => {
await deployExample('storybook');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy svelte', async () => {
await deployExample('svelte');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy sveltekit-1', async () => {
await deployExample('sveltekit-1');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy sveltekit', async () => {
await deployExample('sveltekit');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy umijs', async () => {
await deployExample('umijs');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy vite', async () => {
await deployExample('vite');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy vitepress', async () => {
await deployExample('vitepress');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy vue', async () => {
await deployExample('vue');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy vuepress', async () => {
await deployExample('vuepress');
});

View File

@@ -1,5 +1,4 @@
import { deployExample } from '../test-utils';
it('should deploy', async () => {
await deployExample(__filename);
it('[examples] should deploy zola', async () => {
await deployExample('zola');
});

View File

@@ -3,9 +3,10 @@
This directory is a brief example of an [Astro](https://astro.build/) site that can be deployed to Vercel with zero configuration. This demo 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
- `/ssr` - A page that uses server-side rendering (through [Vercel Edge Functions](https://vercel.com/docs/functions/edge-functions))
- `/ssr-with-swr-caching` - Similar to the previous page, but also caches the response on the [Vercel Edge Network](https://vercel.com/docs/edge-network/overview) using `cache-control` headers
- `/image` - Astro [Asset](https://docs.astro.build/en/guides/assets/) using Vercel [Image Optimization](https://vercel.com/docs/image-optimization)
- `/edge.json` - An Astro API Endpoint that returns JSON data using [Vercel Edge Functions](https://vercel.com/docs/functions/edge-functions)
Learn more about [Astro on Vercel](https://vercel.com/docs/frameworks/astro).

View File

@@ -1,7 +1,17 @@
import { defineConfig } from 'astro/config';
// Use Vercel Edge Functions (Recommended)
import vercel from '@astrojs/vercel/edge';
// Can also use Serverless Functions
// import vercel from '@astrojs/vercel/serverless';
// Or a completely static build
// import vercel from '@astrojs/vercel/static';
export default defineConfig({
output: 'server',
adapter: vercel(),
experimental: {
assets: true
},
adapter: vercel({
imageService: true,
}),
});

View File

@@ -8,8 +8,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/vercel": "3.2.2",
"astro": "^2.2.1",
"@astrojs/vercel": "3.8.2",
"astro": "^2.10.14",
"react": "18.2.0",
"web-vitals": "^3.3.1"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -1,4 +1,4 @@
/// <reference types="astro/client" />
/// <reference types="astro/client-image" />
interface ImportMetaEnv {
readonly PUBLIC_VERCEL_ANALYTICS_ID: string;

View File

@@ -0,0 +1,6 @@
---
import { Image } from 'astro:assets';
import astroLogo from '../assets/logo.png';
---
<Image src={astroLogo} alt="Astro Logo" width={50} quality={75} />

7992
examples/hydrogen/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -29,7 +29,7 @@
<!-- Replace the API key with your own, see:
https://developers.google.com/maps/documentation/javascript/get-api-key -->
<!-- <script async="" defer="" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB8pf6ZdFQj5qw7rc_HSGrhUwQKfIe9ICw"></script> -->
<!-- <script async="" defer="" src="https://maps.googleapis.com/maps/api/js?key=<YOUR_GOOGLE_MAPS_API_KEY>"></script> -->
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body>

View File

@@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
# testing
/coverage

View File

@@ -10,6 +10,8 @@ npm run dev
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

View File

@@ -1,6 +1,6 @@
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
const inter = Inter({ subsets: ['latin'] })

File diff suppressed because it is too large Load Diff

View File

@@ -9,17 +9,19 @@
"lint": "next lint"
},
"dependencies": {
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"eslint": "8.47.0",
"eslint-config-next": "13.4.18",
"next": "13.4.18",
"postcss": "8.4.28",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
"react": "^18",
"react-dom": "^18",
"next": "14.0.0"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10",
"postcss": "^8",
"tailwindcss": "^3",
"eslint": "^8",
"eslint-config-next": "14.0.0"
}
}

View File

@@ -9,6 +9,7 @@
},
"devDependencies": {
"@types/jest": "27.4.1",
"@vercel/frameworks": "2.0.0"
}
"@vercel/frameworks": "2.0.3"
},
"version": null
}

View File

@@ -30,6 +30,6 @@
"wct-browser-legacy": "^1.0.0"
},
"engines": {
"node": ">=8.0"
"node": ">=16.0"
}
}

View File

@@ -14,7 +14,7 @@
"extends": "@redwoodjs/eslint-config"
},
"engines": {
"node": ">=12",
"node": "16.x",
"yarn": ">=1.15"
}
}

View File

@@ -4,9 +4,4 @@ node_modules
/build
/public/build
.env
.vercel
.output
/api/index.js
/api/index.js.map

View File

@@ -19,7 +19,7 @@ export default function App() {
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
</head>

View File

@@ -1,10 +1,15 @@
import type { V2_MetaFunction } from "@vercel/remix";
import type { MetaFunction } from "@vercel/remix";
export const meta: V2_MetaFunction = () => [{ title: "New Remix App" }];
export const meta: MetaFunction = () => {
return [
{ title: "New Remix App" },
{ name: "description", content: "Welcome to Remix!" },
];
};
export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
<h1>Welcome to Remix</h1>
<ul>
<li>

View File

@@ -1,8 +1,8 @@
import type { V2_MetaFunction } from "@vercel/remix";
import type { MetaFunction } from "@vercel/remix";
export const config = { runtime: "edge" };
export const meta: V2_MetaFunction = () => [{ title: "Remix@Edge | New Remix App" }];
export const meta: MetaFunction = () => [{ title: "Remix@Edge | New Remix App" }];
export default function Edge() {
return (

View File

@@ -1,32 +1,34 @@
{
"name": "my-remix-app",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"build": "remix build",
"dev": "remix dev",
"start": "remix-serve build",
"dev": "remix dev --manual",
"start": "remix-serve ./build/index.js",
"typecheck": "tsc"
},
"dependencies": {
"@remix-run/css-bundle": "^1.18.0",
"@remix-run/node": "^1.18.0",
"@remix-run/react": "^1.18.0",
"@remix-run/serve": "^1.18.0",
"@vercel/analytics": "^0.1.11",
"@vercel/remix": "^1.18.0",
"@remix-run/css-bundle": "^2.0.0",
"@remix-run/node": "^2.0.0",
"@remix-run/react": "^2.0.0",
"@remix-run/serve": "^2.0.0",
"@vercel/analytics": "^1.0.2",
"@vercel/remix": "^2.0.0",
"isbot": "^3.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.18.0",
"@remix-run/eslint-config": "^1.18.0",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.11",
"eslint": "^8.28.0",
"typescript": "^5.1.3"
"@remix-run/dev": "^2.0.0",
"@remix-run/eslint-config": "^2.0.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"eslint": "^8.38.0",
"typescript": "^5.1.6"
},
"engines": {
"node": ">=14"
"node": ">=18.0.0"
}
}

View File

@@ -1,17 +1,8 @@
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
future: {
v2_dev: true,
v2_errorBoundary: true,
v2_headers: true,
v2_meta: true,
v2_normalizeFormMethod: true,
v2_routeConvention: true,
},
export default {
ignoredRouteFiles: ["**/.*"],
serverModuleFormat: "cjs",
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
// serverBuildPath: "build/index.js",
};

View File

@@ -1,13 +1,13 @@
{
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "node",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2019",
"target": "ES2022",
"strict": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,

7906
examples/saber/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

31785
examples/sanity/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -46,6 +46,6 @@
]
},
"engines": {
"node": ">=8.0.0 <17"
"node": "16.x"
}
}

View File

@@ -5,7 +5,7 @@
"build": "vuepress build src"
},
"engines": {
"node": ">=14.0.0 <18.0.0"
"node": ">=16.0.0 <18.0.0"
},
"devDependencies": {
"vuepress": "1.9.7"

View File

@@ -4,6 +4,9 @@
"version": "1.0.4",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"files": [
"dist"
],
"scripts": {
"build": "tsc -p tsconfig.json"
},

View File

@@ -5,10 +5,10 @@
"types": "dist/index.d.ts",
"main": "dist/index.js",
"files": [
"dist/*"
"dist"
],
"scripts": {
"build": "tsc",
"build": "node ../../utils/build.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test tests/unit"
},

View File

@@ -1,7 +1,9 @@
{
"extends": "@vercel-internals/tsconfig",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"declaration": true,
"emitDeclarationOnly": true
},
"include": ["src/**/*"]
}

View File

@@ -1,5 +1,54 @@
# @vercel-internals/types
## 1.0.14
### Patch Changes
- Updated dependencies [[`0861dc8fb`](https://github.com/vercel/vercel/commit/0861dc8fbcea1037626b00664a4b6c22f1b0a7ed)]:
- @vercel/build-utils@7.2.3
## 1.0.13
### Patch Changes
- Updated dependencies [[`9e9fac019`](https://github.com/vercel/vercel/commit/9e9fac0191cb1428ac9e5479c3d5c8afd7b7d357)]:
- @vercel/routing-utils@3.1.0
## 1.0.12
### Patch Changes
- Updated dependencies [[`2f5b0aeeb`](https://github.com/vercel/vercel/commit/2f5b0aeeb183ed3ea8cbc68cb3bc3c949c486ada)]:
- @vercel/build-utils@7.2.2
## 1.0.11
### Patch Changes
- Updated dependencies [[`decdf27fb`](https://github.com/vercel/vercel/commit/decdf27fb5ca914fe50a9320c4fd50ef79d2fbb3)]:
- @vercel/build-utils@7.2.1
## 1.0.10
### Patch Changes
- Updated dependencies [[`50e04dd85`](https://github.com/vercel/vercel/commit/50e04dd8584664c842a86c15d92d654f4ea8dcbb), [`45b73c7e8`](https://github.com/vercel/vercel/commit/45b73c7e86458564dc0bab007f6f6365c4c4ab5d), [`d8bc570f6`](https://github.com/vercel/vercel/commit/d8bc570f604950d97156d4f33c8accecf3b3b28f)]:
- @vercel/build-utils@7.2.0
## 1.0.9
### Patch Changes
- Updated dependencies [[`5609a1187`](https://github.com/vercel/vercel/commit/5609a1187be9d6cf8d5f16825690c5ea72f17dc5), [`1b4de4a98`](https://github.com/vercel/vercel/commit/1b4de4a986f7a612aac834ebae3ec7bb9e9b8cf8)]:
- @vercel/build-utils@7.1.1
## 1.0.8
### Patch Changes
- Updated dependencies [[`9e3827c78`](https://github.com/vercel/vercel/commit/9e3827c785e1bc45f2bed421132167381481770f)]:
- @vercel/build-utils@7.1.0
## 1.0.7
### Patch Changes

View File

@@ -65,6 +65,8 @@ export type User = {
billing: Billing;
name?: string;
limited?: boolean;
version?: 'northstar';
defaultTeamId?: string;
};
export interface Team {
@@ -426,7 +428,8 @@ export type ProjectLinkedError = {
| 'TEAM_DELETED'
| 'PATH_IS_FILE'
| 'INVALID_ROOT_DIRECTORY'
| 'MISSING_PROJECT_SETTINGS';
| 'MISSING_PROJECT_SETTINGS'
| 'TOO_MANY_PROJECTS';
};
export type ProjectLinkResult =

View File

@@ -1,14 +1,17 @@
{
"private": true,
"name": "@vercel-internals/types",
"version": "1.0.7",
"version": "1.0.14",
"types": "index.d.ts",
"main": "index.d.ts",
"files": [
"*.d.ts"
],
"dependencies": {
"@types/node": "14.14.31",
"@vercel-internals/constants": "1.0.4",
"@vercel/build-utils": "7.0.0",
"@vercel/routing-utils": "3.0.0"
"@vercel/build-utils": "7.2.3",
"@vercel/routing-utils": "3.1.0"
},
"devDependencies": {
"@vercel-internals/tsconfig": "1.0.0",

View File

@@ -11,11 +11,12 @@
"@typescript-eslint/eslint-plugin": "5.21.0",
"@typescript-eslint/parser": "5.21.0",
"@vercel/build-utils": "*",
"@vercel/ncc": "0.24.0",
"@vercel/style-guide": "4.0.2",
"async-retry": "1.2.3",
"buffer-replace": "1.0.0",
"create-svelte": "2.0.1",
"dot": "1.1.3",
"esbuild": "0.19.2",
"eslint": "8.14.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest": "26.1.5",
@@ -32,7 +33,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "29.1.0",
"turbo": "1.10.12",
"turbo": "1.10.16",
"typescript": "4.9.5"
},
"scripts": {
@@ -49,7 +50,8 @@
"prepare": "husky install",
"pack": "cd utils && node -r ts-eager/register ./pack.ts",
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
"ci:publish": "pnpm publish -r && changeset tag"
"ci:publish": "pnpm publish -r && node utils/update-canary-tags.mjs && changeset tag",
"type-check": "turbo type-check --concurrency=12 --output-logs=errors-only --summarize --continue"
},
"lint-staged": {
"./{*,{api,packages,test,utils}/**/*}.{js,ts}": [

View File

@@ -1,5 +1,49 @@
# @vercel/build-utils
## 7.2.3
### Patch Changes
- Add experimental flag to allow Node.js v20 ([#10802](https://github.com/vercel/vercel/pull/10802))
## 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))
## 7.2.1
### Patch Changes
- Internal variants ([#10549](https://github.com/vercel/vercel/pull/10549))
## 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))
## 7.1.1
### Patch Changes
- add descriptions to NodeVersion properties ([#10403](https://github.com/vercel/vercel/pull/10403))
- Updated semver dependency ([#10411](https://github.com/vercel/vercel/pull/10411))
## 7.1.0
### Minor Changes
- Support serverless function architecture ([#10392](https://github.com/vercel/vercel/pull/10392))
## 7.0.0
### Major Changes

View File

@@ -1,30 +0,0 @@
#!/usr/bin/env node
const fs = require('fs-extra');
const execa = require('execa');
const { join } = require('path');
async function main() {
const outDir = join(__dirname, 'dist');
// Start fresh
await fs.remove(outDir);
// Compile TypeScript
await execa('tsc', [], { stdio: 'inherit' });
// Run `ncc`
const mainDir = join(outDir, 'main');
await execa('ncc', ['build', 'src/index.ts', '-o', mainDir], {
stdio: 'inherit',
});
// Move compiled ncc file to out dir
await fs.rename(join(mainDir, 'index.js'), join(outDir, 'index.js'));
// Delete leftover "main" dir
await fs.remove(mainDir);
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,3 @@
import { tsc, esbuild } from '../../utils/build.mjs';
await Promise.all([tsc(), esbuild().then(() => esbuild({ bundle: true }))]);

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "7.0.0",
"version": "7.2.3",
"license": "Apache-2.0",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
@@ -11,10 +11,11 @@
"directory": "packages/now-build-utils"
},
"scripts": {
"build": "node build",
"build": "node build.mjs",
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
"test-unit": "pnpm test test/unit.*test.*",
"test-e2e": "pnpm test test/integration.test.ts"
"test-e2e": "pnpm test test/integration.test.ts",
"type-check": "tsc --noEmit"
},
"devDependencies": {
"@iarna/toml": "2.2.3",
@@ -32,8 +33,7 @@
"@types/node-fetch": "^2.1.6",
"@types/semver": "6.0.0",
"@types/yazl": "2.4.2",
"@vercel/error-utils": "2.0.0",
"@vercel/ncc": "0.24.0",
"@vercel/error-utils": "2.0.2",
"aggregate-error": "3.0.1",
"async-retry": "1.2.3",
"async-sema": "2.1.4",
@@ -49,7 +49,7 @@
"minimatch": "3.1.2",
"multistream": "2.1.1",
"node-fetch": "2.6.7",
"semver": "6.1.1",
"semver": "6.3.1",
"typescript": "4.9.5",
"yazl": "2.5.1"
}

View File

@@ -37,6 +37,12 @@ function getOptions() {
discontinueDate: new Date('2020-01-06'),
},
] as const;
if (process.env.VERCEL_ALLOW_NODEJS20 === '1') {
return [
{ major: 20, range: '20.x', runtime: 'nodejs20.x' },
...options,
] as const;
}
return options;
}

View File

@@ -16,7 +16,7 @@ import { cloneEnv } from '../clone-env';
// Only allow one `runNpmInstall()` invocation to run concurrently
const runNpmInstallSema = new Sema(1);
export type CliType = 'yarn' | 'npm' | 'pnpm';
export type CliType = 'yarn' | 'npm' | 'pnpm' | 'bun';
export interface ScanParentDirsResult {
/**
@@ -284,27 +284,40 @@ export async function scanParentDirs(
readPackageJson && pkgJsonPath
? JSON.parse(await fs.readFile(pkgJsonPath, 'utf8'))
: undefined;
const [yarnLockPath, npmLockPath, pnpmLockPath] = await walkParentDirsMulti({
base: '/',
start: destPath,
filenames: ['yarn.lock', 'package-lock.json', 'pnpm-lock.yaml'],
});
const [yarnLockPath, npmLockPath, pnpmLockPath, bunLockPath] =
await walkParentDirsMulti({
base: '/',
start: destPath,
filenames: [
'yarn.lock',
'package-lock.json',
'pnpm-lock.yaml',
'bun.lockb',
],
});
let lockfilePath: string | undefined;
let lockfileVersion: number | undefined;
let cliType: CliType = 'yarn';
const [hasYarnLock, packageLockJson, pnpmLockYaml] = await Promise.all([
Boolean(yarnLockPath),
npmLockPath
? readConfigFile<{ lockfileVersion: number }>(npmLockPath)
: null,
pnpmLockPath
? readConfigFile<{ lockfileVersion: number }>(pnpmLockPath)
: null,
]);
const [hasYarnLock, packageLockJson, pnpmLockYaml, bunLockBin] =
await Promise.all([
Boolean(yarnLockPath),
npmLockPath
? readConfigFile<{ lockfileVersion: number }>(npmLockPath)
: null,
pnpmLockPath
? readConfigFile<{ lockfileVersion: number }>(pnpmLockPath)
: null,
bunLockPath ? fs.readFile(bunLockPath, 'utf8') : null,
]);
// Priority order is Yarn > pnpm > npm
if (hasYarnLock) {
// Priority order is bun with yarn lock > yarn > pnpm > npm > bun
if (bunLockBin && hasYarnLock) {
cliType = 'bun';
lockfilePath = bunLockPath;
// TODO: read "bun-lockfile-format-v0"
lockfileVersion = 0;
} else if (hasYarnLock) {
cliType = 'yarn';
lockfilePath = yarnLockPath;
} else if (pnpmLockYaml) {
@@ -315,6 +328,11 @@ export async function scanParentDirs(
cliType = 'npm';
lockfilePath = npmLockPath;
lockfileVersion = packageLockJson.lockfileVersion;
} else if (bunLockBin) {
cliType = 'bun';
lockfilePath = bunLockPath;
// TODO: read "bun-lockfile-format-v0"
lockfileVersion = 0;
}
const packageJsonPath = pkgJsonPath || undefined;
@@ -451,6 +469,10 @@ export async function runNpmInstall(
commandArgs = args
.filter(a => a !== '--prefer-offline')
.concat(['install', '--unsafe-perm']);
} else if (cliType === 'bun') {
// @see options https://bun.sh/docs/cli/install
opts.prettyCommand = 'bun install';
commandArgs = ['install', ...args];
} else {
opts.prettyCommand = 'yarn install';
commandArgs = ['install', ...args];
@@ -505,6 +527,7 @@ export function getEnvForPackageManager({
const npm7 = '/node16/bin-npm7';
const pnpm7 = '/pnpm7/node_modules/.bin';
const pnpm8 = '/pnpm8/node_modules/.bin';
const bun1 = '/bun1';
const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
if (cliType === 'npm') {
if (
@@ -516,7 +539,7 @@ export function getEnvForPackageManager({
) {
// Ensure that npm 7 is at the beginning of the `$PATH`
newEnv.PATH = `${npm7}${path.delimiter}${oldPath}`;
console.log('Detected `package-lock.json` generated by npm 7+...');
console.log('Detected `package-lock.json` generated by npm 7+');
}
} else if (cliType === 'pnpm') {
if (
@@ -528,7 +551,7 @@ export function getEnvForPackageManager({
// Ensure that pnpm 7 is at the beginning of the `$PATH`
newEnv.PATH = `${pnpm7}${path.delimiter}${oldPath}`;
console.log(
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7...`
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7`
);
} else if (
typeof lockfileVersion === 'number' &&
@@ -539,7 +562,16 @@ export function getEnvForPackageManager({
// Ensure that pnpm 8 is at the beginning of the `$PATH`
newEnv.PATH = `${pnpm8}${path.delimiter}${oldPath}`;
console.log(
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8...`
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8`
);
}
} else if (cliType === 'bun') {
if (!oldPath.includes(bun1) && !corepackEnabled) {
// Ensure that Bun 1 is at the beginning of the `$PATH`
newEnv.PATH = `${bun1}${path.delimiter}${oldPath}`;
console.log('Detected `bun.lockb` generated by Bun');
console.warn(
'Warning: Bun is used as a package manager at build time only, not at runtime with Functions'
);
}
} else {
@@ -548,7 +580,6 @@ export function getEnvForPackageManager({
newEnv.YARN_NODE_LINKER = 'node-modules';
}
}
return newEnv;
}
@@ -614,6 +645,8 @@ export async function runPackageJsonScript(
opts.prettyCommand = `npm run ${scriptName}`;
} else if (cliType === 'pnpm') {
opts.prettyCommand = `pnpm run ${scriptName}`;
} else if (cliType === 'bun') {
opts.prettyCommand = `bun run ${scriptName}`;
} else {
opts.prettyCommand = `yarn run ${scriptName}`;
}

View File

@@ -13,9 +13,12 @@ interface Environment {
export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
export type LambdaArchitecture = 'x86_64' | 'arm64';
export interface LambdaOptionsBase {
handler: string;
runtime: string;
architecture?: LambdaArchitecture;
memory?: number;
maxDuration?: number;
environment?: Environment;
@@ -62,6 +65,7 @@ export class Lambda {
files?: Files;
handler: string;
runtime: string;
architecture?: LambdaArchitecture;
memory?: number;
maxDuration?: number;
environment: Environment;
@@ -81,6 +85,7 @@ export class Lambda {
handler,
runtime,
maxDuration,
architecture,
memory,
environment = {},
allowQuery,
@@ -102,6 +107,13 @@ export class Lambda {
assert(typeof runtime === 'string', '"runtime" is not a string');
assert(typeof environment === 'object', '"environment" is not an object');
if (architecture !== undefined) {
assert(
architecture === 'x86_64' || architecture === 'arm64',
'"architecture" must be either "x86_64" or "arm64"'
);
}
if (memory !== undefined) {
assert(typeof memory === 'number', '"memory" is not a number');
}
@@ -159,6 +171,7 @@ export class Lambda {
this.files = 'files' in opts ? opts.files : undefined;
this.handler = handler;
this.runtime = runtime;
this.architecture = architecture;
this.memory = memory;
this.maxDuration = maxDuration;
this.environment = environment;

View File

@@ -1,4 +1,4 @@
import { File } from './types';
import type { File, HasField } from './types';
import { Lambda } from './lambda';
interface PrerenderOptions {
@@ -12,6 +12,8 @@ interface PrerenderOptions {
initialStatus?: number;
passQuery?: boolean;
sourcePath?: string;
experimentalBypassFor?: HasField;
experimentalStreamingLambdaPath?: string;
}
export class Prerender {
@@ -26,6 +28,8 @@ export class Prerender {
public initialStatus?: number;
public passQuery?: boolean;
public sourcePath?: string;
public experimentalBypassFor?: HasField;
public experimentalStreamingLambdaPath?: string;
constructor({
expiration,
@@ -38,6 +42,8 @@ export class Prerender {
initialStatus,
passQuery,
sourcePath,
experimentalBypassFor,
experimentalStreamingLambdaPath,
}: PrerenderOptions) {
this.type = 'Prerender';
this.expiration = expiration;
@@ -86,6 +92,26 @@ export class Prerender {
);
}
if (experimentalBypassFor !== undefined) {
if (
!Array.isArray(experimentalBypassFor) ||
experimentalBypassFor.some(
field =>
typeof field !== 'object' ||
// host doesn't need a key
(field.type !== 'host' && typeof field.key !== 'string') ||
typeof field.type !== 'string' ||
(field.value !== undefined && typeof field.value !== 'string')
)
) {
throw new Error(
'The `experimentalBypassFor` argument for `Prerender` must be Array of objects with fields `type`, `key` and optionally `value`.'
);
}
this.experimentalBypassFor = experimentalBypassFor;
}
if (typeof fallback === 'undefined') {
throw new Error(
'The `fallback` argument for `Prerender` needs to be a `FileBlob`, `FileFsRef`, `FileRef`, or null.'
@@ -130,5 +156,14 @@ export class Prerender {
}
this.allowQuery = allowQuery;
}
if (experimentalStreamingLambdaPath !== undefined) {
if (typeof experimentalStreamingLambdaPath !== 'string') {
throw new Error(
'The `experimentalStreamingLambdaPath` argument for `Prerender` must be a string.'
);
}
this.experimentalStreamingLambdaPath = experimentalStreamingLambdaPath;
}
}
}

View File

@@ -45,6 +45,18 @@ export interface Config {
[key: string]: unknown;
}
export type HasField = Array<
| {
type: 'host';
value: string;
}
| {
type: 'header' | 'cookie' | 'query';
key: string;
value?: string;
}
>;
export interface Meta {
isDev?: boolean;
devCacheDir?: string;
@@ -300,9 +312,13 @@ export interface PackageJson {
}
export interface NodeVersion {
/** major version number: 18 */
major: number;
/** major version range: "18.x" */
range: string;
/** runtime descriptor: "nodejs18.x" */
runtime: string;
/** date beyond which this version is discontinued: 2023-08-17T19:05:45.951Z */
discontinueDate?: Date;
}
@@ -418,6 +434,13 @@ export interface Cron {
schedule: string;
}
// TODO: Proper description once complete
export interface Flag {
key: string;
defaultValue?: unknown;
metadata: Record<string, unknown>;
}
/** The framework which created the function */
export interface FunctionFramework {
slug: string;
@@ -442,6 +465,7 @@ export interface BuildResultV2Typical {
framework?: {
version: string;
};
flags?: Flag[];
}
export type BuildResultV2 = BuildResultV2Typical | BuildResultBuildOutput;

View File

@@ -0,0 +1,2 @@
.vercel
public

Some files were not shown because too many files have changed in this diff Show More