Compare commits

...

22 Commits

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

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

---------

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

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

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

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

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

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

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

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

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

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

I noticed this in the build logs here:

<img width="862" alt="image" src="https://user-images.githubusercontent.com/229881/225774670-9b4aecf5-d020-489f-819f-7b55ce96f877.png">
2023-03-16 23:57:33 +00:00
65 changed files with 950 additions and 503 deletions

View File

@@ -61,6 +61,7 @@ jobs:
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
run: pnpm publish-from-github
env:
NPM_CONFIG_PROVENANCE: 'true'
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

View File

@@ -1,22 +0,0 @@
import { RemixBrowser } from "@remix-run/react";
import { startTransition, StrictMode } from "react";
import { hydrateRoot } from "react-dom/client";
function hydrate() {
startTransition(() => {
hydrateRoot(
document,
<StrictMode>
<RemixBrowser />
</StrictMode>
);
});
}
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
// https://caniuse.com/requestidlecallback
setTimeout(hydrate, 1);
}

View File

@@ -1,18 +0,0 @@
import handleRequest from "@vercel/remix-entry-server";
import { RemixServer } from "@remix-run/react";
import type { EntryContext } from "@remix-run/server-runtime";
export default function (
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
) {
const remixServer = <RemixServer context={remixContext} url={request.url} />;
return handleRequest(
request,
responseStatusCode,
responseHeaders,
remixServer
);
}

View File

@@ -1,4 +1,4 @@
import type { MetaFunction } from "@remix-run/node";
import type { MetaFunction } from "@vercel/remix";
import {
Links,
LiveReload,

View File

@@ -6,18 +6,17 @@
"dev": "remix dev"
},
"dependencies": {
"@remix-run/node": "^1.13.0",
"@remix-run/react": "^1.13.0",
"@remix-run/serve": "^1.13.0",
"@remix-run/server-runtime": "^1.13.0",
"@vercel/analytics": "^0.1.10",
"@vercel/remix-entry-server": "^0.1.0",
"@remix-run/node": "^1.14.3",
"@remix-run/react": "^1.14.3",
"@remix-run/serve": "^1.14.3",
"@vercel/analytics": "^0.1.11",
"@vercel/remix": "1.14.3-patch.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.13.0",
"@remix-run/eslint-config": "^1.13.0",
"@remix-run/dev": "^1.14.3",
"@remix-run/eslint-config": "^1.14.3",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.11",
"eslint": "^8.28.0",

View File

@@ -4,32 +4,30 @@ importers:
.:
specifiers:
'@remix-run/dev': ^1.13.0
'@remix-run/eslint-config': ^1.13.0
'@remix-run/node': ^1.13.0
'@remix-run/react': ^1.13.0
'@remix-run/serve': ^1.13.0
'@remix-run/server-runtime': ^1.13.0
'@remix-run/dev': ^1.14.3
'@remix-run/eslint-config': ^1.14.3
'@remix-run/node': ^1.14.3
'@remix-run/react': ^1.14.3
'@remix-run/serve': ^1.14.3
'@types/react': ^18.0.25
'@types/react-dom': ^18.0.11
'@vercel/analytics': ^0.1.10
'@vercel/remix-entry-server': ^0.1.0
'@vercel/analytics': ^0.1.11
'@vercel/remix': 1.14.3-patch.1
eslint: ^8.28.0
react: ^18.2.0
react-dom: ^18.2.0
typescript: ^4.9.3
dependencies:
'@remix-run/node': 1.13.0
'@remix-run/react': 1.13.0_biqbaboplfbrettd7655fr4n2y
'@remix-run/serve': 1.13.0
'@remix-run/server-runtime': 1.13.0
'@vercel/analytics': 0.1.10_react@18.2.0
'@vercel/remix-entry-server': 0.1.0_react@18.2.0
'@remix-run/node': 1.14.3
'@remix-run/react': 1.14.3_biqbaboplfbrettd7655fr4n2y
'@remix-run/serve': 1.14.3
'@vercel/analytics': 0.1.11_react@18.2.0
'@vercel/remix': 1.14.3-patch.1_biqbaboplfbrettd7655fr4n2y
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
devDependencies:
'@remix-run/dev': 1.13.0_@remix-run+serve@1.13.0
'@remix-run/eslint-config': 1.13.0_km5ddj7uwb23cqeymeyvzjsfb4
'@remix-run/dev': 1.14.3_@remix-run+serve@1.14.3
'@remix-run/eslint-config': 1.14.3_km5ddj7uwb23cqeymeyvzjsfb4
'@types/react': 18.0.28
'@types/react-dom': 18.0.11
eslint: 8.34.0
@@ -1665,12 +1663,12 @@ packages:
tslib: 2.5.0
dev: true
/@remix-run/dev/1.13.0_@remix-run+serve@1.13.0:
resolution: {integrity: sha512-hPqUjM9RRcz3inBOWqP3GKhggVz0a0ikWaRZpdKrhpQNCNiF6Hunbx876mJERj2YrmIzJ05eoeQmmdF6xcr4qg==}
/@remix-run/dev/1.14.3_@remix-run+serve@1.14.3:
resolution: {integrity: sha512-46mmwiA/k9YDkg0UrP90UB3azVVWRXw16NLHRSbZiaaYe8XgUkddEtBnH/nBp/IrVCtzUL3LObplUe5sFk5Z9Q==}
engines: {node: '>=14'}
hasBin: true
peerDependencies:
'@remix-run/serve': ^1.13.0
'@remix-run/serve': ^1.14.3
peerDependenciesMeta:
'@remix-run/serve':
optional: true
@@ -1686,8 +1684,8 @@ packages:
'@babel/types': 7.20.7
'@esbuild-plugins/node-modules-polyfill': 0.1.4_esbuild@0.16.3
'@npmcli/package-json': 2.0.0
'@remix-run/serve': 1.13.0
'@remix-run/server-runtime': 1.13.0
'@remix-run/serve': 1.14.3
'@remix-run/server-runtime': 1.14.3
'@vanilla-extract/integration': 6.1.0
arg: 5.0.2
cacache: 15.3.0
@@ -1718,6 +1716,7 @@ packages:
prettier: 2.7.1
pretty-ms: 7.0.1
proxy-agent: 5.0.0
react-refresh: 0.14.0
recast: 0.21.5
remark-frontmatter: 4.0.1
remark-mdx-frontmatter: 1.1.1
@@ -1736,8 +1735,8 @@ packages:
- utf-8-validate
dev: true
/@remix-run/eslint-config/1.13.0_km5ddj7uwb23cqeymeyvzjsfb4:
resolution: {integrity: sha512-qz/N99D/q1mQefZl2X+p11xVk03r6aFDMvk/4mG+8IrMRU4BqMJ/bF53/CUOveSzvzLua4Pfi2wmqF+deHw0GQ==}
/@remix-run/eslint-config/1.14.3_km5ddj7uwb23cqeymeyvzjsfb4:
resolution: {integrity: sha512-Yy4PYSvAehj31LmkDA+lS5yCPL1lR9O04gMIo0xwHT2o59pF4QU54lEAvJJH+9MI0byZUI/v9DoGz1oGIb44IA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^8.0.0
@@ -1772,35 +1771,20 @@ packages:
- supports-color
dev: true
/@remix-run/express/1.13.0_express@4.18.2:
resolution: {integrity: sha512-MX80PdQu3k1HlQsHlUjPBZe5rpTdn4FqZ5Fg4d85cVi+GMfu3x8n8hB0xbCDLhmRbKTR01PQ01j3UUNtsWWikg==}
/@remix-run/express/1.14.3_express@4.18.2:
resolution: {integrity: sha512-v3TT+zBFSnOiVTHNiLp5A783UVYyZYbePxmPhvoe9JwHCmzVDA9mfyxYgDl/8NPDtYS+dAPU7mQ+aE1M5MXc7g==}
engines: {node: '>=14'}
peerDependencies:
express: ^4.17.1
dependencies:
'@remix-run/node': 1.13.0
'@remix-run/node': 1.14.3
express: 4.18.2
/@remix-run/node/1.12.0:
resolution: {integrity: sha512-WiyRTEQKTUTf3Z3ke5DOwx+fjCkeD8ilI9kbRws1bG3xfdugaDrV9ra76DOZcrYlmVwjwtKE3mVDSRFtiYTTMw==}
/@remix-run/node/1.14.3:
resolution: {integrity: sha512-Mq0wUtgJtGwMQEBr/8p9XpdPBm7N+lby5CEbW6IKV59UC9N3VMGY3snfrsphBCq3sNZfbhIpaDdu2W+8EoqfnQ==}
engines: {node: '>=14'}
dependencies:
'@remix-run/server-runtime': 1.12.0
'@remix-run/web-fetch': 4.3.2
'@remix-run/web-file': 3.0.2
'@remix-run/web-stream': 1.0.3
'@web3-storage/multipart-parser': 1.0.0
abort-controller: 3.0.0
cookie-signature: 1.2.0
source-map-support: 0.5.21
stream-slice: 0.1.2
dev: false
/@remix-run/node/1.13.0:
resolution: {integrity: sha512-FDvPGaoDyon8UGYQ9DroLtiX8vFa0efBQQSHV3az0s7HbUpugw7BcA6NBW5pIs2z5sszCCeRbAgSIXcETLzfhw==}
engines: {node: '>=14'}
dependencies:
'@remix-run/server-runtime': 1.13.0
'@remix-run/server-runtime': 1.14.3
'@remix-run/web-fetch': 4.3.2
'@remix-run/web-file': 3.0.2
'@remix-run/web-stream': 1.0.3
@@ -1810,59 +1794,41 @@ packages:
source-map-support: 0.5.21
stream-slice: 0.1.2
/@remix-run/react/1.13.0_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-LT9TStmMavBlLqRG8u5Ku8bxdYcpIbqpmh44/f2Fyw8RvdaRCYYMkuUXsr8bhOqftaEZMFLqFhi19NWY/18DLA==}
/@remix-run/react/1.14.3_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-dvwIx+9ZdE/9LHe8Rjos9gEOdQFLvC0dojCnKlsUIwfGhyjKE4wOHfqS9mZcmKFCvOFDakcZDallLNGaj0mEYg==}
engines: {node: '>=14'}
peerDependencies:
react: '>=16.8'
react-dom: '>=16.8'
dependencies:
'@remix-run/router': 1.3.2
'@remix-run/router': 1.3.3
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-router-dom: 6.8.1_biqbaboplfbrettd7655fr4n2y
react-router-dom: 6.8.2_biqbaboplfbrettd7655fr4n2y
use-sync-external-store: 1.2.0_react@18.2.0
dev: false
/@remix-run/router/1.3.1:
resolution: {integrity: sha512-+eun1Wtf72RNRSqgU7qM2AMX/oHp+dnx7BHk1qhK5ZHzdHTUU4LA1mGG1vT+jMc8sbhG3orvsfOmryjzx2PzQw==}
engines: {node: '>=14'}
dev: false
/@remix-run/router/1.3.2:
resolution: {integrity: sha512-t54ONhl/h75X94SWsHGQ4G/ZrCEguKSRQr7DrjTciJXW0YU1QhlwYeycvK5JgkzlxmvrK7wq1NB/PLtHxoiDcA==}
/@remix-run/router/1.3.3:
resolution: {integrity: sha512-YRHie1yQEj0kqqCTCJEfHqYSSNlZQ696QJG+MMiW4mxSl9I0ojz/eRhJS4fs88Z5i6D1SmoF9d3K99/QOhI8/w==}
engines: {node: '>=14'}
/@remix-run/serve/1.13.0:
resolution: {integrity: sha512-ondApr1ZUbQR6iy1iGvdarBGqvTZdET4wSNFb2+2NrbxW9Y9E3RZ7q+5M5/iiuy1qbdqubqsoq2N7uFk+gDGxw==}
/@remix-run/serve/1.14.3:
resolution: {integrity: sha512-5So5+PtAaYZq3hc45snkCKIOh51Z45WvhHpRgB0ZsOuhUf6p9UAY9LQk7GRNvkcqL9LChE3LQ9O4gPqnUiZgpA==}
engines: {node: '>=14'}
hasBin: true
dependencies:
'@remix-run/express': 1.13.0_express@4.18.2
'@remix-run/express': 1.14.3_express@4.18.2
compression: 1.7.4
express: 4.18.2
morgan: 1.10.0
transitivePeerDependencies:
- supports-color
/@remix-run/server-runtime/1.12.0:
resolution: {integrity: sha512-7I0165Ns/ffPfCEfuiqD58lMderTn2s/sew1xJ34ONa21mG/7+5T7diHIgxKST8rS3816JPmlwSqUaHgwbmO6Q==}
/@remix-run/server-runtime/1.14.3:
resolution: {integrity: sha512-qh8sxfLj/XW1u6rluN7yIgbvMCoKrVacYGUiPM7g0VHk8h8MlZGAIUfsWM45Poxo3X0uLhNuqqxMaPWldKawIQ==}
engines: {node: '>=14'}
dependencies:
'@remix-run/router': 1.3.1
'@types/cookie': 0.4.1
'@types/react': 18.0.28
'@web3-storage/multipart-parser': 1.0.0
cookie: 0.4.2
set-cookie-parser: 2.5.1
source-map: 0.7.4
dev: false
/@remix-run/server-runtime/1.13.0:
resolution: {integrity: sha512-gjIW3XCeIlOt3rrOZMD6HixQydRgs1SwYjP99ZAVruG2+gNq/tL2OusMFYTLvtWrybt215tPROyF/6iTLsaO3g==}
engines: {node: '>=14'}
dependencies:
'@remix-run/router': 1.3.2
'@remix-run/router': 1.3.3
'@types/cookie': 0.4.1
'@types/react': 18.0.28
'@web3-storage/multipart-parser': 1.0.0
@@ -2252,21 +2218,24 @@ packages:
resolution: {integrity: sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ==}
dev: true
/@vercel/analytics/0.1.10_react@18.2.0:
resolution: {integrity: sha512-jjJ8GzcPnQp0cMxpfYoUycMRBtDiaIeyVjZPiEPe99Dj1PdjMzAFYEASiV/hpNsXHkpcNYCveDFh6jnmh0YSDQ==}
/@vercel/analytics/0.1.11_react@18.2.0:
resolution: {integrity: sha512-mj5CPR02y0BRs1tN3oZcBNAX9a8NxsIUl9vElDPcqxnMfP0RbRc9fI9Ud7+QDg/1Izvt5uMumsr+6YsmVHcyuw==}
peerDependencies:
react: ^16.8||^17||^18
dependencies:
react: 18.2.0
dev: false
/@vercel/remix-entry-server/0.1.0_react@18.2.0:
resolution: {integrity: sha512-ux1pcYvcPXAUXQuSH4fwNfkrzYYemFpdc3r4lF3L3PBE5doGhYDuBdTfXZpWl1M5zXi6VAbK6V6qkD33iZWGDA==}
/@vercel/remix/1.14.3-patch.1_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-TBI/FS77HYZqjbgeABi7Rbg7RVQ1YLHcXm4/zroV4zl0nVbcXM2jVR3SXm0EuQKze+NZ0p3VBUz4I/xocTvq0w==}
engines: {node: '>=14'}
peerDependencies:
react: ^18.0.0
react: '*'
react-dom: '*'
dependencies:
'@remix-run/node': 1.12.0
isbot: 3.6.5
'@remix-run/node': 1.14.3
'@remix-run/server-runtime': 1.14.3
isbot: 3.6.6
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
dev: false
@@ -3092,7 +3061,7 @@ packages:
dev: true
/ee-first/1.1.1:
resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=}
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
/electron-to-chromium/1.4.296:
resolution: {integrity: sha512-i/6Q+Y9bluDa2a0NbMvdtG5TuS/1Fr3TKK8L+7UUL9QjRS5iFJzCC3r70xjyOnLiYG8qGV4/mMpe6HuAbdJW4w==}
@@ -3901,7 +3870,7 @@ packages:
engines: {node: '>= 0.6'}
/fresh/0.5.2:
resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=}
resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
engines: {node: '>= 0.6'}
/fs-constants/1.0.0:
@@ -4638,8 +4607,8 @@ packages:
resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
dev: true
/isbot/3.6.5:
resolution: {integrity: sha512-BchONELXt6yMad++BwGpa0oQxo/uD0keL7N15cYVf0A1oMIoNQ79OqeYdPMFWDrNhCqCbRuw9Y9F3QBjvAxZ5g==}
/isbot/3.6.6:
resolution: {integrity: sha512-98aGl1Spbx1led422YFrusDJ4ZutSNOymb2avZ2V4BCCjF3MqAF2k+J2zoaLYahubaFkb+3UyvbVDVlk/Ngrew==}
engines: {node: '>=12'}
dev: false
@@ -5006,11 +4975,11 @@ packages:
dev: true
/media-typer/0.3.0:
resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=}
resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
engines: {node: '>= 0.6'}
/merge-descriptors/1.0.1:
resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=}
resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==}
/merge-stream/2.0.0:
resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
@@ -6057,26 +6026,31 @@ packages:
resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
dev: true
/react-router-dom/6.8.1_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-67EXNfkQgf34P7+PSb6VlBuaacGhkKn3kpE51+P6zYSG2kiRoumXEL6e27zTa9+PGF2MNXbgIUHTVlleLbIcHQ==}
/react-refresh/0.14.0:
resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==}
engines: {node: '>=0.10.0'}
dev: true
/react-router-dom/6.8.2_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-N/oAF1Shd7g4tWy+75IIufCGsHBqT74tnzHQhbiUTYILYF0Blk65cg+HPZqwC+6SqEyx033nKqU7by38v3lBZg==}
engines: {node: '>=14'}
peerDependencies:
react: '>=16.8'
react-dom: '>=16.8'
dependencies:
'@remix-run/router': 1.3.2
'@remix-run/router': 1.3.3
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-router: 6.8.1_react@18.2.0
react-router: 6.8.2_react@18.2.0
dev: false
/react-router/6.8.1_react@18.2.0:
resolution: {integrity: sha512-Jgi8BzAJQ8MkPt8ipXnR73rnD7EmZ0HFFb7jdQU24TynGW1Ooqin2KVDN9voSC+7xhqbbCd2cjGUepb6RObnyg==}
/react-router/6.8.2_react@18.2.0:
resolution: {integrity: sha512-lF7S0UmXI5Pd8bmHvMdPKI4u4S5McxmHnzJhrYi9ZQ6wE+DA8JN5BzVC5EEBuduWWDaiJ8u6YhVOCmThBli+rw==}
engines: {node: '>=14'}
peerDependencies:
react: '>=16.8'
dependencies:
'@remix-run/router': 1.3.2
'@remix-run/router': 1.3.3
react: 18.2.0
dev: false
@@ -6993,7 +6967,7 @@ packages:
which-typed-array: 1.1.9
/utils-merge/1.0.1:
resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=}
resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
engines: {node: '>= 0.4.0'}
/uvu/0.5.6:

