Compare commits

..

111 Commits

Author SHA1 Message Date
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
1673 changed files with 1106037 additions and 254679 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 @ztanner
/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 @ztanner @huozhi
/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'
@@ -91,7 +91,8 @@ jobs:
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
- name: 'Determing Turbo HIT or MISS'
- name: 'Determine Turbo HIT or MISS'
if: ${{ !cancelled() }}
id: turbo-summary
shell: bash
run: |
@@ -102,7 +103,7 @@ jobs:
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: 'Upload Test Report to Datadog'
if: ${{ steps['turbo-summary'].outputs.misses != '0' }}
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

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');
});

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

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

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.6.3",
"@types/react": "18.2.22",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"eslint": "8.49.0",
"eslint-config-next": "13.5.2",
"next": "13.5.2",
"postcss": "8.4.30",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.2.2"
"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,7 +9,7 @@
},
"devDependencies": {
"@types/jest": "27.4.1",
"@vercel/frameworks": "2.0.2"
"@vercel/frameworks": "2.0.3"
},
"version": null
}

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

@@ -1,5 +1,26 @@
# @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

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "@vercel-internals/types",
"version": "1.0.11",
"version": "1.0.14",
"types": "index.d.ts",
"main": "index.d.ts",
"files": [
@@ -10,8 +10,8 @@
"dependencies": {
"@types/node": "14.14.31",
"@vercel-internals/constants": "1.0.4",
"@vercel/build-utils": "7.2.1",
"@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,7 +11,7 @@
"@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",
@@ -33,7 +33,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "29.1.0",
"turbo": "1.10.14",
"turbo": "1.10.16",
"typescript": "4.9.5"
},
"scripts": {
@@ -50,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 && node utils/update-canary-tags.mjs && 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,17 @@
# @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

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "7.2.1",
"version": "7.2.3",
"license": "Apache-2.0",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
@@ -14,7 +14,8 @@
"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.1",
"@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",

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

@@ -311,8 +311,13 @@ export async function scanParentDirs(
bunLockPath ? fs.readFile(bunLockPath, 'utf8') : null,
]);
// Priority order is Yarn > pnpm > npm > bun
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) {

View File

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

View File

@@ -0,0 +1,8 @@
import { mkdir, rm, writeFile } from 'node:fs/promises'
import { say } from 'cowsay'
const text = say({ text: `bun version: ${process.versions.bun}` })
const content = say({ text })
await rm('./public', { recursive: true, force: true })
await mkdir('./public', { recursive: true })
await writeFile('./public/index.txt', content)

Binary file not shown.

View File

@@ -0,0 +1,9 @@
{
"private": true,
"scripts": {
"build": "bun build.js"
},
"dependencies": {
"cowsay": "1.5.0"
}
}

View File

@@ -0,0 +1,8 @@
{
"probes": [
{
"path": "/",
"mustContain": "bun version: 1"
}
]
}

View File

@@ -0,0 +1,221 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# bun ./bun.lockb --hash: CD5862D9DB80873E-24483eaa80ed0cc4-641E4430BAAAECB3-abebd38edad3b1b9
ansi-regex@^3.0.0:
version "3.0.1"
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz"
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
ansi-styles@^4.0.0:
version "4.3.0"
resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
camelcase@^5.0.0:
version "5.3.1"
resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
cliui@^6.0.0:
version "6.0.0"
resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz"
integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^6.2.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
cowsay@1.5.0:
version "1.5.0"
resolved "https://registry.npmjs.org/cowsay/-/cowsay-1.5.0.tgz"
integrity sha512-8Ipzr54Z8zROr/62C8f0PdhQcDusS05gKTS87xxdji8VbWefWly0k8BwGK7+VqamOrkv3eGsCkPtvlHzrhWsCA==
dependencies:
get-stdin "8.0.0"
string-width "~2.1.1"
strip-final-newline "2.0.0"
yargs "15.4.1"
decamelize@^1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz"
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
find-up@^4.1.0:
version "4.1.0"
resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz"
integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
dependencies:
locate-path "^5.0.0"
path-exists "^4.0.0"
get-caller-file@^2.0.1:
version "2.0.5"
resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
get-stdin@8.0.0:
version "8.0.0"
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz"
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz"
integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz"
integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==
dependencies:
p-locate "^4.1.0"
p-limit@^2.2.0:
version "2.3.0"
resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz"
integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==
dependencies:
p-try "^2.0.0"
p-locate@^4.1.0:
version "4.1.0"
resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz"
integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==
dependencies:
p-limit "^2.2.0"
p-try@^2.0.0:
version "2.2.0"
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
path-exists@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz"
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz"
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
require-main-filename@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz"
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
set-blocking@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz"
integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==
string-width@~2.1.1:
version "2.1.1"
resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz"
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
dependencies:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"
string-width@^4.1.0, string-width@^4.2.0:
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz"
integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==
dependencies:
ansi-regex "^3.0.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-final-newline@2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz"
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
which-module@^2.0.0:
version "2.0.1"
resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz"
integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==
wrap-ansi@^6.2.0:
version "6.2.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz"
integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
y18n@^4.0.0:
version "4.0.3"
resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz"
integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==
yargs@15.4.1:
version "15.4.1"
resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz"
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
find-up "^4.1.0"
get-caller-file "^2.0.1"
require-directory "^2.1.1"
require-main-filename "^2.0.0"
set-blocking "^2.0.0"
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^18.1.2"
yargs-parser@^18.1.2:
version "18.1.3"
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz"
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"

View File

@@ -1,4 +1,7 @@
{
"compilerOptions": {
"sourceMap": true
},
"extends": "../tsconfig.json",
"include": ["*.test.ts"]
}

View File

@@ -29,7 +29,7 @@ describe('Test `readConfigFile()`', () => {
it('should return parsed object when file exists', async () => {
expect(await readConfigFile(tsconfig)).toMatchObject({
compilerOptions: {
strict: true,
outDir: './dist',
},
});
expect(logMessages).toEqual([]);
@@ -39,7 +39,7 @@ describe('Test `readConfigFile()`', () => {
const files = [doesnotexist, tsconfig];
expect(await readConfigFile(files)).toMatchObject({
compilerOptions: {
strict: true,
outDir: './dist',
},
});
expect(logMessages).toEqual([]);
@@ -63,7 +63,7 @@ describe('Test `readConfigFile()`', () => {
await writeFile(invalid, 'borked');
expect(await readConfigFile([invalid, tsconfig])).toMatchObject({
compilerOptions: {
strict: true,
outDir: './dist',
},
});
} finally {

View File

@@ -313,6 +313,23 @@ it('should warn for deprecated versions, soon to be discontinued', async () => {
global.Date.now = realDateNow;
});
it('should only allow nodejs20.x when env var is set', async () => {
try {
expect(getLatestNodeVersion()).toHaveProperty('major', 18);
await expect(getSupportedNodeVersion('20.x')).rejects.toThrow();
process.env.VERCEL_ALLOW_NODEJS20 = '1';
expect(getLatestNodeVersion()).toHaveProperty('major', 20);
expect(await getSupportedNodeVersion('20.x')).toHaveProperty('major', 20);
expect(await getSupportedNodeVersion('20')).toHaveProperty('major', 20);
expect(await getSupportedNodeVersion('20.1.0')).toHaveProperty('major', 20);
expect(await getSupportedNodeVersion('>=16')).toHaveProperty('major', 20);
} finally {
delete process.env.VERCEL_ALLOW_NODEJS20;
}
});
it('should support initialHeaders and initialStatus correctly', async () => {
new Prerender({
expiration: 1,
@@ -541,6 +558,15 @@ it(
);
it('should return cliType bun and correct lock file for bun v1', async () => {
const fixture = path.join(__dirname, 'fixtures', '31-bun-v1-with-yarn-lock');
const result = await scanParentDirs(fixture);
expect(result.cliType).toEqual('bun');
expect(result.lockfileVersion).toEqual(0);
expect(result.lockfilePath).toEqual(path.join(fixture, 'bun.lockb'));
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
});
it('should return cliType bun and correct lock file for bun v1 with yarn.lock file', async () => {
const fixture = path.join(__dirname, 'fixtures', '30-bun-v1');
const result = await scanParentDirs(fixture);
expect(result.cliType).toEqual('bun');

View File

@@ -1,21 +1,9 @@
{
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"esModuleInterop": true,
"lib": ["ES2021"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./dist",
"types": ["node", "jest"],
"strict": true,
"target": "ES2021"
"types": ["node", "jest"]
},
"extends": "../../tsconfig.base.json",
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

View File

@@ -1,5 +1,77 @@
# 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`](https://github.com/vercel/vercel/commit/fc90a3dc0bd998453f6527c03d211c35bb0d5770), [`644b8a52c`](https://github.com/vercel/vercel/commit/644b8a52cb2cc8f05e215e2230f95f902cdf8ae8), [`0861dc8fb`](https://github.com/vercel/vercel/commit/0861dc8fbcea1037626b00664a4b6c22f1b0a7ed), [`33cc8e0ac`](https://github.com/vercel/vercel/commit/33cc8e0acf1b3466d50d45b2e5bbe66b89a87c14), [`f5296c3c0`](https://github.com/vercel/vercel/commit/f5296c3c06e620a39c5f88287ac94e58703bdaac), [`d9065c210`](https://github.com/vercel/vercel/commit/d9065c2102223e9cdb5b22df14db41c363cf7828)]:
- @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
## 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`](https://github.com/vercel/vercel/commit/da300030c999b3555c608a321c9d0a4d36923a5a), [`de84743e1`](https://github.com/vercel/vercel/commit/de84743e10d4c9701d409355c0fe057f35e6e435), [`913608de4`](https://github.com/vercel/vercel/commit/913608de4dd4e37557533d732ca8449a5737d4a6), [`7fa08088e`](https://github.com/vercel/vercel/commit/7fa08088ea0d5df6955ea4af7f08513cf4027bb3)]:
- @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
## 32.4.1
### Patch Changes
- Updated dependencies [[`c523a755f`](https://github.com/vercel/vercel/commit/c523a755f8e4bc41f7c353ebc0b939c21703df00), [`58215906f`](https://github.com/vercel/vercel/commit/58215906f9ee28da3a7f2f3f4aeb862ab53bf55e)]:
- @vercel/next@4.0.10
## 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`](https://github.com/vercel/vercel/commit/e9026c7a692937122e60e73b91100cf7009e022d), [`ea5bc8806`](https://github.com/vercel/vercel/commit/ea5bc8806276abf5ba14bdb4a966267497e5d14d), [`a4996e1c5`](https://github.com/vercel/vercel/commit/a4996e1c5a7e6986d5410b662014dc584c0f7c54), [`a18ed98f2`](https://github.com/vercel/vercel/commit/a18ed98f2df78fe1256410ea8676686564ed9b35), [`2f5b0aeeb`](https://github.com/vercel/vercel/commit/2f5b0aeeb183ed3ea8cbc68cb3bc3c949c486ada), [`09f1bbfa4`](https://github.com/vercel/vercel/commit/09f1bbfa41a87cf0063a3fb3022b7531d03862b5), [`ce7e82fa7`](https://github.com/vercel/vercel/commit/ce7e82fa7aa6cec5f5d7b4953353b297b7ad1694)]:
- @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
## 32.3.1
### Patch Changes
- Use "esbuild" to build CLI ([#10555](https://github.com/vercel/vercel/pull/10555))
- Updated dependencies [[`9f63ca60a`](https://github.com/vercel/vercel/commit/9f63ca60ad914af0f7ba18c9bbe1656eeea68a0a), [`e3f9faf51`](https://github.com/vercel/vercel/commit/e3f9faf513bd97900d8966f2f1116fc3ca07221b)]:
- @vercel/next@4.0.8
- @vercel/remix-builder@2.0.8
## 32.3.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "32.3.0",
"version": "32.5.1",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -16,35 +16,37 @@
"test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
"test-dev": "pnpm test test/dev/",
"coverage": "codecov",
"build": "ts-node ./scripts/build.ts",
"dev": "ts-node ./src/index.ts"
"build": "node scripts/build.mjs",
"dev": "ts-node ./src/index.ts",
"type-check": "tsc --noEmit"
},
"bin": {
"vc": "./dist/index.js",
"vercel": "./dist/index.js"
},
"files": [
"dist",
"scripts/preinstall.js"
"dist"
],
"engines": {
"node": ">= 16"
},
"dependencies": {
"@vercel/build-utils": "7.2.1",
"@vercel/go": "3.0.2",
"@vercel/build-utils": "7.2.3",
"@vercel/fun": "1.1.0",
"@vercel/go": "3.0.3",
"@vercel/hydrogen": "1.0.1",
"@vercel/next": "4.0.7",
"@vercel/node": "3.0.6",
"@vercel/python": "4.0.2",
"@vercel/redwood": "2.0.3",
"@vercel/remix-builder": "2.0.7",
"@vercel/next": "4.0.12",
"@vercel/node": "3.0.8",
"@vercel/python": "4.1.0",
"@vercel/redwood": "2.0.5",
"@vercel/remix-builder": "2.0.11",
"@vercel/ruby": "2.0.2",
"@vercel/static-build": "2.0.7"
"@vercel/static-build": "2.0.10",
"chokidar": "3.3.1"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
"@edge-runtime/node-utils": "2.2.1",
"@edge-runtime/node-utils": "2.2.2",
"@next/env": "11.1.2",
"@sentry/node": "5.5.0",
"@sindresorhus/slugify": "0.11.0",
@@ -86,15 +88,12 @@
"@types/yauzl-promise": "2.1.0",
"@vercel-internals/constants": "1.0.4",
"@vercel-internals/get-package-json": "1.0.0",
"@vercel-internals/types": "1.0.11",
"@vercel/client": "13.0.4",
"@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.2",
"@vercel/fs-detectors": "5.1.0",
"@vercel/fun": "1.1.0",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "3.0.0",
"@zeit/source-map-support": "0.6.2",
"@vercel-internals/types": "1.0.14",
"@vercel/client": "13.0.7",
"@vercel/error-utils": "2.0.2",
"@vercel/frameworks": "2.0.3",
"@vercel/fs-detectors": "5.1.3",
"@vercel/routing-utils": "3.1.0",
"ajv": "6.12.2",
"alpha-sort": "2.0.1",
"ansi-escapes": "4.3.2",
@@ -106,10 +105,8 @@
"bytes": "3.0.0",
"chalk": "4.1.0",
"chance": "1.1.7",
"chokidar": "3.3.1",
"cli-table3": "0.6.3",
"codecov": "3.8.2",
"cpy": "7.2.0",
"date-fns": "1.29.0",
"debug": "3.1.0",
"dot": "1.1.3",
@@ -161,7 +158,6 @@
"strip-ansi": "6.0.1",
"supports-hyperlinks": "3.0.0",
"tar-fs": "1.16.3",
"test-listen": "1.1.0",
"text-table": "0.2.0",
"title": "3.4.1",
"tmp-promise": "1.0.3",

View File

@@ -0,0 +1,54 @@
import { join } from 'node:path';
import { copyFileSync, readFileSync, writeFileSync } from 'node:fs';
import { esbuild } from '../../../utils/build.mjs';
import { compileDevTemplates } from './compile-templates.mjs';
const repoRoot = new URL('../', import.meta.url);
function createConstants() {
const filename = new URL('src/util/constants.ts', repoRoot);
const contents = `// This file is auto-generated
export const GA_TRACKING_ID: string | undefined = ${envToString(
'GA_TRACKING_ID'
)};
export const SENTRY_DSN: string | undefined = ${envToString('SENTRY_DSN')};
`;
writeFileSync(filename, contents, 'utf8');
}
function envToString(key) {
const value = process.env[key];
if (value) {
return JSON.stringify(value);
}
}
// Read the secrets from GitHub Actions and generate a file.
// During local development, these secrets will be empty.
createConstants();
// Compile the `doT.js` template files for `vercel dev`
await compileDevTemplates();
const pkgPath = join(process.cwd(), 'package.json');
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
const externals = Object.keys(pkg.dependencies || {});
await esbuild({
bundle: true,
external: externals,
});
// Copy a few static files into `dist`
const distRoot = new URL('dist/', repoRoot);
copyFileSync(
new URL('src/util/projects/VERCEL_DIR_README.txt', repoRoot),
new URL('VERCEL_DIR_README.txt', distRoot)
);
copyFileSync(
new URL('src/util/dev/builder-worker.js', repoRoot),
new URL('builder-worker.js', distRoot)
);
copyFileSync(
new URL('src/util/get-latest-version/get-latest-worker.js', repoRoot),
new URL('get-latest-worker.js', distRoot)
);

View File

@@ -1,100 +0,0 @@
import cpy from 'cpy';
import execa from 'execa';
import { join } from 'path';
import { remove, readJSON, writeFile } from 'fs-extra';
const dirRoot = join(__dirname, '..');
const distRoot = join(dirRoot, 'dist');
async function createConstants() {
console.log('Creating constants.ts');
const filename = join(dirRoot, 'src/util/constants.ts');
const contents = `// This file is auto-generated
export const GA_TRACKING_ID: string | undefined = ${envToString(
'GA_TRACKING_ID'
)};
export const SENTRY_DSN: string | undefined = ${envToString('SENTRY_DSN')};
`;
await writeFile(filename, contents, 'utf8');
}
function envToString(key: string) {
const value = process.env[key];
if (!value) {
console.log(`- Constant ${key} is not assigned`);
}
return JSON.stringify(value);
}
async function main() {
// Read the secrets from GitHub Actions and generate a file.
// During local development, these secrets will be empty.
await createConstants();
// `vercel dev` uses chokidar to watch the filesystem, but opts-out of the
// `fsevents` feature using `useFsEvents: false`, so delete the module here so
// that it is not compiled by ncc, which makes the npm package size larger
// than necessary.
await remove(join(dirRoot, '../../node_modules/fsevents'));
// Compile the `doT.js` template files for `vercel dev`
console.log();
await execa(process.execPath, [join(__dirname, 'compile-templates.js')], {
stdio: 'inherit',
});
const pkg = await readJSON(join(dirRoot, 'package.json'));
const dependencies = Object.keys(pkg?.dependencies ?? {});
// Do the initial `ncc` build
console.log('Dependencies:', dependencies);
const externs: Array<string> = [];
for (const dep of dependencies) {
externs.push('--external', dep);
}
const args = ['ncc', 'build', 'src/index.ts', ...externs];
await execa('pnpm', args, { stdio: 'inherit', cwd: dirRoot });
// `ncc` has some issues with `@vercel/fun`'s runtime files:
// - Executable bits on the `bootstrap` files appear to be lost:
// https://github.com/vercel/ncc/pull/182
// - The `bootstrap.js` asset does not get copied into the output dir:
// https://github.com/vercel/ncc/issues/278
//
// Aside from those issues, all the same files from the `runtimes` directory
// should be copied into the output runtimes dir, specifically the `index.js`
// files (correctly) do not get copied into the output bundle because they
// get compiled into the final ncc bundle file, however, we want them to be
// present in the npm package because the contents of those files are involved
// with `fun`'s cache invalidation mechanism and they need to be shasum'd.
const runtimes = join(dirRoot, 'node_modules/@vercel/fun/dist/src/runtimes');
await cpy('**/*', join(distRoot, 'runtimes'), {
parents: true,
cwd: runtimes,
});
// Band-aid to bundle stuff that `ncc` neglects to bundle
await cpy(join(dirRoot, 'src/util/projects/VERCEL_DIR_README.txt'), distRoot);
await cpy(join(dirRoot, 'src/util/dev/builder-worker.js'), distRoot);
await cpy(
join(dirRoot, 'src/util/get-latest-version/get-latest-worker.js'),
distRoot
);
console.log('Finished building Vercel CLI');
}
process.on('unhandledRejection', (reason: any, promise: Promise<any>) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
process.exit(1);
});
process.on('uncaughtException', err => {
console.error('Uncaught Exception:');
console.error(err);
process.exit(1);
});
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -1,88 +0,0 @@
const execa = require('execa');
const { join } = require('path');
const { readFile, writeFile, readdir, remove } = require('fs-extra');
async function main() {
const dirRoot = join(__dirname, '..');
// Compile the `doT.js` template files for `vercel dev`
const templatesDir = join(dirRoot, 'src/util/dev/templates');
const dotPacker = join(dirRoot, '../../node_modules/dot/bin/dot-packer');
await execa(process.execPath, [dotPacker], {
cwd: templatesDir,
stdio: 'inherit',
});
const files = await readdir(templatesDir);
const compiledFiles = files.filter(f => f.endsWith('.js'));
// Prettier
console.log('\nMaking the compiled template functions prettier...');
const prettier = join(dirRoot, '../../node_modules/prettier/bin-prettier.js');
await execa(
process.execPath,
[prettier, '--write', '--single-quote', ...compiledFiles],
{
cwd: templatesDir,
stdio: 'inherit',
}
);
console.log('\nConverting template functions to TypeScript');
for (const file of compiledFiles) {
const start = Date.now();
const fnPath = join(templatesDir, file);
const tsPath = fnPath.replace(/\.js$/, '.ts');
const def = await readFile(fnPath.replace(/\.js$/, '.tsdef'), 'utf8');
const interfaceName = def.match(/interface (\w+)/)[1];
const lines = require(fnPath).toString().split('\n');
let errorHtmlStart = -1;
let errorHtmlEnd = -1;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (errorHtmlStart === -1 && line.includes('encodeHTML')) {
errorHtmlStart = i;
} else if (errorHtmlEnd === -1 && line.includes(')();')) {
errorHtmlEnd = i;
}
if (/\bvar\b/.test(line)) {
lines[i] = line.replace(/\bvar\b/g, 'let');
}
}
lines.splice(errorHtmlStart, errorHtmlEnd);
lines[0] = `export default ${lines[0].replace(
'(it)',
`(it: ${interfaceName}): string`
)}`;
lines.unshift(
"import encodeHTML from 'escape-html';",
'',
...def.split('\n')
);
await Promise.all([writeFile(tsPath, lines.join('\n')), remove(fnPath)]);
console.log(
`${file} -> ${file.replace(/\.js$/, '.ts')} (${Date.now() - start}ms)`
);
}
}
process.on('unhandledRejection', err => {
console.error('Unhandled Rejection:');
console.error(err);
process.exit(1);
});
process.on('uncaughtException', err => {
console.error('Uncaught Exception:');
console.error(err);
process.exit(1);
});
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,43 @@
import execa from 'execa';
import { fileURLToPath } from 'node:url';
import { readFile, writeFile, readdir, unlink } from 'node:fs/promises';
export async function compileDevTemplates() {
const dirRoot = new URL('../', import.meta.url);
// Compile the `doT.js` template files for `vercel dev`
const templatesDir = new URL('src/util/dev/templates/', dirRoot);
const dotPacker = fileURLToPath(
new URL('../../node_modules/dot/bin/dot-packer', dirRoot)
);
await execa(process.execPath, [dotPacker], {
cwd: templatesDir,
stdio: ['ignore', 'ignore', 'inherit'],
});
const files = await readdir(templatesDir);
const compiledFiles = files.filter(f => f.endsWith('.js'));
for (const file of compiledFiles) {
const fnPath = new URL(file, templatesDir);
const tsPath = fnPath.href.replace(/\.js$/, '.ts');
const def = await readFile(
new URL(fnPath.href.replace(/\.js$/, '.tsdef')),
'utf8'
);
const interfaceName = def.match(/interface (\w+)/)[1];
const { default: fn } = await import(fnPath);
const contents = `import encodeHTML from 'escape-html';
${def}
export default ${fn
.toString()
.replace(/var encodeHTML.+\(\)\);/s, '')
.replace(/\bvar\b/g, 'let')
.replace(/\(it\s*\)/s, `(it: ${interfaceName}): string`)}`;
await Promise.all([writeFile(new URL(tsPath), contents), unlink(fnPath)]);
}
}

View File

@@ -106,6 +106,10 @@ export interface BuildsManifest {
argv: string[];
error?: any;
builds?: SerializedBuilder[];
features?: {
speedInsightsVersion?: string | undefined;
webAnalyticsVersion?: string | undefined;
};
}
export default async function main(client: Client): Promise<number> {
@@ -249,7 +253,7 @@ export default async function main(client: Client): Promise<number> {
output.debug(`Loaded environment variables from "${envPath}"`);
}
// For Vercel Speed Insights support
// For Vercel Legacy speed Insights support
if (project.settings.analyticsId) {
envToUnset.add('VERCEL_ANALYTICS_ID');
process.env.VERCEL_ANALYTICS_ID = project.settings.analyticsId;
@@ -428,21 +432,27 @@ async function doBuild(
const ops: Promise<Error | void>[] = [];
const dependencies = [
...Object.keys(pkg?.dependencies ?? {}),
...Object.keys(pkg?.devDependencies ?? {}),
];
const dependencyMap = makeDepencyMap(pkg);
const speedInsighsVersion = dependencyMap.get('@vercel/speed-insights');
if (speedInsighsVersion) {
if (process.env.VERCEL_ANALYTICS_ID) {
output.warn(
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
);
const isUsingSpeedInsights = dependencies.some(
d => d === '@vercel/speed-insights'
);
if (isUsingSpeedInsights && process.env.VERCEL_ANALYTICS_ID) {
output.warn(
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
);
delete process.env.VERCEL_ANALYTICS_ID;
delete process.env.VERCEL_ANALYTICS_ID;
}
buildsJson.features = {
...(buildsJson.features ?? {}),
speedInsightsVersion: speedInsighsVersion,
};
}
const webAnalyticsVersion = dependencyMap.get('@vercel/analytics');
if (webAnalyticsVersion) {
buildsJson.features = {
...(buildsJson.features ?? {}),
webAnalyticsVersion: webAnalyticsVersion,
};
}
// Write the `detectedBuilders` result to output dir
@@ -807,3 +817,10 @@ function mergeFlags(
return [];
});
}
function makeDepencyMap(pkg: PackageJson | null): Map<string, string> {
return new Map([
...Object.entries(pkg?.devDependencies ?? {}),
...Object.entries(pkg?.dependencies ?? {}),
]);
}

View File

@@ -43,10 +43,7 @@ async function ls(
}
// Get the list of certificates
const { certs, pagination } = await getCerts(
client,
...paginationOptions
).catch(err => err);
const { certs, pagination } = await getCerts(client, ...paginationOptions);
output.log(
`${

View File

@@ -17,12 +17,14 @@ type Options = {};
export default async function buy(
client: Client,
opts: Options,
opts: Partial<Options>,
args: string[]
) {
const { output } = client;
const { contextName } = await getScope(client);
const skipConfirmation = !!process.env.CI;
const [domainName] = args;
if (!domainName) {
output.error(
@@ -78,25 +80,31 @@ export default async function buy(
'available'
)} to buy under ${chalk.bold(contextName)}! ${availableStamp()}`
);
if (
!(await promptBool(
`Buy now for ${chalk.bold(`$${price}`)} (${`${period}yr${
period > 1 ? 's' : ''
}`})?`,
client
))
) {
return 0;
}
const autoRenew = await promptBool(
renewalPrice.period === 1
? `Auto renew yearly for ${chalk.bold(`$${price}`)}?`
: `Auto renew every ${renewalPrice.period} years for ${chalk.bold(
`$${price}`
)}?`,
{ ...client, defaultValue: true }
);
let autoRenew;
if (skipConfirmation) {
autoRenew = true;
} else {
if (
!(await promptBool(
`Buy now for ${chalk.bold(`$${price}`)} (${`${period}yr${
period > 1 ? 's' : ''
}`})?`,
client
))
) {
return 0;
}
autoRenew = await promptBool(
renewalPrice.period === 1
? `Auto renew yearly for ${chalk.bold(`$${price}`)}?`
: `Auto renew every ${renewalPrice.period} years for ${chalk.bold(
`$${price}`
)}?`,
{ ...client, defaultValue: true }
);
}
let buyResult;
const purchaseStamp = stamp();

View File

@@ -24,6 +24,9 @@ import { updateCurrentTeamAfterLogin } from '../../util/login/update-current-tea
export default async function login(client: Client): Promise<number> {
const { output } = client;
// user is not currently authenticated on this machine
const isInitialLogin = !client.authConfig.token;
const argv = getArgs(client.argv.slice(2), {
'--oob': Boolean,
'--github': Boolean,
@@ -68,14 +71,22 @@ export default async function login(client: Client): Promise<number> {
return result;
}
const isNewLogin = !client.authConfig.token;
// Save the user's authentication token to the configuration file.
client.authConfig.token = result.token;
// If we have a new login, update `currentTeam`
if (isNewLogin) {
await updateCurrentTeamAfterLogin(client, output, result.teamId);
if (result.teamId) {
client.config.currentTeam = result.teamId;
} else {
delete client.config.currentTeam;
}
// If we have a brand new login, update `currentTeam`
if (isInitialLogin) {
await updateCurrentTeamAfterLogin(
client,
output,
client.config.currentTeam
);
}
writeToAuthConfigFile(client.authConfig);

View File

@@ -14,7 +14,6 @@ try {
import { join } from 'path';
import { existsSync } from 'fs';
import sourceMap from '@zeit/source-map-support';
import { mkdirp } from 'fs-extra';
import chalk from 'chalk';
import epipebomb from 'epipebomb';
@@ -66,8 +65,6 @@ const GLOBAL_COMMANDS = new Set(['help']);
epipebomb();
sourceMap.install();
// Configure the error reporting system
Sentry.init({
dsn: SENTRY_DSN,
@@ -429,6 +426,10 @@ const main = async () => {
try {
user = await getUser(client);
} catch (err: unknown) {
if (err instanceof Error) {
output.debug(err.stack || err.toString());
}
if (isErrnoException(err) && err.code === 'NOT_AUTHORIZED') {
output.prettyError({
message: `You do not have access to the specified account`,

View File

@@ -3,6 +3,7 @@ import plural from 'pluralize';
import npa from 'npm-package-arg';
import { satisfies } from 'semver';
import { dirname, join } from 'path';
import { createRequire } from 'module';
import { mkdirp, outputJSON, readJSON, symlink } from 'fs-extra';
import { isStaticRuntime } from '@vercel/fs-detectors';
import { BuilderV2, BuilderV3, PackageJson } from '@vercel/build-utils';
@@ -28,6 +29,9 @@ type ResolveBuildersResult =
| { buildersToAdd: Set<string> }
| { builders: Map<string, BuilderWithPkg> };
// Get a real `require()` reference that esbuild won't mutate
const require_ = createRequire(__filename);
/**
* Imports the specified Vercel Builders, installing any missing ones
* into `.vercel/builders` if necessary.
@@ -115,10 +119,9 @@ export async function resolveBuilders(
// If `pkgPath` wasn't found in `.vercel/builders` then try as a CLI local
// dependency. `require.resolve()` will throw if the Builder is not a CLI
// dep, in which case we'll install it into `.vercel/builders`.
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__`
pkgPath = eval('require').resolve(`${name}/package.json`, {
pkgPath = require_.resolve(`${name}/package.json`, {
paths: [__dirname],
}) as string;
});
builderPkg = await readJSON(pkgPath);
}
@@ -159,8 +162,7 @@ export async function resolveBuilders(
const path = join(dirname(pkgPath), builderPkg.main || 'index.js');
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__`
const builder = eval('require')(path);
const builder = require_(path);
builders.set(spec, {
builder,

View File

@@ -790,11 +790,10 @@ export default class DevServer {
const merged: Env = { ...env, ...localEnv };
// Validate that the env var name matches what AWS Lambda allows:
// - https://docs.aws.amazon.com/lambda/latest/dg/env_variables.html
// Validate that the env var name satisfies what Vercel's platform accepts.
let hasInvalidName = false;
for (const key of Object.keys(merged)) {
if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(key)) {
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) {
this.output.warn(
`Ignoring ${type
.split('.')
@@ -808,7 +807,7 @@ export default class DevServer {
}
if (hasInvalidName) {
this.output.log(
'Env var names must start with letters, and can only contain alphanumeric characters and underscores'
'The name contains invalid characters. Only letters, digits, and underscores are allowed. Furthermore, the name should not start with a digit'
);
}
@@ -1319,6 +1318,11 @@ export default class DevServer {
}
if (!match && status && phase !== 'miss') {
if (routeResult.userDest) {
// If it's a user defined route then we continue routing
return false;
}
this.output.debug(`Route found with with status code ${status}`);
await this.sendError(req, res, requestId, '', status, headers);
return true;

View File

@@ -24,11 +24,7 @@ export function createProxy(client: Client): Server {
json: false,
});
res.statusCode = fetchRes.status;
mergeIntoServerResponse(
// @ts-expect-error - `node-fetch` Headers is missing `getAll()`
toOutgoingHeaders(fetchRes.headers),
res
);
mergeIntoServerResponse(toOutgoingHeaders(fetchRes.headers), res);
fetchRes.body.pipe(res);
} catch (err: unknown) {
client.output.prettyError(err);

View File

@@ -10,8 +10,8 @@
* the world, but something to be aware of.
*
* IMPORTANT! This file must NOT depend on any 3rd party dependencies. This
* file is NOT bundled by `ncc` and thus any 3rd party dependencies will never
* be available.
* file is NOT bundled by `esbuild` and thus any 3rd party dependencies will
* never be available.
*/
const https = require('https');

View File

@@ -0,0 +1,27 @@
{
"name": "01-node",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"moment": "^2.24.0"
}
},
"node_modules/moment": {
"version": "2.25.3",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.25.3.tgz",
"integrity": "sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg==",
"engines": {
"node": "*"
}
}
},
"dependencies": {
"moment": {
"version": "2.25.3",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.25.3.tgz",
"integrity": "sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg=="
}
}
}

View File

@@ -1,8 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
moment@^2.24.0:
version "2.25.3"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.25.3.tgz#252ff41319cf41e47761a1a88cab30edfe9808c0"
integrity sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg==

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,6 @@
"aurelia-testing": "1.0.0",
"aurelia-tools": "2.0.0",
"aurelia-webpack-plugin": "3.0.0",
"babel-eslint": "10.0.1",
"babel-jest": "24.5.0",
"babel-loader": "8.0.5",
"babel-plugin-istanbul": "5.1.1",
@@ -31,7 +30,6 @@
"css-loader": "1.0.0",
"del": "3.0.0",
"duplicate-package-checker-webpack-plugin": "3.0.0",
"eslint": "7.0.0",
"expose-loader": "0.7.5",
"file-loader": "2.0.0",
"gulp": "4.0.0",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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