Compare commits

..

21 Commits

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

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

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

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

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

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

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

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

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

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

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

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

Linear: https://linear.app/vercel/issue/VCCLI-411/display-uncompressed-edge-middleware-matcher-show-the-list-of-matches
2023-02-28 21:26:26 +00:00
Mehul Kar
347c2de3a2 [tests] Adopt Workspace Configurations from turbo@1.8 (#9573) 2023-02-28 20:49:28 +00:00
Ethan Arrowood
a05cc11719 [tests] Fix gatsby cron job script - git diff operation (#9577)
as titled
2023-02-28 13:13:57 -07:00
Ethan Arrowood
55b999ea9b [tests] add missing -w option for pnpm in gatsby cron job script (#9575)
as titled
2023-02-28 13:05:31 -07:00
Ethan Arrowood
8babc3694f [tests] Fix gatsby cron job (#9574)
Changes logic so its a single npm call instead of multiple
2023-02-28 11:59:58 -08:00
Ethan Arrowood
6dc0321216 [tests] add missing __dirname from gatsby cron job script (#9572)
as titled
2023-02-28 11:40:05 -08:00
Ethan Arrowood
3df8c05792 [tests] Add cron job to update gatsby fixtures (#9510)
PR to add a cron job and script that automatically updates gatsby
fixture versions.
2023-02-28 11:32:00 -08:00
64 changed files with 49008 additions and 38619 deletions

View File

@@ -0,0 +1,31 @@
name: Cron Update Gatsby Fixtures
on:
# Allow manual runs
workflow_dispatch:
# Run once a week https://crontab.guru/once-a-week
schedule:
- cron: '0 0 * * 0'
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# 0 means fetch all commits so we can commit and push in the script below
with:
fetch-depth: 0
- name: Enable corepack
run: corepack enable pnpm
- name: Create Pull Request
uses: actions/github-script@v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-gatsby-fixtures.js')
await script({ github, context })

View File

@@ -16,6 +16,9 @@ jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -41,6 +44,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
- name: install npm@9
run: npm i -g npm@9
- name: install pnpm@7.24.2
run: npm i -g pnpm@7.24.2
- name: Install

View File

@@ -0,0 +1,28 @@
name: Update @remix-run/dev
on:
workflow_dispatch:
inputs:
new-version:
type: string
description: "Optional version to update @remix-run/dev to inside of @vercel/remix"
jobs:
update-remix-run-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
- name: Enable corepack
run: corepack enable pnpm
- name: Update @remix-run/dev
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-remix-run-dev.js')
await script({ github, context }, "${{ inputs.new-version }}")

1
.npmrc
View File

@@ -1,3 +1,4 @@
provenance=true
save-exact=true
hoist-pattern[]=!"**/@types/**"
hoist-pattern[]=!"**/typedoc"

View File

@@ -1,6 +1,5 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}

View File

@@ -8,9 +8,9 @@
"name": "nextjs",
"version": "0.1.0",
"dependencies": {
"eslint": "8.34.0",
"eslint-config-next": "13.2.1",
"next": "13.2.1",
"eslint": "8.35.0",
"eslint-config-next": "13.2.3",
"next": "13.2.3",
"react": "18.2.0",
"react-dom": "18.2.0"
}
@@ -27,9 +27,9 @@
}
},
"node_modules/@eslint/eslintrc": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
"integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz",
"integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==",
"dependencies": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
@@ -48,6 +48,14 @@
"url": "https://opencollective.com/eslint"
}
},
"node_modules/@eslint/js": {
"version": "8.35.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz",
"integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.11.8",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
@@ -79,22 +87,22 @@
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
},
"node_modules/@next/env": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.2.1.tgz",
"integrity": "sha512-Hq+6QZ6kgmloCg8Kgrix+4F0HtvLqVK3FZAnlAoS0eonaDemHe1Km4kwjSWRE3JNpJNcKxFHF+jsZrYo0SxWoQ=="
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.2.3.tgz",
"integrity": "sha512-FN50r/E+b8wuqyRjmGaqvqNDuWBWYWQiigfZ50KnSFH0f+AMQQyaZl+Zm2+CIpKk0fL9QxhLxOpTVA3xFHgFow=="
},
"node_modules/@next/eslint-plugin-next": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.2.1.tgz",
"integrity": "sha512-r0i5rcO6SMAZtqiGarUVMr3k256X0R0j6pEkKg4PxqUW+hG0qgMxRVAJsuoRG5OBFkCOlSfWZJ0mP9fQdCcyNg==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.2.3.tgz",
"integrity": "sha512-QmMPItnU7VeojI1KnuwL9SLFWEwmaNHNlnOGpoTwdLoSiP9sc8KYiAHWEc4/44L+cAdCxcZYvn7frcRNP5l84Q==",
"dependencies": {
"glob": "7.1.7"
}
},
"node_modules/@next/swc-android-arm-eabi": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.2.1.tgz",
"integrity": "sha512-Yua7mUpEd1wzIT6Jjl3dpRizIfGp9NR4F2xeRuQv+ae+SDI1Em2WyM9m46UL+oeW5GpMiEHoaBagr47RScZFmQ==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.2.3.tgz",
"integrity": "sha512-mykdVaAXX/gm+eFO2kPeVjnOCKwanJ9mV2U0lsUGLrEdMUifPUjiXKc6qFAIs08PvmTMOLMNnUxqhGsJlWGKSw==",
"cpu": [
"arm"
],
@@ -107,9 +115,9 @@
}
},
"node_modules/@next/swc-android-arm64": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.2.1.tgz",
"integrity": "sha512-Bifcr2f6VwInOdq1uH/9lp8fH7Nf7XGkIx4XceVd32LPJqG2c6FZU8ZRBvTdhxzXVpt5TPtuXhOP4Ij9UPqsVw==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.2.3.tgz",
"integrity": "sha512-8XwHPpA12gdIFtope+n9xCtJZM3U4gH4vVTpUwJ2w1kfxFmCpwQ4xmeGSkR67uOg80yRMuF0h9V1ueo05sws5w==",
"cpu": [
"arm64"
],
@@ -122,9 +130,9 @@
}
},
"node_modules/@next/swc-darwin-arm64": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.2.1.tgz",
"integrity": "sha512-gvqm+fGMYxAkwBapH0Vvng5yrb6HTkIvZfY4oEdwwYrwuLdkjqnJygCMgpNqIFmAHSXgtlWxfYv1VC8sjN81Kw==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.2.3.tgz",
"integrity": "sha512-TXOubiFdLpMfMtaRu1K5d1I9ipKbW5iS2BNbu8zJhoqrhk3Kp7aRKTxqFfWrbliAHhWVE/3fQZUYZOWSXVQi1w==",
"cpu": [
"arm64"
],
@@ -137,9 +145,9 @@
}
},
"node_modules/@next/swc-darwin-x64": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.2.1.tgz",
"integrity": "sha512-HGqVqmaZWj6zomqOZUVbO5NhlABL0iIaxTmd0O5B0MoMa5zpDGoaHSG+fxgcWMXcGcxmUNchv1NfNOYiTKoHOg==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.2.3.tgz",
"integrity": "sha512-GZctkN6bJbpjlFiS5pylgB2pifHvgkqLAPumJzxnxkf7kqNm6rOGuNjsROvOWVWXmKhrzQkREO/WPS2aWsr/yw==",
"cpu": [
"x64"
],
@@ -152,9 +160,9 @@
}
},
"node_modules/@next/swc-freebsd-x64": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.2.1.tgz",
"integrity": "sha512-N/a4JarAq+E+g+9K2ywJUmDIgU2xs2nA+BBldH0oq4zYJMRiUhL0iaN9G4e72VmGOJ61L/3W6VN8RIUOwTLoqQ==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.2.3.tgz",
"integrity": "sha512-rK6GpmMt/mU6MPuav0/M7hJ/3t8HbKPCELw/Uqhi4732xoq2hJ2zbo2FkYs56y6w0KiXrIp4IOwNB9K8L/q62g==",
"cpu": [
"x64"
],
@@ -167,9 +175,9 @@
}
},
"node_modules/@next/swc-linux-arm-gnueabihf": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.2.1.tgz",
"integrity": "sha512-WaFoerF/eRbhbE57TaIGJXbQAERADZ/RZ45u6qox9beb5xnWsyYgzX+WuN7Tkhyvga0/aMuVYFzS9CEay7D+bw==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.2.3.tgz",
"integrity": "sha512-yeiCp/Odt1UJ4KUE89XkeaaboIDiVFqKP4esvoLKGJ0fcqJXMofj4ad3tuQxAMs3F+qqrz9MclqhAHkex1aPZA==",
"cpu": [
"arm"
],
@@ -182,9 +190,9 @@
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.2.1.tgz",
"integrity": "sha512-R+Jhc1/RJTnncE9fkePboHDNOCm1WJ8daanWbjKhfPySMyeniKYRwGn5SLYW3S8YlRS0QVdZaaszDSZWgUcsmA==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.2.3.tgz",
"integrity": "sha512-/miIopDOUsuNlvjBjTipvoyjjaxgkOuvlz+cIbbPcm1eFvzX2ltSfgMgty15GuOiR8Hub4FeTSiq3g2dmCkzGA==",
"cpu": [
"arm64"
],
@@ -197,9 +205,9 @@
}
},
"node_modules/@next/swc-linux-arm64-musl": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.2.1.tgz",
"integrity": "sha512-oI1UfZPidGAVddlL2eOTmfsuKV9EaT1aktIzVIxIAgxzQSdwsV371gU3G55ggkurzfdlgF3GThFePDWF0d8dmw==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.2.3.tgz",
"integrity": "sha512-sujxFDhMMDjqhruup8LLGV/y+nCPi6nm5DlFoThMJFvaaKr/imhkXuk8uCTq4YJDbtRxnjydFv2y8laBSJVC2g==",
"cpu": [
"arm64"
],
@@ -212,9 +220,9 @@
}
},
"node_modules/@next/swc-linux-x64-gnu": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.2.1.tgz",
"integrity": "sha512-PCygPwrQmS+7WUuAWWioWMZCzZm4PG91lfRxToLDg7yIm/3YfAw5N2EK2TaM9pzlWdvHQAqRMX/oLvv027xUiA==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.2.3.tgz",
"integrity": "sha512-w5MyxPknVvC9LVnMenAYMXMx4KxPwXuJRMQFvY71uXg68n7cvcas85U5zkdrbmuZ+JvsO5SIG8k36/6X3nUhmQ==",
"cpu": [
"x64"
],
@@ -227,9 +235,9 @@
}
},
"node_modules/@next/swc-linux-x64-musl": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.2.1.tgz",
"integrity": "sha512-sUAKxo7CFZYGHNxheGh9nIBElLYBM6md/liEGfOTwh/xna4/GTTcmkGWkF7PdnvaYNgcPIQgHIMYiAa6yBKAVw==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.2.3.tgz",
"integrity": "sha512-CTeelh8OzSOVqpzMFMFnVRJIFAFQoTsI9RmVJWW/92S4xfECGcOzgsX37CZ8K982WHRzKU7exeh7vYdG/Eh4CA==",
"cpu": [
"x64"
],
@@ -242,9 +250,9 @@
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.2.1.tgz",
"integrity": "sha512-qDmyEjDBpl/vBXxuOOKKWmPQOcARcZIMach1s7kjzaien0SySut/PHRlj56sosa81Wt4hTGhfhZ1R7g1n7+B8w==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.2.3.tgz",
"integrity": "sha512-7N1KBQP5mo4xf52cFCHgMjzbc9jizIlkTepe9tMa2WFvEIlKDfdt38QYcr9mbtny17yuaIw02FXOVEytGzqdOQ==",
"cpu": [
"arm64"
],
@@ -257,9 +265,9 @@
}
},
"node_modules/@next/swc-win32-ia32-msvc": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.2.1.tgz",
"integrity": "sha512-2joqFQ81ZYPg6DcikIzQn3DgjKglNhPAozx6dL5sCNkr1CPMD0YIkJgT3CnYyMHQ04Qi3Npv0XX3MD6LJO8OCA==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.2.3.tgz",
"integrity": "sha512-LzWD5pTSipUXTEMRjtxES/NBYktuZdo7xExJqGDMnZU8WOI+v9mQzsmQgZS/q02eIv78JOCSemqVVKZBGCgUvA==",
"cpu": [
"ia32"
],
@@ -272,9 +280,9 @@
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.2.1.tgz",
"integrity": "sha512-r3+0fSaIZT6N237iMzwUhfNwjhAFvXjqB+4iuW+wcpxW+LHm1g/IoxN8eSRcb8jPItC86JxjAxpke0QL97qd6g==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.2.3.tgz",
"integrity": "sha512-aLG2MaFs4y7IwaMTosz2r4mVbqRyCnMoFqOcmfTi7/mAS+G4IMH0vJp4oLdbshqiVoiVuKrAfqtXj55/m7Qu1Q==",
"cpu": [
"x64"
],
@@ -356,13 +364,13 @@
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
},
"node_modules/@typescript-eslint/parser": {
"version": "5.53.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.53.0.tgz",
"integrity": "sha512-MKBw9i0DLYlmdOb3Oq/526+al20AJZpANdT6Ct9ffxcV8nKCHz63t/S0IhlTFNsBIHJv+GY5SFJ0XfqVeydQrQ==",
"version": "5.54.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.54.0.tgz",
"integrity": "sha512-aAVL3Mu2qTi+h/r04WI/5PfNWvO6pdhpeMRWk9R7rEV4mwJNzoWf5CCU5vDKBsPIFQFjEq1xg7XBI2rjiMXQbQ==",
"dependencies": {
"@typescript-eslint/scope-manager": "5.53.0",
"@typescript-eslint/types": "5.53.0",
"@typescript-eslint/typescript-estree": "5.53.0",
"@typescript-eslint/scope-manager": "5.54.0",
"@typescript-eslint/types": "5.54.0",
"@typescript-eslint/typescript-estree": "5.54.0",
"debug": "^4.3.4"
},
"engines": {
@@ -382,12 +390,12 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "5.53.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.53.0.tgz",
"integrity": "sha512-Opy3dqNsp/9kBBeCPhkCNR7fmdSQqA+47r21hr9a14Bx0xnkElEQmhoHga+VoaoQ6uDHjDKmQPIYcUcKJifS7w==",
"version": "5.54.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.54.0.tgz",
"integrity": "sha512-VTPYNZ7vaWtYna9M4oD42zENOBrb+ZYyCNdFs949GcN8Miwn37b8b7eMj+EZaq7VK9fx0Jd+JhmkhjFhvnovhg==",
"dependencies": {
"@typescript-eslint/types": "5.53.0",
"@typescript-eslint/visitor-keys": "5.53.0"
"@typescript-eslint/types": "5.54.0",
"@typescript-eslint/visitor-keys": "5.54.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -398,9 +406,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "5.53.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.53.0.tgz",
"integrity": "sha512-5kcDL9ZUIP756K6+QOAfPkigJmCPHcLN7Zjdz76lQWWDdzfOhZDTj1irs6gPBKiXx5/6O3L0+AvupAut3z7D2A==",
"version": "5.54.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.54.0.tgz",
"integrity": "sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ==",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
@@ -410,12 +418,12 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "5.53.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.53.0.tgz",
"integrity": "sha512-eKmipH7QyScpHSkhbptBBYh9v8FxtngLquq292YTEQ1pxVs39yFBlLC1xeIZcPPz1RWGqb7YgERJRGkjw8ZV7w==",
"version": "5.54.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.0.tgz",
"integrity": "sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ==",
"dependencies": {
"@typescript-eslint/types": "5.53.0",
"@typescript-eslint/visitor-keys": "5.53.0",
"@typescript-eslint/types": "5.54.0",
"@typescript-eslint/visitor-keys": "5.54.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -436,11 +444,11 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "5.53.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.53.0.tgz",
"integrity": "sha512-JqNLnX3leaHFZEN0gCh81sIvgrp/2GOACZNgO4+Tkf64u51kTpAyWFOY8XHx8XuXr3N2C9zgPPHtcpMg6z1g0w==",
"version": "5.54.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.54.0.tgz",
"integrity": "sha512-xu4wT7aRCakGINTLGeyGqDn+78BwFlggwBjnHa1ar/KaGagnmwLYmlrXIrgAaQ3AE1Vd6nLfKASm7LrFHNbKGA==",
"dependencies": {
"@typescript-eslint/types": "5.53.0",
"@typescript-eslint/types": "5.54.0",
"eslint-visitor-keys": "^3.3.0"
},
"engines": {
@@ -670,9 +678,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001457",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001457.tgz",
"integrity": "sha512-SDIV6bgE1aVbK6XyxdURbUE89zY7+k1BBBaOwYwkNCglXlel/E7mELiHC64HQ+W0xSKlqWhV9Wh7iHxUjMs4fA==",
"version": "1.0.30001458",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001458.tgz",
"integrity": "sha512-lQ1VlUUq5q9ro9X+5gOEyH7i3vm+AYVT1WDCVB69XOZ17KZRhnZ9J0Sqz7wTHQaLBJccNCHq8/Ww5LlOIZbB0w==",
"funding": [
{
"type": "opencollective",
@@ -967,11 +975,12 @@
}
},
"node_modules/eslint": {
"version": "8.34.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.34.0.tgz",
"integrity": "sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg==",
"version": "8.35.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz",
"integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==",
"dependencies": {
"@eslint/eslintrc": "^1.4.1",
"@eslint/eslintrc": "^2.0.0",
"@eslint/js": "8.35.0",
"@humanwhocodes/config-array": "^0.11.8",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
@@ -985,7 +994,7 @@
"eslint-utils": "^3.0.0",
"eslint-visitor-keys": "^3.3.0",
"espree": "^9.4.0",
"esquery": "^1.4.0",
"esquery": "^1.4.2",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
"file-entry-cache": "^6.0.1",
@@ -1022,11 +1031,11 @@
}
},
"node_modules/eslint-config-next": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.2.1.tgz",
"integrity": "sha512-2GAx7EjSiCzJN6H2L/v1kbYrNiwQxzkyjy6eWSjuhAKt+P6d3nVNHGy9mON8ZcYd72w/M8kyMjm4UB9cvijgrw==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.2.3.tgz",
"integrity": "sha512-kPulHiQEHGei9hIaaNGygHRc0UzlWM+3euOmYbxNkd2Nbhci5rrCDeMBMPSV8xgUssphDGmwDHWbk4VZz3rlZQ==",
"dependencies": {
"@next/eslint-plugin-next": "13.2.1",
"@next/eslint-plugin-next": "13.2.3",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.42.0",
"eslint-import-resolver-node": "^0.3.6",
@@ -2317,11 +2326,11 @@
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
},
"node_modules/next": {
"version": "13.2.1",
"resolved": "https://registry.npmjs.org/next/-/next-13.2.1.tgz",
"integrity": "sha512-qhgJlDtG0xidNViJUPeQHLGJJoT4zDj/El7fP3D3OzpxJDUfxsm16cK4WTMyvSX1ciIfAq05u+0HqFAa+VJ+Hg==",
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/next/-/next-13.2.3.tgz",
"integrity": "sha512-nKFJC6upCPN7DWRx4+0S/1PIOT7vNlCT157w9AzbXEgKy6zkiPKEt5YyRUsRZkmpEqBVrGgOqNfwecTociyg+w==",
"dependencies": {
"@next/env": "13.2.1",
"@next/env": "13.2.3",
"@swc/helpers": "0.4.14",
"caniuse-lite": "^1.0.30001406",
"postcss": "8.4.14",
@@ -2334,19 +2343,19 @@
"node": ">=14.6.0"
},
"optionalDependencies": {
"@next/swc-android-arm-eabi": "13.2.1",
"@next/swc-android-arm64": "13.2.1",
"@next/swc-darwin-arm64": "13.2.1",
"@next/swc-darwin-x64": "13.2.1",
"@next/swc-freebsd-x64": "13.2.1",
"@next/swc-linux-arm-gnueabihf": "13.2.1",
"@next/swc-linux-arm64-gnu": "13.2.1",
"@next/swc-linux-arm64-musl": "13.2.1",
"@next/swc-linux-x64-gnu": "13.2.1",
"@next/swc-linux-x64-musl": "13.2.1",
"@next/swc-win32-arm64-msvc": "13.2.1",
"@next/swc-win32-ia32-msvc": "13.2.1",
"@next/swc-win32-x64-msvc": "13.2.1"
"@next/swc-android-arm-eabi": "13.2.3",
"@next/swc-android-arm64": "13.2.3",
"@next/swc-darwin-arm64": "13.2.3",
"@next/swc-darwin-x64": "13.2.3",
"@next/swc-freebsd-x64": "13.2.3",
"@next/swc-linux-arm-gnueabihf": "13.2.3",
"@next/swc-linux-arm64-gnu": "13.2.3",
"@next/swc-linux-arm64-musl": "13.2.3",
"@next/swc-linux-x64-gnu": "13.2.3",
"@next/swc-linux-x64-musl": "13.2.3",
"@next/swc-win32-arm64-msvc": "13.2.3",
"@next/swc-win32-ia32-msvc": "13.2.3",
"@next/swc-win32-x64-msvc": "13.2.3"
},
"peerDependencies": {
"@opentelemetry/api": "^1.4.0",
@@ -3074,12 +3083,12 @@
}
},
"node_modules/tsconfig-paths": {
"version": "3.14.1",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz",
"integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==",
"version": "3.14.2",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz",
"integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==",
"dependencies": {
"@types/json5": "^0.0.29",
"json5": "^1.0.1",
"json5": "^1.0.2",
"minimist": "^1.2.6",
"strip-bom": "^3.0.0"
}

View File

@@ -9,9 +9,9 @@
"lint": "next lint"
},
"dependencies": {
"eslint": "8.34.0",
"eslint-config-next": "13.2.1",
"next": "13.2.1",
"eslint": "8.35.0",
"eslint-config-next": "13.2.3",
"next": "13.2.3",
"react": "18.2.0",
"react-dom": "18.2.0"
}

View File

@@ -32,7 +32,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "28.0.5",
"turbo": "1.7.4"
"turbo": "1.8.2"
},
"scripts": {
"lerna": "lerna",

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.16.8",
"version": "28.16.11",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -44,13 +44,13 @@
"@vercel/build-utils": "6.3.2",
"@vercel/go": "2.3.9",
"@vercel/hydrogen": "0.0.55",
"@vercel/next": "3.6.2",
"@vercel/node": "2.9.9",
"@vercel/next": "3.6.3",
"@vercel/node": "2.9.10",
"@vercel/python": "3.1.51",
"@vercel/redwood": "1.1.7",
"@vercel/remix": "1.4.2",
"@vercel/remix": "1.5.0",
"@vercel/ruby": "1.3.68",
"@vercel/static-build": "1.3.13"
"@vercel/static-build": "1.3.14"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",

View File

@@ -484,6 +484,7 @@ describe('build', () => {
{
src: '^/.*$',
middlewarePath: 'middleware',
middlewareRawSrc: [],
override: true,
continue: true,
},
@@ -548,6 +549,7 @@ describe('build', () => {
{
src: '^/.*$',
middlewarePath: 'middleware',
middlewareRawSrc: [],
override: true,
continue: true,
},
@@ -612,6 +614,7 @@ describe('build', () => {
{
src: '^\\/about(?:\\/((?:[^\\/#\\?]+?)(?:\\/(?:[^\\/#\\?]+?))*))?[\\/#\\?]?$|^\\/dashboard(?:\\/((?:[^\\/#\\?]+?)(?:\\/(?:[^\\/#\\?]+?))*))?[\\/#\\?]?$',
middlewarePath: 'middleware',
middlewareRawSrc: ['/about/:path*', '/dashboard/:path*'],
override: true,
continue: true,
},

13
packages/cli/turbo.json Normal file
View File

@@ -0,0 +1,13 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
"outputs": [
"dist/**",
"src/util/constants.ts",
"src/util/dev/templates/*.ts"
]
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-analytics",
"version": "1.0.7",
"version": "1.0.8",
"description": "Track Core Web Vitals in Gatsby projects with Vercel Analytics.",
"main": "index.js",
"files": [

View File

@@ -0,0 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
"outputs": ["gatsby-browser.js", "web-vitals.js", "index.js"]
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-builder",
"version": "1.1.10",
"version": "1.1.11",
"main": "dist/index.js",
"files": [
"dist",
@@ -15,7 +15,7 @@
},
"dependencies": {
"@vercel/build-utils": "6.3.2",
"@vercel/node": "2.9.9",
"@vercel/node": "2.9.10",
"@vercel/routing-utils": "2.1.10",
"ajv": "8.12.0",
"esbuild": "0.14.47",

View File

@@ -0,0 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
"outputs": ["dist/**", "gatsby-node.js"]
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.6.2",
"version": "3.6.3",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",

View File

@@ -1556,7 +1556,7 @@ export async function serverBuild({
{
src: `^${path.posix.join('/', entryDirectory)}/?(?:${i18n.locales
.map(locale => escapeStringRegexp(locale))
.join('|')})/(.*)`,
.join('|')})/?(.*)`,
dest: `${path.posix.join('/', entryDirectory, '/')}$1`,
check: true,
},

View File

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

View File

@@ -0,0 +1,3 @@
export default function Page() {
return <p>My Enter Page</p>;
}

View File

@@ -0,0 +1,10 @@
export default function Root({ children }) {
return (
<html lang="en">
<head>
<title>My Title</title>
</head>
<body>{children}</body>
</html>
);
}

View File

@@ -0,0 +1,3 @@
export default function Page() {
return <p>My Other Page</p>;
}

View File

@@ -0,0 +1,3 @@
export default function Page() {
return <p>My Index Page</p>;
}

View File

@@ -0,0 +1,12 @@
/* eslint-env jest */
const path = require('path');
const { deployAndTest } = require('../../utils');
const ctx = {};
describe(`${__dirname.split(path.sep).pop()}`, () => {
it('should deploy and pass probe checks', async () => {
const info = await deployAndTest(__dirname);
Object.assign(ctx, info);
});
});

View File

@@ -0,0 +1,9 @@
module.exports = {
experimental: {
appDir: true,
},
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
};

View File

@@ -0,0 +1,13 @@
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "canary",
"react": "experimental",
"react-dom": "experimental"
}
}

View File

@@ -0,0 +1,34 @@
{
"probes": [
{
"fetchOptions": { "redirect": "manual" },
"path": "/",
"status": 200,
"mustContain": "My Index Page"
},
{
"fetchOptions": { "redirect": "manual" },
"path": "/en",
"status": 200,
"mustContain": "My Index Page"
},
{
"fetchOptions": { "redirect": "manual" },
"path": "/enter",
"status": 200,
"mustContain": "My Enter Page"
},
{
"fetchOptions": { "redirect": "manual" },
"path": "/other",
"status": 200,
"mustContain": "My Other Page"
},
{
"fetchOptions": { "redirect": "manual" },
"path": "/en/other",
"status": 200,
"mustContain": "My Other Page"
}
]
}

View File

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

View File

@@ -0,0 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
"outputs": ["helpers.js", "source-map-support.js"]
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.9.9",
"version": "2.9.10",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -32,7 +32,7 @@
"@edge-runtime/vm": "2.0.0",
"@types/node": "14.18.33",
"@vercel/build-utils": "6.3.2",
"@vercel/node-bridge": "3.1.13",
"@vercel/node-bridge": "3.1.14",
"@vercel/static-config": "2.0.13",
"edge-runtime": "2.0.0",
"esbuild": "0.14.47",

View File

@@ -449,9 +449,19 @@ export const build: BuildV3 = async ({
// Middleware is a catch-all for all paths unless a `matcher` property is defined
const src = getRegExpFromMatchers(staticConfig?.matcher);
const middlewareRawSrc: string[] = [];
if (staticConfig?.matcher) {
if (Array.isArray(staticConfig.matcher)) {
middlewareRawSrc.push(...staticConfig.matcher);
} else {
middlewareRawSrc.push(staticConfig.matcher as string);
}
}
routes = [
{
src,
middlewareRawSrc,
middlewarePath: outputPath,
continue: true,
override: true,

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix",
"version": "1.4.2",
"version": "1.5.0",
"license": "MIT",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -22,7 +22,7 @@
"vercel-edge-entrypoint.js"
],
"dependencies": {
"@remix-run/dev": "1.13.0",
"@remix-run/dev": "npm:@vercel/remix-run-dev@1.13.0-patch.2",
"@vercel/nft": "0.22.5",
"@vercel/static-config": "2.0.13",
"path-to-regexp": "6.2.1",

View File

@@ -1,3 +1,3 @@
import { createRequestHandler } from '@remix-run/server-runtime';
import build from './index.js';
import build from '@remix-run/dev/server-build';
export default createRequestHandler(build);

View File

@@ -9,7 +9,7 @@ import {
installGlobals();
import build from './index.js';
import build from '@remix-run/dev/server-build';
const handleRequest = createRemixRequestHandler(build, process.env.NODE_ENV);

View File

@@ -19,7 +19,7 @@ import {
scanParentDirs,
walkParentDirs,
} from '@vercel/build-utils';
import { getConfig, BaseFunctionConfig } from '@vercel/static-config';
import { getConfig } from '@vercel/static-config';
import { nodeFileTrace } from '@vercel/nft';
import { readConfig } from '@remix-run/dev/dist/config';
import type {
@@ -29,18 +29,36 @@ import type {
PackageJson,
BuildResultV2Typical,
} from '@vercel/build-utils';
import type { BaseFunctionConfig } from '@vercel/static-config';
import type { RemixConfig } from '@remix-run/dev/dist/config';
import type { ConfigRoute } from '@remix-run/dev/dist/config/routes';
import {
calculateRouteConfigHash,
findConfig,
getPathFromRoute,
getRegExpFromPath,
getRouteIterator,
getResolvedRouteConfig,
isLayoutRoute,
ResolvedRouteConfig,
ResolvedNodeRouteConfig,
ResolvedEdgeRouteConfig,
} from './utils';
const _require: typeof require = eval('require');
const REMIX_RUN_DEV_PATH = dirname(
_require.resolve('@remix-run/dev/package.json')
);
const edgeServerSrcPromise = fs.readFile(
join(__dirname, '../server-edge.mjs'),
'utf-8'
);
const nodeServerSrcPromise = fs.readFile(
join(__dirname, '../server-node.mjs'),
'utf-8'
);
export const build: BuildV2 = async ({
entrypoint,
files,
@@ -93,19 +111,96 @@ export const build: BuildV2 = async ({
await runNpmInstall(entrypointFsDirname, [], spawnOpts, meta, nodeVersion);
}
const remixDevPackageJsonPath = _require.resolve(
'@remix-run/dev/package.json',
{ paths: [entrypointFsDirname] }
);
const remixVersion = JSON.parse(
await fs.readFile(remixDevPackageJsonPath, 'utf8')
).version;
// Make our version of `remix` CLI available to the project's build
// command by creating a symlink to the copy in our node modules,
// so that `serverBundles` works: https://github.com/remix-run/remix/pull/5479
const nodeModulesDir = join(entrypointFsDirname, 'node_modules');
const remixRunDevPath = join(nodeModulesDir, '@remix-run/dev');
let backupRemixRunDevPath:
| string
| false = `${remixRunDevPath}.__vercel_backup`;
try {
await fs.rename(remixRunDevPath, backupRemixRunDevPath);
} catch (err: any) {
if (err.code !== 'ENOENT') {
throw err;
}
backupRemixRunDevPath = false;
}
await fs.symlink(REMIX_RUN_DEV_PATH, remixRunDevPath);
// Make `remix build` output production mode
spawnOpts.env.NODE_ENV = 'production';
const remixConfig = await chdirAndReadConfig(entrypointFsDirname);
const remixRoutes = Object.values(remixConfig.routes);
// Read the `export const config` (if any) for each route
const project = new Project();
const staticConfigsMap = new Map<ConfigRoute, BaseFunctionConfig | null>();
for (const route of remixRoutes) {
const routePath = join(remixConfig.appDirectory, route.file);
const staticConfig = getConfig(project, routePath);
staticConfigsMap.set(route, staticConfig);
}
const resolvedConfigsMap = new Map<ConfigRoute, ResolvedRouteConfig>();
for (const route of remixRoutes) {
const config = getResolvedRouteConfig(
route,
remixConfig.routes,
staticConfigsMap
);
resolvedConfigsMap.set(route, config);
}
// Figure out which routes belong to which server bundles
// based on having common static config properties
const serverBundlesMap = new Map<string, ConfigRoute[]>();
for (const route of remixRoutes) {
if (isLayoutRoute(route.id, remixRoutes)) continue;
const config = resolvedConfigsMap.get(route);
if (!config) {
throw new Error(`Expected resolved config for "${route.id}"`);
}
const hash = calculateRouteConfigHash(config);
let routesForHash = serverBundlesMap.get(hash);
if (!Array.isArray(routesForHash)) {
routesForHash = [];
serverBundlesMap.set(hash, routesForHash);
}
routesForHash.push(route);
}
const serverBundles = Array.from(serverBundlesMap.entries()).map(
([hash, routes]) => {
const runtime = resolvedConfigsMap.get(routes[0])?.runtime ?? 'nodejs';
return {
serverBuildPath: `build/build-${runtime}-${hash}.js`,
routes: routes.map(r => r.id),
};
}
);
// We need to patch the `remix.config.js` file to force some values necessary
// for a build that works on either Node.js or the Edge runtime
const remixConfigPath = findConfig(entrypointFsDirname, 'remix.config');
const renamedRemixConfigPath = remixConfigPath
? `${remixConfigPath}.original${extname(remixConfigPath)}`
: undefined;
const serverBuildPath = 'build/index.js';
if (remixConfigPath && renamedRemixConfigPath) {
await fs.rename(remixConfigPath, renamedRemixConfigPath);
@@ -125,7 +220,8 @@ export const build: BuildV2 = async ({
config.serverBuildTarget = undefined;
config.serverModuleFormat = 'cjs';
config.serverPlatform = 'node';
config.serverBuildPath = ${JSON.stringify(serverBuildPath)}
config.serverBuildPath = undefined;
config.serverBundles = ${JSON.stringify(serverBundles)};
export default config;`;
} else {
patchedConfig = `const config = require('./${basename(
@@ -134,7 +230,8 @@ export default config;`;
config.serverBuildTarget = undefined;
config.serverModuleFormat = 'cjs';
config.serverPlatform = 'node';
config.serverBuildPath = ${JSON.stringify(serverBuildPath)}
config.serverBuildPath = undefined;
config.serverBundles = ${JSON.stringify(serverBundles)};
module.exports = config;`;
}
await fs.writeFile(remixConfigPath, patchedConfig);
@@ -174,20 +271,12 @@ module.exports = config;`;
if (remixConfigPath && renamedRemixConfigPath) {
await fs.rename(renamedRemixConfigPath, remixConfigPath);
}
}
// Figure out which pages should be edge functions
let hasEdgeRoute = false;
const staticConfigsMap = new Map<ConfigRoute, BaseFunctionConfig>();
const project = new Project();
for (const route of remixRoutes) {
const routePath = join(remixConfig.appDirectory, route.file);
const staticConfig = getConfig(project, routePath);
if (staticConfig) {
staticConfigsMap.set(route, staticConfig);
}
if (staticConfig?.runtime && isEdgeRuntime(staticConfig.runtime)) {
hasEdgeRoute = true;
// Remove `@remix-run/dev` symlink
await fs.unlink(remixRunDevPath);
if (backupRemixRunDevPath) {
// Restore previous version if it was existed
await fs.rename(backupRemixRunDevPath, remixRunDevPath);
}
}
@@ -201,23 +290,35 @@ module.exports = config;`;
ensureResolvable(entrypointFsDirname, repoRootPath, '@remix-run/node'),
]);
const [staticFiles, nodeFunction, edgeFunction] = await Promise.all([
const [staticFiles, ...functions] = await Promise.all([
glob('**', join(entrypointFsDirname, 'public')),
createRenderNodeFunction(
entrypointFsDirname,
repoRootPath,
join(entrypointFsDirname, serverBuildPath),
remixConfig.serverEntryPoint,
nodeVersion
),
hasEdgeRoute
? createRenderEdgeFunction(
...serverBundles.map(bundle => {
const firstRoute = remixConfig.routes[bundle.routes[0]];
const config = resolvedConfigsMap.get(firstRoute) ?? {
runtime: 'nodejs',
};
if (config.runtime === 'edge') {
return createRenderEdgeFunction(
entrypointFsDirname,
repoRootPath,
join(entrypointFsDirname, serverBuildPath),
remixConfig.serverEntryPoint
)
: undefined,
join(entrypointFsDirname, bundle.serverBuildPath),
remixConfig.serverEntryPoint,
remixVersion,
config
);
}
return createRenderNodeFunction(
nodeVersion,
entrypointFsDirname,
repoRootPath,
join(entrypointFsDirname, bundle.serverBuildPath),
remixConfig.serverEntryPoint,
remixVersion,
config
);
}),
]);
const output: BuildResultV2Typical['output'] = staticFiles;
@@ -244,27 +345,26 @@ module.exports = config;`;
continue;
}
let isEdge = false;
for (const currentRoute of getRouteIterator(route, remixConfig.routes)) {
const staticConfig = staticConfigsMap.get(currentRoute);
if (staticConfig?.runtime) {
isEdge = isEdgeRuntime(staticConfig.runtime);
break;
}
const funcIndex = serverBundles.findIndex(bundle => {
return bundle.routes.includes(route.id);
});
const func = functions[funcIndex];
if (!func) {
throw new Error(`Could not determine server bundle for "${route.id}"`);
}
const fn =
isEdge && edgeFunction
output[path] =
func instanceof EdgeFunction
? // `EdgeFunction` currently requires the "name" property to be set.
// Ideally this property will be removed, at which point we can
// return the same `edgeFunction` instance instead of creating a
// new one for each page.
new EdgeFunction({
...edgeFunction,
...func,
name: path,
})
: nodeFunction;
output[path] = fn;
: func;
// If this is a dynamic route then add a Vercel route
const re = getRegExpFromPath(path);
@@ -277,11 +377,20 @@ module.exports = config;`;
}
// Add a 404 path for not found pages to be server-side rendered by Remix.
// Use the edge function if one was generated, otherwise use Node.js.
// Use an edge function bundle if one was generated, otherwise use Node.js.
if (!output['404']) {
output['404'] = edgeFunction
? new EdgeFunction({ ...edgeFunction, name: '404' })
: nodeFunction;
const edgeFunctionIndex = Array.from(serverBundlesMap.values()).findIndex(
routes => {
const runtime = resolvedConfigsMap.get(routes[0])?.runtime;
return runtime === 'edge';
}
);
const func =
edgeFunctionIndex !== -1 ? functions[edgeFunctionIndex] : functions[0];
output['404'] =
func instanceof EdgeFunction
? new EdgeFunction({ ...func, name: '404' })
: func;
}
routes.push({
src: '/(.*)',
@@ -297,23 +406,33 @@ function hasScript(scriptName: string, pkg: PackageJson | null) {
}
async function createRenderNodeFunction(
nodeVersion: NodeVersion,
entrypointDir: string,
rootDir: string,
serverBuildPath: string,
serverEntryPoint: string | undefined,
nodeVersion: NodeVersion
remixVersion: string,
config: ResolvedNodeRouteConfig
): Promise<NodejsLambda> {
const files: Files = {};
let handler = relative(rootDir, serverBuildPath);
let handlerPath = join(rootDir, handler);
if (!serverEntryPoint) {
handler = join(dirname(handler), 'server-node.mjs');
const baseServerBuildPath = basename(serverBuildPath, '.js');
handler = join(dirname(handler), `server-${baseServerBuildPath}.mjs`);
handlerPath = join(rootDir, handler);
// Copy the `server-node.mjs` file into the "build" directory
const sourceHandlerPath = join(__dirname, '../server-node.mjs');
await fs.copyFile(sourceHandlerPath, handlerPath);
const nodeServerSrc = await nodeServerSrcPromise;
await writeEntrypointFile(
handlerPath,
nodeServerSrc.replace(
'@remix-run/dev/server-build',
`./${baseServerBuildPath}.js`
),
rootDir
);
}
// Trace the handler with `@vercel/nft`
@@ -338,6 +457,13 @@ async function createRenderNodeFunction(
shouldAddSourcemapSupport: false,
operationType: 'SSR',
experimentalResponseStreaming: true,
regions: config.regions,
memory: config.memory,
maxDuration: config.maxDuration,
framework: {
slug: 'remix',
version: remixVersion,
},
});
return fn;
@@ -347,19 +473,29 @@ async function createRenderEdgeFunction(
entrypointDir: string,
rootDir: string,
serverBuildPath: string,
serverEntryPoint: string | undefined
serverEntryPoint: string | undefined,
remixVersion: string,
config: ResolvedEdgeRouteConfig
): Promise<EdgeFunction> {
const files: Files = {};
let handler = relative(rootDir, serverBuildPath);
let handlerPath = join(rootDir, handler);
if (!serverEntryPoint) {
handler = join(dirname(handler), 'server-edge.mjs');
const baseServerBuildPath = basename(serverBuildPath, '.js');
handler = join(dirname(handler), `server-${baseServerBuildPath}.mjs`);
handlerPath = join(rootDir, handler);
// Copy the `server-edge.mjs` file into the "build" directory
const sourceHandlerPath = join(__dirname, '../server-edge.mjs');
await fs.copyFile(sourceHandlerPath, handlerPath);
const edgeServerSrc = await edgeServerSrcPromise;
await writeEntrypointFile(
handlerPath,
edgeServerSrc.replace(
'@remix-run/dev/server-build',
`./${baseServerBuildPath}.js`
),
rootDir
);
}
let remixRunVercelPkgJson: string | undefined;
@@ -447,6 +583,11 @@ async function createRenderEdgeFunction(
deploymentTarget: 'v8-worker',
name: 'render',
entrypoint: handler,
regions: config.regions,
framework: {
slug: 'remix',
version: remixVersion,
},
});
return fn;
@@ -481,14 +622,7 @@ async function ensureResolvable(start: string, base: string, pkgName: string) {
const match = packages.find(p => p.startsWith(prefix));
if (match) {
const pkgDir = join(pnpmDir, match, 'node_modules', pkgName);
const symlinkPath = join(pnpmDir, '..', pkgName);
const symlinkDir = dirname(symlinkPath);
const symlinkTarget = relative(symlinkDir, pkgDir);
await fs.mkdir(symlinkDir, { recursive: true });
await fs.symlink(symlinkTarget, symlinkPath);
console.warn(
`WARN: Created symlink for "${pkgName}". To silence this warning, add "${pkgName}" to "dependencies" in your \`package.json\` file.`
);
await ensureSymlink(pkgDir, join(pnpmDir, '..'), pkgName);
return;
}
}
@@ -506,14 +640,7 @@ async function ensureResolvable(start: string, base: string, pkgName: string) {
const match = packages.find(p => p.startsWith(prefix));
if (match) {
const pkgDir = join(prefixDir, match, 'node_modules', pkgName);
const symlinkPath = join(npmDir, '..', pkgName);
const symlinkDir = dirname(symlinkPath);
const symlinkTarget = relative(symlinkDir, pkgDir);
await fs.mkdir(symlinkDir, { recursive: true });
await fs.symlink(symlinkTarget, symlinkPath);
console.warn(
`WARN: Created symlink for "${pkgName}". To silence this warning, add "${pkgName}" to "dependencies" in your \`package.json\` file.`
);
await ensureSymlink(pkgDir, join(npmDir, '..'), pkgName);
return;
}
}
@@ -523,8 +650,35 @@ async function ensureResolvable(start: string, base: string, pkgName: string) {
);
}
function isEdgeRuntime(runtime: string): boolean {
return runtime === 'edge' || runtime === 'experimental-edge';
async function ensureSymlink(
target: string,
nodeModulesDir: string,
pkgName: string
) {
const symlinkPath = join(nodeModulesDir, pkgName);
const symlinkDir = dirname(symlinkPath);
const relativeTarget = relative(symlinkDir, target);
try {
const existingTarget = await fs.readlink(symlinkPath);
if (existingTarget === relativeTarget) {
// Symlink is already the expected value, so do nothing
return;
} else {
// If a symlink already exists then delete it if the target doesn't match
await fs.unlink(symlinkPath);
}
} catch (err: any) {
// Ignore when path does not exist or is not a symlink
if (err.code !== 'ENOENT' && err.code !== 'EINVAL') {
throw err;
}
}
await fs.symlink(relativeTarget, symlinkPath);
console.warn(
`WARN: Created symlink for "${pkgName}". To silence this warning, add "${pkgName}" to "dependencies" in your \`package.json\` file.`
);
}
async function chdirAndReadConfig(dir: string) {
@@ -538,3 +692,23 @@ async function chdirAndReadConfig(dir: string) {
}
return remixConfig;
}
async function writeEntrypointFile(
path: string,
data: string,
rootDir: string
) {
try {
await fs.writeFile(path, data);
} catch (err: any) {
if (err.code === 'ENOENT') {
throw new Error(
`The "${relative(
rootDir,
dirname(path)
)}" directory does not exist. Please contact support@vercel.com.`
);
}
throw err;
}
}

View File

@@ -5,6 +5,22 @@ import type {
ConfigRoute,
RouteManifest,
} from '@remix-run/dev/dist/config/routes';
import type { BaseFunctionConfig } from '@vercel/static-config';
export interface ResolvedNodeRouteConfig {
runtime: 'nodejs';
regions?: string[];
maxDuration?: number;
memory?: number;
}
export interface ResolvedEdgeRouteConfig {
runtime: 'edge';
regions?: BaseFunctionConfig['regions'];
}
export type ResolvedRouteConfig =
| ResolvedNodeRouteConfig
| ResolvedEdgeRouteConfig;
const configExts = ['.js', '.cjs', '.mjs'];
@@ -18,6 +34,60 @@ export function findConfig(dir: string, basename: string): string | undefined {
return undefined;
}
function isEdgeRuntime(runtime: string): boolean {
return runtime === 'edge' || runtime === 'experimental-edge';
}
export function getResolvedRouteConfig(
route: ConfigRoute,
routes: RouteManifest,
configs: Map<ConfigRoute, BaseFunctionConfig | null>
): ResolvedRouteConfig {
let runtime: ResolvedRouteConfig['runtime'] | undefined;
let regions: ResolvedRouteConfig['regions'];
let maxDuration: ResolvedNodeRouteConfig['maxDuration'];
let memory: ResolvedNodeRouteConfig['memory'];
for (const currentRoute of getRouteIterator(route, routes)) {
const staticConfig = configs.get(currentRoute);
if (staticConfig) {
if (typeof runtime === 'undefined' && staticConfig.runtime) {
runtime = isEdgeRuntime(staticConfig.runtime) ? 'edge' : 'nodejs';
}
if (typeof regions === 'undefined') {
regions = staticConfig.regions;
}
if (typeof maxDuration === 'undefined') {
maxDuration = staticConfig.maxDuration;
}
if (typeof memory === 'undefined') {
memory = staticConfig.memory;
}
}
}
if (Array.isArray(regions)) {
regions = Array.from(new Set(regions)).sort();
}
if (runtime === 'edge') {
return { runtime, regions };
}
if (regions && !Array.isArray(regions)) {
throw new Error(
`"regions" for route "${route.id}" must be an array of strings`
);
}
return { runtime: 'nodejs', regions, maxDuration, memory };
}
export function calculateRouteConfigHash(config: ResolvedRouteConfig): string {
const str = JSON.stringify(config);
return Buffer.from(str).toString('base64url');
}
export function isLayoutRoute(
routeId: string,
routes: Pick<ConfigRoute, 'id' | 'parentId'>[]
@@ -41,7 +111,10 @@ export function getPathFromRoute(
route: ConfigRoute,
routes: RouteManifest
): string {
if (route.id === 'root' || (route.parentId === 'root' && route.index)) {
if (
route.id === 'root' ||
(route.parentId === 'root' && !route.path && route.index)
) {
return 'index';
}

View File

@@ -0,0 +1,20 @@
// Edge functions can not use child processes, but this is route
// uses Node.js. So this is here to verify that bundle splitting
// is working correctly (because this route should not exist in
// the Edge bundle).
import { exec } from 'child_process';
import { json } from '@remix-run/node';
export async function loader() {
const hi = await new Promise<string>((resolve, reject) => {
exec(
`echo hi from the B page running in ${process.env.VERCEL_REGION}`,
(err, stdout) => {
if (err) return reject(err);
resolve(stdout);
}
);
});
return json({ hi });
}

View File

@@ -1,7 +1,16 @@
import { loader } from '~/b.server';
import { useLoaderData } from '@remix-run/react';
export const config = { regions: ['sfo1'] };
export { loader };
export default function B() {
const { hi } = useLoaderData<typeof loader>();
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
<h1>B page</h1>
<p>{hi}</p>
</div>
);
}

View File

@@ -1,18 +1,8 @@
{
"version": 2,
"builds": [
{
"src": "package.json",
"use": "@vercel/remix",
"config": {
"zeroConfig": true
}
}
],
"probes": [
{ "path": "/", "mustContain": "Welcome to Remix" },
{ "path": "/edge", "mustContain": "Welcome to Remix@Edge" },
{ "path": "/b", "mustContain": "B page" },
{ "path": "/b", "mustContain": "hi from the B page running in sfo1" },
{ "path": "/nested", "mustContain": "Nested index page" },
{ "path": "/nested/another", "mustContain": "Nested another page" },
{ "path": "/nested/index", "status": 404, "mustContain": "Not Found" },

View File

@@ -1,14 +1,4 @@
{
"version": 2,
"builds": [
{
"src": "package.json",
"use": "@vercel/remix",
"config": {
"zeroConfig": true
}
}
],
"probes": [
{ "path": "/", "mustContain": "Welcome to Remix" },
{ "path": "/edge", "mustContain": "Welcome to Remix@Edge" },

View File

@@ -10,13 +10,13 @@
"start": "remix-serve build"
},
"dependencies": {
"@remix-run/react": "^1.7.4",
"@remix-run/serve": "^1.7.4",
"@remix-run/react": "1.5.0",
"@remix-run/serve": "1.5.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.7.4",
"@remix-run/dev": "1.5.0",
"@types/react": "^17.0.45",
"@types/react-dom": "^17.0.17",
"typescript": "^4.6.4"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
{
"probes": [
{
"path": "/",
"mustContain": "Welcome to Remix",
"logMustContain": "WARN: Created symlink for \"@remix-run/node\". To silence this warning, add \"@remix-run/node\" to \"dependencies\" in your `package.json` file"
},
{
"path": "/edge",
"mustContain": "Welcome to Remix@Edge",
"logMustContain": "WARN: Created symlink for \"@remix-run/server-runtime\". To silence this warning, add \"@remix-run/server-runtime\" to \"dependencies\" in your `package.json` file"
},
{ "path": "/b", "mustContain": "B page" },
{ "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>" }
]
}

View File

@@ -1,21 +0,0 @@
{
"version": 2,
"builds": [
{
"src": "package.json",
"use": "@vercel/remix",
"config": {
"zeroConfig": true
}
}
],
"probes": [
{ "path": "/", "mustContain": "Welcome to Remix" },
{ "path": "/edge", "mustContain": "Welcome to Remix@Edge" },
{ "path": "/b", "mustContain": "B page" },
{ "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>" }
]
}

View File

@@ -0,0 +1,19 @@
{
"probes": [
{
"path": "/",
"mustContain": "Welcome to Remix",
"logMustContain": "WARN: Created symlink for \"@remix-run/node\". To silence this warning, add \"@remix-run/node\" to \"dependencies\" in your `package.json` file"
},
{
"path": "/edge",
"mustContain": "Welcome to Remix@Edge",
"logMustContain": "WARN: Created symlink for \"@remix-run/server-runtime\". To silence this warning, add \"@remix-run/server-runtime\" to \"dependencies\" in your `package.json` file"
},
{ "path": "/b", "mustContain": "B page" },
{ "path": "/nested", "mustContain": "Nested index page" },
{ "path": "/nested/another", "mustContain": "Nested another page" },
{ "path": "/nested/index", "mustContain": "Not Found" },
{ "path": "/asdf", "mustContain": "Not Found" }
]
}

View File

@@ -1,27 +1,8 @@
{
"version": 2,
"builds": [
{
"src": "package.json",
"use": "@vercel/remix",
"config": {
"installCommand": "npm install --install-strategy=linked",
"zeroConfig": true
}
}
],
"installCommand": "npm install --install-strategy=linked && ln -sf broken 'node_modules/@remix-run/server-runtime'",
"build": {
"env": {
"ENABLE_EXPERIMENTAL_COREPACK": "1"
}
},
"probes": [
{ "path": "/", "mustContain": "Welcome to Remix" },
{ "path": "/edge", "mustContain": "Welcome to Remix@Edge" },
{ "path": "/b", "mustContain": "B page" },
{ "path": "/nested", "mustContain": "Nested index page" },
{ "path": "/nested/another", "mustContain": "Nested another page" },
{ "path": "/nested/index", "mustContain": "Not Found" },
{ "path": "/asdf", "mustContain": "Not Found" }
]
}
}

View File

@@ -72,6 +72,14 @@ describe('getPathFromRoute()', () => {
parentId: 'root',
file: 'routes/$.tsx',
},
'routes/nested/index': {
path: 'nested',
index: true,
caseSensitive: undefined,
id: 'routes/nested/index',
parentId: 'root',
file: 'routes/nested/index.tsx',
},
};
it.each([
@@ -79,6 +87,7 @@ describe('getPathFromRoute()', () => {
{ id: 'routes/__pathless', expected: '' },
{ id: 'routes/index', expected: 'index' },
{ id: 'routes/api.hello', expected: 'api/hello' },
{ id: 'routes/nested/index', expected: 'nested' },
{ id: 'routes/projects', expected: 'projects' },
{ id: 'routes/projects/__pathless', expected: 'projects' },
{ id: 'routes/projects/index', expected: 'projects' },

View File

@@ -0,0 +1,76 @@
import { getResolvedRouteConfig } from '../src/utils';
import type {
ConfigRoute,
RouteManifest,
} from '@remix-run/dev/dist/config/routes';
import type { BaseFunctionConfig } from '@vercel/static-config';
describe('getResolvedRouteConfig()', () => {
const staticConfigsMap = new Map<ConfigRoute, BaseFunctionConfig | null>([
[{ id: 'root', file: 'root.tsx' }, null],
[
{ id: 'routes/edge', file: 'routes/edge.tsx', parentId: 'root' },
{ runtime: 'edge' },
],
[
{
id: 'routes/edge/sfo1',
file: 'routes/edge/sfo1.tsx',
parentId: 'routes/edge',
},
{ regions: ['sfo1'] },
],
[
{
id: 'routes/edge/iad1',
file: 'routes/edge/iad1.tsx',
parentId: 'routes/edge',
},
{ regions: ['iad1'] },
],
[
{ id: 'routes/node', file: 'routes/node.tsx' },
{ runtime: 'nodejs', regions: ['sfo1'] },
],
[
{
id: 'routes/node/mem',
file: 'routes/node/mem.tsx',
parentId: 'routes/node',
},
{ maxDuration: 5, memory: 3008 },
],
]);
const routes: RouteManifest = {};
for (const route of staticConfigsMap.keys()) {
routes[route.id] = route;
}
it.each([
{ id: 'root', expected: { runtime: 'nodejs' } },
{ id: 'routes/edge', expected: { runtime: 'edge' } },
{
id: 'routes/edge/sfo1',
expected: { runtime: 'edge', regions: ['sfo1'] },
},
{
id: 'routes/edge/iad1',
expected: { runtime: 'edge', regions: ['iad1'] },
},
{ id: 'routes/node', expected: { runtime: 'nodejs', regions: ['sfo1'] } },
{
id: 'routes/node/mem',
expected: {
runtime: 'nodejs',
regions: ['sfo1'],
maxDuration: 5,
memory: 3008,
},
},
])('should resolve config for "$id" route', ({ id, expected }) => {
const route = routes[id];
const config = getResolvedRouteConfig(route, routes, staticConfigsMap);
expect(config).toMatchObject(expected);
});
});

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/static-build",
"version": "1.3.13",
"version": "1.3.14",
"license": "MIT",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/build-step",
@@ -29,8 +29,8 @@
}
},
"dependencies": {
"@vercel/gatsby-plugin-vercel-analytics": "1.0.7",
"@vercel/gatsby-plugin-vercel-builder": "1.1.10"
"@vercel/gatsby-plugin-vercel-analytics": "1.0.8",
"@vercel/gatsby-plugin-vercel-builder": "1.1.11"
},
"devDependencies": {
"@types/aws-lambda": "8.10.64",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"private": true,
"dependencies": {
"gatsby": "4.25.2",
"gatsby": "4.25.4",
"gatsby-plugin-image": "^2.21.0",
"gatsby-plugin-manifest": "^4.21.0",
"gatsby-plugin-pnpm": "1.2.10",

View File

@@ -4,7 +4,7 @@ importers:
.:
specifiers:
gatsby: 4.25.2
gatsby: 4.25.4
gatsby-plugin-image: ^2.21.0
gatsby-plugin-manifest: ^4.21.0
gatsby-plugin-pnpm: 1.2.10
@@ -15,13 +15,13 @@ importers:
react: ^18.1.0
react-dom: ^18.1.0
dependencies:
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby-plugin-image: 2.25.0_ydhzldbgycgmvbrpalo2wmdfge
gatsby-plugin-manifest: 4.25.0_gatsby@4.25.2
gatsby-plugin-pnpm: 1.2.10_gatsby@4.25.2
gatsby-plugin-sharp: 4.25.0_gatsby@4.25.2
gatsby-source-filesystem: 4.25.0_gatsby@4.25.2
gatsby-transformer-sharp: 4.25.0_6zi7tjmr4qfzq3ejpz7sb2ox7u
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-plugin-image: 2.25.0_xaovy7gaxklfiuhcegdtqnpnhi
gatsby-plugin-manifest: 4.25.0_gatsby@4.25.4
gatsby-plugin-pnpm: 1.2.10_gatsby@4.25.4
gatsby-plugin-sharp: 4.25.0_gatsby@4.25.4
gatsby-source-filesystem: 4.25.0_gatsby@4.25.4
gatsby-transformer-sharp: 4.25.0_c4ebbafybzmh26iep5hpxccrn4
prop-types: 15.8.1
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
@@ -2330,6 +2330,10 @@ packages:
lodash.deburr: 4.1.0
dev: false
/@socket.io/component-emitter/3.1.0:
resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==}
dev: false
/@swc/helpers/0.4.14:
resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==}
dependencies:
@@ -2385,10 +2389,6 @@ packages:
resolution: {integrity: sha512-20R/mDpKSPWdJs5TOpz3e7zqbeCNuMCPhV7Yndk9KU2Rbij2r5W4RzwDPkzC+2lzUqXYu9rFzTktCBnDjHuNQg==}
dev: false
/@types/component-emitter/1.2.11:
resolution: {integrity: sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==}
dev: false
/@types/configstore/2.1.1:
resolution: {integrity: sha512-YY+hm3afkDHeSM2rsFXxeZtu0garnusBWNG1+7MknmDWQHqcH2w21/xOU9arJUi8ch4qyFklidANLCu3ihhVwQ==}
dev: false
@@ -2411,7 +2411,7 @@ packages:
resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==}
dependencies:
'@types/eslint': 8.4.10
'@types/estree': 0.0.51
'@types/estree': 1.0.0
dev: false
/@types/eslint/7.29.0:
@@ -2424,7 +2424,7 @@ packages:
/@types/eslint/8.4.10:
resolution: {integrity: sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==}
dependencies:
'@types/estree': 0.0.51
'@types/estree': 1.0.0
'@types/json-schema': 7.0.11
dev: false
@@ -2444,7 +2444,7 @@ packages:
resolution: {integrity: sha512-ATA/xrS7CZ3A2WCPVY4eKdNpybq56zqlTirnHhhyOztZM/lPxJzusOBI3BsaXbu6FrUluqzvMlI4sZ6BDYMlMg==}
dependencies:
'@types/minimatch': 5.1.2
'@types/node': 8.10.66
'@types/node': 18.11.18
dev: false
/@types/http-cache-semantics/4.0.1:
@@ -2482,7 +2482,7 @@ packages:
/@types/mkdirp/0.5.2:
resolution: {integrity: sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==}
dependencies:
'@types/node': 8.10.66
'@types/node': 18.11.18
dev: false
/@types/node-fetch/2.6.2:
@@ -2532,7 +2532,7 @@ packages:
resolution: {integrity: sha512-YyP+VfeaqAyFmXoTh3HChxOQMyjByRMsHU7kc5KOJkSlXudhMhQIALbYV7rHh/l8d2lX3VUQzprrcAgWdRuU8g==}
dependencies:
'@types/glob': 5.0.37
'@types/node': 8.10.66
'@types/node': 18.11.18
dev: false
/@types/scheduler/0.16.2:
@@ -3180,7 +3180,7 @@ packages:
- supports-color
dev: false
/babel-plugin-remove-graphql-queries/4.25.0_b3vlds4jyvbln6bwxmbjhxwmje:
/babel-plugin-remove-graphql-queries/4.25.0_7b2zndudfh72txnvkexbyma2ty:
resolution: {integrity: sha512-enyqRNRrn7vTG3nwg1V+XhoAJIyUv3ZukQCs5KbHOK+WNDDiGZQzIG+FCiZFACScdZBJWyx7TYRYbOFJZ/KEGg==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -3190,11 +3190,11 @@ packages:
'@babel/core': 7.20.12
'@babel/runtime': 7.20.7
'@babel/types': 7.20.7
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
dev: false
/babel-plugin-remove-graphql-queries/4.25.0_gatsby@4.25.2:
/babel-plugin-remove-graphql-queries/4.25.0_gatsby@4.25.4:
resolution: {integrity: sha512-enyqRNRrn7vTG3nwg1V+XhoAJIyUv3ZukQCs5KbHOK+WNDDiGZQzIG+FCiZFACScdZBJWyx7TYRYbOFJZ/KEGg==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -3203,7 +3203,7 @@ packages:
dependencies:
'@babel/runtime': 7.20.7
'@babel/types': 7.20.7
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
dev: false
@@ -3280,10 +3280,6 @@ packages:
- supports-color
dev: false
/backo2/1.0.2:
resolution: {integrity: sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA==}
dev: false
/balanced-match/1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: false
@@ -3294,11 +3290,6 @@ packages:
safe-buffer: 5.2.1
dev: false
/base64-arraybuffer/0.1.4:
resolution: {integrity: sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg==}
engines: {node: '>= 0.6.0'}
dev: false
/base64-js/1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
dev: false
@@ -3771,10 +3762,6 @@ packages:
resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
dev: false
/component-emitter/1.3.0:
resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==}
dev: false
/compressible/2.0.18:
resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==}
engines: {node: '>= 0.6'}
@@ -3857,7 +3844,7 @@ packages:
dev: false
/cookie-signature/1.0.6:
resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=}
resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==}
dev: false
/cookie/0.4.2:
@@ -4466,43 +4453,39 @@ packages:
once: 1.4.0
dev: false
/engine.io-client/4.1.4:
resolution: {integrity: sha512-843fqAdKeUMFqKi1sSjnR11tJ4wi8sIefu6+JC1OzkkJBmjtc/gM/rZ53tJfu5Iae/3gApm5veoS+v+gtT0+Fg==}
/engine.io-client/6.2.3:
resolution: {integrity: sha512-aXPtgF1JS3RuuKcpSrBtimSjYvrbhKW9froICH4s0F3XQWLxsKNxqzG39nnvQZQnva4CMvUK63T7shevxRyYHw==}
dependencies:
base64-arraybuffer: 0.1.4
component-emitter: 1.3.0
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
engine.io-parser: 4.0.3
has-cors: 1.1.0
parseqs: 0.0.6
parseuri: 0.0.6
ws: 7.4.6
xmlhttprequest-ssl: 1.6.3
yeast: 0.1.2
engine.io-parser: 5.0.6
ws: 8.2.3
xmlhttprequest-ssl: 2.0.0
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/engine.io-parser/4.0.3:
resolution: {integrity: sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA==}
engines: {node: '>=8.0.0'}
dependencies:
base64-arraybuffer: 0.1.4
/engine.io-parser/5.0.6:
resolution: {integrity: sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==}
engines: {node: '>=10.0.0'}
dev: false
/engine.io/4.1.2:
resolution: {integrity: sha512-t5z6zjXuVLhXDMiFJPYsPOWEER8B0tIsD3ETgw19S1yg9zryvUfY3Vhtk3Gf4sihw/bQGIqQ//gjvVlu+Ca0bQ==}
/engine.io/6.2.1:
resolution: {integrity: sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==}
engines: {node: '>=10.0.0'}
dependencies:
'@types/cookie': 0.4.1
'@types/cors': 2.8.13
'@types/node': 18.11.18
accepts: 1.3.8
base64id: 2.0.0
cookie: 0.4.2
cors: 2.8.5
debug: 4.3.4
engine.io-parser: 4.0.3
ws: 7.4.6
engine.io-parser: 5.0.6
ws: 8.2.3
transitivePeerDependencies:
- bufferutil
- supports-color
@@ -5613,7 +5596,7 @@ packages:
'@parcel/transformer-json': 2.6.2_@parcel+core@2.6.2
dev: false
/gatsby-plugin-image/2.25.0_ydhzldbgycgmvbrpalo2wmdfge:
/gatsby-plugin-image/2.25.0_xaovy7gaxklfiuhcegdtqnpnhi:
resolution: {integrity: sha512-Q1TRjvBF7x50alS22i91rksl7A3g42S0jIdPEQcT9bl8MbFaJiboHGna/jp78nxm9vu4qtUJ1IziRSOu0bgHNQ==}
peerDependencies:
'@babel/core': ^7.12.3
@@ -5628,16 +5611,16 @@ packages:
'@babel/runtime': 7.20.7
'@babel/traverse': 7.20.12
babel-jsx-utils: 1.1.0
babel-plugin-remove-graphql-queries: 4.25.0_gatsby@4.25.2
babel-plugin-remove-graphql-queries: 4.25.0_gatsby@4.25.4
camelcase: 5.3.1
chokidar: 3.5.3
common-tags: 1.8.2
fs-extra: 10.1.0
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
gatsby-plugin-sharp: 4.25.0_gatsby@4.25.2
gatsby-plugin-utils: 3.19.0_gatsby@4.25.2
gatsby-source-filesystem: 4.25.0_gatsby@4.25.2
gatsby-plugin-sharp: 4.25.0_gatsby@4.25.4
gatsby-plugin-utils: 3.19.0_gatsby@4.25.4
gatsby-source-filesystem: 4.25.0_gatsby@4.25.4
objectFitPolyfill: 2.3.5
prop-types: 15.8.1
react: 18.2.0
@@ -5647,23 +5630,23 @@ packages:
- supports-color
dev: false
/gatsby-plugin-manifest/4.25.0_gatsby@4.25.2:
/gatsby-plugin-manifest/4.25.0_gatsby@4.25.4:
resolution: {integrity: sha512-2n7v+TvhWUMoOJEaeiPDFsf9jvOImKLZpnzxE8e6ZeeoGeDngXSZhkkP3x2UYIknHtZXUUjFJh8BaVBXiB1dSQ==}
engines: {node: '>=14.15.0'}
peerDependencies:
gatsby: ^4.0.0-next
dependencies:
'@babel/runtime': 7.20.7
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
gatsby-plugin-utils: 3.19.0_gatsby@4.25.2
gatsby-plugin-utils: 3.19.0_gatsby@4.25.4
semver: 7.3.8
sharp: 0.30.7
transitivePeerDependencies:
- graphql
dev: false
/gatsby-plugin-page-creator/4.25.0_5nijmeqlgjulq3py6h447sls2a:
/gatsby-plugin-page-creator/4.25.0_ikkr2w7n6b7ns22fowdw6fv24e:
resolution: {integrity: sha512-plHek7xHSV9l1bLPa1JAnxzBqP7j2ihCPRwpBk/wIJAR8cG65wjAT+Nu8DKpW0+2/MYill84ns1r2m8g0L/7bg==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -5675,10 +5658,10 @@ packages:
chokidar: 3.5.3
fs-exists-cached: 1.0.0
fs-extra: 10.1.0
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
gatsby-page-utils: 2.25.0
gatsby-plugin-utils: 3.19.0_5nijmeqlgjulq3py6h447sls2a
gatsby-plugin-utils: 3.19.0_ikkr2w7n6b7ns22fowdw6fv24e
gatsby-telemetry: 3.25.0
globby: 11.1.0
lodash: 4.17.21
@@ -5688,17 +5671,17 @@ packages:
- supports-color
dev: false
/gatsby-plugin-pnpm/1.2.10_gatsby@4.25.2:
/gatsby-plugin-pnpm/1.2.10_gatsby@4.25.4:
resolution: {integrity: sha512-29xjIakNEUY42OBb3wI9Thmawr5EcUUOB3dB8nE51yr/TfKQFCREk+HAOATQHTNedG3VZhgU4wVjl2V3wgOXJA==}
peerDependencies:
gatsby: ~2.x.x || ~3.x.x || ~4.x.x
dependencies:
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
lodash.get: 4.4.2
lodash.uniq: 4.5.0
dev: false
/gatsby-plugin-sharp/4.25.0_gatsby@4.25.2:
/gatsby-plugin-sharp/4.25.0_gatsby@4.25.4:
resolution: {integrity: sha512-8XiSKibQyp6pOFHEkEdRCpoDA3Ywcq5PKftNMExZ51MormT0+WqRC7ynuU+0fzktDTbbSyREvblKa+21Id+rRA==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -5710,9 +5693,9 @@ packages:
debug: 4.3.4
filenamify: 4.3.0
fs-extra: 10.1.0
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
gatsby-plugin-utils: 3.19.0_gatsby@4.25.2
gatsby-plugin-utils: 3.19.0_gatsby@4.25.4
lodash: 4.17.21
probe-image-size: 7.2.3
semver: 7.3.8
@@ -5722,7 +5705,7 @@ packages:
- supports-color
dev: false
/gatsby-plugin-typescript/4.25.0_gatsby@4.25.2:
/gatsby-plugin-typescript/4.25.0_gatsby@4.25.4:
resolution: {integrity: sha512-8BTtiVWuIqIEGx/PBBMWd6FYPgel16hT3js7SMo5oI9K4EPsSxRItgRf41MTJGxRR20EhL4e99g2S8x0v1+odA==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -5734,13 +5717,13 @@ packages:
'@babel/plugin-proposal-optional-chaining': 7.20.7_@babel+core@7.20.12
'@babel/preset-typescript': 7.18.6_@babel+core@7.20.12
'@babel/runtime': 7.20.7
babel-plugin-remove-graphql-queries: 4.25.0_b3vlds4jyvbln6bwxmbjhxwmje
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
babel-plugin-remove-graphql-queries: 4.25.0_7b2zndudfh72txnvkexbyma2ty
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
transitivePeerDependencies:
- supports-color
dev: false
/gatsby-plugin-utils/3.19.0_5nijmeqlgjulq3py6h447sls2a:
/gatsby-plugin-utils/3.19.0_gatsby@4.25.4:
resolution: {integrity: sha512-EZtvgHSU5NPbEn6a4cfSpEGCQ09SfwbhoybHTJKj1clop86HSwOCV2iH8RbCc+X6jbdgHaSZsfsl7zG1h7DBUw==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -5750,17 +5733,16 @@ packages:
'@babel/runtime': 7.20.7
fastq: 1.15.0
fs-extra: 10.1.0
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
gatsby-sharp: 0.19.0
graphql: 15.8.0
graphql-compose: 9.0.10_graphql@15.8.0
graphql-compose: 9.0.10
import-from: 4.0.0
joi: 17.7.0
mime: 3.0.0
dev: false
/gatsby-plugin-utils/3.19.0_gatsby@4.25.2:
/gatsby-plugin-utils/3.19.0_ikkr2w7n6b7ns22fowdw6fv24e:
resolution: {integrity: sha512-EZtvgHSU5NPbEn6a4cfSpEGCQ09SfwbhoybHTJKj1clop86HSwOCV2iH8RbCc+X6jbdgHaSZsfsl7zG1h7DBUw==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -5770,10 +5752,11 @@ packages:
'@babel/runtime': 7.20.7
fastq: 1.15.0
fs-extra: 10.1.0
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
gatsby-sharp: 0.19.0
graphql-compose: 9.0.10
graphql: 15.8.0
graphql-compose: 9.0.10_graphql@15.8.0
import-from: 4.0.0
joi: 17.7.0
mime: 3.0.0
@@ -5815,7 +5798,7 @@ packages:
sharp: 0.30.7
dev: false
/gatsby-source-filesystem/4.25.0_gatsby@4.25.2:
/gatsby-source-filesystem/4.25.0_gatsby@4.25.4:
resolution: {integrity: sha512-gja4++bPkYpnum4/TxFicr3zRHBArnM2HjT77EE4EuDhdl6qlJYr/heD09LIPN2jdR5gmPwMDjIZnuYZ/6j/aQ==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -5825,7 +5808,7 @@ packages:
chokidar: 3.5.3
file-type: 16.5.4
fs-extra: 10.1.0
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-core-utils: 3.25.0
md5-file: 5.0.0
mime: 2.6.0
@@ -5855,7 +5838,7 @@ packages:
- encoding
dev: false
/gatsby-transformer-sharp/4.25.0_6zi7tjmr4qfzq3ejpz7sb2ox7u:
/gatsby-transformer-sharp/4.25.0_c4ebbafybzmh26iep5hpxccrn4:
resolution: {integrity: sha512-7aqecTvOUFiNB96ij77UnAGJs7Un0TlkpamG//dSl6Nru9EylGz/NW/Eg0vioQyHLCYdMvd5xO8V3BOHJADsnw==}
engines: {node: '>=14.15.0'}
peerDependencies:
@@ -5866,9 +5849,9 @@ packages:
bluebird: 3.7.2
common-tags: 1.8.2
fs-extra: 10.1.0
gatsby: 4.25.2_biqbaboplfbrettd7655fr4n2y
gatsby-plugin-sharp: 4.25.0_gatsby@4.25.2
gatsby-plugin-utils: 3.19.0_gatsby@4.25.2
gatsby: 4.25.4_biqbaboplfbrettd7655fr4n2y
gatsby-plugin-sharp: 4.25.0_gatsby@4.25.4
gatsby-plugin-utils: 3.19.0_gatsby@4.25.4
probe-image-size: 7.2.3
semver: 7.3.8
sharp: 0.30.7
@@ -5887,8 +5870,8 @@ packages:
- supports-color
dev: false
/gatsby/4.25.2_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-HKSWRdTOK5IBFDDgCKiPXiyszfdTTGZ+pple6My6dQ5a5U+Gn1PpjBIiYj4Me9WJAveQzC7tChsqBVVt7r6few==}
/gatsby/4.25.4_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-4IGQ615FCJi/o9qTvyZeZ4Pr04y+zpmxr531/r8rcJK1fcPC3BFR8QGxCrPNxI4jST/Imu4oRYYhnja/VWBCNg==}
engines: {node: '>=14.15.0'}
hasBin: true
requiresBuild: true
@@ -5933,7 +5916,7 @@ packages:
babel-plugin-add-module-exports: 1.0.4
babel-plugin-dynamic-import-node: 2.3.3
babel-plugin-lodash: 3.3.4
babel-plugin-remove-graphql-queries: 4.25.0_b3vlds4jyvbln6bwxmbjhxwmje
babel-plugin-remove-graphql-queries: 4.25.0_7b2zndudfh72txnvkexbyma2ty
babel-preset-gatsby: 2.25.0_cmslh6tfftwpzuhidsdk3oqsoi
better-opn: 2.1.1
bluebird: 3.7.2
@@ -5983,9 +5966,9 @@ packages:
gatsby-link: 4.25.0_jrmehtgkntpgvrzvp7eiismjfa
gatsby-page-utils: 2.25.0
gatsby-parcel-config: 0.16.0_@parcel+core@2.6.2
gatsby-plugin-page-creator: 4.25.0_5nijmeqlgjulq3py6h447sls2a
gatsby-plugin-typescript: 4.25.0_gatsby@4.25.2
gatsby-plugin-utils: 3.19.0_5nijmeqlgjulq3py6h447sls2a
gatsby-plugin-page-creator: 4.25.0_ikkr2w7n6b7ns22fowdw6fv24e
gatsby-plugin-typescript: 4.25.0_gatsby@4.25.4
gatsby-plugin-utils: 3.19.0_ikkr2w7n6b7ns22fowdw6fv24e
gatsby-react-router-scroll: 5.25.0_jrmehtgkntpgvrzvp7eiismjfa
gatsby-script: 1.10.0_jrmehtgkntpgvrzvp7eiismjfa
gatsby-telemetry: 3.25.0
@@ -6043,8 +6026,8 @@ packages:
shallow-compare: 1.2.2
signal-exit: 3.0.7
slugify: 1.6.5
socket.io: 3.1.2
socket.io-client: 3.1.3
socket.io: 4.5.4
socket.io-client: 4.5.4
st: 2.0.0
stack-trace: 0.0.10
string-similarity: 1.2.2
@@ -6345,10 +6328,6 @@ packages:
resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
dev: false
/has-cors/1.1.0:
resolution: {integrity: sha512-g5VNKdkFuUuVCP9gYfDJHjK2nqdQJ7aDLTnycnc2+RvsOQbuLdF5pm7vuE5J76SEBIQjs4kQY/BWq74JUmjbXA==}
dev: false
/has-flag/3.0.0:
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
engines: {node: '>=4'}
@@ -7987,14 +7966,6 @@ packages:
parse-path: 7.0.0
dev: false
/parseqs/0.0.6:
resolution: {integrity: sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==}
dev: false
/parseuri/0.0.6:
resolution: {integrity: sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==}
dev: false
/parseurl/1.3.3:
resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
engines: {node: '>= 0.8'}
@@ -9303,51 +9274,44 @@ packages:
tslib: 2.4.1
dev: false
/socket.io-adapter/2.1.0:
resolution: {integrity: sha512-+vDov/aTsLjViYTwS9fPy5pEtTkrbEKsw2M+oVSoFGw6OD1IpvlV1VPhUzNbofCQ8oyMbdYJqDtGdmHQK6TdPg==}
/socket.io-adapter/2.4.0:
resolution: {integrity: sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==}
dev: false
/socket.io-client/3.1.3:
resolution: {integrity: sha512-4sIGOGOmCg3AOgGi7EEr6ZkTZRkrXwub70bBB/F0JSkMOUFpA77WsL87o34DffQQ31PkbMUIadGOk+3tx1KGbw==}
/socket.io-client/4.5.4:
resolution: {integrity: sha512-ZpKteoA06RzkD32IbqILZ+Cnst4xewU7ZYK12aS1mzHftFFjpoMz69IuhP/nL25pJfao/amoPI527KnuhFm01g==}
engines: {node: '>=10.0.0'}
dependencies:
'@types/component-emitter': 1.2.11
backo2: 1.0.2
component-emitter: 1.3.0
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
engine.io-client: 4.1.4
parseuri: 0.0.6
socket.io-parser: 4.0.5
engine.io-client: 6.2.3
socket.io-parser: 4.2.2
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/socket.io-parser/4.0.5:
resolution: {integrity: sha512-sNjbT9dX63nqUFIOv95tTVm6elyIU4RvB1m8dOeZt+IgWwcWklFDOdmGcfo3zSiRsnR/3pJkjY5lfoGqEe4Eig==}
/socket.io-parser/4.2.2:
resolution: {integrity: sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==}
engines: {node: '>=10.0.0'}
dependencies:
'@types/component-emitter': 1.2.11
component-emitter: 1.3.0
'@socket.io/component-emitter': 3.1.0
debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: false
/socket.io/3.1.2:
resolution: {integrity: sha512-JubKZnTQ4Z8G4IZWtaAZSiRP3I/inpy8c/Bsx2jrwGrTbKeVU5xd6qkKMHpChYeM3dWZSO0QACiGK+obhBNwYw==}
/socket.io/4.5.4:
resolution: {integrity: sha512-m3GC94iK9MfIEeIBfbhJs5BqFibMtkRk8ZpKwG2QwxV0m/eEhPIV4ara6XCF1LWNAus7z58RodiZlAH71U3EhQ==}
engines: {node: '>=10.0.0'}
dependencies:
'@types/cookie': 0.4.1
'@types/cors': 2.8.13
'@types/node': 18.11.18
accepts: 1.3.8
base64id: 2.0.0
debug: 4.3.4
engine.io: 4.1.2
socket.io-adapter: 2.1.0
socket.io-parser: 4.0.5
engine.io: 6.2.1
socket.io-adapter: 2.4.0
socket.io-parser: 4.2.2
transitivePeerDependencies:
- bufferutil
- supports-color
@@ -10297,9 +10261,9 @@ packages:
typedarray-to-buffer: 3.1.5
dev: false
/ws/7.4.6:
resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==}
engines: {node: '>=8.3.0'}
/ws/8.2.3:
resolution: {integrity: sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ^5.0.2
@@ -10315,8 +10279,8 @@ packages:
engines: {node: '>=8'}
dev: false
/xmlhttprequest-ssl/1.6.3:
resolution: {integrity: sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q==}
/xmlhttprequest-ssl/2.0.0:
resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==}
engines: {node: '>=0.4.0'}
dev: false
@@ -10402,10 +10366,6 @@ packages:
yargs-parser: 18.1.3
dev: false
/yeast/0.1.2:
resolution: {integrity: sha512-8HFIh676uyGYP6wP13R/j6OJ/1HwJ46snpvzE7aHAN3Ryqh2yX6Xox2B4CUmTwwOIzlG3Bs7ocsP5dZH/R1Qbg==}
dev: false
/yocto-queue/0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"private": true,
"dependencies": {
"gatsby": "4.25.2",
"gatsby": "4.25.4",
"gatsby-plugin-image": "^2.21.0",
"gatsby-plugin-manifest": "^4.21.0",
"gatsby-plugin-pnpm": "1.2.10",

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
"clean": "gatsby clean"
},
"dependencies": {
"gatsby": "^5.4.2",
"gatsby": "5.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
"clean": "gatsby clean"
},
"dependencies": {
"gatsby": "^5.4.2",
"gatsby": "5.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}

592
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,30 +7,6 @@
"outputMode": "new-only",
"outputs": ["dist/**"]
},
"@vercel/node-bridge#build": {
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": ["helpers.js", "source-map-support.js"]
},
"@vercel/gatsby-plugin-vercel-builder#build": {
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": ["dist/**", "gatsby-node.js"]
},
"@vercel/gatsby-plugin-vercel-analytics#build": {
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": ["gatsby-browser.js", "web-vitals.js", "index.js"]
},
"vercel#build": {
"dependsOn": ["^build"],
"outputMode": "new-only",
"outputs": [
"dist/**",
"src/util/constants.ts",
"src/util/dev/templates/*.ts"
]
},
"test-unit": {
"dependsOn": ["build"],
"outputMode": "new-only"

16
utils/exec.js vendored Normal file
View File

@@ -0,0 +1,16 @@
const { execFileSync } = require('node:child_process');
function exec(cmd, args, opts) {
console.log({ input: `${cmd} ${args.join(' ')}` });
const output = execFileSync(cmd, args, {
encoding: 'utf-8',
...opts,
}).trim();
console.log({ output });
console.log();
return output;
}
module.exports = {
exec,
};

1
utils/publish.sh vendored
View File

@@ -13,6 +13,7 @@ fi
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
echo "Logged in to npm as: $(npm whoami)"
echo "Version of npm is: $(npm --version)"
dist_tag=""
tag="$(git describe --tags --exact-match 2> /dev/null || :)"

118
utils/update-gatsby-fixtures.js vendored Normal file
View File

@@ -0,0 +1,118 @@
const path = require('path');
const fs = require('fs');
const { exec } = require('./exec');
const branch = `update/gatsby-fixtures`;
/**
* invoked by ../.github/workflows/cron-test-and-update-gatsby.yml
* @param {{ github: ReturnType<import('@actions/github').getOctokit>, context: import('@actions/github').context }} param0 Defined by https://github.com/actions/github-script
* @returns
*/
module.exports = async ({ github, context }) => {
exec('git', ['config', '--global', 'user.email', 'infra+release@vercel.com']);
exec('git', ['config', '--global', 'user.name', 'vercel-release-bot']);
try {
// Branch may exist if there's already an existing PR
exec('git', ['checkout', branch]);
} catch {
exec('git', ['checkout', '-b', branch]);
}
const fixturesPath = path.join(
__dirname,
'..',
'packages',
'static-build',
'test',
'fixtures'
);
const gatsbyFixtures = [
'gatsby-v2',
'gatsby-v3',
'gatsby-v4-pnpm',
'gatsby-v4',
'gatsby-v5-pathPrefix',
'gatsby-v5',
];
for (const fixture of gatsbyFixtures) {
const fixturePath = path.join(fixturesPath, fixture);
const packageJSONPath = path.join(fixturePath, 'package.json');
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'));
const oldVersion = packageJSON.dependencies.gatsby;
const major = oldVersion.split('.')[0];
if (fixture.includes('pnpm')) {
exec(
'pnpm',
[
'-w',
'install',
`gatsby@^${major}`,
'--save-exact',
'--lockfile-only',
],
{ cwd: fixturePath }
);
} else {
exec(
'npm',
['install', `gatsby@^${major}`, '--save-exact', '--package-lock-only'],
{ cwd: fixturePath }
);
}
}
// exec throws error on non-zero exit code
// git diff --quiet returns exit code 1 if changes detected
try {
exec('git', ['diff', '--quiet']);
} catch {
exec('git', ['add', '-A']);
exec('git', ['commit', '-m', branch]);
exec('git', ['push', 'origin', branch]);
const { repo, owner } = context.repo;
const pulls = await github.rest.pulls.list({
owner,
repo,
state: 'open',
head: branch,
});
if (pulls.length === 0) {
const pr = await github.rest.pulls.create({
owner,
repo,
head: branch,
base: 'main',
title: '[tests] Update Gatsby fixture versions',
body: 'Automatically generated PR to update Gatsby fixture versions in `@vercel/static-build`',
});
await github.rest.pulls.requestReviewers({
owner,
repo,
pull_number: pr.data.number,
reviewers: [
'Ethan-Arrowood',
'styfle',
'TooTallNate',
'EndangeredMassa',
'cb1kenobi',
],
});
await github.rest.issues.addLabels({
owner,
repo,
issue_number: pr.data.number,
labels: ['area: tests', 'semver: none', 'pr: automerge'],
});
}
}
};

73
utils/update-remix-run-dev.js vendored Normal file
View File

@@ -0,0 +1,73 @@
const { execSync } = require('child_process');
const path = require('path');
const fs = require('fs');
module.exports = async ({ github, context }, newVersion) => {
execSync('git config --global user.email infra+release@vercel.com');
execSync('git config --global user.name vercel-release-bot');
execSync('git checkout main');
const packagePath = path.join(__dirname, '..', 'packages', 'remix');
const oldVersion = JSON.parse(
fs.readFileSync(path.join(packagePath, 'package.json'), 'utf-8')
).dependencies['@remix-run/dev'];
if (newVersion === '') {
newVersion = execSync('npm view @vercel/remix-run-dev dist-tags.latest', {
encoding: 'utf-8',
});
}
const branch = `vercel-remix-run-dev-${newVersion.replaceAll('.', '-')}`;
if (oldVersion === newVersion) {
// eslint-disable-next-line no-console
console.log(
`@vercel/remix-run-dev version ${newVersion} did not change, skipping update.`
);
return;
}
if (
execSync(`git ls-remote --heads origin ${branch}`, { encoding: 'utf-8' })
.toString()
.trim()
) {
// eslint-disable-next-line no-console
console.log(`Branch ${branch} already exists, skipping update.`);
return;
}
execSync(
`pnpm install @remix-run/dev@npm:@vercel/remix-run-dev@${newVersion} --save-exact --lockfile-only`,
{ cwd: packagePath }
);
execSync(`git checkout -b ${branch}`);
execSync('git add -A');
execSync(`git commit -m ${branch}`);
execSync(`git push origin ${branch}`);
const { repo, owner } = context.repo;
const pr = await github.rest.pulls.create({
owner,
repo,
head: branch,
base: 'main',
title: `[remix] Upgrade @remix-run/dev to version ${newVersion}`,
body: `This auto-generated PR updates @remix-run/dev to version ${newVersion}`,
});
await github.rest.pulls.requestReviewers({
owner,
repo,
pull_number: pr.data.number,
reviewers: ['Ethan-Arrowood', 'TooTallNate'],
});
await github.rest.issues.addLabels({
owner,
repo,
issue_number: pr.data.number,
labels: ['area: remix', 'semver: patch', 'pr: automerge'],
});
};