View File

@@ -1,2 +1,2 @@
/// <reference types="@remix-run/dev" />
/// <reference types="@remix-run/node" />
/// <reference types="@vercel/remix" />

View File

@@ -32,7 +32,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "28.0.5",
"turbo": "1.8.3"
"turbo": "1.8.5"
},
"scripts": {
"lerna": "lerna",
@@ -42,14 +42,14 @@
"publish-canary": "git checkout main && git pull && lerna version prerelease --preid canary --message \"Publish Canary\" --exact",
"publish-from-github": "./utils/publish.sh",
"changelog": "node utils/changelog.js",
"build": "node utils/gen.js && turbo run build",
"build": "node utils/gen.js && turbo --no-update-notifier run build",
"vercel-build": "pnpm build && pnpm run pack && cd api && node -r ts-eager/register ./_lib/script/build.ts",
"pre-commit": "lint-staged",
"test": "jest --rootDir=\"test\" --testPathPattern=\"\\.test.js\"",
"test-unit": "pnpm test && node utils/gen.js && turbo run test-unit",
"test-cli": "node utils/gen.js && turbo run test-cli",
"test-e2e": "node utils/gen.js && turbo run test-e2e",
"test-dev": "node utils/gen.js && turbo run test-dev",
"test-unit": "pnpm test && node utils/gen.js && turbo --no-update-notifier run test-unit",
"test-cli": "node utils/gen.js && turbo --no-update-notifier run test-cli",
"test-e2e": "node utils/gen.js && turbo --no-update-notifier run test-e2e",
"test-dev": "node utils/gen.js && turbo --no-update-notifier run test-dev",
"lint": "eslint . --cache --ext .ts,.js",
"prettier-check": "prettier --check .",
"prepare": "husky install",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "6.4.0",
"version": "6.6.0",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",

View File

@@ -487,6 +487,7 @@ export function getEnvForPackageManager({
const oldPath = env.PATH + '';
const npm7 = '/node16/bin-npm7';
const pnpm7 = '/pnpm7/node_modules/.bin';
const pnpm8 = '/pnpm8/node_modules/.bin';
const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
if (cliType === 'npm') {
if (
@@ -509,7 +510,20 @@ export function getEnvForPackageManager({
) {
// Ensure that pnpm 7 is at the beginning of the `$PATH`
newEnv.PATH = `${pnpm7}${path.delimiter}${oldPath}`;
console.log('Detected `pnpm-lock.yaml` generated by pnpm 7...');
console.log(
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7...`
);
} else if (
typeof lockfileVersion === 'number' &&
lockfileVersion >= 6 &&
!oldPath.includes(pnpm8) &&
!corepackEnabled
) {
// Ensure that pnpm 8 is at the beginning of the `$PATH`
newEnv.PATH = `${pnpm8}${path.delimiter}${oldPath}`;
console.log(
`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8...`
);
}
} else {
// Yarn v2 PnP mode may be activated, so force "node-modules" linker style

View File

@@ -14,10 +14,11 @@ export function getPrefixedEnvVars({
envs: Envs;
}): Envs {
const vercelSystemEnvPrefix = 'VERCEL_';
const allowed = ['VERCEL_URL', 'VERCEL_ENV', 'VERCEL_REGION'];
const newEnvs: Envs = {};
if (envPrefix && envs.VERCEL_URL) {
Object.keys(envs)
.filter(key => key.startsWith(vercelSystemEnvPrefix))
.filter(key => allowed.includes(key) || key.startsWith('VERCEL_GIT_'))
.forEach(key => {
const newKey = `${envPrefix}${key}`;
if (!(newKey in envs)) {

View File

@@ -11,6 +11,7 @@ interface PrerenderOptions {
initialHeaders?: Record<string, string>;
initialStatus?: number;
passQuery?: boolean;
sourcePath?: string;
}
export class Prerender {
@@ -24,6 +25,7 @@ export class Prerender {
public initialHeaders?: Record<string, string>;
public initialStatus?: number;
public passQuery?: boolean;
public sourcePath?: string;
constructor({
expiration,
@@ -35,9 +37,11 @@ export class Prerender {
initialHeaders,
initialStatus,
passQuery,
sourcePath,
}: PrerenderOptions) {
this.type = 'Prerender';
this.expiration = expiration;
this.sourcePath = sourcePath;
this.lambda = lambda;
if (this.lambda) {

View File

@@ -4,8 +4,7 @@
"probes": [
{
"path": "/",
"mustContain": "pnpm version: 6",
"logMustContain": "pnpm run build"
"mustContain": "pnpm version: 7"
}
]
}

View File

@@ -0,0 +1,9 @@
{
"private": true,
"scripts": {
"build": "mkdir -p public && (printf \"pnpm version: \" && pnpm -v) > public/index.txt"
},
"dependencies": {
"once": "^1.4.0"
}
}

View File

@@ -0,0 +1,21 @@
lockfileVersion: 5.4
importers:
.:
specifiers:
once: ^1.4.0
dependencies:
once: 1.4.0
packages:
/once/1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
dev: false
/wrappy/1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: false

View File

@@ -0,0 +1 @@
# Empty so this is treated as its own pnpm workspace

View File

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

View File

@@ -0,0 +1,9 @@
{
"private": true,
"scripts": {
"build": "mkdir -p public && (printf \"pnpm version: \" && pnpm -v) > public/index.txt"
},
"dependencies": {
"once": "^1.4.0"
}
}

View File

@@ -0,0 +1,21 @@
lockfileVersion: '6.0'
importers:
.:
dependencies:
once:
specifier: ^1.4.0
version: 1.4.0
packages:
/once@1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
dependencies:
wrappy: 1.0.2
dev: false
/wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
dev: false

View File

@@ -0,0 +1 @@
# Empty so this is treated as its own pnpm workspace

View File

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

View File

@@ -14,6 +14,7 @@ describe('Test `getPrefixedEnvVars()`', () => {
VERCEL: '1',
VERCEL_URL: 'example.vercel.sh',
USER_ENV_VAR_NOT_VERCEL: 'example.com',
VERCEL_ARTIFACTS_TOKEN: 'abc123',
FOO: 'bar',
},
},
@@ -28,6 +29,7 @@ describe('Test `getPrefixedEnvVars()`', () => {
envPrefix: 'GATSBY_',
envs: {
USER_ENV_VAR_NOT_VERCEL: 'example.com',
VERCEL_ARTIFACTS_TOKEN: 'abc123',
FOO: 'bar',
VERCEL_URL: 'example.vercel.sh',
VERCEL_ENV: 'production',
@@ -51,6 +53,7 @@ describe('Test `getPrefixedEnvVars()`', () => {
USER_ENV_VAR_NOT_VERCEL: 'example.com',
FOO: 'bar',
BLARG_VERCEL_THING: 'fake',
VERCEL_ARTIFACTS_TOKEN: 'abc123',
},
},
want: {},

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.17.0",
"version": "28.18.2",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -32,16 +32,16 @@
"node": ">= 14"
},
"dependencies": {
"@vercel/build-utils": "6.4.0",
"@vercel/go": "2.4.0",
"@vercel/hydrogen": "0.0.58",
"@vercel/next": "3.6.7",
"@vercel/node": "2.9.13",
"@vercel/python": "3.1.54",
"@vercel/redwood": "1.1.10",
"@vercel/remix-builder": "1.7.0",
"@vercel/ruby": "1.3.71",
"@vercel/static-build": "1.3.17"
"@vercel/build-utils": "6.6.0",
"@vercel/go": "2.4.2",
"@vercel/hydrogen": "0.0.60",
"@vercel/next": "3.7.2",
"@vercel/node": "2.10.1",
"@vercel/python": "3.1.56",
"@vercel/redwood": "1.1.12",
"@vercel/remix-builder": "1.8.2",
"@vercel/ruby": "1.3.73",
"@vercel/static-build": "1.3.20"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -85,10 +85,10 @@
"@types/write-json-file": "2.2.1",
"@types/yauzl-promise": "2.1.0",
"@vercel-internals/types": "*",
"@vercel/client": "12.4.5",
"@vercel/client": "12.4.7",
"@vercel/error-utils": "1.0.8",
"@vercel/frameworks": "1.3.3",
"@vercel/fs-detectors": "3.8.5",
"@vercel/fs-detectors": "3.8.7",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.1.11",

View File

@@ -157,6 +157,7 @@ export default async function main(client: Client): Promise<number> {
'--output': String,
'--prod': Boolean,
'--yes': Boolean,
'-y': '--yes',
});
if (argv['--help']) {

View File

@@ -281,7 +281,12 @@ const main = async () => {
GLOBAL_COMMANDS.has(targetOrSubcommand) ||
commands.has(targetOrSubcommand);
if (targetPathExists && subcommandExists && !argv['--cwd']) {
if (
targetPathExists &&
subcommandExists &&
!argv['--cwd'] &&
!process.env.NOW_BUILDER
) {
output.warn(
`Did you mean to deploy the subdirectory "${targetOrSubcommand}"? ` +
`Use \`vc --cwd ${targetOrSubcommand}\` instead.`

View File

@@ -290,7 +290,8 @@ export default class Now extends EventEmitter {
if (
error.errorCode === 'BUILD_FAILED' ||
error.errorCode === 'UNEXPECTED_ERROR'
error.errorCode === 'UNEXPECTED_ERROR' ||
error.errorCode.includes('BUILD_UTILS_SPAWN_')
) {
return new BuildError({
message: error.errorMessage,
@@ -298,7 +299,7 @@ export default class Now extends EventEmitter {
});
}
return new Error(error.message);
return new Error(error.message || error.errorMessage);
}
async listSecrets(next?: number, testWarningFlag?: boolean) {

View File

@@ -105,7 +105,7 @@ test('[vercel dev] throws an error when an edge function has no response', async
expect(await res.status).toBe(500);
expect(await res.text()).toMatch('FUNCTION_INVOCATION_FAILED');
expect(stdout).toMatch(
/Error from API Route \/api\/edge-no-response: Edge Function "api\/edge-no-response.js" did not return a response./g
/Error from API Route \/api\/edge-no-response: Edge Function did not return a response./g
);
} finally {
await dev.kill();

View File

@@ -1,5 +1,3 @@
// @ts-nocheck
// Note: this file is incrementally migrating to typescript
import ms from 'ms';
import path from 'path';
import { URL, parse as parseUrl } from 'url';
@@ -8,7 +6,8 @@ import { Readable } from 'stream';
import { homedir, tmpdir } from 'os';
import _execa from 'execa';
import XDGAppPaths from 'xdg-app-paths';
import fetch from 'node-fetch';
import fetch, { RequestInfo, RequestInit } from 'node-fetch';
// @ts-ignore
import tmp from 'tmp-promise';
import retry from 'async-retry';
import fs, {
@@ -25,17 +24,61 @@ import pkg from '../package.json';
import prepareFixtures from './helpers/prepare';
import { fetchTokenWithRetry } from '../../../test/lib/deployment/now-deploy';
import { once } from 'node:events';
import type { PackageJson } from '@vercel/build-utils';
import type http from 'http';
const TEST_TIMEOUT = 3 * 60 * 1000;
jest.setTimeout(TEST_TIMEOUT);
// log command when running `execa`
function execa(file, args, options) {
console.log(`$ vercel ${args.join(' ')}`);
return _execa(file, args, options);
type BoundChildProcess = _execa.ExecaChildProcess & {
stdout: Readable;
stdin: Readable;
stderr: Readable;
};
interface TmpDir {
name: string;
removeCallback: () => void;
}
function fixture(name) {
interface Build {
use: string;
}
type NowJson = {
name: string;
};
type DeploymentLike = {
error?: Error;
builds: Build[];
};
// log command when running `execa`
function execa(
file: string,
args: string[],
options?: _execa.Options<string>
): BoundChildProcess {
console.log(`$ vercel ${args.join(' ')}`);
const proc = _execa(file, args, options);
if (proc.stdin === null) {
console.warn(`vercel ${args.join(' ')} - not bound to stdin`);
}
if (proc.stdout === null) {
console.warn(`vercel ${args.join(' ')} - not bound to stdout`);
}
if (proc.stderr === null) {
console.warn(`vercel ${args.join(' ')} - not bound to stderr`);
}
// if a reference to `proc.stdout` (for example) fails later,
// the logs will say clearly where that came from
// so, it's not awful to use the type assertion here
return proc as BoundChildProcess;
}
function fixture(name: string) {
const directory = path.join(tmpFixturesDir, name);
const config = path.join(directory, 'project.json');
@@ -48,21 +91,21 @@ function fixture(name) {
}
const binaryPath = path.resolve(__dirname, `../scripts/start.js`);
const example = name =>
const example = (name: string) =>
path.join(__dirname, '..', '..', '..', 'examples', name);
const deployHelpMessage = `${logo} vercel [options] <command | path>`;
let session = 'temp-session';
const isCanary = pkg.version.includes('canary');
const pickUrl = stdout => {
const pickUrl = (stdout: string) => {
const lines = stdout.split('\n');
return lines[lines.length - 1];
};
const createFile = dest => fs.closeSync(fs.openSync(dest, 'w'));
const createFile = (dest: fs.PathLike) => fs.closeSync(fs.openSync(dest, 'w'));
const waitForDeployment = async href => {
const waitForDeployment = async (href: RequestInfo) => {
console.log(`waiting for ${href} to become ready...`);
const start = Date.now();
const max = ms('4m');
@@ -89,7 +132,7 @@ const waitForDeployment = async href => {
}
};
function fetchTokenInformation(token, retries = 3) {
function fetchTokenInformation(token: string, retries = 3) {
const url = `https://api.vercel.com/v2/user`;
const headers = { Authorization: `Bearer ${token}` };
@@ -111,7 +154,13 @@ function fetchTokenInformation(token, retries = 3) {
);
}
function formatOutput({ stderr, stdout }) {
function formatOutput({
stderr,
stdout,
}: {
stderr: string | Readable;
stdout: string | Readable;
}) {
return `
-----
@@ -127,7 +176,7 @@ ${stdout || '(no output)'}
`;
}
async function vcLink(projectPath) {
async function vcLink(projectPath: string) {
const { exitCode, stdout, stderr } = await execa(
binaryPath,
['link', '--yes', ...defaultArgs],
@@ -140,26 +189,55 @@ async function vcLink(projectPath) {
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
}
const context = {};
async function getLocalhost(vc: BoundChildProcess): Promise<RegExpExecArray> {
let localhost: RegExpExecArray | undefined;
await waitForPrompt(vc, chunk => {
if (chunk.includes('Ready! Available at')) {
localhost = /(https?:[^\s]+)/g.exec(chunk) || undefined;
return true;
}
return false;
});
// This should never happen because waitForPrompt will time out
// and never return here in this case, but extra checking is fine
// and it makes typescript happy
if (!localhost) {
throw new Error('Localhost not found!');
}
return localhost;
}
function getTmpDir(): TmpDir {
return tmp.dirSync({
// This ensures the directory gets
// deleted even if it has contents
unsafeCleanup: true,
}) as TmpDir;
}
const context: {
deployment: string | undefined;
secretName: string | undefined;
} = {
deployment: undefined,
secretName: undefined,
};
const defaultOptions = { reject: false };
const defaultArgs = [];
let token;
let email;
let contextName;
const defaultArgs: string[] = [];
let token: string | undefined;
let email: string | undefined;
let contextName: string | undefined;
let tmpDir;
let tmpDir: TmpDir | undefined;
let tmpFixturesDir = path.join(tmpdir(), 'tmp-fixtures');
let globalDir = XDGAppPaths('com.vercel.cli').dataDirs()[0];
if (!process.env.CI) {
tmpDir = tmp.dirSync({
// This ensures the directory gets
// deleted even if it has contents
unsafeCleanup: true,
});
tmpDir = getTmpDir();
globalDir = path.join(tmpDir.name, 'com.vercel.tests');
defaultArgs.push('-Q', globalDir);
@@ -169,7 +247,7 @@ if (!process.env.CI) {
);
}
function mockLoginApi(req, res) {
function mockLoginApi(req: http.IncomingMessage, res: http.ServerResponse) {
const { url = '/', method } = req;
let { pathname = '/', query = {} } = parseUrl(url, true);
console.log(`[mock-login-server] ${method} ${pathname}`);
@@ -202,13 +280,13 @@ const loginApiServer = require('http')
console.log(`[mock-login-server] Listening on ${loginApiUrl}`);
});
const execute = (args, options) =>
const execute = (args: string[], options?: _execa.Options<string>) =>
execa(binaryPath, [...defaultArgs, ...args], {
...defaultOptions,
...options,
});
const apiFetch = (url, { headers, ...options } = {}) => {
const apiFetch = (url: string, { headers, ...options }: RequestInit = {}) => {
return fetch(`https://api.vercel.com${url}`, {
headers: {
Authorization: `Bearer ${token}`,
@@ -218,14 +296,23 @@ const apiFetch = (url, { headers, ...options } = {}) => {
});
};
const waitForPrompt = (cp, assertion) =>
new Promise((resolve, reject) => {
// the prompt timeout has to be less than the test timeout
const PROMPT_TIMEOUT = TEST_TIMEOUT / 2;
const waitForPrompt = (
cp: BoundChildProcess,
assertion: (chunk: string) => boolean
) =>
new Promise<void>((resolve, reject) => {
console.log('Waiting for prompt...');
const handleTimeout = setTimeout(
() => reject(new Error('timeout in waitForPrompt')),
TEST_TIMEOUT / 2
() =>
reject(
new Error(`timed out after ${PROMPT_TIMEOUT}ms in waitForPrompt`)
),
PROMPT_TIMEOUT
);
const listener = chunk => {
const listener = (chunk: string) => {
console.log('> ' + chunk);
if (assertion(chunk)) {
cp.stdout.off && cp.stdout.off('data', listener);
@@ -265,7 +352,15 @@ const createUser = async () => {
const getConfigAuthPath = () => path.join(globalDir, 'auth.json');
async function setupProject(process, projectName, overrides) {
async function setupProject(
process: BoundChildProcess,
projectName: string,
overrides: {
devCommand?: string;
buildCommand?: string;
outputDirectory?: string;
}
) {
await waitForPrompt(process, chunk => /Set up [^?]+\?/.test(chunk));
process.stdin.write('yes\n');
@@ -385,6 +480,10 @@ test('default command should prompt login with empty auth.json', async () => {
test(
'login',
async () => {
if (!email) {
throw new Error('Shared state "email" not set.');
}
await fs.remove(getConfigAuthPath());
const loginOutput = await execa(binaryPath, [
'login',
@@ -1047,15 +1146,7 @@ test('Deploy `api-env` fixture and test `vercel env` command', async () => {
cwd: target,
});
let localhost = undefined;
await waitForPrompt(vc, chunk => {
if (chunk.includes('Ready! Available at')) {
localhost = /(https?:[^\s]+)/g.exec(chunk);
return true;
}
return false;
});
const localhost = await getLocalhost(vc);
const apiUrl = `${localhost[0]}/api/get-env`;
const apiRes = await fetch(apiUrl);
@@ -1085,15 +1176,7 @@ test('Deploy `api-env` fixture and test `vercel env` command', async () => {
cwd: target,
});
let localhost = undefined;
await waitForPrompt(vc, chunk => {
if (chunk.includes('Ready! Available at')) {
localhost = /(https?:[^\s]+)/g.exec(chunk);
return true;
}
return false;
});
const localhost = await getLocalhost(vc);
const apiUrl = `${localhost[0]}/api/get-env`;
const apiRes = await fetch(apiUrl);
expect(apiRes.status).toBe(200);
@@ -1165,15 +1248,7 @@ test('Deploy `api-env` fixture and test `vercel env` command', async () => {
cwd: target,
});
let localhost = undefined;
await waitForPrompt(vc, chunk => {
if (chunk.includes('Ready! Available at')) {
localhost = /(https?:[^\s]+)/g.exec(chunk);
return true;
}
return false;
});
const localhost = await getLocalhost(vc);
const apiUrl = `${localhost[0]}/api/get-env`;
const apiRes = await fetch(apiUrl);
@@ -1260,7 +1335,7 @@ test('Deploy `api-env` fixture and test `vercel env` command', async () => {
expect(exitCode, formatOutput({ stdout, stderr })).toBe(0);
}
function vcEnvRemoveByName(name) {
function vcEnvRemoveByName(name: string) {
return execa(binaryPath, ['env', 'rm', name, '-y', ...defaultArgs], {
reject: false,
cwd: target,
@@ -1715,6 +1790,10 @@ test('ensure we render a warning for deployments with no files', async () => {
});
test('output logs with "short" output', async () => {
if (!context.deployment) {
throw new Error('Shared state "context.deployment" not set.');
}
const { stderr, stdout, exitCode } = await execa(
binaryPath,
['logs', context.deployment, ...defaultArgs],
@@ -1736,6 +1815,10 @@ test('output logs with "short" output', async () => {
});
test('output logs with "raw" output', async () => {
if (!context.deployment) {
throw new Error('Shared state "context.deployment" not set.');
}
const { stderr, stdout, exitCode } = await execa(
binaryPath,
['logs', context.deployment, ...defaultArgs, '--output', 'raw'],
@@ -2054,7 +2137,7 @@ test('try to deploy with non-existing team', async () => {
});
test('initialize example "angular"', async () => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
tmpDir = getTmpDir();
const cwd = tmpDir.name;
const goal = '> Success! Initialized "angular" example in';
@@ -2080,7 +2163,7 @@ test('initialize example "angular"', async () => {
});
test('initialize example ("angular") to specified directory', async () => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
tmpDir = getTmpDir();
const cwd = tmpDir.name;
const goal = '> Success! Initialized "angular" example in';
@@ -2109,7 +2192,7 @@ test('initialize example ("angular") to specified directory', async () => {
});
test('initialize example to existing directory with "-f"', async () => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
tmpDir = getTmpDir();
const cwd = tmpDir.name;
const goal = '> Success! Initialized "angular" example in';
@@ -2140,7 +2223,7 @@ test('initialize example to existing directory with "-f"', async () => {
});
test('try to initialize example to existing directory', async () => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
tmpDir = getTmpDir();
const cwd = tmpDir.name;
const goal =
'Error: Destination path "angular" already exists and is not an empty directory. You may use `--force` or `-f` to override it.';
@@ -2157,7 +2240,7 @@ test('try to initialize example to existing directory', async () => {
});
test('try to initialize misspelled example (noce) in non-tty', async () => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
tmpDir = getTmpDir();
const cwd = tmpDir.name;
const goal =
'Error: No example found for noce, run `vercel init` to see the list of available examples.';
@@ -2169,7 +2252,7 @@ test('try to initialize misspelled example (noce) in non-tty', async () => {
});
test('try to initialize example "example-404"', async () => {
tmpDir = tmp.dirSync({ unsafeCleanup: true });
tmpDir = getTmpDir();
const cwd = tmpDir.name;
const goal =
'Error: No example found for example-404, run `vercel init` to see the list of available examples.';
@@ -2187,8 +2270,8 @@ test('try to revert a deployment and assign the automatic aliases', async () =>
const secondDeployment = fixture('now-revert-alias-2');
const { name } = JSON.parse(
fs.readFileSync(path.join(firstDeployment, 'now.json'))
);
fs.readFileSync(path.join(firstDeployment, 'now.json')).toString()
) as NowJson;
expect(name).toBeTruthy();
const url = `https://${name}.user.vercel.app`;
@@ -2299,7 +2382,7 @@ test('`vercel rm` removes a deployment', async () => {
session,
...defaultArgs,
'-V',
2,
'2',
'--force',
'--yes',
],
@@ -2358,7 +2441,7 @@ test('render build errors', async () => {
});
test('invalid deployment, projects and alias names', async () => {
const check = async (...args) => {
const check = async (...args: string[]) => {
const output = await execute(args);
expect(output.exitCode, formatOutput(output)).toBe(1);
expect(output.stderr).toMatch(/The provided argument/gm);
@@ -2409,7 +2492,7 @@ test('create zero-config deployment', async () => {
const text = await response.text();
expect(response.status).toBe(200);
const data = JSON.parse(text);
const data = JSON.parse(text) as DeploymentLike;
expect(data.error).toBe(undefined);
@@ -2447,7 +2530,6 @@ test('vercel secret ls', async () => {
const output = await execute(['secret', 'ls']);
expect(output.exitCode, formatOutput(output)).toBe(0);
expect(output.stdout).toMatch(/Secrets found under/gm);
expect(output.stdout).toMatch(new RegExp());
});
test('vercel secret ls --test-warning', async () => {
@@ -2460,6 +2542,10 @@ test('vercel secret ls --test-warning', async () => {
});
test('vercel secret rename', async () => {
if (!context.secretName) {
throw new Error('Shared state "context.secretName" not set.');
}
const nextName = `renamed-secret-${Date.now().toString(36)}`;
const output = await execute([
'secret',
@@ -2473,6 +2559,10 @@ test('vercel secret rename', async () => {
});
test('vercel secret rm', async () => {
if (!context.secretName) {
throw new Error('Shared state "context.secretName" not set.');
}
const output = await execute(['secret', 'rm', context.secretName, '-y']);
expect(output.exitCode, formatOutput(output)).toBe(0);
});
@@ -2572,6 +2662,10 @@ test('fail to add a domain without a project', async () => {
test(
'change user',
async () => {
if (!email) {
throw new Error('Shared state "email" not set.');
}
const { stdout: prevUser } = await execute(['whoami']);
// Delete the current token
@@ -2671,13 +2765,19 @@ test('should show prompts to set up project during first deploy', async () => {
// and output directory
let stderr = '';
const port = 58351;
const dev = execa(binaryPath, ['dev', '--listen', port, dir, ...defaultArgs]);
const dev = execa(binaryPath, [
'dev',
'--listen',
port.toString(),
dir,
...defaultArgs,
]);
dev.stderr.setEncoding('utf8');
try {
dev.stdout.pipe(process.stdout);
dev.stderr.pipe(process.stderr);
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
dev.once('close', (code, signal) => {
reject(`"vc dev" failed with ${signal || code}`);
});
@@ -2882,6 +2982,10 @@ test('should prefill "project name" prompt with now.json `name`', async () => {
});
test('deploy with unknown `VERCEL_PROJECT_ID` should fail', async () => {
if (!token) {
throw new Error('Shared state "token" not set.');
}
const directory = fixture('static-deployment');
const user = await fetchTokenInformation(token);
@@ -2897,6 +3001,10 @@ test('deploy with unknown `VERCEL_PROJECT_ID` should fail', async () => {
});
test('deploy with `VERCEL_ORG_ID` but without `VERCEL_PROJECT_ID` should fail', async () => {
if (!token) {
throw new Error('Shared state "token" not set.');
}
const directory = fixture('static-deployment');
const user = await fetchTokenInformation(token);
@@ -3032,6 +3140,10 @@ test('vercel env with unknown `VERCEL_ORG_ID` or `VERCEL_PROJECT_ID` should erro
});
test('whoami with `VERCEL_ORG_ID` should favor `--scope` and should error', async () => {
if (!token) {
throw new Error('Shared state "token" not set.');
}
const user = await fetchTokenInformation(token);
const output = await execute(['whoami', '--scope', 'asdf'], {
@@ -3043,6 +3155,10 @@ test('whoami with `VERCEL_ORG_ID` should favor `--scope` and should error', asyn
});
test('whoami with local .vercel scope', async () => {
if (!token) {
throw new Error('Shared state "token" not set.');
}
const directory = fixture('static-deployment');
const user = await fetchTokenInformation(token);
@@ -3139,9 +3255,12 @@ test(
const directory = example('gatsby');
const packageJsonPath = path.join(directory, 'package.json');
const packageJsonOriginal = await readFile(packageJsonPath, 'utf8');
const pkg = JSON.parse(packageJsonOriginal);
const pkg = JSON.parse(packageJsonOriginal) as PackageJson;
if (!pkg.scripts) {
throw new Error(`"scripts" not found in "${packageJsonPath}"`);
}
async function tryDeploy(cwd) {
async function tryDeploy(cwd: string) {
const { exitCode, stdout, stderr } = await execa(
binaryPath,
[...defaultArgs, '--public', '--yes'],
@@ -3354,12 +3473,16 @@ test('[vc dev] should show prompts to set up project', async () => {
// remove previously linked project if it exists
await remove(path.join(dir, '.vercel'));
const dev = execa(binaryPath, ['dev', '--listen', port, ...defaultArgs], {
cwd: dir,
env: {
FORCE_TTY: '1',
},
});
const dev = execa(
binaryPath,
['dev', '--listen', port.toString(), ...defaultArgs],
{
cwd: dir,
env: {
FORCE_TTY: '1',
},
}
);
await setupProject(dev, projectName, {
buildCommand: `mkdir -p o && echo '<h1>custom hello</h1>' > o/index.html`,
@@ -3461,12 +3584,16 @@ test('[vc dev] should send the platform proxy request headers to frontend dev se
// remove previously linked project if it exists
await remove(path.join(dir, '.vercel'));
const dev = execa(binaryPath, ['dev', '--listen', port, ...defaultArgs], {
cwd: dir,
env: {
FORCE_TTY: '1',
},
});
const dev = execa(
binaryPath,
['dev', '--listen', port.toString(), ...defaultArgs],
{
cwd: dir,
env: {
FORCE_TTY: '1',
},
}
);
await setupProject(dev, projectName, {
buildCommand: `mkdir -p o && echo '<h1>custom hello</h1>' > o/index.html`,
@@ -3488,6 +3615,10 @@ test('[vc dev] should send the platform proxy request headers to frontend dev se
});
test('[vc link] should support the `--project` flag', async () => {
if (!token) {
throw new Error('Shared state "token" not set.');
}
const projectName = 'link-project-flag';
const directory = fixture('static-deployment');

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "12.4.5",
"version": "12.4.7",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -43,7 +43,7 @@
]
},
"dependencies": {
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/routing-utils": "2.1.11",
"@zeit/fetch": "5.2.0",
"async-retry": "1.2.3",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "3.8.5",
"version": "3.8.7",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -35,7 +35,7 @@
"@types/minimatch": "3.0.5",
"@types/node": "14.18.33",
"@types/semver": "7.3.10",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"typescript": "4.3.4"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-builder",
"version": "1.2.2",
"version": "1.2.5",
"main": "dist/index.js",
"files": [
"dist",
@@ -15,8 +15,8 @@
},
"dependencies": {
"@sinclair/typebox": "0.25.24",
"@vercel/build-utils": "6.4.0",
"@vercel/node": "2.9.13",
"@vercel/build-utils": "6.6.0",
"@vercel/node": "2.10.1",
"@vercel/routing-utils": "2.1.11",
"esbuild": "0.14.47",
"etag": "1.8.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/go",
"version": "2.4.0",
"version": "2.4.2",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
@@ -37,7 +37,7 @@
"@types/node-fetch": "^2.3.0",
"@types/tar": "^4.0.0",
"@types/yauzl-promise": "2.1.0",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/ncc": "0.24.0",
"async-retry": "1.3.1",
"execa": "^1.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/hydrogen",
"version": "0.0.58",
"version": "0.0.60",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -21,7 +21,7 @@
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/static-config": "2.0.14",
"execa": "3.2.0",
"fs-extra": "11.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.6.7",
"version": "3.7.2",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -45,7 +45,7 @@
"@types/semver": "6.0.0",
"@types/text-table": "0.2.1",
"@types/webpack-sources": "3.2.0",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/nft": "0.22.5",
"@vercel/routing-utils": "2.1.11",
"async-sema": "3.0.1",

View File

@@ -410,7 +410,6 @@ export const build: BuildV2 = async ({
const env: typeof process.env = { ...spawnOpts.env };
env.NEXT_EDGE_RUNTIME_PROVIDER = 'vercel';
env.NEXT_PUBLIC_EDGE_RUNTIME_PROVIDER = env.NEXT_EDGE_RUNTIME_PROVIDER;
if (target) {
// Since version v10.0.8-canary.15 of Next.js the NEXT_PRIVATE_TARGET env
@@ -418,13 +417,11 @@ export const build: BuildV2 = async ({
// this helps us catch cases where we can't locate the next.config.js
// correctly
env.NEXT_PRIVATE_TARGET = target;
env.NEXT_PUBLIC_TARGET = target;
}
// Only NEXT_PUBLIC_ is considered for turbo/nx cache keys
// and caches may not have the correct trace root so we
// need to ensure this included in the cache key
env.NEXT_PRIVATE_OUTPUT_TRACE_ROOT = baseDir;
env.NEXT_PUBLIC_OUTPUT_TRACE_ROOT = baseDir;
if (isServerMode) {
// when testing with jest NODE_ENV will be set to test so ensure

View File

@@ -2074,6 +2074,11 @@ export const onPrerenderRoute =
const rscContentTypeHeader =
routesManifest?.rsc?.contentTypeHeader || 'text/x-component';
let sourcePath: string | undefined;
if (`/${outputPathPage}` !== srcRoute && srcRoute) {
sourcePath = srcRoute;
}
prerenders[outputPathPage] = new Prerender({
expiration: initialRevalidate,
lambda,
@@ -2083,6 +2088,7 @@ export const onPrerenderRoute =
bypassToken: prerenderManifest.bypassToken,
initialStatus,
initialHeaders,
sourcePath,
...(isNotFound
? {

View File

@@ -160,6 +160,7 @@ it('should build using server build', async () => {
expect(output['fallback/[slug]'].type).toBe('Prerender');
expect(output['fallback/[slug]'].allowQuery).toEqual(['slug']);
expect(output['fallback/[slug]'].lambda.operationType).toBe('ISR');
expect(output['fallback/[slug]'].sourcePath).toBe(undefined);
expect(output['_next/data/testing-build-id/fallback/[slug].json'].type).toBe(
'Prerender'
@@ -175,6 +176,7 @@ it('should build using server build', async () => {
expect(output['fallback/first'].type).toBe('Prerender');
expect(output['fallback/first'].allowQuery).toEqual([]);
expect(output['fallback/first'].lambda.operationType).toBe('ISR');
expect(output['fallback/first'].sourcePath).toBe('/fallback/[slug]');
expect(output['_next/data/testing-build-id/fallback/first.json'].type).toBe(
'Prerender'
@@ -208,6 +210,7 @@ it('should build using server build', async () => {
expect(output['ssg'].type).toBe('Prerender');
expect(output['ssg'].allowQuery).toEqual([]);
expect(output['ssg'].lambda.operationType).toBe('ISR');
expect(output['ssg'].sourcePath).toBe(undefined);
expect(output['index'] === output['another']).toBe(true);
expect(output['dynamic/[slug]'] !== output['fallback/[slug]'].lambda).toBe(

View File

@@ -39,19 +39,20 @@ function normalizeProxyEvent(event) {
responseCallbackCipherKey,
responseCallbackStream,
responseCallbackUrl,
features,
} = payload;
/**
*
* @param {string | Buffer} b
* @param {string | Buffer} body
* @returns Buffer
*/
const normalizeBody = b => {
if (b) {
if (typeof b === 'string' && encoding === 'base64') {
bodyBuffer = Buffer.from(b, encoding);
const normalizeBody = body => {
if (body) {
if (typeof body === 'string' && encoding === 'base64') {
bodyBuffer = Buffer.from(body, encoding);
} else if (encoding === undefined) {
bodyBuffer = Buffer.from(b);
bodyBuffer = Buffer.from(body);
} else {
throw new Error(`Unsupported encoding: ${encoding}`);
}
@@ -62,8 +63,9 @@ function normalizeProxyEvent(event) {
};
if (payloads) {
for (const p of payloads) {
p.body = normalizeBody(payload.body);
for (const targetPayload of payloads) {
targetPayload.features = features;
targetPayload.body = normalizeBody(payload.body);
}
}
bodyBuffer = normalizeBody(body);
@@ -75,6 +77,7 @@ function normalizeProxyEvent(event) {
headers,
body: bodyBuffer,
payloads,
features,
responseCallbackCipher,
responseCallbackCipherIV,
responseCallbackCipherKey,
@@ -84,50 +87,12 @@ function normalizeProxyEvent(event) {
}
/**
* @param {import('aws-lambda').APIGatewayProxyEvent} event
*/
function normalizeAPIGatewayProxyEvent(event) {
let bodyBuffer;
const { httpMethod: method, path, headers, body } = event;
if (body) {
if (event.isBase64Encoded) {
bodyBuffer = Buffer.from(body, 'base64');
} else {
bodyBuffer = Buffer.from(body);
}
} else {
bodyBuffer = Buffer.alloc(0);
}
return {
body: bodyBuffer,
headers,
isApiGateway: true,
method,
path,
responseCallbackCipher: undefined,
responseCallbackCipherIV: undefined,
responseCallbackCipherKey: undefined,
responseCallbackStream: undefined,
responseCallbackUrl: undefined,
};
}
/**
* @param {import('./types').VercelProxyEvent | import('aws-lambda').APIGatewayProxyEvent} event
* @return {import('./types').VercelProxyRequest}
* @param {import('./types').VercelProxyEvent } event
* @return {import('./types').VercelProxyRequest }
*/
function normalizeEvent(event) {
if ('Action' in event) {
if (event.Action === 'Invoke') {
return normalizeProxyEvent(event);
} else {
throw new Error(`Unexpected event.Action: ${event.Action}`);
}
} else {
return normalizeAPIGatewayProxyEvent(event);
}
if (event.Action === 'Invoke') return normalizeProxyEvent(event);
throw new Error(`Unexpected event.Action: ${event.Action}`);
}
class Bridge {
@@ -207,7 +172,7 @@ class Bridge {
/**
*
* @param {import('./types').VercelProxyEvent | import('aws-lambda').APIGatewayProxyEvent} event
* @param {import('./types').VercelProxyEvent} event
* @param {import('aws-lambda').Context} context
* @return {Promise<import('./types').VercelProxyResponse>}
*/

View File

@@ -153,17 +153,17 @@ function getAwsLauncher({ entrypointPath, awsLambdaHandler = '' }) {
}
/**
* @param {import('aws-lambda').APIGatewayProxyEvent} e
* @param {import('aws-lambda').APIGatewayProxyEvent} event
* @param {import('aws-lambda').Context} context
* @param {() => void} callback
*/
function internal(e, context, callback) {
function internal(event, context, callback) {
const {
path,
method: httpMethod,
body,
headers,
} = JSON.parse(e.body || '{}');
} = JSON.parse(event.body || '{}');
const { query } = parse(path, true);
/**
* @type {{[key: string]: string}}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node-bridge",
"version": "3.1.14",
"version": "4.0.0",
"license": "MIT",
"main": "./index.js",
"repository": {

View File

@@ -19,39 +19,6 @@ test('port binding', async () => {
server.close();
});
test('`APIGatewayProxyEvent` normalizing', async () => {
const server = new Server((req, res) =>
res.end(
JSON.stringify({
method: req.method,
path: req.url,
headers: req.headers,
})
)
);
const bridge = new Bridge(server);
bridge.listen();
const context = {};
const result = await bridge.launcher(
{
httpMethod: 'GET',
headers: { foo: 'bar' },
path: '/apigateway',
body: null,
},
context
);
assert.strictEqual(result.encoding, 'base64');
assert.strictEqual(result.statusCode, 200);
const body = JSON.parse(Buffer.from(result.body, 'base64').toString());
assert.strictEqual(body.method, 'GET');
assert.strictEqual(body.path, '/apigateway');
assert.strictEqual(body.headers.foo, 'bar');
assert.strictEqual(context.callbackWaitsForEmptyEventLoop, false);
server.close();
});
test('`NowProxyEvent` normalizing', async () => {
const server = new Server((req, res) =>
res.end(
@@ -62,8 +29,19 @@ test('`NowProxyEvent` normalizing', async () => {
})
)
);
const bridge = new Bridge(server);
let features;
class CustomBridge extends Bridge {
handleEvent(normalizedEvent) {
features = normalizedEvent.features;
return super.handleEvent(normalizedEvent);
}
}
const bridge = new CustomBridge(server);
bridge.listen();
const context = { callbackWaitsForEmptyEventLoop: true };
const result = await bridge.launcher(
{
@@ -71,12 +49,14 @@ test('`NowProxyEvent` normalizing', async () => {
body: JSON.stringify({
method: 'POST',
headers: { foo: 'baz' },
features: { enabled: true },
path: '/nowproxy',
body: 'body=1',
}),
},
context
);
assert.deepStrictEqual(features, { enabled: true });
assert.strictEqual(result.encoding, 'base64');
assert.strictEqual(result.statusCode, 200);
const body = JSON.parse(Buffer.from(result.body, 'base64').toString());

View File

@@ -19,6 +19,7 @@ export interface VercelProxyRequest {
body: Buffer;
encoding?: string;
payloads?: Array<VercelProxyRequest>;
features?: Record<string, boolean>;
responseCallbackCipher?: CipherCCMTypes;
responseCallbackCipherIV?: string;
responseCallbackCipherKey?: string;

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.9.13",
"version": "2.10.1",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -31,8 +31,8 @@
"dependencies": {
"@edge-runtime/vm": "2.0.0",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.4.0",
"@vercel/node-bridge": "3.1.14",
"@vercel/build-utils": "6.6.0",
"@vercel/node-bridge": "4.0.0",
"@vercel/static-config": "2.0.14",
"edge-runtime": "2.0.0",
"esbuild": "0.14.47",

View File

@@ -93,7 +93,7 @@ async function main() {
handleEvent = await createEventHandler(entrypoint!, config, {
shouldAddHelpers,
});
} catch (error) {
} catch (error: any) {
logError(error);
handlerEventError = error;
}
@@ -132,7 +132,7 @@ export async function onDevRequest(
}
}
res.end(Buffer.from(result.body, result.encoding));
} catch (error) {
} catch (error: any) {
res.statusCode = 500;
res.end(error.stack);
}

View File

@@ -2,9 +2,18 @@
/* global addEventListener */
function buildUrl(requestDetails) {
let proto = requestDetails.headers['x-forwarded-proto'].split(/\b/).shift(); // handling multi-protocol like https,http://...
let host = requestDetails.headers['x-forwarded-host'];
let path = requestDetails.url;
const host = requestDetails.headers['x-forwarded-host'] || '127.0.0.1';
const path = requestDetails.url || '/';
const allProtocols = requestDetails.headers['x-forwarded-proto'];
let proto;
if (allProtocols) {
// handle multi-protocol like: https,http://...
proto = allProtocols.split(/\b/).shift();
} else {
proto = 'http';
}
return `${proto}://${host}${path}`;
}
@@ -16,7 +25,7 @@ async function respond(
dependencies
) {
const { Request, Response } = dependencies;
const { isMiddleware, entrypointLabel } = options;
const { isMiddleware } = options;
let body;
@@ -26,7 +35,7 @@ async function respond(
}
}
let request = new Request(buildUrl(requestDetails), {
const request = new Request(buildUrl(requestDetails), {
headers: requestDetails.headers,
method: requestDetails.method,
body: body,
@@ -45,9 +54,7 @@ async function respond(
},
});
} else {
throw new Error(
`Edge Function "${entrypointLabel}" did not return a response.`
);
throw new Error(`Edge Function did not return a response.`);
}
}
return response;
@@ -68,8 +75,8 @@ function toResponseError(error, Response) {
}
async function parseRequestEvent(event) {
let serializedRequest = await event.request.text();
let requestDetails = JSON.parse(serializedRequest);
const serializedRequest = await event.request.text();
const requestDetails = JSON.parse(serializedRequest);
return requestDetails;
}
@@ -78,8 +85,8 @@ async function parseRequestEvent(event) {
function registerFetchListener(userEdgeHandler, options, dependencies) {
addEventListener('fetch', async event => {
try {
let requestDetails = await parseRequestEvent(event);
let response = await respond(
const requestDetails = await parseRequestEvent(event);
const response = await respond(
userEdgeHandler,
requestDetails,
event,

View File

@@ -9,6 +9,10 @@ import fetch from 'node-fetch';
import { createEdgeWasmPlugin, WasmAssets } from './edge-wasm-plugin';
import { entrypointToOutputPath, logError } from '../utils';
import { readFileSync } from 'fs';
import {
createNodeCompatPlugin,
NodeCompatBindings,
} from './edge-node-compat-plugin';
const NODE_VERSION_MAJOR = process.version.match(/^v(\d+)\.\d+/)?.[1];
const NODE_VERSION_IDENTIFIER = `node${NODE_VERSION_MAJOR}`;
@@ -37,8 +41,17 @@ async function compileUserCode(
entrypointFullPath: string,
entrypointRelativePath: string,
isMiddleware: boolean
): Promise<undefined | { userCode: string; wasmAssets: WasmAssets }> {
): Promise<
| undefined
| {
userCode: string;
wasmAssets: WasmAssets;
nodeCompatBindings: NodeCompatBindings;
}
> {
const { wasmAssets, plugin: edgeWasmPlugin } = createEdgeWasmPlugin();
const nodeCompatPlugin = createNodeCompatPlugin();
try {
const result = await esbuild.build({
// bundling behavior: use globals (like "browser") instead
@@ -50,7 +63,7 @@ async function compileUserCode(
sourcemap: 'inline',
legalComments: 'none',
bundle: true,
plugins: [edgeWasmPlugin],
plugins: [edgeWasmPlugin, nodeCompatPlugin.plugin],
entryPoints: [entrypointFullPath],
write: false, // operate in memory
format: 'cjs',
@@ -93,7 +106,11 @@ async function compileUserCode(
registerFetchListener(userEdgeHandler, options, dependencies);
`;
return { userCode, wasmAssets };
return {
userCode,
wasmAssets,
nodeCompatBindings: nodeCompatPlugin.bindings,
};
} catch (error) {
// We can't easily show a meaningful stack trace from ncc -> edge-runtime.
// So, stick with just the message for now.
@@ -106,6 +123,7 @@ async function compileUserCode(
async function createEdgeRuntime(params?: {
userCode: string;
wasmAssets: WasmAssets;
nodeCompatBindings: NodeCompatBindings;
}) {
try {
if (!params) {
@@ -113,6 +131,8 @@ async function createEdgeRuntime(params?: {
}
const wasmBindings = await params.wasmAssets.getContext();
const nodeCompatBindings = params.nodeCompatBindings.getContext();
const edgeRuntime = new EdgeRuntime({
initialCode: params.userCode,
extend: (context: EdgeContext) => {
@@ -127,6 +147,9 @@ async function createEdgeRuntime(params?: {
env: process.env,
},
// These are the global bindings for Node.js compatibility
...nodeCompatBindings,
// These are the global bindings for WebAssembly module
...wasmBindings,
});

View File

@@ -0,0 +1,162 @@
import BufferImplementation from 'buffer';
import EventsImplementation from 'events';
import AsyncHooksImplementation from 'async_hooks';
import AssertImplementation from 'assert';
import UtilImplementation from 'util';
import type { Plugin } from 'esbuild';
const SUPPORTED_NODE_MODULES = [
'buffer',
'events',
'assert',
'util',
'async_hooks',
] as const;
const getSupportedNodeModuleRegex = () =>
new RegExp(`^(?:node:)?(?:${SUPPORTED_NODE_MODULES.join('|')})$`);
function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {
const res: Partial<Pick<T, K>> = {};
for (const key of keys) {
res[key] = obj[key];
}
return res as Pick<T, K>;
}
const NativeModuleMap = () => {
const mods: Record<typeof SUPPORTED_NODE_MODULES[number], unknown> = {
buffer: pick(BufferImplementation, [
'constants',
'kMaxLength',
'kStringMaxLength',
'Buffer',
'SlowBuffer',
]),
events: pick(EventsImplementation, [
'EventEmitter',
'captureRejectionSymbol',
'defaultMaxListeners',
'errorMonitor',
'listenerCount',
'on',
'once',
]),
async_hooks: pick(AsyncHooksImplementation, [
'AsyncLocalStorage',
'AsyncResource',
]),
assert: pick(AssertImplementation, [
'AssertionError',
'deepEqual',
'deepStrictEqual',
'doesNotMatch',
'doesNotReject',
'doesNotThrow',
'equal',
'fail',
'ifError',
'match',
'notDeepEqual',
'notDeepStrictEqual',
'notEqual',
'notStrictEqual',
'ok',
'rejects',
'strict',
'strictEqual',
'throws',
]),
util: pick(UtilImplementation, [
'_extend' as any,
'callbackify',
'format',
'inherits',
'promisify',
'types',
]),
};
return new Map(Object.entries(mods));
};
const NODE_COMPAT_NAMESPACE = 'vercel-node-compat';
export class NodeCompatBindings {
private bindings = new Map<
string,
{
name: string;
modulePath: string;
value: unknown;
}
>();
use(modulePath: `node:${string}`) {
const stripped = modulePath.replace(/^node:/, '');
const name = `__vc_node_${stripped}__`;
if (!this.bindings.has(modulePath)) {
const value = NativeModuleMap().get(stripped);
if (value === undefined) {
throw new Error(`Could not find module ${modulePath}`);
}
this.bindings.set(modulePath, {
modulePath: modulePath,
name,
value,
});
}
return name;
}
getContext(): Record<string, unknown> {
const context: Record<string, unknown> = {};
for (const binding of this.bindings.values()) {
context[binding.name] = binding.value;
}
return context;
}
}
/**
* Allows to enable Node.js compatibility by detecting namespaced `node:`
* imports and producing metadata to bind global variables for each.
* It requires from the consumer to add the imports.
*/
export function createNodeCompatPlugin() {
const bindings = new NodeCompatBindings();
const plugin: Plugin = {
name: 'vc-node-compat',
setup(b) {
b.onResolve({ filter: getSupportedNodeModuleRegex() }, async args => {
const importee = args.path.replace('node:', '');
if (!SUPPORTED_NODE_MODULES.includes(importee as any)) {
return;
}
return {
namespace: NODE_COMPAT_NAMESPACE,
path: args.path,
};
});
b.onLoad(
{ filter: /.+/, namespace: NODE_COMPAT_NAMESPACE },
async args => {
const fullName = args.path.startsWith('node:')
? (args.path as `node:${string}`)
: (`node:${args.path}` as const);
const globalName = bindings.use(fullName);
return {
contents: `module.exports = ${globalName};`,
loader: 'js',
};
}
);
},
};
return {
plugin,
bindings,
};
}

View File

@@ -175,7 +175,9 @@ async function compile(
return source;
}
const conditions = isEdgeFunction ? ['worker', 'browser'] : undefined;
const conditions = isEdgeFunction
? ['edge-light', 'browser', 'module', 'import', 'require']
: undefined;
const { fileList, esmFileList, warnings } = await nodeFileTrace(
[...inputFiles],

View File

@@ -0,0 +1,16 @@
/* global Response */
import B from 'node:buffer';
import { Buffer } from 'buffer';
export const config = { runtime: 'edge' };
export default async () => {
const encoded = Buffer.from('Hello, world!').toString('base64');
return new Response(
JSON.stringify({
encoded,
'Buffer === B.Buffer': Buffer === B.Buffer,
})
);
};

View File

@@ -22,6 +22,33 @@ function testForkDevServer(entrypoint: string) {
});
}
test('runs an edge function that uses `buffer`', async () => {
const child = testForkDevServer('./edge-buffer.js');
try {
const result = await readMessage(child);
if (result.state !== 'message') {
throw new Error('Exited. error: ' + JSON.stringify(result.value));
}
const response = await fetch(
`http://localhost:${result.value.port}/api/edge-buffer`
);
expect({
status: response.status,
json: await response.json(),
}).toEqual({
status: 200,
json: {
encoded: Buffer.from('Hello, world!').toString('base64'),
'Buffer === B.Buffer': true,
},
});
} finally {
child.kill(9);
}
});
test('runs a mjs endpoint', async () => {
const child = testForkDevServer('./esm-module.mjs');

View File

@@ -28,6 +28,39 @@ describe('edge-handler-template', () => {
});
expect(url).toBe('https://somewhere.com/api/add');
});
test('url falls back to `/`', async () => {
const url = buildUrl({
// missing url
headers: {
'x-forwarded-proto': 'https',
'x-forwarded-host': 'somewhere.com',
},
});
expect(url).toBe('https://somewhere.com/');
});
test('host header falls back to `127.0.0.1`', async () => {
const url = buildUrl({
url: '/api/add',
headers: {
'x-forwarded-proto': 'https',
// missing 'x-forwarded-host'
},
});
expect(url).toBe('https://127.0.0.1/api/add');
});
test('proto header falls back to `http`', async () => {
const url = buildUrl({
url: '/api/add',
headers: {
// missing 'x-forwarded-proto'
'x-forwarded-host': 'somewhere.com',
},
});
expect(url).toBe('http://somewhere.com/api/add');
});
});
describe('respond()', () => {

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/python",
"version": "3.1.54",
"version": "3.1.56",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -23,7 +23,7 @@
"@types/execa": "^0.9.0",
"@types/jest": "27.4.1",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/ncc": "0.24.0",
"execa": "^1.0.0",
"typescript": "4.3.4"

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/redwood",
"version": "1.1.10",
"version": "1.1.12",
"main": "./dist/index.js",
"license": "MIT",
"homepage": "https://vercel.com/docs",
@@ -27,7 +27,7 @@
"@types/aws-lambda": "8.10.19",
"@types/node": "14.18.33",
"@types/semver": "6.0.0",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"execa": "3.2.0",
"fs-extra": "11.1.0",
"typescript": "4.3.4"

View File

@@ -1,5 +1,5 @@
import handleRequest from '@vercel/remix-entry-server';
import { RemixServer } from '@remix-run/react';
import { handleRequest } from '@vercel/remix';
export default function (
request,

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix-builder",
"version": "1.7.0",
"version": "1.8.2",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -21,15 +21,17 @@
],
"dependencies": {
"@remix-run/dev": "npm:@vercel/remix-run-dev@1.14.2",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/nft": "0.22.5",
"@vercel/static-config": "2.0.14",
"path-to-regexp": "6.2.1",
"semver": "7.3.8",
"ts-morph": "12.0.0"
},
"devDependencies": {
"@types/jest": "27.5.1",
"@types/node": "14.18.33",
"@types/semver": "7.3.13",
"typescript": "4.9.4"
}
}

View File

@@ -44,6 +44,7 @@ import {
chdirAndReadConfig,
addDependency,
} from './utils';
import semver from 'semver';
const _require: typeof require = eval('require');
@@ -62,6 +63,9 @@ const nodeServerSrcPromise = fs.readFile(
'utf-8'
);
// This value is the minimum supported version for our fork of Remix
const minimumSupportRemixVersion = '1.10.0';
export const build: BuildV2 = async ({
entrypoint,
files,
@@ -149,17 +153,43 @@ export const build: BuildV2 = async ({
join(DEFAULTS_PATH, 'entry.server.jsx'),
join(appDirectory, 'entry.server.jsx')
);
if (!pkg.dependencies['@vercel/remix-entry-server']) {
if (!pkg.dependencies['@vercel/remix']) {
// Dependency version resolution logic
// 1. Users app is on 1.9.0 -> we install the 1.10.0 (minimum) version of our fork (`@vercel/remix`)
// 2. Users app is on 1.11.0 (a version greater than 1.10.0 and less than the latest version of the fork) -> we install the (matching) 1.11.0 version of `@vercel/remix`
// 3. Users app is on something greater than our latest version of the fork -> we install the latest version of our fork
// remixVersion is the version of the `@remix-run/dev` package in the *users' app*
const usersRemixVersion = semver.gt(
remixVersion,
minimumSupportRemixVersion
)
? remixVersion
: minimumSupportRemixVersion;
// Prevent frozen lockfile rejections
const envForAddDep = { ...spawnOpts.env };
delete envForAddDep.CI;
delete envForAddDep.VERCEL;
delete envForAddDep.NOW_BUILDER;
await addDependency(cliType, ['@vercel/remix-entry-server'], {
...spawnOpts,
env: envForAddDep,
cwd: entrypointFsDirname,
});
await addDependency(
cliType,
[
`@vercel/remix@${
semver.gt(
usersRemixVersion,
require('@remix-run/dev/package.json').version
)
? 'latest'
: usersRemixVersion
}`,
],
{
...spawnOpts,
env: envForAddDep,
cwd: entrypointFsDirname,
}
);
}
}
@@ -540,7 +570,7 @@ async function createRenderEdgeFunction(
const trace = await nodeFileTrace([handlerPath], {
base: rootDir,
processCwd: entrypointDir,
conditions: ['worker', 'browser'],
conditions: ['edge-light', 'browser', 'module', 'import', 'require'],
async readFile(fsPath) {
let source: Buffer | string;
try {

View File

@@ -42,7 +42,7 @@ export interface ResolvedRoutePaths {
rePath: string;
}
const SPLAT_PATH = '/:params+';
const SPLAT_PATH = '/:params*';
const entryExts = ['.js', '.jsx', '.ts', '.tsx'];

View File

@@ -0,0 +1,3 @@
export const config = { runtime: 'edge' };
export default function () { return <div>Sub catch-all</div> }

View File

@@ -12,6 +12,10 @@
{ "path": "/nested", "mustContain": "Nested index page" },
{ "path": "/nested/another", "mustContain": "Nested another page" },
{ "path": "/nested/index", "mustContain": "<div>nested/index</div>" },
{ "path": "/asdf", "mustContain": "<div>asdf</div>" }
{ "path": "/asdf", "mustContain": "<div>asdf</div>" },
{ "path": "/foo/bar", "mustContain": "<div>foo/bar</div>" },
{ "path": "/sub", "mustContain": "<div>Sub catch-all</div>" },
{ "path": "/sub/", "mustContain": "<div>Sub catch-all</div>" },
{ "path": "/sub/another", "mustContain": "<div>Sub catch-all</div>" }
]
}

View File

@@ -144,14 +144,14 @@ describe('getPathFromRoute()', () => {
},
{
id: 'routes/projects/$',
expected: { path: 'projects/*', rePath: '/projects/:params+' },
expected: { path: 'projects/*', rePath: '/projects/:params*' },
},
{
id: 'routes/$foo.$bar.$baz',
expected: { path: ':foo/:bar/:baz', rePath: '/:foo/:bar/:baz' },
},
{ id: 'routes/node', expected: { path: 'node', rePath: '/node' } },
{ id: 'routes/$', expected: { path: '*', rePath: '/:params+' } },
{ id: 'routes/$', expected: { path: '*', rePath: '/:params*' } },
{
id: 'routes/($lang)/index',
expected: { path: '(:lang)', rePath: '/:lang?' },

View File

@@ -13,11 +13,11 @@ describe('getRegExpFromPath()', () => {
describe.each([
{
path: '/:params+',
path: '/:params*',
urls: [
{
url: '/',
expected: false,
expected: true,
},
{
url: '/foo',
@@ -38,7 +38,7 @@ describe('getRegExpFromPath()', () => {
],
},
{
path: '/projects/:params+',
path: '/projects/:params*',
urls: [
{
url: '/',
@@ -48,12 +48,20 @@ describe('getRegExpFromPath()', () => {
url: '/foo',
expected: false,
},
{
url: '/projects',
expected: true,
},
{
url: '/projects/',
expected: true,
},
{
url: '/projects/foo',
expected: true,
},
{
url: '/projects/another',
url: '/projects/foo/another',
expected: true,
},
],

View File

@@ -1,7 +1,7 @@
{
"name": "@vercel/ruby",
"author": "Nathan Cahill <nathan@nathancahill.com>",
"version": "1.3.71",
"version": "1.3.73",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
@@ -22,7 +22,7 @@
"devDependencies": {
"@types/fs-extra": "8.0.0",
"@types/semver": "6.0.0",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/ncc": "0.24.0",
"execa": "2.0.4",
"fs-extra": "^7.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "1.3.17",
"version": "1.3.20",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -30,7 +30,7 @@
},
"dependencies": {
"@vercel/gatsby-plugin-vercel-analytics": "1.0.8",
"@vercel/gatsby-plugin-vercel-builder": "1.2.2"
"@vercel/gatsby-plugin-vercel-builder": "1.2.5"
},
"devDependencies": {
"@types/aws-lambda": "8.10.64",
@@ -42,9 +42,9 @@
"@types/node-fetch": "2.5.4",
"@types/promise-timeout": "1.3.0",
"@types/semver": "7.3.13",
"@vercel/build-utils": "6.4.0",
"@vercel/build-utils": "6.6.0",
"@vercel/frameworks": "1.3.3",
"@vercel/fs-detectors": "3.8.5",
"@vercel/fs-detectors": "3.8.7",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.1.11",
"@vercel/static-config": "2.0.14",

172
pnpm-lock.yaml generated
View File

@@ -29,7 +29,7 @@ importers:
source-map-support: 0.5.12
ts-eager: 2.0.2
ts-jest: 28.0.5
turbo: 1.8.3
turbo: 1.8.5
dependencies:
lerna: 5.6.2
devDependencies:
@@ -57,7 +57,7 @@ importers:
source-map-support: 0.5.12
ts-eager: 2.0.2
ts-jest: 28.0.5_jest@28.0.2
turbo: 1.8.3
turbo: 1.8.5
api:
specifiers:
@@ -236,23 +236,23 @@ importers:
'@types/write-json-file': 2.2.1
'@types/yauzl-promise': 2.1.0
'@vercel-internals/types': '*'
'@vercel/build-utils': 6.4.0
'@vercel/client': 12.4.5
'@vercel/build-utils': 6.6.0
'@vercel/client': 12.4.7
'@vercel/error-utils': 1.0.8
'@vercel/frameworks': 1.3.3
'@vercel/fs-detectors': 3.8.5
'@vercel/fs-detectors': 3.8.7
'@vercel/fun': 1.0.4
'@vercel/go': 2.4.0
'@vercel/hydrogen': 0.0.58
'@vercel/go': 2.4.2
'@vercel/hydrogen': 0.0.60
'@vercel/ncc': 0.24.0
'@vercel/next': 3.6.7
'@vercel/node': 2.9.13
'@vercel/python': 3.1.54
'@vercel/redwood': 1.1.10
'@vercel/remix-builder': 1.7.0
'@vercel/next': 3.7.2
'@vercel/node': 2.10.1
'@vercel/python': 3.1.56
'@vercel/redwood': 1.1.12
'@vercel/remix-builder': 1.8.2
'@vercel/routing-utils': 2.1.11
'@vercel/ruby': 1.3.71
'@vercel/static-build': 1.3.17
'@vercel/ruby': 1.3.73
'@vercel/static-build': 1.3.20
'@zeit/source-map-support': 0.6.2
ajv: 6.12.2
alpha-sort: 2.0.1
@@ -475,7 +475,7 @@ importers:
'@types/node-fetch': 2.5.4
'@types/recursive-readdir': 2.2.0
'@types/tar-fs': 1.16.1
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/routing-utils': 2.1.11
'@zeit/fetch': 5.2.0
async-retry: 1.2.3
@@ -580,7 +580,7 @@ importers:
'@types/minimatch': 3.0.5
'@types/node': 14.18.33
'@types/semver': 7.3.10
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/error-utils': 1.0.8
'@vercel/frameworks': 1.3.3
'@vercel/routing-utils': 2.1.11
@@ -629,8 +629,8 @@ importers:
'@types/fs-extra': 11.0.1
'@types/node': 14.18.33
'@types/react': 18.0.26
'@vercel/build-utils': 6.4.0
'@vercel/node': 2.9.13
'@vercel/build-utils': 6.6.0
'@vercel/node': 2.10.1
'@vercel/routing-utils': 2.1.11
esbuild: 0.14.47
etag: 1.8.1
@@ -662,7 +662,7 @@ importers:
'@types/node-fetch': ^2.3.0
'@types/tar': ^4.0.0
'@types/yauzl-promise': 2.1.0
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/ncc': 0.24.0
async-retry: 1.3.1
execa: ^1.0.0
@@ -699,7 +699,7 @@ importers:
specifiers:
'@types/jest': 27.5.1
'@types/node': 14.18.33
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/static-config': 2.0.14
execa: 3.2.0
fs-extra: 11.1.0
@@ -730,7 +730,7 @@ importers:
'@types/semver': 6.0.0
'@types/text-table': 0.2.1
'@types/webpack-sources': 3.2.0
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/nft': 0.22.5
'@vercel/routing-utils': 2.1.11
async-sema: 3.0.1
@@ -809,10 +809,10 @@ importers:
'@types/node': 14.18.33
'@types/node-fetch': ^2.6.1
'@types/test-listen': 1.1.0
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/ncc': 0.24.0
'@vercel/nft': 0.22.5
'@vercel/node-bridge': 3.1.14
'@vercel/node-bridge': 4.0.0
'@vercel/static-config': 2.0.14
content-type: 1.0.4
cookie: 0.4.0
@@ -893,7 +893,7 @@ importers:
'@types/execa': ^0.9.0
'@types/jest': 27.4.1
'@types/node': 14.18.33
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/ncc': 0.24.0
execa: ^1.0.0
typescript: 4.3.4
@@ -911,7 +911,7 @@ importers:
'@types/aws-lambda': 8.10.19
'@types/node': 14.18.33
'@types/semver': 6.0.0
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/nft': 0.22.5
'@vercel/routing-utils': 2.1.11
execa: 3.2.0
@@ -936,10 +936,12 @@ importers:
'@remix-run/dev': npm:@vercel/remix-run-dev@1.14.2
'@types/jest': 27.5.1
'@types/node': 14.18.33
'@vercel/build-utils': 6.4.0
'@types/semver': 7.3.13
'@vercel/build-utils': 6.6.0
'@vercel/nft': 0.22.5
'@vercel/static-config': 2.0.14
path-to-regexp: 6.2.1
semver: 7.3.8
ts-morph: 12.0.0
typescript: 4.9.4
dependencies:
@@ -948,10 +950,12 @@ importers:
'@vercel/nft': 0.22.5
'@vercel/static-config': link:../static-config
path-to-regexp: 6.2.1
semver: 7.3.8
ts-morph: 12.0.0
devDependencies:
'@types/jest': 27.5.1
'@types/node': 14.18.33
'@types/semver': 7.3.13
typescript: 4.9.4
packages/remix-entry-server:
@@ -993,7 +997,7 @@ importers:
specifiers:
'@types/fs-extra': 8.0.0
'@types/semver': 6.0.0
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/ncc': 0.24.0
execa: 2.0.4
fs-extra: ^7.0.1
@@ -1020,11 +1024,11 @@ importers:
'@types/node-fetch': 2.5.4
'@types/promise-timeout': 1.3.0
'@types/semver': 7.3.13
'@vercel/build-utils': 6.4.0
'@vercel/build-utils': 6.6.0
'@vercel/frameworks': 1.3.3
'@vercel/fs-detectors': 3.8.5
'@vercel/fs-detectors': 3.8.7
'@vercel/gatsby-plugin-vercel-analytics': 1.0.8
'@vercel/gatsby-plugin-vercel-builder': 1.2.2
'@vercel/gatsby-plugin-vercel-builder': 1.2.5
'@vercel/ncc': 0.24.0
'@vercel/routing-utils': 2.1.11
'@vercel/static-config': 2.0.14
@@ -2672,7 +2676,7 @@ packages:
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
dependencies:
'@jest/types': 28.1.3
'@types/node': 18.14.6
'@types/node': 16.18.11
chalk: 4.1.0
jest-message-util: 28.1.3
jest-util: 28.1.3
@@ -2782,7 +2786,7 @@ packages:
dependencies:
'@jest/fake-timers': 28.1.3
'@jest/types': 28.1.3
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-mock: 28.1.3
dev: true
@@ -2792,7 +2796,7 @@ packages:
dependencies:
'@jest/fake-timers': 29.3.1
'@jest/types': 29.3.1
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-mock: 29.3.1
dev: true
@@ -2836,7 +2840,7 @@ packages:
dependencies:
'@jest/types': 28.1.3
'@sinonjs/fake-timers': 9.1.2
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-message-util: 28.1.3
jest-mock: 28.1.3
jest-util: 28.1.3
@@ -2848,7 +2852,7 @@ packages:
dependencies:
'@jest/types': 29.3.1
'@sinonjs/fake-timers': 9.1.2
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-message-util: 29.3.1
jest-mock: 29.3.1
jest-util: 29.3.1
@@ -2892,7 +2896,7 @@ packages:
'@jest/transform': 28.1.3
'@jest/types': 28.1.3
'@jridgewell/trace-mapping': 0.3.17
'@types/node': 18.14.6
'@types/node': 16.18.11
chalk: 4.1.0
collect-v8-coverage: 1.0.1
exit: 0.1.2
@@ -3077,7 +3081,7 @@ packages:
'@jest/schemas': 28.1.3
'@types/istanbul-lib-coverage': 2.0.4
'@types/istanbul-reports': 3.0.1
'@types/node': 18.14.6
'@types/node': 16.18.11
'@types/yargs': 17.0.19
chalk: 4.1.0
dev: true
@@ -4976,7 +4980,7 @@ packages:
dependencies:
'@types/http-cache-semantics': 4.0.1
'@types/keyv': 3.1.4
'@types/node': 18.14.6
'@types/node': 16.18.11
'@types/responselike': 1.0.0
dev: false
@@ -5153,7 +5157,7 @@ packages:
/@types/graceful-fs/4.1.6:
resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==}
dependencies:
'@types/node': 18.14.6
'@types/node': 16.18.11
dev: true
/@types/hast/2.3.4:
@@ -5258,7 +5262,7 @@ packages:
/@types/keyv/3.1.4:
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
dependencies:
'@types/node': 18.14.6
'@types/node': 16.18.11
dev: false
/@types/load-json-file/2.0.7:
@@ -5446,7 +5450,7 @@ packages:
/@types/responselike/1.0.0:
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
dependencies:
'@types/node': 18.14.6
'@types/node': 16.18.11
dev: false
/@types/retry/0.12.2:
@@ -8193,7 +8197,7 @@ packages:
supports-color:
optional: true
dependencies:
ms: 2.1.3
ms: 2.1.2
dev: true
/debug/4.1.1:
@@ -8587,7 +8591,7 @@ packages:
dev: false
/ee-first/1.1.1:
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=}
/ejs/3.1.8:
resolution: {integrity: sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==}
@@ -9358,7 +9362,7 @@ packages:
eslint-import-resolver-webpack:
optional: true
dependencies:
'@typescript-eslint/parser': 5.54.1
'@typescript-eslint/parser': 5.54.1_typescript@4.9.4
debug: 3.2.7
eslint-import-resolver-node: 0.3.7
eslint-import-resolver-typescript: 3.5.3_5rfvta7qn57kxm7ir36ta6fixq
@@ -9386,7 +9390,7 @@ packages:
'@typescript-eslint/parser':
optional: true
dependencies:
'@typescript-eslint/parser': 5.54.1
'@typescript-eslint/parser': 5.54.1_typescript@4.9.4
array-includes: 3.1.6
array.prototype.flat: 1.3.1
array.prototype.flatmap: 1.3.1
@@ -9503,7 +9507,7 @@ packages:
eslint-plugin-jest:
optional: true
dependencies:
eslint-plugin-jest: 27.2.1_j7aytffwn6h2xuxtcd36dokff4
eslint-plugin-jest: 27.2.1_6xo4tvwzjwdi6xwjpxfe6jodqe
dev: true
/eslint-plugin-react-hooks/4.6.0:
@@ -10285,7 +10289,7 @@ packages:
dev: true
/fresh/0.5.2:
resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=}
engines: {node: '>= 0.6'}
/from2/2.3.0:
@@ -11934,7 +11938,7 @@ packages:
'@jest/expect': 28.1.3
'@jest/test-result': 28.1.3
'@jest/types': 28.1.3
'@types/node': 18.14.6
'@types/node': 16.18.11
chalk: 4.1.0
co: 4.6.0
dedent: 0.7.0
@@ -11961,7 +11965,7 @@ packages:
'@jest/expect': 29.3.1
'@jest/test-result': 29.3.1
'@jest/types': 29.3.1
'@types/node': 18.14.6
'@types/node': 16.18.11
chalk: 4.1.0
co: 4.6.0
dedent: 0.7.0
@@ -12265,7 +12269,7 @@ packages:
'@jest/environment': 28.1.3
'@jest/fake-timers': 28.1.3
'@jest/types': 28.1.3
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-mock: 28.1.3
jest-util: 28.1.3
dev: true
@@ -12277,7 +12281,7 @@ packages:
'@jest/environment': 29.3.1
'@jest/fake-timers': 29.3.1
'@jest/types': 29.3.1
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-mock: 29.3.1
jest-util: 29.3.1
dev: true
@@ -12303,7 +12307,7 @@ packages:
dependencies:
'@jest/types': 28.1.3
'@types/graceful-fs': 4.1.6
'@types/node': 18.14.6
'@types/node': 16.18.11
anymatch: 3.1.3
fb-watchman: 2.0.2
graceful-fs: 4.2.10
@@ -12416,7 +12420,7 @@ packages:
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
dependencies:
'@jest/types': 28.1.3
'@types/node': 18.14.6
'@types/node': 16.18.11
dev: true
/jest-mock/29.3.1:
@@ -12424,7 +12428,7 @@ packages:
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dependencies:
'@jest/types': 29.3.1
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-util: 29.3.1
dev: true
@@ -12521,7 +12525,7 @@ packages:
'@jest/test-result': 28.1.3
'@jest/transform': 28.1.3
'@jest/types': 28.1.3
'@types/node': 18.14.6
'@types/node': 16.18.11
chalk: 4.1.0
emittery: 0.10.2
graceful-fs: 4.2.10
@@ -12747,7 +12751,7 @@ packages:
dependencies:
'@jest/test-result': 28.1.3
'@jest/types': 28.1.3
'@types/node': 18.14.6
'@types/node': 16.18.11
ansi-escapes: 4.3.2
chalk: 4.1.0
emittery: 0.10.2
@@ -12773,7 +12777,7 @@ packages:
resolution: {integrity: sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==}
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
dependencies:
'@types/node': 18.14.6
'@types/node': 16.18.11
merge-stream: 2.0.0
supports-color: 8.1.1
dev: true
@@ -12782,7 +12786,7 @@ packages:
resolution: {integrity: sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dependencies:
'@types/node': 18.14.6
'@types/node': 16.18.11
jest-util: 29.3.1
merge-stream: 2.0.0
supports-color: 8.1.1
@@ -13632,7 +13636,7 @@ packages:
dev: false
/media-typer/0.3.0:
resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=}
engines: {node: '>= 0.6'}
/meow/8.1.2:
@@ -13653,7 +13657,7 @@ packages:
dev: false
/merge-descriptors/1.0.1:
resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==}
resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=}
/merge-stream/2.0.0:
resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
@@ -14472,7 +14476,7 @@ packages:
dependencies:
hosted-git-info: 2.8.9
osenv: 0.1.5
semver: 5.5.0
semver: 5.7.1
validate-npm-package-name: 3.0.0
dev: true
@@ -15607,7 +15611,7 @@ packages:
/pump/3.0.0:
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
dependencies:
end-of-stream: 1.4.4
end-of-stream: 1.4.1
once: 1.4.0
/pumpify/1.5.1:
@@ -17027,7 +17031,7 @@ packages:
engines: {node: '>=6'}
dependencies:
bl: 4.1.0
end-of-stream: 1.4.4
end-of-stream: 1.4.1
fs-constants: 1.0.0
inherits: 2.0.4
readable-stream: 3.6.0
@@ -17555,65 +17559,65 @@ packages:
safe-buffer: 5.2.1
dev: true
/turbo-darwin-64/1.8.3:
resolution: {integrity: sha512-bLM084Wr17VAAY/EvCWj7+OwYHvI9s/NdsvlqGp8iT5HEYVimcornCHespgJS/yvZDfC+mX9EQkn3V2JmYgGGw==}
/turbo-darwin-64/1.8.5:
resolution: {integrity: sha512-CAYh56bzeHfnh7jTm03r29bh8p5a/EjQo1Id5yLUH7hS7msTau/+YpxJWPodLbN0UQsUYivUqHQkglJ+eMJ7xA==}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/turbo-darwin-arm64/1.8.3:
resolution: {integrity: sha512-4oZjXtzakopMK110kue3z/hqu3WLv+eDLZOX1NGdo49gqca9BeD8GbH+sXpAp6tqyeuzpss+PIliVYuyt7LgbA==}
/turbo-darwin-arm64/1.8.5:
resolution: {integrity: sha512-R3jCPOv+lu3dcvMhj8b/Defv6dyUwX6W+tbX7d6YUCA46Plf/bGCQ8+MSbxmr/4E1GyGOVFsn1wRfiYk0us/Dg==}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/turbo-linux-64/1.8.3:
resolution: {integrity: sha512-uvX2VKotf5PU14FCxJA5iHItPQno2JWzerMd+g3/h/Asay6dvxvtVjc39MQeGT0H5njSvzVKFkT+3/5q8lgOEg==}
/turbo-linux-64/1.8.5:
resolution: {integrity: sha512-YRc/KNRZeUVvth11UO4SDQZR2IqGgl9MSsbzqoHuFz4B4Q5QXH7onHogv9aXWE/BZBBbcrSBTlwBSG0Gg+J8hg==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-linux-arm64/1.8.3:
resolution: {integrity: sha512-E1p+oH3XKMaPS4rqWhYsL4j2Pzc0d/9P5KU7Kn1kqVLo2T3iRA7n2KVULEieUNE0nTH+aIJPXYXOpqCI5wFJaA==}
/turbo-linux-arm64/1.8.5:
resolution: {integrity: sha512-8exVZb7XBl/V3gHSweuUyG2D9IzfWqwLvlXoeLWlVYSj61Ajgdv+WU7lvUmx+H2s+sSKqmIFmewA5Lw6YY37sg==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/turbo-windows-64/1.8.3:
resolution: {integrity: sha512-cnzAytHtoLXd0J7aNzRpZFpL/GTjcBmkvAPlbOdf/Pl1iwS4qzGrudZQ+OM1lmLgLIfBPIavsGHBknTwTNib4A==}
/turbo-windows-64/1.8.5:
resolution: {integrity: sha512-fA8PU5ZNoFnQkapG06WiEqfsVQ5wbIPkIqTwUsd/M2Lp+KgxE79SQbuEI+2vQ9SmwM5qoMi515IPjgvXAJXgCw==}
cpu: [x64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/turbo-windows-arm64/1.8.3:
resolution: {integrity: sha512-ulIiItNm2w/zYJdD5/oAzjzNns1IjbpweRzpsE8tLXaWwo6+fnXXkyloUug0IUhcd2k6fJXfoiDZfygqpOVuXg==}
/turbo-windows-arm64/1.8.5:
resolution: {integrity: sha512-SW/NvIdhckLsAWjU/iqBbCB0S8kXupKscUK3kEW1DZIr3MYcP/yIuaE/IdPuqcoF3VP0I3TLD4VTYCCKAo3tKA==}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/turbo/1.8.3:
resolution: {integrity: sha512-zGrkU1EuNFmkq6iky6LcMqD4h0OLE8XysVFxQWRIZbcTNnf0XAycbsbeEyiJpiWeqb7qtg2bVuY9EYcNoNhVuQ==}
/turbo/1.8.5:
resolution: {integrity: sha512-UBnH2wIFb5g6OQCk8f34Ud15ZXV4xEMmugeDJTU5Ur2LpVRsNEny0isSCYdb3Iu3howoNyyXmtpaxWsAwNYkkg==}
hasBin: true
requiresBuild: true
optionalDependencies:
turbo-darwin-64: 1.8.3
turbo-darwin-arm64: 1.8.3
turbo-linux-64: 1.8.3
turbo-linux-arm64: 1.8.3
turbo-windows-64: 1.8.3
turbo-windows-arm64: 1.8.3
turbo-darwin-64: 1.8.5
turbo-darwin-arm64: 1.8.5
turbo-linux-64: 1.8.5
turbo-linux-arm64: 1.8.5
turbo-windows-64: 1.8.5
turbo-windows-arm64: 1.8.5
dev: true
/tweetnacl/0.14.5:
@@ -18005,7 +18009,7 @@ packages:
dev: true
/utils-merge/1.0.1:
resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=}
engines: {node: '>= 0.4.0'}
/uuid/3.3.2:

View File

@@ -199,6 +199,9 @@ async function fetchCachedToken() {
return token;
}
/**
* @returns { Promise<String> }
*/
async function fetchTokenWithRetry(retries = 5) {
const {
NOW_TOKEN,