mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 12:57:46 +00:00
Compare commits
21 Commits
@vercel/py
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a585969dd3 | ||
|
|
35eca33b44 | ||
|
|
d608153961 | ||
|
|
a4cfc5f943 | ||
|
|
2eef3e3ddb | ||
|
|
8120fd3d7a | ||
|
|
ba498f3a8e | ||
|
|
b5a9408272 | ||
|
|
946f7f0bfc | ||
|
|
804a3863e7 | ||
|
|
a4d16c681a | ||
|
|
61bbd4f98b | ||
|
|
fedf264862 | ||
|
|
6420e54b35 | ||
|
|
aa6b957b23 | ||
|
|
c6717a1492 | ||
|
|
0b33c1c3e7 | ||
|
|
dbea973546 | ||
|
|
8ac4814702 | ||
|
|
c84d6c4355 | ||
|
|
61b6e87987 |
9
.github/workflows/publish.yml
vendored
9
.github/workflows/publish.yml
vendored
@@ -41,15 +41,6 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Cache
|
||||
if: ${{ steps.check-release.outputs.IS_RELEASE == 'true' }}
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: pnpm-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: pnpm-${{ matrix.os }}-${{ matrix.node }}
|
||||
env:
|
||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 # See https://github.com/actions/cache/issues/810
|
||||
- name: install pnpm@7.24.2
|
||||
run: npm i -g pnpm@7.24.2
|
||||
- name: Install
|
||||
|
||||
7
.github/workflows/test-integration-cli.yml
vendored
7
.github/workflows/test-integration-cli.yml
vendored
@@ -37,13 +37,6 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: pnpm-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: pnpm-${{ matrix.os }}-${{ matrix.node }}
|
||||
env:
|
||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 # See https://github.com/actions/cache/issues/810
|
||||
- name: install pnpm@7.24.2
|
||||
run: npm i -g pnpm@7.24.2
|
||||
- run: pnpm install
|
||||
|
||||
7
.github/workflows/test-unit.yml
vendored
7
.github/workflows/test-unit.yml
vendored
@@ -37,13 +37,6 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: pnpm-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: pnpm-${{ matrix.os }}-${{ matrix.node }}
|
||||
env:
|
||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 # See https://github.com/actions/cache/issues/810
|
||||
- name: install pnpm@7.24.2
|
||||
run: npm i -g pnpm@7.24.2
|
||||
- run: pnpm install
|
||||
|
||||
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -35,13 +35,6 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: pnpm-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: pnpm-${{ matrix.os }}-${{ matrix.node }}
|
||||
env:
|
||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 # See https://github.com/actions/cache/issues/810
|
||||
- name: install pnpm@7.24.2
|
||||
run: npm i -g pnpm@7.24.2
|
||||
- run: pnpm install
|
||||
@@ -79,13 +72,6 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: pnpm-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: pnpm-${{ matrix.os }}-${{ matrix.node }}
|
||||
env:
|
||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 # See https://github.com/actions/cache/issues/810
|
||||
|
||||
- name: Install Hugo
|
||||
if: matrix.runner == 'macos-latest'
|
||||
|
||||
@@ -24,7 +24,7 @@ npm install next --save
|
||||
}
|
||||
```
|
||||
|
||||
3. Add `target: 'serverless'` to `next.config.js`
|
||||
3. Add `target: 'serverless'` to `next.config.js` [deprecated]
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
@@ -43,3 +43,5 @@ module.exports = {
|
||||
"builds": [{ "src": "package.json", "use": "@vercel/next" }]
|
||||
}
|
||||
```
|
||||
|
||||
6. Make sure you have the correct Node.js version selected for your build step in your project settings (`https://vercel.com/[username]/[project]/settings`)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"astro": "astro"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^1.6.10",
|
||||
"web-vitals": "^3.1.0"
|
||||
"astro": "^2.0.6",
|
||||
"web-vitals": "^3.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
1830
examples/astro/pnpm-lock.yaml
generated
1830
examples/astro/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
306
examples/nextjs/package-lock.json
generated
306
examples/nextjs/package-lock.json
generated
@@ -8,10 +8,10 @@
|
||||
"name": "nextjs",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@next/font": "13.1.5",
|
||||
"@next/font": "13.1.6",
|
||||
"eslint": "8.32.0",
|
||||
"eslint-config-next": "13.1.5",
|
||||
"next": "13.1.5",
|
||||
"eslint-config-next": "13.1.6",
|
||||
"next": "13.1.6",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
@@ -80,27 +80,27 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
||||
},
|
||||
"node_modules/@next/env": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.1.5.tgz",
|
||||
"integrity": "sha512-0Ry4NhJy6qLbXhvxPRUQ1H6RzgtryGdUto7hfgAK0Iw/bScgeVjwLZdfhm2iT7qsOS32apo9cWzLCxjc6iGPsA=="
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.1.6.tgz",
|
||||
"integrity": "sha512-s+W9Fdqh5MFk6ECrbnVmmAOwxKQuhGMT7xXHrkYIBMBcTiOqNWhv5KbJIboKR5STXxNXl32hllnvKaffzFaWQg=="
|
||||
},
|
||||
"node_modules/@next/eslint-plugin-next": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.5.tgz",
|
||||
"integrity": "sha512-3kvLTX35bOWOCKU8KY74Ygczc55Qk/kB2TQy0tH7Rti6hzZ6Aij7WQ8zHdIVjmnlD0n/zXWXrIf5y56RKcLQkQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.6.tgz",
|
||||
"integrity": "sha512-o7cauUYsXjzSJkay8wKjpKJf2uLzlggCsGUkPu3lP09Pv97jYlekTC20KJrjQKmSv5DXV0R/uks2ZXhqjNkqAw==",
|
||||
"dependencies": {
|
||||
"glob": "7.1.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/font": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/font/-/font-13.1.5.tgz",
|
||||
"integrity": "sha512-6M5R6yC3JkdJiqo/YJxDp6+0vDn0smXOAzl8uHt4qmDS2u53ji/19K0HM51d+5kg8xntDi+N2hw7YjaU9inkNA=="
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/font/-/font-13.1.6.tgz",
|
||||
"integrity": "sha512-AITjmeb1RgX1HKMCiA39ztx2mxeAyxl4ljv2UoSBUGAbFFMg8MO7YAvjHCgFhD39hL7YTbFjol04e/BPBH5RzQ=="
|
||||
},
|
||||
"node_modules/@next/swc-android-arm-eabi": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.1.5.tgz",
|
||||
"integrity": "sha512-QAEf3YM9U0qWVQTxgF3Tsh4OeCN1i9Smsf6cVlwZsPzoLyj2nQ879joCoN+ONqDknkBgG6OG/ajefywL3jw9Cg==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.1.6.tgz",
|
||||
"integrity": "sha512-F3/6Z8LH/pGlPzR1AcjPFxx35mPqjE5xZcf+IL+KgbW9tMkp7CYi1y7qKrEWU7W4AumxX/8OINnDQWLiwLasLQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -113,9 +113,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-android-arm64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.1.5.tgz",
|
||||
"integrity": "sha512-ZmtGPTghRuT5YKL0nNcC2bBVSiG1O0is16eIZ2rWSP/hRW64ZCcAew6pxw2rihntNp22UfequjSTHd91WE/tyQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.1.6.tgz",
|
||||
"integrity": "sha512-cMwQjnB8vrYkWyK/H0Rf2c2pKIH4RGjpKUDvbjVAit6SbwPDpmaijLio0LWFV3/tOnY6kvzbL62lndVA0mkYpw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -128,9 +128,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-arm64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.1.5.tgz",
|
||||
"integrity": "sha512-aeFXK+M/zmG/CNdMJ0tGNs0MWcLueUe7vZ2V6fa+2yz/ZgYJLI7fEfFvVh1p1yBMzupSbZDowvMuCSFTaeg3MA==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.1.6.tgz",
|
||||
"integrity": "sha512-KKRQH4DDE4kONXCvFMNBZGDb499Hs+xcFAwvj+rfSUssIDrZOlyfJNy55rH5t2Qxed1e4K80KEJgsxKQN1/fyw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -143,9 +143,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-x64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.1.5.tgz",
|
||||
"integrity": "sha512-6mPX0GNRg8NzjV70at8I8pD9YBnPHDpxJCoMuIqysdTjtQhd09Xk6GUhquNhp1kEJzzVk7OW5l2ch4XIJjtY3A==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.1.6.tgz",
|
||||
"integrity": "sha512-/uOky5PaZDoaU99ohjtNcDTJ6ks/gZ5ykTQDvNZDjIoCxFe3+t06bxsTPY6tAO6uEAw5f6vVFX5H5KLwhrkZCA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -158,9 +158,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-freebsd-x64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.1.5.tgz",
|
||||
"integrity": "sha512-nR4a/SNblG0w8hhYRflTZjk4yD99ld18w/FCftw99ziw8sgciBlOXRICJIiRIaMRU8UH7QLSgBOQVnfNcVNKMA==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.1.6.tgz",
|
||||
"integrity": "sha512-qaEALZeV7to6weSXk3Br80wtFQ7cFTpos/q+m9XVRFggu+8Ib895XhMWdJBzew6aaOcMvYR6KQ6JmHA2/eMzWw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -173,9 +173,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm-gnueabihf": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.1.5.tgz",
|
||||
"integrity": "sha512-EzkltCVKg3gUzamoeKPhGeSgXTTLAhSzc7v/+g1Y+HQa7JKMrlzdRkrJf+H4LJXcz7lnxgNKHGRyZBSXnmJKJw==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.1.6.tgz",
|
||||
"integrity": "sha512-OybkbC58A1wJ+JrJSOjGDvZzrVEQA4sprJejGqMwiZyLqhr9Eo8FXF0y6HL+m1CPCpPhXEHz/2xKoYsl16kNqw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -188,9 +188,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-gnu": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.1.5.tgz",
|
||||
"integrity": "sha512-E7HMkdoxStmTUJU4KzBUU4vZ5DHT4Gd327tC3KFZS5lda0NRerJAOCfsRg+fBj22FvCb1UWsX6XI+weL6xhyeQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.1.6.tgz",
|
||||
"integrity": "sha512-yCH+yDr7/4FDuWv6+GiYrPI9kcTAO3y48UmaIbrKy8ZJpi7RehJe3vIBRUmLrLaNDH3rY1rwoHi471NvR5J5NQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -203,9 +203,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-musl": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.1.5.tgz",
|
||||
"integrity": "sha512-qlO0Fd3GQwJS6YpbF9NyL5NGHVZ43dKtZDC/jP4vdeMIYDtSu13HcY/nmA1NdW+RpMwDxSCpx4WKsCCEZGIX8Q==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.1.6.tgz",
|
||||
"integrity": "sha512-ECagB8LGX25P9Mrmlc7Q/TQBb9rGScxHbv/kLqqIWs2fIXy6Y/EiBBiM72NTwuXUFCNrWR4sjUPSooVBJJ3ESQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -218,9 +218,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-gnu": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.1.5.tgz",
|
||||
"integrity": "sha512-GftSBFAay2nocGl+KNqFsj6EVSvomaM/bp86hzezbKsTwQmu76PjOCVcejI1gE+4k7f5zPDgCuorF6F04BV0HQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.1.6.tgz",
|
||||
"integrity": "sha512-GT5w2mruk90V/I5g6ScuueE7fqj/d8Bui2qxdw6lFxmuTgMeol5rnzAv4uAoVQgClOUO/MULilzlODg9Ib3Y4Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -233,9 +233,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-musl": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.1.5.tgz",
|
||||
"integrity": "sha512-UD+3lxU4yuAjd+uBkCDfBpAcbGAVfEcE8mX/efIxUGIImmzN0QzgTHYEpKFnY3Lxu02dIBcwQRT3Q5mfO4obng==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.1.6.tgz",
|
||||
"integrity": "sha512-keFD6KvwOPzmat4TCnlnuxJCQepPN+8j3Nw876FtULxo8005Y9Ghcl7ACcR8GoiKoddAq8gxNBrpjoxjQRHeAQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -248,9 +248,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-arm64-msvc": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.1.5.tgz",
|
||||
"integrity": "sha512-uzsvkQY+K3EbL+97IUHPWZPwjsCmCkdH/O5Cf9wCnh0k0gaj7ob1mGKqr1vNNak+9U7HloGwuHcXnZpijWSP7w==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.1.6.tgz",
|
||||
"integrity": "sha512-OwertslIiGQluFvHyRDzBCIB07qJjqabAmINlXUYt7/sY7Q7QPE8xVi5beBxX/rxTGPIbtyIe3faBE6Z2KywhQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -263,9 +263,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-ia32-msvc": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.1.5.tgz",
|
||||
"integrity": "sha512-v0NaC1w8mPf620GlJaHBdEm3dm4G4AEQMasDqjzQvo0yCRrvtvzMgCIe8MocBxFHzaF6868NybMqvumxP5YxEg==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.1.6.tgz",
|
||||
"integrity": "sha512-g8zowiuP8FxUR9zslPmlju7qYbs2XBtTLVSxVikPtUDQedhcls39uKYLvOOd1JZg0ehyhopobRoH1q+MHlIN/w==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -278,9 +278,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-x64-msvc": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.5.tgz",
|
||||
"integrity": "sha512-IZHwvd649ccbWyLCfu92IXEpR250NpmBkaRelPV+WVm4jrd62FKRFCNdqdCXq6TrEg9wN8cK4YG8tm44uEZqLA==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.6.tgz",
|
||||
"integrity": "sha512-Ls2OL9hi3YlJKGNdKv8k3X/lLgc3VmLG3a/DeTkAd+lAituJp8ZHmRmm9f9SL84fT3CotlzcgbdaCDfFwFA6bA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -676,9 +676,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001447",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz",
|
||||
"integrity": "sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw==",
|
||||
"version": "1.0.30001449",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001449.tgz",
|
||||
"integrity": "sha512-CPB+UL9XMT/Av+pJxCKGhdx+yg1hzplvFJQlJ2n68PyQGMz9L/E2zCyLdOL8uasbouTUgnPl+y0tccI/se+BEw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -1028,11 +1028,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-next": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.1.5.tgz",
|
||||
"integrity": "sha512-7FqkjkvGCQfvYUiPTFRiRYPR1uI6Ew+4f4mVp16lLSWcaChtWoZxQCZHM5n0yxzKKVmuEg1aM4uvDQfSXSjTww==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.1.6.tgz",
|
||||
"integrity": "sha512-0cg7h5wztg/SoLAlxljZ0ZPUQ7i6QKqRiP4M2+MgTZtxWwNKb2JSwNc18nJ6/kXBI6xYvPraTbQSIhAuVw6czw==",
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "13.1.5",
|
||||
"@next/eslint-plugin-next": "13.1.6",
|
||||
"@rushstack/eslint-patch": "^1.1.3",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint-import-resolver-node": "^0.3.6",
|
||||
@@ -2323,11 +2323,11 @@
|
||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
|
||||
},
|
||||
"node_modules/next": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.1.5.tgz",
|
||||
"integrity": "sha512-rmpYZFCxxWAi2nJCT9sSqMLGC3cu+Pf689hx9clcyP0KbVIhh/7Dus5QcKrVd/PrAd6AjsuogSRR1mCP7BoYRw==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.1.6.tgz",
|
||||
"integrity": "sha512-hHlbhKPj9pW+Cymvfzc15lvhaOZ54l+8sXDXJWm3OBNBzgrVj6hwGPmqqsXg40xO1Leq+kXpllzRPuncpC0Phw==",
|
||||
"dependencies": {
|
||||
"@next/env": "13.1.5",
|
||||
"@next/env": "13.1.6",
|
||||
"@swc/helpers": "0.4.14",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
"postcss": "8.4.14",
|
||||
@@ -2340,19 +2340,19 @@
|
||||
"node": ">=14.6.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@next/swc-android-arm-eabi": "13.1.5",
|
||||
"@next/swc-android-arm64": "13.1.5",
|
||||
"@next/swc-darwin-arm64": "13.1.5",
|
||||
"@next/swc-darwin-x64": "13.1.5",
|
||||
"@next/swc-freebsd-x64": "13.1.5",
|
||||
"@next/swc-linux-arm-gnueabihf": "13.1.5",
|
||||
"@next/swc-linux-arm64-gnu": "13.1.5",
|
||||
"@next/swc-linux-arm64-musl": "13.1.5",
|
||||
"@next/swc-linux-x64-gnu": "13.1.5",
|
||||
"@next/swc-linux-x64-musl": "13.1.5",
|
||||
"@next/swc-win32-arm64-msvc": "13.1.5",
|
||||
"@next/swc-win32-ia32-msvc": "13.1.5",
|
||||
"@next/swc-win32-x64-msvc": "13.1.5"
|
||||
"@next/swc-android-arm-eabi": "13.1.6",
|
||||
"@next/swc-android-arm64": "13.1.6",
|
||||
"@next/swc-darwin-arm64": "13.1.6",
|
||||
"@next/swc-darwin-x64": "13.1.6",
|
||||
"@next/swc-freebsd-x64": "13.1.6",
|
||||
"@next/swc-linux-arm-gnueabihf": "13.1.6",
|
||||
"@next/swc-linux-arm64-gnu": "13.1.6",
|
||||
"@next/swc-linux-arm64-musl": "13.1.6",
|
||||
"@next/swc-linux-x64-gnu": "13.1.6",
|
||||
"@next/swc-linux-x64-musl": "13.1.6",
|
||||
"@next/swc-win32-arm64-msvc": "13.1.6",
|
||||
"@next/swc-win32-ia32-msvc": "13.1.6",
|
||||
"@next/swc-win32-x64-msvc": "13.1.6"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"fibers": ">= 3.1.0",
|
||||
@@ -3087,9 +3087,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
|
||||
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||
},
|
||||
"node_modules/tsutils": {
|
||||
"version": "3.21.0",
|
||||
@@ -3318,99 +3318,99 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
||||
},
|
||||
"@next/env": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.1.5.tgz",
|
||||
"integrity": "sha512-0Ry4NhJy6qLbXhvxPRUQ1H6RzgtryGdUto7hfgAK0Iw/bScgeVjwLZdfhm2iT7qsOS32apo9cWzLCxjc6iGPsA=="
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.1.6.tgz",
|
||||
"integrity": "sha512-s+W9Fdqh5MFk6ECrbnVmmAOwxKQuhGMT7xXHrkYIBMBcTiOqNWhv5KbJIboKR5STXxNXl32hllnvKaffzFaWQg=="
|
||||
},
|
||||
"@next/eslint-plugin-next": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.5.tgz",
|
||||
"integrity": "sha512-3kvLTX35bOWOCKU8KY74Ygczc55Qk/kB2TQy0tH7Rti6hzZ6Aij7WQ8zHdIVjmnlD0n/zXWXrIf5y56RKcLQkQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.6.tgz",
|
||||
"integrity": "sha512-o7cauUYsXjzSJkay8wKjpKJf2uLzlggCsGUkPu3lP09Pv97jYlekTC20KJrjQKmSv5DXV0R/uks2ZXhqjNkqAw==",
|
||||
"requires": {
|
||||
"glob": "7.1.7"
|
||||
}
|
||||
},
|
||||
"@next/font": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/font/-/font-13.1.5.tgz",
|
||||
"integrity": "sha512-6M5R6yC3JkdJiqo/YJxDp6+0vDn0smXOAzl8uHt4qmDS2u53ji/19K0HM51d+5kg8xntDi+N2hw7YjaU9inkNA=="
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/font/-/font-13.1.6.tgz",
|
||||
"integrity": "sha512-AITjmeb1RgX1HKMCiA39ztx2mxeAyxl4ljv2UoSBUGAbFFMg8MO7YAvjHCgFhD39hL7YTbFjol04e/BPBH5RzQ=="
|
||||
},
|
||||
"@next/swc-android-arm-eabi": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.1.5.tgz",
|
||||
"integrity": "sha512-QAEf3YM9U0qWVQTxgF3Tsh4OeCN1i9Smsf6cVlwZsPzoLyj2nQ879joCoN+ONqDknkBgG6OG/ajefywL3jw9Cg==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.1.6.tgz",
|
||||
"integrity": "sha512-F3/6Z8LH/pGlPzR1AcjPFxx35mPqjE5xZcf+IL+KgbW9tMkp7CYi1y7qKrEWU7W4AumxX/8OINnDQWLiwLasLQ==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-android-arm64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.1.5.tgz",
|
||||
"integrity": "sha512-ZmtGPTghRuT5YKL0nNcC2bBVSiG1O0is16eIZ2rWSP/hRW64ZCcAew6pxw2rihntNp22UfequjSTHd91WE/tyQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.1.6.tgz",
|
||||
"integrity": "sha512-cMwQjnB8vrYkWyK/H0Rf2c2pKIH4RGjpKUDvbjVAit6SbwPDpmaijLio0LWFV3/tOnY6kvzbL62lndVA0mkYpw==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-darwin-arm64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.1.5.tgz",
|
||||
"integrity": "sha512-aeFXK+M/zmG/CNdMJ0tGNs0MWcLueUe7vZ2V6fa+2yz/ZgYJLI7fEfFvVh1p1yBMzupSbZDowvMuCSFTaeg3MA==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.1.6.tgz",
|
||||
"integrity": "sha512-KKRQH4DDE4kONXCvFMNBZGDb499Hs+xcFAwvj+rfSUssIDrZOlyfJNy55rH5t2Qxed1e4K80KEJgsxKQN1/fyw==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-darwin-x64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.1.5.tgz",
|
||||
"integrity": "sha512-6mPX0GNRg8NzjV70at8I8pD9YBnPHDpxJCoMuIqysdTjtQhd09Xk6GUhquNhp1kEJzzVk7OW5l2ch4XIJjtY3A==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.1.6.tgz",
|
||||
"integrity": "sha512-/uOky5PaZDoaU99ohjtNcDTJ6ks/gZ5ykTQDvNZDjIoCxFe3+t06bxsTPY6tAO6uEAw5f6vVFX5H5KLwhrkZCA==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-freebsd-x64": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.1.5.tgz",
|
||||
"integrity": "sha512-nR4a/SNblG0w8hhYRflTZjk4yD99ld18w/FCftw99ziw8sgciBlOXRICJIiRIaMRU8UH7QLSgBOQVnfNcVNKMA==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.1.6.tgz",
|
||||
"integrity": "sha512-qaEALZeV7to6weSXk3Br80wtFQ7cFTpos/q+m9XVRFggu+8Ib895XhMWdJBzew6aaOcMvYR6KQ6JmHA2/eMzWw==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-linux-arm-gnueabihf": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.1.5.tgz",
|
||||
"integrity": "sha512-EzkltCVKg3gUzamoeKPhGeSgXTTLAhSzc7v/+g1Y+HQa7JKMrlzdRkrJf+H4LJXcz7lnxgNKHGRyZBSXnmJKJw==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.1.6.tgz",
|
||||
"integrity": "sha512-OybkbC58A1wJ+JrJSOjGDvZzrVEQA4sprJejGqMwiZyLqhr9Eo8FXF0y6HL+m1CPCpPhXEHz/2xKoYsl16kNqw==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-linux-arm64-gnu": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.1.5.tgz",
|
||||
"integrity": "sha512-E7HMkdoxStmTUJU4KzBUU4vZ5DHT4Gd327tC3KFZS5lda0NRerJAOCfsRg+fBj22FvCb1UWsX6XI+weL6xhyeQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.1.6.tgz",
|
||||
"integrity": "sha512-yCH+yDr7/4FDuWv6+GiYrPI9kcTAO3y48UmaIbrKy8ZJpi7RehJe3vIBRUmLrLaNDH3rY1rwoHi471NvR5J5NQ==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-linux-arm64-musl": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.1.5.tgz",
|
||||
"integrity": "sha512-qlO0Fd3GQwJS6YpbF9NyL5NGHVZ43dKtZDC/jP4vdeMIYDtSu13HcY/nmA1NdW+RpMwDxSCpx4WKsCCEZGIX8Q==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.1.6.tgz",
|
||||
"integrity": "sha512-ECagB8LGX25P9Mrmlc7Q/TQBb9rGScxHbv/kLqqIWs2fIXy6Y/EiBBiM72NTwuXUFCNrWR4sjUPSooVBJJ3ESQ==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-linux-x64-gnu": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.1.5.tgz",
|
||||
"integrity": "sha512-GftSBFAay2nocGl+KNqFsj6EVSvomaM/bp86hzezbKsTwQmu76PjOCVcejI1gE+4k7f5zPDgCuorF6F04BV0HQ==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.1.6.tgz",
|
||||
"integrity": "sha512-GT5w2mruk90V/I5g6ScuueE7fqj/d8Bui2qxdw6lFxmuTgMeol5rnzAv4uAoVQgClOUO/MULilzlODg9Ib3Y4Q==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-linux-x64-musl": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.1.5.tgz",
|
||||
"integrity": "sha512-UD+3lxU4yuAjd+uBkCDfBpAcbGAVfEcE8mX/efIxUGIImmzN0QzgTHYEpKFnY3Lxu02dIBcwQRT3Q5mfO4obng==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.1.6.tgz",
|
||||
"integrity": "sha512-keFD6KvwOPzmat4TCnlnuxJCQepPN+8j3Nw876FtULxo8005Y9Ghcl7ACcR8GoiKoddAq8gxNBrpjoxjQRHeAQ==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-win32-arm64-msvc": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.1.5.tgz",
|
||||
"integrity": "sha512-uzsvkQY+K3EbL+97IUHPWZPwjsCmCkdH/O5Cf9wCnh0k0gaj7ob1mGKqr1vNNak+9U7HloGwuHcXnZpijWSP7w==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.1.6.tgz",
|
||||
"integrity": "sha512-OwertslIiGQluFvHyRDzBCIB07qJjqabAmINlXUYt7/sY7Q7QPE8xVi5beBxX/rxTGPIbtyIe3faBE6Z2KywhQ==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-win32-ia32-msvc": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.1.5.tgz",
|
||||
"integrity": "sha512-v0NaC1w8mPf620GlJaHBdEm3dm4G4AEQMasDqjzQvo0yCRrvtvzMgCIe8MocBxFHzaF6868NybMqvumxP5YxEg==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.1.6.tgz",
|
||||
"integrity": "sha512-g8zowiuP8FxUR9zslPmlju7qYbs2XBtTLVSxVikPtUDQedhcls39uKYLvOOd1JZg0ehyhopobRoH1q+MHlIN/w==",
|
||||
"optional": true
|
||||
},
|
||||
"@next/swc-win32-x64-msvc": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.5.tgz",
|
||||
"integrity": "sha512-IZHwvd649ccbWyLCfu92IXEpR250NpmBkaRelPV+WVm4jrd62FKRFCNdqdCXq6TrEg9wN8cK4YG8tm44uEZqLA==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.6.tgz",
|
||||
"integrity": "sha512-Ls2OL9hi3YlJKGNdKv8k3X/lLgc3VmLG3a/DeTkAd+lAituJp8ZHmRmm9f9SL84fT3CotlzcgbdaCDfFwFA6bA==",
|
||||
"optional": true
|
||||
},
|
||||
"@nodelib/fs.scandir": {
|
||||
@@ -3674,9 +3674,9 @@
|
||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001447",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz",
|
||||
"integrity": "sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw=="
|
||||
"version": "1.0.30001449",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001449.tgz",
|
||||
"integrity": "sha512-CPB+UL9XMT/Av+pJxCKGhdx+yg1hzplvFJQlJ2n68PyQGMz9L/E2zCyLdOL8uasbouTUgnPl+y0tccI/se+BEw=="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
@@ -3942,11 +3942,11 @@
|
||||
}
|
||||
},
|
||||
"eslint-config-next": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.1.5.tgz",
|
||||
"integrity": "sha512-7FqkjkvGCQfvYUiPTFRiRYPR1uI6Ew+4f4mVp16lLSWcaChtWoZxQCZHM5n0yxzKKVmuEg1aM4uvDQfSXSjTww==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.1.6.tgz",
|
||||
"integrity": "sha512-0cg7h5wztg/SoLAlxljZ0ZPUQ7i6QKqRiP4M2+MgTZtxWwNKb2JSwNc18nJ6/kXBI6xYvPraTbQSIhAuVw6czw==",
|
||||
"requires": {
|
||||
"@next/eslint-plugin-next": "13.1.5",
|
||||
"@next/eslint-plugin-next": "13.1.6",
|
||||
"@rushstack/eslint-patch": "^1.1.3",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint-import-resolver-node": "^0.3.6",
|
||||
@@ -4860,24 +4860,24 @@
|
||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
|
||||
},
|
||||
"next": {
|
||||
"version": "13.1.5",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.1.5.tgz",
|
||||
"integrity": "sha512-rmpYZFCxxWAi2nJCT9sSqMLGC3cu+Pf689hx9clcyP0KbVIhh/7Dus5QcKrVd/PrAd6AjsuogSRR1mCP7BoYRw==",
|
||||
"version": "13.1.6",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.1.6.tgz",
|
||||
"integrity": "sha512-hHlbhKPj9pW+Cymvfzc15lvhaOZ54l+8sXDXJWm3OBNBzgrVj6hwGPmqqsXg40xO1Leq+kXpllzRPuncpC0Phw==",
|
||||
"requires": {
|
||||
"@next/env": "13.1.5",
|
||||
"@next/swc-android-arm-eabi": "13.1.5",
|
||||
"@next/swc-android-arm64": "13.1.5",
|
||||
"@next/swc-darwin-arm64": "13.1.5",
|
||||
"@next/swc-darwin-x64": "13.1.5",
|
||||
"@next/swc-freebsd-x64": "13.1.5",
|
||||
"@next/swc-linux-arm-gnueabihf": "13.1.5",
|
||||
"@next/swc-linux-arm64-gnu": "13.1.5",
|
||||
"@next/swc-linux-arm64-musl": "13.1.5",
|
||||
"@next/swc-linux-x64-gnu": "13.1.5",
|
||||
"@next/swc-linux-x64-musl": "13.1.5",
|
||||
"@next/swc-win32-arm64-msvc": "13.1.5",
|
||||
"@next/swc-win32-ia32-msvc": "13.1.5",
|
||||
"@next/swc-win32-x64-msvc": "13.1.5",
|
||||
"@next/env": "13.1.6",
|
||||
"@next/swc-android-arm-eabi": "13.1.6",
|
||||
"@next/swc-android-arm64": "13.1.6",
|
||||
"@next/swc-darwin-arm64": "13.1.6",
|
||||
"@next/swc-darwin-x64": "13.1.6",
|
||||
"@next/swc-freebsd-x64": "13.1.6",
|
||||
"@next/swc-linux-arm-gnueabihf": "13.1.6",
|
||||
"@next/swc-linux-arm64-gnu": "13.1.6",
|
||||
"@next/swc-linux-arm64-musl": "13.1.6",
|
||||
"@next/swc-linux-x64-gnu": "13.1.6",
|
||||
"@next/swc-linux-x64-musl": "13.1.6",
|
||||
"@next/swc-win32-arm64-msvc": "13.1.6",
|
||||
"@next/swc-win32-ia32-msvc": "13.1.6",
|
||||
"@next/swc-win32-x64-msvc": "13.1.6",
|
||||
"@swc/helpers": "0.4.14",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
"postcss": "8.4.14",
|
||||
@@ -5350,9 +5350,9 @@
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
|
||||
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||
},
|
||||
"tsutils": {
|
||||
"version": "3.21.0",
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@next/font": "13.1.5",
|
||||
"@next/font": "13.1.6",
|
||||
"eslint": "8.32.0",
|
||||
"eslint-config-next": "13.1.5",
|
||||
"next": "13.1.5",
|
||||
"eslint-config-next": "13.1.6",
|
||||
"next": "13.1.6",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.0.1",
|
||||
"version": "6.2.0",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Files } from './types';
|
||||
import type { Cron, Files } from './types';
|
||||
|
||||
/**
|
||||
* An Edge Functions output
|
||||
@@ -41,6 +41,9 @@ export class EdgeFunction {
|
||||
/** The regions where the edge function will be executed on */
|
||||
regions?: string | string[];
|
||||
|
||||
/** Cronjob definition for the edge function */
|
||||
cron?: Cron;
|
||||
|
||||
constructor(params: Omit<EdgeFunction, 'type'>) {
|
||||
this.type = 'EdgeFunction';
|
||||
this.name = params.name;
|
||||
@@ -50,5 +53,6 @@ export class EdgeFunction {
|
||||
this.envVarsInUse = params.envVarsInUse;
|
||||
this.assets = params.assets;
|
||||
this.regions = params.regions;
|
||||
this.cron = params.cron;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ export function getSpawnOptions(
|
||||
|
||||
export async function getNodeVersion(
|
||||
destPath: string,
|
||||
_nodeVersion?: string,
|
||||
nodeVersionFallback = process.env.VERCEL_PROJECT_SETTINGS_NODE_VERSION,
|
||||
config: Config = {},
|
||||
meta: Meta = {}
|
||||
): Promise<NodeVersion> {
|
||||
@@ -209,7 +209,7 @@ export async function getNodeVersion(
|
||||
return { ...latest, runtime: 'nodejs' };
|
||||
}
|
||||
const { packageJson } = await scanParentDirs(destPath, true);
|
||||
let { nodeVersion } = config;
|
||||
let nodeVersion = config.nodeVersion || nodeVersionFallback;
|
||||
let isAuto = true;
|
||||
if (packageJson?.engines?.node) {
|
||||
const { node } = packageJson.engines;
|
||||
|
||||
@@ -5,7 +5,7 @@ import minimatch from 'minimatch';
|
||||
import { readlink } from 'fs-extra';
|
||||
import { isSymbolicLink, isDirectory } from './fs/download';
|
||||
import streamToBuffer from './fs/stream-to-buffer';
|
||||
import type { Files, Config } from './types';
|
||||
import type { Files, Config, Cron } from './types';
|
||||
|
||||
interface Environment {
|
||||
[key: string]: string;
|
||||
@@ -25,6 +25,7 @@ export interface LambdaOptionsBase {
|
||||
supportsWrapper?: boolean;
|
||||
experimentalResponseStreaming?: boolean;
|
||||
operationType?: string;
|
||||
cron?: Cron;
|
||||
}
|
||||
|
||||
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
|
||||
@@ -62,6 +63,7 @@ export class Lambda {
|
||||
environment: Environment;
|
||||
allowQuery?: string[];
|
||||
regions?: string[];
|
||||
cron?: Cron;
|
||||
/**
|
||||
* @deprecated Use `await lambda.createZip()` instead.
|
||||
*/
|
||||
@@ -79,6 +81,7 @@ export class Lambda {
|
||||
environment = {},
|
||||
allowQuery,
|
||||
regions,
|
||||
cron,
|
||||
supportsMultiPayloads,
|
||||
supportsWrapper,
|
||||
experimentalResponseStreaming,
|
||||
@@ -132,6 +135,10 @@ export class Lambda {
|
||||
);
|
||||
}
|
||||
|
||||
if (cron !== undefined) {
|
||||
assert(typeof cron === 'string', '"cron" is not a string');
|
||||
}
|
||||
|
||||
this.type = 'Lambda';
|
||||
this.operationType = operationType;
|
||||
this.files = 'files' in opts ? opts.files : undefined;
|
||||
@@ -142,6 +149,7 @@ export class Lambda {
|
||||
this.environment = environment;
|
||||
this.allowQuery = allowQuery;
|
||||
this.regions = regions;
|
||||
this.cron = cron;
|
||||
this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
|
||||
this.supportsMultiPayloads = supportsMultiPayloads;
|
||||
this.supportsWrapper = supportsWrapper;
|
||||
@@ -220,7 +228,7 @@ export async function getLambdaOptionsFromFunction({
|
||||
sourceFile,
|
||||
config,
|
||||
}: GetLambdaOptionsFromFunctionOptions): Promise<
|
||||
Pick<LambdaOptions, 'memory' | 'maxDuration'>
|
||||
Pick<LambdaOptions, 'memory' | 'maxDuration' | 'cron'>
|
||||
> {
|
||||
if (config?.functions) {
|
||||
for (const [pattern, fn] of Object.entries(config.functions)) {
|
||||
@@ -228,6 +236,7 @@ export async function getLambdaOptionsFromFunction({
|
||||
return {
|
||||
memory: fn.memory,
|
||||
maxDuration: fn.maxDuration,
|
||||
cron: fn.cron,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@ export const functionsSchema = {
|
||||
type: 'string',
|
||||
maxLength: 256,
|
||||
},
|
||||
cron: {
|
||||
type: 'string',
|
||||
minLength: 9,
|
||||
maxLength: 256,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -319,6 +319,7 @@ export interface BuilderFunctions {
|
||||
runtime?: string;
|
||||
includeFiles?: string;
|
||||
excludeFiles?: string;
|
||||
cron?: Cron;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -410,6 +411,8 @@ export interface BuildResultBuildOutput {
|
||||
buildOutputPath: string;
|
||||
}
|
||||
|
||||
export type Cron = string;
|
||||
|
||||
/**
|
||||
* When a Builder implements `version: 2`, the `build()` function is expected
|
||||
* to return this type.
|
||||
|
||||
14
packages/build-utils/test/unit.test.ts
vendored
14
packages/build-utils/test/unit.test.ts
vendored
@@ -138,13 +138,25 @@ it('should ignore node version in vercel dev getNodeVersion()', async () => {
|
||||
).toHaveProperty('runtime', 'nodejs');
|
||||
});
|
||||
|
||||
it('should select project setting from config when no package.json is found', async () => {
|
||||
it('should select project setting from config when no package.json is found and fallback undefined', async () => {
|
||||
expect(
|
||||
await getNodeVersion('/tmp', undefined, { nodeVersion: '16.x' }, {})
|
||||
).toHaveProperty('range', '16.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('should select project setting from config when no package.json is found and fallback is null', async () => {
|
||||
expect(
|
||||
await getNodeVersion('/tmp', null as any, { nodeVersion: '16.x' }, {})
|
||||
).toHaveProperty('range', '16.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('should select project setting from fallback when no package.json is found', async () => {
|
||||
expect(await getNodeVersion('/tmp', '16.x')).toHaveProperty('range', '16.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('should prefer package.json engines over project setting from config and warn', async () => {
|
||||
expect(
|
||||
await getNodeVersion(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "28.14.1",
|
||||
"version": "28.15.1",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -41,16 +41,16 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/go": "2.3.0",
|
||||
"@vercel/hydrogen": "0.0.46",
|
||||
"@vercel/next": "3.3.20",
|
||||
"@vercel/node": "2.8.17",
|
||||
"@vercel/python": "3.1.42",
|
||||
"@vercel/redwood": "1.0.53",
|
||||
"@vercel/remix": "1.2.9",
|
||||
"@vercel/ruby": "1.3.58",
|
||||
"@vercel/static-build": "1.3.1"
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/go": "2.3.2",
|
||||
"@vercel/hydrogen": "0.0.48",
|
||||
"@vercel/next": "3.4.0",
|
||||
"@vercel/node": "2.9.1",
|
||||
"@vercel/python": "3.1.44",
|
||||
"@vercel/redwood": "1.1.0",
|
||||
"@vercel/remix": "1.2.11",
|
||||
"@vercel/ruby": "1.3.60",
|
||||
"@vercel/static-build": "1.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
@@ -93,10 +93,10 @@
|
||||
"@types/which": "1.3.2",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel/client": "12.3.4",
|
||||
"@vercel/client": "12.3.6",
|
||||
"@vercel/error-utils": "1.0.8",
|
||||
"@vercel/frameworks": "1.3.0",
|
||||
"@vercel/fs-detectors": "3.7.7",
|
||||
"@vercel/fs-detectors": "3.7.9",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
|
||||
@@ -212,10 +212,15 @@ export default async function main(client: Client): Promise<number> {
|
||||
}
|
||||
|
||||
// Delete output directory from potential previous build
|
||||
const defaultOutputDir = join(cwd, OUTPUT_DIR);
|
||||
const outputDir = argv['--output']
|
||||
? resolve(argv['--output'])
|
||||
: join(cwd, OUTPUT_DIR);
|
||||
await fs.remove(outputDir);
|
||||
: defaultOutputDir;
|
||||
await Promise.all([
|
||||
fs.remove(outputDir),
|
||||
// Also delete `.vercel/output`, in case the script is targeting Build Output API directly
|
||||
outputDir !== defaultOutputDir ? fs.remove(defaultOutputDir) : undefined,
|
||||
]);
|
||||
|
||||
const buildsJson: BuildsManifest = {
|
||||
'//': 'This file was generated by the `vercel build` command. It is not part of the Build Output API.',
|
||||
@@ -471,6 +476,22 @@ async function doBuild(
|
||||
try {
|
||||
const { builder, pkg: builderPkg } = builderWithPkg;
|
||||
|
||||
for (const key of [
|
||||
'buildCommand',
|
||||
'installCommand',
|
||||
'outputDirectory',
|
||||
'nodeVersion',
|
||||
] as const) {
|
||||
const value = projectSettings[key];
|
||||
if (typeof value === 'string') {
|
||||
const envKey =
|
||||
`VERCEL_PROJECT_SETTINGS_` +
|
||||
key.replace(/[A-Z]/g, letter => `_${letter}`).toUpperCase();
|
||||
process.env[envKey] = value;
|
||||
output.debug(`Setting env ${envKey} to "${value}"`);
|
||||
}
|
||||
}
|
||||
|
||||
const buildConfig: Config = isZeroConfig
|
||||
? {
|
||||
outputDirectory: projectSettings.outputDirectory ?? undefined,
|
||||
|
||||
46
packages/cli/src/util/build/merge.ts
Normal file
46
packages/cli/src/util/build/merge.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { join } from 'path';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import { stat, move, remove, rmdir, readdir } from 'fs-extra';
|
||||
import type { Stats } from 'fs-extra';
|
||||
|
||||
/**
|
||||
* Merge a directory into another directory. A `move` file operation is preferred,
|
||||
* falling back to a recursive `move` of contents within the source directory.
|
||||
*/
|
||||
export async function merge(source: string, destination: string) {
|
||||
const destStat: Stats | NodeJS.ErrnoException = await stat(destination).catch(
|
||||
err => err
|
||||
);
|
||||
if (isErrnoException(destStat)) {
|
||||
if (destStat.code === 'ENOENT') {
|
||||
// Destination does not exist, so move directly
|
||||
await move(source, destination);
|
||||
return;
|
||||
}
|
||||
// Some other kind of error, bail
|
||||
throw destStat;
|
||||
} else if (destStat.isDirectory()) {
|
||||
// Destination is already a directory, so merge contents recursively
|
||||
const contents: string[] | NodeJS.ErrnoException = await readdir(
|
||||
source
|
||||
).catch(err => err);
|
||||
if (isErrnoException(contents)) {
|
||||
// If source is not a directory, then fall through to rm + move
|
||||
if (contents.code !== 'ENOTDIR') {
|
||||
// Any other error then bail
|
||||
throw contents;
|
||||
}
|
||||
} else {
|
||||
await Promise.all(
|
||||
contents.map(name => merge(join(source, name), join(destination, name)))
|
||||
);
|
||||
// Source should be empty at this point
|
||||
await rmdir(source);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Destination is not a directory, or dest is a dir + source is not, so overwrite
|
||||
await remove(destination);
|
||||
await move(source, destination);
|
||||
}
|
||||
@@ -54,8 +54,12 @@ export async function setMonorepoDefaultSettings(
|
||||
)} monorepo manager. Attempting to assign default settings.`
|
||||
);
|
||||
|
||||
setCommand('buildCommand', commands.buildCommand);
|
||||
setCommand('installCommand', commands.installCommand);
|
||||
if (commands.buildCommand) {
|
||||
setCommand('buildCommand', commands.buildCommand);
|
||||
}
|
||||
if (commands.installCommand) {
|
||||
setCommand('installCommand', commands.installCommand);
|
||||
}
|
||||
if (commands.commandForIgnoringBuildStep) {
|
||||
setCommand(
|
||||
'commandForIgnoringBuildStep',
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
Builder,
|
||||
BuildResultV2,
|
||||
BuildResultV3,
|
||||
Cron,
|
||||
File,
|
||||
FileFsRef,
|
||||
BuilderV2,
|
||||
@@ -28,6 +29,7 @@ import {
|
||||
normalizePath,
|
||||
} from '@vercel/build-utils';
|
||||
import pipe from 'promisepipe';
|
||||
import { merge } from './merge';
|
||||
import { unzip } from './unzip';
|
||||
import { VERCEL_DIR } from '../projects/link';
|
||||
import { fileNameSymbol, VercelConfig } from '@vercel/client';
|
||||
@@ -39,6 +41,7 @@ export const OUTPUT_DIR = join(VERCEL_DIR, 'output');
|
||||
* An entry in the "functions" object in `vercel.json`.
|
||||
*/
|
||||
interface FunctionConfiguration {
|
||||
cron?: Cron;
|
||||
memory?: number;
|
||||
maxDuration?: number;
|
||||
}
|
||||
@@ -369,12 +372,14 @@ async function writeLambda(
|
||||
throw new Error('Malformed `Lambda` - no "files" present');
|
||||
}
|
||||
|
||||
const cron = functionConfiguration?.cron ?? lambda.cron;
|
||||
const memory = functionConfiguration?.memory ?? lambda.memory;
|
||||
const maxDuration = functionConfiguration?.maxDuration ?? lambda.maxDuration;
|
||||
|
||||
const config = {
|
||||
...lambda,
|
||||
handler: normalizePath(lambda.handler),
|
||||
cron,
|
||||
memory,
|
||||
maxDuration,
|
||||
type: undefined,
|
||||
@@ -426,7 +431,7 @@ async function mergeBuilderOutput(
|
||||
// so no need to do anything
|
||||
return;
|
||||
}
|
||||
await fs.copy(buildResult.buildOutputPath, outputDir);
|
||||
await merge(buildResult.buildOutputPath, outputDir);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { lookup as lookupMimeType } from 'mime-types';
|
||||
import { contentType } from 'mime-types';
|
||||
|
||||
export default function getMimeType(fileName: string) {
|
||||
return lookupMimeType(fileName) || 'application/octet-stream';
|
||||
return contentType(fileName) || 'application/octet-stream';
|
||||
}
|
||||
|
||||
@@ -1129,10 +1129,10 @@ export default class DevServer {
|
||||
});
|
||||
body = `${json}\n`;
|
||||
} else if (accept.includes('html')) {
|
||||
res.setHeader('content-type', 'text/html');
|
||||
res.setHeader('content-type', 'text/html; charset=utf-8');
|
||||
body = redirectTemplate({ location, statusCode });
|
||||
} else {
|
||||
res.setHeader('content-type', 'text/plain');
|
||||
res.setHeader('content-type', 'text/plain; charset=utf-8');
|
||||
body = `Redirecting to ${location} (${statusCode})\n`;
|
||||
}
|
||||
res.end(body);
|
||||
|
||||
@@ -686,6 +686,7 @@ test('[vercel dev] should support static files with zero config', async () => {
|
||||
expect(body).toEqual('bye:user');
|
||||
|
||||
res = await fetch(`http://localhost:${port}/`);
|
||||
expect(res.headers.get('content-type')).toBe('text/html; charset=utf-8');
|
||||
body = await res.text();
|
||||
expect(body.startsWith('<h1>goodbye world</h1>')).toBeTruthy();
|
||||
} finally {
|
||||
|
||||
1
packages/cli/test/fixtures/unit/commands/build/project-settings-env-vars/.gitignore
vendored
Normal file
1
packages/cli/test/fixtures/unit/commands/build/project-settings-env-vars/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
out
|
||||
11
packages/cli/test/fixtures/unit/commands/build/project-settings-env-vars/.vercel/project.json
vendored
Normal file
11
packages/cli/test/fixtures/unit/commands/build/project-settings-env-vars/.vercel/project.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"orgId": ".",
|
||||
"projectId": ".",
|
||||
"settings": {
|
||||
"nodeVersion": "18.x",
|
||||
"buildCommand": "node build.cjs",
|
||||
"installCommand": "",
|
||||
"outputDirectory": "out",
|
||||
"framework": null
|
||||
}
|
||||
}
|
||||
4
packages/cli/test/fixtures/unit/commands/build/project-settings-env-vars/build.cjs
vendored
Normal file
4
packages/cli/test/fixtures/unit/commands/build/project-settings-env-vars/build.cjs
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
const fs = require('fs');
|
||||
const { join } = require('path');
|
||||
fs.mkdirSync(join(__dirname , 'out'), { recursive: true });
|
||||
fs.writeFileSync(join(__dirname , 'out', 'env.json'), JSON.stringify(process.env));
|
||||
7
packages/cli/test/fixtures/unit/commands/build/with-cron/.vercel/project.json
vendored
Normal file
7
packages/cli/test/fixtures/unit/commands/build/with-cron/.vercel/project.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"orgId": ".",
|
||||
"projectId": ".",
|
||||
"settings": {
|
||||
"framework": null
|
||||
}
|
||||
}
|
||||
17
packages/cli/test/fixtures/unit/commands/build/with-cron/api/edge.js
vendored
Normal file
17
packages/cli/test/fixtures/unit/commands/build/with-cron/api/edge.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export const config = {
|
||||
runtime: 'edge',
|
||||
cron: '* * * * *',
|
||||
};
|
||||
|
||||
export default async function edge(request, event) {
|
||||
const requestBody = await request.text();
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
headerContentType: request.headers.get('content-type'),
|
||||
url: request.url,
|
||||
method: request.method,
|
||||
body: requestBody,
|
||||
})
|
||||
);
|
||||
}
|
||||
3
packages/cli/test/fixtures/unit/commands/build/with-cron/api/overwrite/edge.js
vendored
Normal file
3
packages/cli/test/fixtures/unit/commands/build/with-cron/api/overwrite/edge.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function (req, res) {
|
||||
res.json('hello from the edge');
|
||||
}
|
||||
3
packages/cli/test/fixtures/unit/commands/build/with-cron/api/overwrite/serverless.js
vendored
Normal file
3
packages/cli/test/fixtures/unit/commands/build/with-cron/api/overwrite/serverless.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function (req, res) {
|
||||
res.end('serverless says hello');
|
||||
}
|
||||
7
packages/cli/test/fixtures/unit/commands/build/with-cron/api/serverless.js
vendored
Normal file
7
packages/cli/test/fixtures/unit/commands/build/with-cron/api/serverless.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function (req, res) {
|
||||
res.json({ memory: parseInt(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE) });
|
||||
}
|
||||
|
||||
export const config = {
|
||||
cron: '* * * * *',
|
||||
};
|
||||
1
packages/cli/test/fixtures/unit/commands/build/with-cron/index.html
vendored
Normal file
1
packages/cli/test/fixtures/unit/commands/build/with-cron/index.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<h1>Vercel</h1>
|
||||
10
packages/cli/test/fixtures/unit/commands/build/with-cron/vercel.json
vendored
Normal file
10
packages/cli/test/fixtures/unit/commands/build/with-cron/vercel.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"functions": {
|
||||
"api/overwrite/serverless.js": {
|
||||
"cron": "0 10-20 * * *"
|
||||
},
|
||||
"api/overwrite/edge.js": {
|
||||
"cron": "10 * * * *"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1025,6 +1025,27 @@ describe('build', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('should set VERCEL_PROJECT_SETTINGS_ environment variables', async () => {
|
||||
const cwd = fixture('project-settings-env-vars');
|
||||
const output = join(cwd, '.vercel/output');
|
||||
try {
|
||||
process.chdir(cwd);
|
||||
const exitCode = await build(client);
|
||||
expect(exitCode).toEqual(0);
|
||||
|
||||
const contents = await fs.readJSON(join(output, 'static/env.json'));
|
||||
expect(contents).toMatchObject({
|
||||
VERCEL_PROJECT_SETTINGS_BUILD_COMMAND: `node build.cjs`,
|
||||
VERCEL_PROJECT_SETTINGS_INSTALL_COMMAND: '',
|
||||
VERCEL_PROJECT_SETTINGS_OUTPUT_DIRECTORY: 'out',
|
||||
VERCEL_PROJECT_SETTINGS_NODE_VERSION: '18.x',
|
||||
});
|
||||
} finally {
|
||||
process.chdir(originalCwd);
|
||||
delete process.env.__VERCEL_BUILD_RUNNING;
|
||||
}
|
||||
});
|
||||
|
||||
it('should apply "images" configuration from `vercel.json`', async () => {
|
||||
const cwd = fixture('images');
|
||||
const output = join(cwd, '.vercel/output');
|
||||
@@ -1081,6 +1102,40 @@ describe('build', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('should include crons property in build output', async () => {
|
||||
const cwd = fixture('with-cron');
|
||||
const output = join(cwd, '.vercel', 'output', 'functions', 'api');
|
||||
|
||||
try {
|
||||
process.chdir(cwd);
|
||||
const exitCode = await build(client);
|
||||
expect(exitCode).toBe(0);
|
||||
|
||||
const edge = await fs.readJSON(
|
||||
join(output, 'edge.func', '.vc-config.json')
|
||||
);
|
||||
expect(edge).toHaveProperty('cron', '* * * * *');
|
||||
|
||||
const serverless = await fs.readJSON(
|
||||
join(output, 'serverless.func', '.vc-config.json')
|
||||
);
|
||||
expect(serverless).toHaveProperty('cron', '* * * * *');
|
||||
|
||||
const overwriteServerless = await fs.readJSON(
|
||||
join(output, 'overwrite', 'serverless.func', '.vc-config.json')
|
||||
);
|
||||
expect(overwriteServerless).toHaveProperty('cron', '0 10-20 * * *');
|
||||
|
||||
const overwriteEdge = await fs.readJSON(
|
||||
join(output, 'overwrite', 'edge.func', '.vc-config.json')
|
||||
);
|
||||
expect(overwriteEdge).toHaveProperty('cron', '10 * * * *');
|
||||
} finally {
|
||||
process.chdir(originalCwd);
|
||||
delete process.env.__VERCEL_BUILD_RUNNING;
|
||||
}
|
||||
});
|
||||
|
||||
describe('should find packages with different main/module/browser keys', function () {
|
||||
let output: string;
|
||||
|
||||
|
||||
71
packages/cli/test/unit/util/build/merge.test.ts
Normal file
71
packages/cli/test/unit/util/build/merge.test.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import { tmpdir } from 'os';
|
||||
import { join } from 'path';
|
||||
import { writeFile, readdir, mkdirp, stat, remove, readFile } from 'fs-extra';
|
||||
import { merge } from '../../../../src/util/build/merge';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
|
||||
describe('merge()', () => {
|
||||
it('should move source to non-existent destination', async () => {
|
||||
const source = join(tmpdir(), 'src');
|
||||
const dest = join(tmpdir(), 'dest');
|
||||
try {
|
||||
await mkdirp(source);
|
||||
await writeFile(join(source, 'a.txt'), 'a');
|
||||
await merge(source, dest);
|
||||
const destContents = await readdir(dest);
|
||||
expect(destContents.sort()).toEqual(['a.txt']);
|
||||
const sourceStat: Error = await stat(source).then(
|
||||
() => {},
|
||||
err => err
|
||||
);
|
||||
expect(isErrnoException(sourceStat) && sourceStat.code).toEqual('ENOENT');
|
||||
} finally {
|
||||
await Promise.all([source, dest].map(p => remove(p)));
|
||||
}
|
||||
});
|
||||
|
||||
it('should merge source into existing destination', async () => {
|
||||
const source = join(tmpdir(), 'src');
|
||||
const dest = join(tmpdir(), 'dest');
|
||||
try {
|
||||
await mkdirp(source);
|
||||
await mkdirp(dest);
|
||||
await writeFile(join(source, 'a.txt'), 'a');
|
||||
await writeFile(join(source, 'c.txt'), 'c');
|
||||
await writeFile(join(dest, 'b.txt'), 'b');
|
||||
await writeFile(join(dest, 'c.txt'), 'original');
|
||||
await merge(source, dest);
|
||||
const destContents = await readdir(dest);
|
||||
expect(destContents.sort()).toEqual(['a.txt', 'b.txt', 'c.txt']);
|
||||
const sourceStat: Error = await stat(source).then(
|
||||
() => {},
|
||||
err => err
|
||||
);
|
||||
expect(isErrnoException(sourceStat) && sourceStat.code).toEqual('ENOENT');
|
||||
expect(await readFile(join(dest, 'c.txt'), 'utf8')).toEqual('c');
|
||||
} finally {
|
||||
await Promise.all([source, dest].map(p => remove(p)));
|
||||
}
|
||||
});
|
||||
|
||||
it('should overwrite dest directory when source is a file', async () => {
|
||||
const source = join(tmpdir(), 'src');
|
||||
const dest = join(tmpdir(), 'dest');
|
||||
try {
|
||||
await mkdirp(source);
|
||||
await mkdirp(join(dest, 'a'));
|
||||
await writeFile(join(source, 'a'), 'a');
|
||||
await merge(source, dest);
|
||||
const destContents = await readdir(dest);
|
||||
expect(destContents.sort()).toEqual(['a']);
|
||||
const sourceStat: Error = await stat(source).then(
|
||||
() => {},
|
||||
err => err
|
||||
);
|
||||
expect(isErrnoException(sourceStat) && sourceStat.code).toEqual('ENOENT');
|
||||
expect(await readFile(join(dest, 'a'), 'utf8')).toEqual('a');
|
||||
} finally {
|
||||
await Promise.all([source, dest].map(p => remove(p)));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/client",
|
||||
"version": "12.3.4",
|
||||
"version": "12.3.6",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"homepage": "https://vercel.com",
|
||||
@@ -43,7 +43,7 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@zeit/fetch": "5.2.0",
|
||||
"async-retry": "1.2.3",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/fs-detectors",
|
||||
"version": "3.7.7",
|
||||
"version": "3.7.9",
|
||||
"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.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"typescript": "4.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,19 @@ export class MissingBuildTarget extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
type MonorepoDefaultSettings = {
|
||||
buildCommand?: string | null;
|
||||
installCommand?: string | null;
|
||||
commandForIgnoringBuildStep?: string;
|
||||
monorepoManager: string;
|
||||
} | null;
|
||||
|
||||
export async function getMonorepoDefaultSettings(
|
||||
projectName: string,
|
||||
projectPath: string,
|
||||
relativeToRoot: string,
|
||||
detectorFilesystem: DetectorFilesystem
|
||||
) {
|
||||
): Promise<MonorepoDefaultSettings> {
|
||||
const [monorepoManager, packageManager] = await Promise.all([
|
||||
detectFramework({
|
||||
fs: detectorFilesystem,
|
||||
@@ -64,14 +71,27 @@ export async function getMonorepoDefaultSettings(
|
||||
throw new MissingBuildPipeline();
|
||||
}
|
||||
|
||||
if (projectPath === '/') {
|
||||
return {
|
||||
monorepoManager: 'turbo',
|
||||
buildCommand: 'npx turbo run build',
|
||||
installCommand: packageManager ? `${packageManager} install` : null,
|
||||
commandForIgnoringBuildStep: 'npx turbo-ignore',
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
monorepoManager: 'turbo',
|
||||
buildCommand: `cd ${relativeToRoot} && npx turbo run build --filter={${projectPath}}...`,
|
||||
buildCommand: projectPath
|
||||
? `cd ${relativeToRoot} && npx turbo run build --filter={${projectPath}}...`
|
||||
: null,
|
||||
installCommand:
|
||||
packageManager === 'npm'
|
||||
? `${packageManager} install --prefix=${relativeToRoot}`
|
||||
: `${packageManager} install`,
|
||||
commandForIgnoringBuildStep: `npx turbo-ignore`,
|
||||
: packageManager
|
||||
? `${packageManager} install`
|
||||
: null,
|
||||
commandForIgnoringBuildStep: 'npx turbo-ignore',
|
||||
};
|
||||
} else if (monorepoManager === 'nx') {
|
||||
// No ENOENT handling required here since conditional wouldn't be `true` unless `nx.json` was found.
|
||||
@@ -111,13 +131,24 @@ export async function getMonorepoDefaultSettings(
|
||||
}
|
||||
}
|
||||
|
||||
if (projectPath === '/') {
|
||||
return {
|
||||
monorepoManager: 'nx',
|
||||
buildCommand: 'npx nx build',
|
||||
installCommand: packageManager ? `${packageManager} install` : null,
|
||||
};
|
||||
}
|
||||
return {
|
||||
monorepoManager: 'nx',
|
||||
buildCommand: `cd ${relativeToRoot} && npx nx build ${projectName}`,
|
||||
buildCommand: projectName
|
||||
? `cd ${relativeToRoot} && npx nx build ${projectName}`
|
||||
: null,
|
||||
installCommand:
|
||||
packageManager === 'npm'
|
||||
? `${packageManager} install --prefix=${relativeToRoot}`
|
||||
: `${packageManager} install`,
|
||||
: packageManager
|
||||
? `${packageManager} install`
|
||||
: null,
|
||||
};
|
||||
}
|
||||
// TODO (@Ethan-Arrowood) - Revisit rush support when we can test it better
|
||||
|
||||
16
packages/fs-detectors/test/fixtures/get-monorepo-default-settings/turbo-npm-root-proj/package-lock.json
generated
vendored
Normal file
16
packages/fs-detectors/test/fixtures/get-monorepo-default-settings/turbo-npm-root-proj/package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "app-root-proj",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "app-root-proj",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"next": "1.2.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"next": "1.2.3"
|
||||
}
|
||||
}
|
||||
19
packages/fs-detectors/test/fixtures/get-monorepo-default-settings/turbo-npm-root-proj/turbo.json
vendored
Normal file
19
packages/fs-detectors/test/fixtures/get-monorepo-default-settings/turbo-npm-root-proj/turbo.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"$schema": "https://turborepo.org/schema.json",
|
||||
"pipeline": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": [".next/**"]
|
||||
},
|
||||
"test": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": []
|
||||
},
|
||||
"lint": {
|
||||
"outputs": []
|
||||
},
|
||||
"dev": {
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,41 +26,56 @@ describe('getMonorepoDefaultSettings', () => {
|
||||
});
|
||||
|
||||
test.each([
|
||||
['turbo', 'turbo', false, 'app-14'],
|
||||
['turbo-package-config', 'turbo', false, 'app-13'],
|
||||
['turbo-npm', 'turbo', true, 'app-15'],
|
||||
['nx', 'nx', false, 'app-12'],
|
||||
['nx-package-config', 'nx', false, 'app-11'],
|
||||
['nx-project-and-package-config-1', 'nx', false, 'app-10'],
|
||||
['nx-project-and-package-config-2', 'nx', false, 'app-9'],
|
||||
['nx-project-config', 'nx', false, 'app-8'],
|
||||
])('fixture %s', async (fixture, expectedResultKey, isNpm, packageName) => {
|
||||
const expectedResultMap: Record<string, Record<string, string>> = {
|
||||
turbo: {
|
||||
monorepoManager: 'turbo',
|
||||
buildCommand:
|
||||
'cd ../.. && npx turbo run build --filter={packages/app-1}...',
|
||||
installCommand: isNpm ? 'npm install --prefix=../..' : 'yarn install',
|
||||
commandForIgnoringBuildStep: 'npx turbo-ignore',
|
||||
},
|
||||
nx: {
|
||||
monorepoManager: 'nx',
|
||||
buildCommand: `cd ../.. && npx nx build ${packageName}`,
|
||||
installCommand: 'yarn install',
|
||||
},
|
||||
};
|
||||
['turbo', 'turbo', false, 'app-14', false],
|
||||
['turbo-package-config', 'turbo', false, 'app-13', false],
|
||||
['turbo-npm', 'turbo', true, 'app-15', false],
|
||||
['turbo-npm-root-proj', 'turbo', true, 'app-root-proj', true],
|
||||
['nx', 'nx', false, 'app-12', false],
|
||||
['nx-package-config', 'nx', false, 'app-11', false],
|
||||
['nx-project-and-package-config-1', 'nx', false, 'app-10', false],
|
||||
['nx-project-and-package-config-2', 'nx', false, 'app-9', false],
|
||||
['nx-project-config', 'nx', false, 'app-8', false],
|
||||
])(
|
||||
'fixture %s',
|
||||
async (fixture, expectedResultKey, isNpm, packageName, isRoot) => {
|
||||
const expectedResultMap: Record<string, Record<string, string>> = {
|
||||
turbo: {
|
||||
monorepoManager: 'turbo',
|
||||
buildCommand: isRoot
|
||||
? 'npx turbo run build'
|
||||
: 'cd ../.. && npx turbo run build --filter={packages/app-1}...',
|
||||
installCommand:
|
||||
isNpm && isRoot
|
||||
? 'npm install'
|
||||
: isNpm
|
||||
? 'npm install --prefix=../..'
|
||||
: 'yarn install',
|
||||
commandForIgnoringBuildStep: 'npx turbo-ignore',
|
||||
},
|
||||
nx: {
|
||||
monorepoManager: 'nx',
|
||||
buildCommand: `cd ../.. && npx nx build ${packageName}`,
|
||||
installCommand: 'yarn install',
|
||||
},
|
||||
};
|
||||
|
||||
const ffs = new FixtureFilesystem(
|
||||
path.join(__dirname, 'fixtures', 'get-monorepo-default-settings', fixture)
|
||||
);
|
||||
const result = await getMonorepoDefaultSettings(
|
||||
packageName,
|
||||
'packages/app-1',
|
||||
'../..',
|
||||
ffs
|
||||
);
|
||||
expect(result).toStrictEqual(expectedResultMap[expectedResultKey]);
|
||||
});
|
||||
const ffs = new FixtureFilesystem(
|
||||
path.join(
|
||||
__dirname,
|
||||
'fixtures',
|
||||
'get-monorepo-default-settings',
|
||||
fixture
|
||||
)
|
||||
);
|
||||
const result = await getMonorepoDefaultSettings(
|
||||
packageName,
|
||||
isRoot ? '/' : 'packages/app-1',
|
||||
isRoot ? '/' : '../..',
|
||||
ffs
|
||||
);
|
||||
expect(result).toStrictEqual(expectedResultMap[expectedResultKey]);
|
||||
}
|
||||
);
|
||||
|
||||
test('returns null when neither nx nor turbo is detected', async () => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'monorepo-test-'));
|
||||
|
||||
@@ -1,28 +1,15 @@
|
||||
import path from 'path';
|
||||
|
||||
import type { GatsbyNode } from 'gatsby';
|
||||
|
||||
// this gets built separately, so import from "dist" instead of "src"
|
||||
import { generateVercelBuildOutputAPI3Output } from './dist';
|
||||
|
||||
export const pluginOptionsSchema: GatsbyNode['pluginOptionsSchema'] = ({
|
||||
Joi,
|
||||
export const onPostBuild: GatsbyNode['onPostBuild'] = async ({
|
||||
pathPrefix,
|
||||
store,
|
||||
}) => {
|
||||
return Joi.object({
|
||||
exportPath: Joi.string().optional(),
|
||||
});
|
||||
};
|
||||
|
||||
export const onPostBuild: GatsbyNode['onPostBuild'] = async (
|
||||
{ store },
|
||||
pluginOptions
|
||||
) => {
|
||||
// validated by `pluginOptionSchema`
|
||||
const exportPath = (pluginOptions?.exportPath ??
|
||||
path.join('.vercel', 'output', 'config.json')) as string;
|
||||
|
||||
await generateVercelBuildOutputAPI3Output({
|
||||
exportPath,
|
||||
pathPrefix,
|
||||
// validated by `pluginOptionSchema`
|
||||
gatsbyStoreState: store.getState(),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/gatsby-plugin-vercel-builder",
|
||||
"version": "1.0.3",
|
||||
"version": "1.1.1",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -14,8 +14,8 @@
|
||||
"build:src": "tsc -p tsconfig.src.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/node": "2.8.17",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/node": "2.9.1",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"ajv": "8.12.0",
|
||||
"esbuild": "0.14.47",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { join } from 'path';
|
||||
|
||||
import { getNodeVersion } from '@vercel/build-utils';
|
||||
import { build } from 'esbuild';
|
||||
import {
|
||||
@@ -10,7 +9,6 @@ import {
|
||||
writeFileSync,
|
||||
ensureFileSync,
|
||||
} from 'fs-extra';
|
||||
|
||||
import type {
|
||||
NodejsServerlessFunctionConfig,
|
||||
PrerenderFunctionConfig,
|
||||
@@ -29,7 +27,7 @@ export const writeHandler = async ({
|
||||
return await build({
|
||||
entryPoints: [handlerFile],
|
||||
loader: { '.ts': 'ts' },
|
||||
outfile: join(outDir, './index.js'),
|
||||
outfile: join(outDir, 'index.js'),
|
||||
format: 'cjs',
|
||||
target: `node${major}`,
|
||||
platform: 'node',
|
||||
@@ -60,7 +58,8 @@ export const writeVCConfig = async ({
|
||||
shouldAddHelpers: true,
|
||||
};
|
||||
|
||||
return writeJson(`${functionDir}/.vc-config.json`, config);
|
||||
const configPath = join(functionDir, '.vc-config.json');
|
||||
await writeJson(configPath, config);
|
||||
};
|
||||
|
||||
export const writePrerenderConfig = (outputPath: string, group: number) => {
|
||||
@@ -88,10 +87,6 @@ export async function copyFunctionLibs({
|
||||
src: join('.cache', 'page-ssr'),
|
||||
dest: join(functionDir, '.cache', 'page-ssr'),
|
||||
},
|
||||
// {
|
||||
// src: join(functionDir, '.cache', 'query-engine', 'assets'),
|
||||
// dest: join(functionDir, 'assets'),
|
||||
// },
|
||||
{
|
||||
src: join('.cache', 'data', 'datastore'),
|
||||
dest: join(functionDir, '.cache', 'data', 'datastore'),
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { join } from 'path';
|
||||
import { copy, ensureDir } from 'fs-extra';
|
||||
import { join, dirname } from 'path';
|
||||
import { copy, move, ensureDir } from 'fs-extra';
|
||||
|
||||
export async function createStaticDir(prefix?: string) {
|
||||
const publicDir = join(process.cwd(), 'public');
|
||||
const targetDir = join(
|
||||
process.cwd(),
|
||||
'.vercel',
|
||||
@@ -9,6 +10,14 @@ export async function createStaticDir(prefix?: string) {
|
||||
'static',
|
||||
prefix ?? ''
|
||||
);
|
||||
await ensureDir(targetDir);
|
||||
await copy(join(process.cwd(), 'public'), targetDir);
|
||||
await ensureDir(dirname(targetDir));
|
||||
try {
|
||||
await move(publicDir, targetDir);
|
||||
} catch (err: any) {
|
||||
console.error(
|
||||
`Failed to move "public" dir from "${publicDir}" to "${targetDir}". Copying instead.`,
|
||||
err
|
||||
);
|
||||
await copy(publicDir, targetDir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,17 +9,17 @@ import { createStaticDir } from './helpers/static';
|
||||
import type { Config } from './types';
|
||||
|
||||
export interface GenerateVercelBuildOutputAPI3OutputOptions {
|
||||
exportPath: string;
|
||||
pathPrefix: string;
|
||||
gatsbyStoreState: {
|
||||
pages: Map<string, unknown>;
|
||||
redirects: unknown;
|
||||
functions: unknown;
|
||||
config: unknown;
|
||||
};
|
||||
[x: string]: unknown;
|
||||
}
|
||||
|
||||
export async function generateVercelBuildOutputAPI3Output({
|
||||
exportPath,
|
||||
pathPrefix,
|
||||
gatsbyStoreState,
|
||||
}: GenerateVercelBuildOutputAPI3OutputOptions) {
|
||||
const state = {
|
||||
@@ -38,18 +38,21 @@ export async function generateVercelBuildOutputAPI3Output({
|
||||
.map(p => p[1])
|
||||
.filter(page => page.mode === 'SSR' || page.mode === 'DSG');
|
||||
|
||||
const ops: Promise<void>[] = [createStaticDir(gatsbyConfig.pathPrefix)];
|
||||
const ops: Promise<void>[] = [];
|
||||
|
||||
if (functions.length > 0) {
|
||||
ops.push(createAPIRoutes(functions, gatsbyConfig.pathPrefix));
|
||||
ops.push(createAPIRoutes(functions, pathPrefix));
|
||||
}
|
||||
|
||||
if (ssrRoutes.length > 0) {
|
||||
ops.push(createServerlessFunctions(ssrRoutes, gatsbyConfig.pathPrefix));
|
||||
ops.push(createServerlessFunctions(ssrRoutes, pathPrefix));
|
||||
}
|
||||
|
||||
await Promise.all(ops);
|
||||
|
||||
// "static" directory needs to happen last since it moves "public"
|
||||
await createStaticDir(pathPrefix);
|
||||
|
||||
let trailingSlash: boolean | undefined = undefined;
|
||||
if (gatsbyConfig.trailingSlash === 'always') {
|
||||
trailingSlash = true;
|
||||
@@ -71,7 +74,7 @@ export async function generateVercelBuildOutputAPI3Output({
|
||||
routes: routes || undefined,
|
||||
};
|
||||
|
||||
await writeJson(exportPath, config);
|
||||
await writeJson('.vercel/output/config.json', config);
|
||||
console.log('Vercel output has been generated');
|
||||
} else {
|
||||
throw new Error(
|
||||
|
||||
@@ -55,10 +55,7 @@ const GatsbyRedirectSchema: JSONSchemaType<GatsbyRedirect> = {
|
||||
required: ['fromPath', 'toPath'],
|
||||
} as const;
|
||||
|
||||
export type GatsbyConfig = Pick<
|
||||
IGatsbyConfig,
|
||||
'trailingSlash' | 'assetPrefix' | 'pathPrefix'
|
||||
>;
|
||||
export type GatsbyConfig = Pick<IGatsbyConfig, 'trailingSlash'>;
|
||||
|
||||
const GatsbyConfigSchema: JSONSchemaType<GatsbyConfig> = {
|
||||
type: 'object',
|
||||
@@ -68,14 +65,6 @@ const GatsbyConfigSchema: JSONSchemaType<GatsbyConfig> = {
|
||||
enum: ['always', 'never', 'ignore', 'legacy'],
|
||||
nullable: true,
|
||||
},
|
||||
assetPrefix: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
pathPrefix: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/go",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.2",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
|
||||
@@ -36,7 +36,7 @@
|
||||
"@types/node": "14.18.33",
|
||||
"@types/node-fetch": "^2.3.0",
|
||||
"@types/tar": "^4.0.0",
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"async-retry": "1.3.1",
|
||||
"execa": "^1.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/hydrogen",
|
||||
"version": "0.0.46",
|
||||
"version": "0.0.48",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -21,8 +21,8 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/static-config": "2.0.11",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/static-config": "2.0.12",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"ts-morph": "12.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/next",
|
||||
"version": "3.3.20",
|
||||
"version": "3.4.0",
|
||||
"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.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/nft": "0.22.5",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"async-sema": "3.0.1",
|
||||
|
||||
@@ -873,6 +873,7 @@ export async function serverBuild({
|
||||
runtime: nodeVersion.runtime,
|
||||
maxDuration: group.maxDuration,
|
||||
isStreaming: group.isStreaming,
|
||||
cron: group.cron,
|
||||
});
|
||||
|
||||
for (const page of group.pages) {
|
||||
@@ -967,6 +968,7 @@ export async function serverBuild({
|
||||
});
|
||||
|
||||
const middleware = await getMiddlewareBundle({
|
||||
config,
|
||||
entryPath,
|
||||
outputDirectory,
|
||||
routesManifest,
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
NodejsLambda,
|
||||
EdgeFunction,
|
||||
Images,
|
||||
Cron,
|
||||
} from '@vercel/build-utils';
|
||||
import { NodeFileTraceReasons } from '@vercel/nft';
|
||||
import type {
|
||||
@@ -1308,6 +1309,7 @@ export function addLocaleOrDefault(
|
||||
export type LambdaGroup = {
|
||||
pages: string[];
|
||||
memory?: number;
|
||||
cron?: Cron;
|
||||
maxDuration?: number;
|
||||
isStreaming?: boolean;
|
||||
isPrerenders?: boolean;
|
||||
@@ -1360,7 +1362,7 @@ export async function getPageLambdaGroups({
|
||||
const routeName = normalizePage(page.replace(/\.js$/, ''));
|
||||
const isPrerenderRoute = prerenderRoutes.has(routeName);
|
||||
|
||||
let opts: { memory?: number; maxDuration?: number } = {};
|
||||
let opts: { memory?: number; maxDuration?: number; cron?: Cron } = {};
|
||||
|
||||
if (config && config.functions) {
|
||||
const sourceFile = await getSourceFilePathFromPage({
|
||||
@@ -1378,7 +1380,8 @@ export async function getPageLambdaGroups({
|
||||
const matches =
|
||||
group.maxDuration === opts.maxDuration &&
|
||||
group.memory === opts.memory &&
|
||||
group.isPrerenders === isPrerenderRoute;
|
||||
group.isPrerenders === isPrerenderRoute &&
|
||||
!opts.cron; // Functions with a cronjob must be on their own
|
||||
|
||||
if (matches) {
|
||||
let newTracedFilesSize = group.pseudoLayerBytes;
|
||||
@@ -2311,12 +2314,14 @@ interface EdgeFunctionMatcher {
|
||||
}
|
||||
|
||||
export async function getMiddlewareBundle({
|
||||
config = {},
|
||||
entryPath,
|
||||
outputDirectory,
|
||||
routesManifest,
|
||||
isCorrectMiddlewareOrder,
|
||||
prerenderBypassToken,
|
||||
}: {
|
||||
config: Config;
|
||||
entryPath: string;
|
||||
outputDirectory: string;
|
||||
prerenderBypassToken: string;
|
||||
@@ -2372,6 +2377,21 @@ export async function getMiddlewareBundle({
|
||||
edgeFunction.wasm
|
||||
);
|
||||
|
||||
const edgeFunctionOptions: { cron?: Cron } = {};
|
||||
if (config.functions) {
|
||||
const sourceFile = await getSourceFilePathFromPage({
|
||||
workPath: entryPath,
|
||||
page: `${edgeFunction.page}.js`,
|
||||
});
|
||||
|
||||
const opts = await getLambdaOptionsFromFunction({
|
||||
sourceFile,
|
||||
config,
|
||||
});
|
||||
|
||||
edgeFunctionOptions.cron = opts.cron;
|
||||
}
|
||||
|
||||
return {
|
||||
type,
|
||||
page: edgeFunction.page,
|
||||
@@ -2416,6 +2436,7 @@ export async function getMiddlewareBundle({
|
||||
);
|
||||
|
||||
return new EdgeFunction({
|
||||
...edgeFunctionOptions,
|
||||
deploymentTarget: 'v8-worker',
|
||||
name: edgeFunction.name,
|
||||
files: {
|
||||
|
||||
44
packages/next/test/unit/build.test.js
Normal file
44
packages/next/test/unit/build.test.js
Normal file
@@ -0,0 +1,44 @@
|
||||
const path = require('node:path');
|
||||
const fs = require('fs-extra');
|
||||
const { build } = require('../../dist');
|
||||
|
||||
function getFixture(name) {
|
||||
return path.join(__dirname, 'fixtures', name);
|
||||
}
|
||||
|
||||
const initialCorepackValue = process.env.COREPACK_ENABLE_STRICT;
|
||||
|
||||
beforeEach(() => {
|
||||
process.env.COREPACK_ENABLE_STRICT = '0';
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
process.env.COREPACK_ENABLE_STRICT = initialCorepackValue;
|
||||
});
|
||||
|
||||
it('should include cron property from config', async () => {
|
||||
const cwd = getFixture('03-with-api-routes');
|
||||
await fs.remove(path.join(cwd, '.next'));
|
||||
|
||||
const result = await build({
|
||||
workPath: cwd,
|
||||
repoRootPath: cwd,
|
||||
entrypoint: 'package.json',
|
||||
config: {
|
||||
functions: {
|
||||
'pages/api/edge.js': {
|
||||
cron: '* * * * *',
|
||||
},
|
||||
'pages/api/serverless.js': {
|
||||
cron: '* * * * *',
|
||||
},
|
||||
},
|
||||
},
|
||||
meta: {
|
||||
skipDownload: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.output['api/serverless']).toHaveProperty('cron', '* * * * *');
|
||||
expect(result.output['api/edge']).toHaveProperty('cron', '* * * * *');
|
||||
});
|
||||
2
packages/next/test/unit/fixtures/03-with-api-routes/.gitignore
vendored
Normal file
2
packages/next/test/unit/fixtures/03-with-api-routes/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.vercel
|
||||
node_modules
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
generateBuildId() {
|
||||
return 'testing-build-id';
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "03-with-api-routes",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "latest",
|
||||
"react": "latest",
|
||||
"react-dom": "latest"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export const config = {
|
||||
runtime: 'edge',
|
||||
};
|
||||
|
||||
export default async function Edge(req, res) {
|
||||
res.json({ edge: 1 });
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default async function Edge(req, res) {
|
||||
res.json({ serverless: 1 });
|
||||
}
|
||||
185
packages/next/test/unit/fixtures/03-with-api-routes/yarn.lock
Normal file
185
packages/next/test/unit/fixtures/03-with-api-routes/yarn.lock
Normal file
@@ -0,0 +1,185 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@next/env@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/env/-/env-13.1.6.tgz#c4925609f16142ded1a5cb833359ab17359b7a93"
|
||||
integrity sha512-s+W9Fdqh5MFk6ECrbnVmmAOwxKQuhGMT7xXHrkYIBMBcTiOqNWhv5KbJIboKR5STXxNXl32hllnvKaffzFaWQg==
|
||||
|
||||
"@next/swc-android-arm-eabi@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.1.6.tgz#d766dfc10e27814d947b20f052067c239913dbcc"
|
||||
integrity sha512-F3/6Z8LH/pGlPzR1AcjPFxx35mPqjE5xZcf+IL+KgbW9tMkp7CYi1y7qKrEWU7W4AumxX/8OINnDQWLiwLasLQ==
|
||||
|
||||
"@next/swc-android-arm64@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-13.1.6.tgz#f37a98d5f18927d8c9970d750d516ac779465176"
|
||||
integrity sha512-cMwQjnB8vrYkWyK/H0Rf2c2pKIH4RGjpKUDvbjVAit6SbwPDpmaijLio0LWFV3/tOnY6kvzbL62lndVA0mkYpw==
|
||||
|
||||
"@next/swc-darwin-arm64@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.1.6.tgz#ec1b90fd9bf809d8b81004c5182e254dced4ad96"
|
||||
integrity sha512-KKRQH4DDE4kONXCvFMNBZGDb499Hs+xcFAwvj+rfSUssIDrZOlyfJNy55rH5t2Qxed1e4K80KEJgsxKQN1/fyw==
|
||||
|
||||
"@next/swc-darwin-x64@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.1.6.tgz#e869ac75d16995eee733a7d1550322d9051c1eb4"
|
||||
integrity sha512-/uOky5PaZDoaU99ohjtNcDTJ6ks/gZ5ykTQDvNZDjIoCxFe3+t06bxsTPY6tAO6uEAw5f6vVFX5H5KLwhrkZCA==
|
||||
|
||||
"@next/swc-freebsd-x64@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.1.6.tgz#84a7b2e423a2904afc2edca21c2f1ba6b53fa4c1"
|
||||
integrity sha512-qaEALZeV7to6weSXk3Br80wtFQ7cFTpos/q+m9XVRFggu+8Ib895XhMWdJBzew6aaOcMvYR6KQ6JmHA2/eMzWw==
|
||||
|
||||
"@next/swc-linux-arm-gnueabihf@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.1.6.tgz#980eed1f655ff8a72187d8a6ef9e73ac39d20d23"
|
||||
integrity sha512-OybkbC58A1wJ+JrJSOjGDvZzrVEQA4sprJejGqMwiZyLqhr9Eo8FXF0y6HL+m1CPCpPhXEHz/2xKoYsl16kNqw==
|
||||
|
||||
"@next/swc-linux-arm64-gnu@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.1.6.tgz#87a71db21cded3f7c63d1d19079845c59813c53d"
|
||||
integrity sha512-yCH+yDr7/4FDuWv6+GiYrPI9kcTAO3y48UmaIbrKy8ZJpi7RehJe3vIBRUmLrLaNDH3rY1rwoHi471NvR5J5NQ==
|
||||
|
||||
"@next/swc-linux-arm64-musl@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.1.6.tgz#c5aac8619331b9fd030603bbe2b36052011e11de"
|
||||
integrity sha512-ECagB8LGX25P9Mrmlc7Q/TQBb9rGScxHbv/kLqqIWs2fIXy6Y/EiBBiM72NTwuXUFCNrWR4sjUPSooVBJJ3ESQ==
|
||||
|
||||
"@next/swc-linux-x64-gnu@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.1.6.tgz#9513d36d540bbfea575576746736054c31aacdea"
|
||||
integrity sha512-GT5w2mruk90V/I5g6ScuueE7fqj/d8Bui2qxdw6lFxmuTgMeol5rnzAv4uAoVQgClOUO/MULilzlODg9Ib3Y4Q==
|
||||
|
||||
"@next/swc-linux-x64-musl@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.1.6.tgz#d61fc6884899f5957251f4ce3f522e34a2c479b7"
|
||||
integrity sha512-keFD6KvwOPzmat4TCnlnuxJCQepPN+8j3Nw876FtULxo8005Y9Ghcl7ACcR8GoiKoddAq8gxNBrpjoxjQRHeAQ==
|
||||
|
||||
"@next/swc-win32-arm64-msvc@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.1.6.tgz#fac2077a8ae9768e31444c9ae90807e64117cda7"
|
||||
integrity sha512-OwertslIiGQluFvHyRDzBCIB07qJjqabAmINlXUYt7/sY7Q7QPE8xVi5beBxX/rxTGPIbtyIe3faBE6Z2KywhQ==
|
||||
|
||||
"@next/swc-win32-ia32-msvc@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.1.6.tgz#498bc11c91b4c482a625bf4b978f98ae91111e46"
|
||||
integrity sha512-g8zowiuP8FxUR9zslPmlju7qYbs2XBtTLVSxVikPtUDQedhcls39uKYLvOOd1JZg0ehyhopobRoH1q+MHlIN/w==
|
||||
|
||||
"@next/swc-win32-x64-msvc@13.1.6":
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.1.6.tgz#17ed919c723426b7d0ce1cd73d40ce3dcd342089"
|
||||
integrity sha512-Ls2OL9hi3YlJKGNdKv8k3X/lLgc3VmLG3a/DeTkAd+lAituJp8ZHmRmm9f9SL84fT3CotlzcgbdaCDfFwFA6bA==
|
||||
|
||||
"@swc/helpers@0.4.14":
|
||||
version "0.4.14"
|
||||
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.14.tgz#1352ac6d95e3617ccb7c1498ff019654f1e12a74"
|
||||
integrity sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==
|
||||
dependencies:
|
||||
tslib "^2.4.0"
|
||||
|
||||
caniuse-lite@^1.0.30001406:
|
||||
version "1.0.30001450"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001450.tgz#022225b91200589196b814b51b1bbe45144cf74f"
|
||||
integrity sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew==
|
||||
|
||||
client-only@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1"
|
||||
integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==
|
||||
|
||||
"js-tokens@^3.0.0 || ^4.0.0":
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
|
||||
|
||||
loose-envify@^1.1.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
|
||||
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
|
||||
dependencies:
|
||||
js-tokens "^3.0.0 || ^4.0.0"
|
||||
|
||||
nanoid@^3.3.4:
|
||||
version "3.3.4"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
|
||||
integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==
|
||||
|
||||
next@latest:
|
||||
version "13.1.6"
|
||||
resolved "https://registry.yarnpkg.com/next/-/next-13.1.6.tgz#054babe20b601f21f682f197063c9b0b32f1a27c"
|
||||
integrity sha512-hHlbhKPj9pW+Cymvfzc15lvhaOZ54l+8sXDXJWm3OBNBzgrVj6hwGPmqqsXg40xO1Leq+kXpllzRPuncpC0Phw==
|
||||
dependencies:
|
||||
"@next/env" "13.1.6"
|
||||
"@swc/helpers" "0.4.14"
|
||||
caniuse-lite "^1.0.30001406"
|
||||
postcss "8.4.14"
|
||||
styled-jsx "5.1.1"
|
||||
optionalDependencies:
|
||||
"@next/swc-android-arm-eabi" "13.1.6"
|
||||
"@next/swc-android-arm64" "13.1.6"
|
||||
"@next/swc-darwin-arm64" "13.1.6"
|
||||
"@next/swc-darwin-x64" "13.1.6"
|
||||
"@next/swc-freebsd-x64" "13.1.6"
|
||||
"@next/swc-linux-arm-gnueabihf" "13.1.6"
|
||||
"@next/swc-linux-arm64-gnu" "13.1.6"
|
||||
"@next/swc-linux-arm64-musl" "13.1.6"
|
||||
"@next/swc-linux-x64-gnu" "13.1.6"
|
||||
"@next/swc-linux-x64-musl" "13.1.6"
|
||||
"@next/swc-win32-arm64-msvc" "13.1.6"
|
||||
"@next/swc-win32-ia32-msvc" "13.1.6"
|
||||
"@next/swc-win32-x64-msvc" "13.1.6"
|
||||
|
||||
picocolors@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
|
||||
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
|
||||
|
||||
postcss@8.4.14:
|
||||
version "8.4.14"
|
||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf"
|
||||
integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==
|
||||
dependencies:
|
||||
nanoid "^3.3.4"
|
||||
picocolors "^1.0.0"
|
||||
source-map-js "^1.0.2"
|
||||
|
||||
react-dom@latest:
|
||||
version "18.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
|
||||
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
scheduler "^0.23.0"
|
||||
|
||||
react@latest:
|
||||
version "18.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
|
||||
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
|
||||
scheduler@^0.23.0:
|
||||
version "0.23.0"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
|
||||
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
|
||||
source-map-js@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
|
||||
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
|
||||
|
||||
styled-jsx@5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.1.1.tgz#839a1c3aaacc4e735fed0781b8619ea5d0009d1f"
|
||||
integrity sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==
|
||||
dependencies:
|
||||
client-only "0.0.1"
|
||||
|
||||
tslib@^2.4.0:
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
|
||||
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/node",
|
||||
"version": "2.8.17",
|
||||
"version": "2.9.1",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
||||
@@ -31,9 +31,9 @@
|
||||
"dependencies": {
|
||||
"@edge-runtime/vm": "2.0.0",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/node-bridge": "3.1.10",
|
||||
"@vercel/static-config": "2.0.11",
|
||||
"@vercel/static-config": "2.0.12",
|
||||
"edge-runtime": "2.0.0",
|
||||
"esbuild": "0.14.47",
|
||||
"exit-hook": "2.2.1",
|
||||
|
||||
@@ -413,9 +413,16 @@ export const build: BuildV3 = async ({
|
||||
)} (must be one of: ${JSON.stringify(ALLOWED_RUNTIMES)})`
|
||||
);
|
||||
}
|
||||
if (staticConfig.runtime === 'nodejs') {
|
||||
console.log(
|
||||
`Detected unused static config runtime "nodejs" in "${entrypointPath}"`
|
||||
);
|
||||
}
|
||||
isEdgeFunction = isEdgeRuntime(staticConfig.runtime);
|
||||
}
|
||||
|
||||
const cron = staticConfig?.cron;
|
||||
|
||||
debug('Tracing input files...');
|
||||
const traceTime = Date.now();
|
||||
const { preparedFiles, shouldAddSourcemapSupport } = await compile(
|
||||
@@ -465,6 +472,7 @@ export const build: BuildV3 = async ({
|
||||
// TODO: remove - these two properties should not be required
|
||||
name: outputPath,
|
||||
deploymentTarget: 'v8-worker',
|
||||
cron,
|
||||
});
|
||||
} else {
|
||||
// "nodejs" runtime is the default
|
||||
@@ -483,6 +491,7 @@ export const build: BuildV3 = async ({
|
||||
shouldAddSourcemapSupport,
|
||||
awsLambdaHandler,
|
||||
experimentalResponseStreaming,
|
||||
cron,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/python",
|
||||
"version": "3.1.42",
|
||||
"version": "3.1.44",
|
||||
"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.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"execa": "^1.0.0",
|
||||
"typescript": "4.3.4"
|
||||
|
||||
14
packages/python/test/fixtures/32-fail-duplicate-header/index.py
vendored
Normal file
14
packages/python/test/fixtures/32-fail-duplicate-header/index.py
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
async def app(scope, receive, send):
|
||||
assert scope["type"] == "http"
|
||||
await send(
|
||||
{
|
||||
"type": "http.response.start",
|
||||
"status": 200,
|
||||
}
|
||||
)
|
||||
await send(
|
||||
{
|
||||
"type": "http.response.body",
|
||||
"body": b"hello world"
|
||||
}
|
||||
)
|
||||
18
packages/python/test/fixtures/32-fail-duplicate-header/probe.js
vendored
Normal file
18
packages/python/test/fixtures/32-fail-duplicate-header/probe.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
const execa = require('execa');
|
||||
|
||||
module.exports = async function ({ deploymentUrl, fetch }) {
|
||||
const probeUrl = `https://${deploymentUrl}`;
|
||||
const result = await execa('curl', [
|
||||
probeUrl,
|
||||
'-s',
|
||||
'-H',
|
||||
'foo: bar',
|
||||
'-H',
|
||||
'foo: bar',
|
||||
]);
|
||||
if (result.stdout.includes('FUNCTION_INVOCATION_FAILED')) {
|
||||
throw new Error(
|
||||
'Duplicate headers should not cause a function invocation failure'
|
||||
);
|
||||
}
|
||||
};
|
||||
9
packages/python/test/fixtures/32-fail-duplicate-header/vercel.json
vendored
Normal file
9
packages/python/test/fixtures/32-fail-duplicate-header/vercel.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [
|
||||
{
|
||||
"src": "*.py",
|
||||
"use": "@vercel/python"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -276,6 +276,14 @@ elif 'app' in __vc_variables:
|
||||
query = url.query.encode()
|
||||
path = url.path
|
||||
|
||||
headers_encoded = []
|
||||
for k, v in headers.items():
|
||||
# Cope with repeated headers in the encoding.
|
||||
if isinstance(v, list):
|
||||
headers_encoded.append([k.lower().encode(), [i.encode() for i in v]])
|
||||
else:
|
||||
headers_encoded.append([k.lower().encode(), v.encode()])
|
||||
|
||||
scope = {
|
||||
'server': (headers.get('host', 'lambda'), headers.get('x-forwarded-port', 80)),
|
||||
'client': (headers.get(
|
||||
@@ -285,7 +293,7 @@ elif 'app' in __vc_variables:
|
||||
'scheme': headers.get('x-forwarded-proto', 'http'),
|
||||
'root_path': '',
|
||||
'query_string': query,
|
||||
'headers': [[k.lower().encode(), v.encode()] for k, v in headers.items()],
|
||||
'headers': headers_encoded,
|
||||
'type': 'http',
|
||||
'http_version': '1.1',
|
||||
'method': payload['method'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/redwood",
|
||||
"version": "1.0.53",
|
||||
"version": "1.1.0",
|
||||
"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.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"typescript": "4.3.4"
|
||||
|
||||
@@ -256,7 +256,7 @@ export const build: BuildV2 = async ({
|
||||
|
||||
lambdaFiles[relative(workPath, fileFsRef.fsPath)] = fileFsRef;
|
||||
|
||||
const { memory, maxDuration } = await getLambdaOptionsFromFunction({
|
||||
const lambdaOptions = await getLambdaOptionsFromFunction({
|
||||
sourceFile,
|
||||
config,
|
||||
});
|
||||
@@ -265,11 +265,10 @@ export const build: BuildV2 = async ({
|
||||
files: lambdaFiles,
|
||||
handler: relativeEntrypoint,
|
||||
runtime: nodeVersion.runtime,
|
||||
memory,
|
||||
maxDuration,
|
||||
shouldAddHelpers: false,
|
||||
shouldAddSourcemapSupport: false,
|
||||
awsLambdaHandler,
|
||||
...lambdaOptions,
|
||||
});
|
||||
lambdaOutputs[outputName] = lambda;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/remix",
|
||||
"version": "1.2.9",
|
||||
"version": "1.2.11",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"homepage": "https://vercel.com/docs",
|
||||
@@ -24,7 +24,7 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/node": "14.18.33",
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"typescript": "4.9.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { promises as fs } from 'fs';
|
||||
import { runInContext, createContext } from 'vm';
|
||||
import { dirname, join, relative } from 'path';
|
||||
import {
|
||||
debug,
|
||||
@@ -23,8 +24,9 @@ import type {
|
||||
PackageJson,
|
||||
} from '@vercel/build-utils';
|
||||
import { nodeFileTrace } from '@vercel/nft';
|
||||
import type { AppConfig } from './types';
|
||||
import { findConfig } from './utils';
|
||||
import type { AppConfig, RemixBuildManifest } from './types';
|
||||
import type { BuildResultV2Typical } from '@vercel/build-utils';
|
||||
|
||||
// Name of the Remix runtime adapter npm package for Vercel
|
||||
const REMIX_RUNTIME_ADAPTER_NAME = '@remix-run/vercel';
|
||||
@@ -205,7 +207,7 @@ export const build: BuildV2 = async ({
|
||||
if (err.code !== 'MODULE_NOT_FOUND') throw err;
|
||||
}
|
||||
|
||||
const [staticFiles, renderFunction] = await Promise.all([
|
||||
const [staticFiles, renderFunction, ssrRoutes] = await Promise.all([
|
||||
glob('**', join(entrypointFsDirname, 'public')),
|
||||
createRenderFunction(
|
||||
entrypointFsDirname,
|
||||
@@ -214,8 +216,17 @@ export const build: BuildV2 = async ({
|
||||
needsHandler,
|
||||
nodeVersion
|
||||
),
|
||||
getSsrRoutes(entrypointFsDirname),
|
||||
]);
|
||||
|
||||
const output: BuildResultV2Typical['output'] = staticFiles;
|
||||
for (const path of ssrRoutes) {
|
||||
output[path] = renderFunction;
|
||||
}
|
||||
|
||||
// Add a 404 path for not found pages to be server-side rendered by Remix
|
||||
output['404'] = renderFunction;
|
||||
|
||||
return {
|
||||
routes: [
|
||||
{
|
||||
@@ -228,13 +239,10 @@ export const build: BuildV2 = async ({
|
||||
},
|
||||
{
|
||||
src: '/(.*)',
|
||||
dest: '/render',
|
||||
dest: '/404',
|
||||
},
|
||||
],
|
||||
output: {
|
||||
render: renderFunction,
|
||||
...staticFiles,
|
||||
},
|
||||
output,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -287,3 +295,30 @@ async function createRenderFunction(
|
||||
|
||||
return lambda;
|
||||
}
|
||||
|
||||
async function getSsrRoutes(entrypointDir: string): Promise<string[]> {
|
||||
// Find the name of the manifest file
|
||||
const buildDir = join(entrypointDir, 'public/build');
|
||||
const manifestFileName = (await fs.readdir(buildDir)).find(n =>
|
||||
n.startsWith('manifest-')
|
||||
);
|
||||
|
||||
if (!manifestFileName) {
|
||||
throw new Error(`Failed to find manifest file in "${buildDir}"`);
|
||||
}
|
||||
|
||||
const context: { window: { __remixManifest?: RemixBuildManifest } } = {
|
||||
window: {},
|
||||
};
|
||||
createContext(context);
|
||||
|
||||
const code = await fs.readFile(join(buildDir, manifestFileName), 'utf8');
|
||||
runInContext(code, context);
|
||||
|
||||
const routes = context.window.__remixManifest?.routes || {};
|
||||
return Object.keys(routes)
|
||||
.filter(id => id !== 'root')
|
||||
.map(id => {
|
||||
return routes[id].path || 'index';
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,3 +5,11 @@ export interface AppConfig {
|
||||
serverBuildPath?: string;
|
||||
serverBuildTarget?: string;
|
||||
}
|
||||
|
||||
export interface RemixBuildManifest {
|
||||
routes: {
|
||||
[id: string]: {
|
||||
path: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
7
packages/remix/test/fixtures/01-remix-basics/app/routes/b.tsx
vendored
Normal file
7
packages/remix/test/fixtures/01-remix-basics/app/routes/b.tsx
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function B() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
<h1>B page</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
7
packages/remix/test/fixtures/01-remix-basics/app/routes/nested/another.tsx
vendored
Normal file
7
packages/remix/test/fixtures/01-remix-basics/app/routes/nested/another.tsx
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function Another() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
<h1>Nested another page</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
7
packages/remix/test/fixtures/01-remix-basics/app/routes/nested/index.tsx
vendored
Normal file
7
packages/remix/test/fixtures/01-remix-basics/app/routes/nested/index.tsx
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function Nested() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
<h1>Nested index page</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -9,5 +9,12 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"probes": [{ "path": "/", "mustContain": "Welcome to Remix" }]
|
||||
"probes": [
|
||||
{ "path": "/", "mustContain": "Welcome to Remix" },
|
||||
{ "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" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@vercel/ruby",
|
||||
"author": "Nathan Cahill <nathan@nathancahill.com>",
|
||||
"version": "1.3.58",
|
||||
"version": "1.3.60",
|
||||
"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.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"execa": "2.0.4",
|
||||
"fs-extra": "^7.0.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/static-build",
|
||||
"version": "1.3.1",
|
||||
"version": "1.3.3",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/build-step",
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/gatsby-plugin-vercel-analytics": "1.0.7",
|
||||
"@vercel/gatsby-plugin-vercel-builder": "1.0.3"
|
||||
"@vercel/gatsby-plugin-vercel-builder": "1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/aws-lambda": "8.10.64",
|
||||
@@ -42,12 +42,12 @@
|
||||
"@types/node-fetch": "2.5.4",
|
||||
"@types/promise-timeout": "1.3.0",
|
||||
"@types/semver": "7.3.13",
|
||||
"@vercel/build-utils": "6.0.1",
|
||||
"@vercel/build-utils": "6.2.0",
|
||||
"@vercel/frameworks": "1.3.0",
|
||||
"@vercel/fs-detectors": "3.7.7",
|
||||
"@vercel/fs-detectors": "3.7.9",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.1.8",
|
||||
"@vercel/static-config": "2.0.11",
|
||||
"@vercel/static-config": "2.0.12",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "10.0.0",
|
||||
"get-port": "5.0.0",
|
||||
|
||||
@@ -85,9 +85,8 @@ async function updateGatsbyConfig(dir: string, plugins: string[]) {
|
||||
} else {
|
||||
await fs.writeFile(
|
||||
gatsbyConfigPathJs,
|
||||
`module.exports = ${JSON.stringify({
|
||||
plugins,
|
||||
})}`
|
||||
`${GENERATED_FILE_COMMENT}
|
||||
module.exports = ${JSON.stringify({ plugins })}`
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -231,7 +230,8 @@ async function updateGatsbyNode(dir: string) {
|
||||
} else {
|
||||
await fs.writeFile(
|
||||
gatsbyNodePathJs,
|
||||
`module.exports = require('@vercel/gatsby-plugin-vercel-builder/gatsby-node.js');`
|
||||
`${GENERATED_FILE_COMMENT}
|
||||
module.exports = require('@vercel/gatsby-plugin-vercel-builder/gatsby-node.js');`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
21
packages/static-build/test/gatsby.test.ts
vendored
21
packages/static-build/test/gatsby.test.ts
vendored
@@ -65,9 +65,10 @@ describe('gatsby utilities', () => {
|
||||
const [gatsbyConfig] = await Promise.all([
|
||||
fs.readFile(path.join(fixture, 'gatsby-config.js'), 'utf-8'),
|
||||
]);
|
||||
expect(gatsbyConfig).toMatchInlineSnapshot(
|
||||
`"module.exports = {\\"plugins\\":[\\"@vercel/gatsby-plugin-vercel-analytics\\"]}"`
|
||||
);
|
||||
expect(gatsbyConfig).toMatchInlineSnapshot(`
|
||||
"// This file was generated by @vercel/static-build
|
||||
module.exports = {\\"plugins\\":[\\"@vercel/gatsby-plugin-vercel-analytics\\"]}"
|
||||
`);
|
||||
});
|
||||
|
||||
it('should inject plugins and create gatsby-node.js and gatsby-config.js', async () => {
|
||||
@@ -80,12 +81,14 @@ describe('gatsby utilities', () => {
|
||||
fs.readFile(path.join(fixture, 'gatsby-node.js'), 'utf-8'),
|
||||
fs.readFile(path.join(fixture, 'gatsby-config.js'), 'utf-8'),
|
||||
]);
|
||||
expect(gatsbyNode).toMatchInlineSnapshot(
|
||||
`"module.exports = require('@vercel/gatsby-plugin-vercel-builder/gatsby-node.js');"`
|
||||
);
|
||||
expect(gatsbyConfig).toMatchInlineSnapshot(
|
||||
`"module.exports = {\\"plugins\\":[\\"@vercel/gatsby-plugin-vercel-analytics\\"]}"`
|
||||
);
|
||||
expect(gatsbyNode).toMatchInlineSnapshot(`
|
||||
"// This file was generated by @vercel/static-build
|
||||
module.exports = require('@vercel/gatsby-plugin-vercel-builder/gatsby-node.js');"
|
||||
`);
|
||||
expect(gatsbyConfig).toMatchInlineSnapshot(`
|
||||
"// This file was generated by @vercel/static-build
|
||||
module.exports = {\\"plugins\\":[\\"@vercel/gatsby-plugin-vercel-analytics\\"]}"
|
||||
`);
|
||||
});
|
||||
|
||||
it('should inject builder plugin and update gatsby-node.js and gatsby-config.js', async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/static-config",
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.12",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index",
|
||||
"repository": {
|
||||
|
||||
@@ -14,6 +14,7 @@ export const BaseFunctionConfigSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
runtime: { type: 'string' },
|
||||
cron: { type: 'string' },
|
||||
memory: { type: 'number' },
|
||||
maxDuration: { type: 'number' },
|
||||
regions: {
|
||||
|
||||
60
pnpm-lock.yaml
generated
60
pnpm-lock.yaml
generated
@@ -196,23 +196,23 @@ importers:
|
||||
'@types/which': 1.3.2
|
||||
'@types/write-json-file': 2.2.1
|
||||
'@types/yauzl-promise': 2.1.0
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/client': 12.3.4
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/client': 12.3.6
|
||||
'@vercel/error-utils': 1.0.8
|
||||
'@vercel/frameworks': 1.3.0
|
||||
'@vercel/fs-detectors': 3.7.7
|
||||
'@vercel/fs-detectors': 3.7.9
|
||||
'@vercel/fun': 1.0.4
|
||||
'@vercel/go': 2.3.0
|
||||
'@vercel/hydrogen': 0.0.46
|
||||
'@vercel/go': 2.3.2
|
||||
'@vercel/hydrogen': 0.0.48
|
||||
'@vercel/ncc': 0.24.0
|
||||
'@vercel/next': 3.3.20
|
||||
'@vercel/node': 2.8.17
|
||||
'@vercel/python': 3.1.42
|
||||
'@vercel/redwood': 1.0.53
|
||||
'@vercel/remix': 1.2.9
|
||||
'@vercel/next': 3.4.0
|
||||
'@vercel/node': 2.9.1
|
||||
'@vercel/python': 3.1.44
|
||||
'@vercel/redwood': 1.1.0
|
||||
'@vercel/remix': 1.2.11
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
'@vercel/ruby': 1.3.58
|
||||
'@vercel/static-build': 1.3.1
|
||||
'@vercel/ruby': 1.3.60
|
||||
'@vercel/static-build': 1.3.3
|
||||
'@zeit/source-map-support': 0.6.2
|
||||
ajv: 6.12.2
|
||||
alpha-sort: 2.0.1
|
||||
@@ -438,7 +438,7 @@ importers:
|
||||
'@types/node-fetch': 2.5.4
|
||||
'@types/recursive-readdir': 2.2.0
|
||||
'@types/tar-fs': 1.16.1
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
'@zeit/fetch': 5.2.0
|
||||
async-retry: 1.2.3
|
||||
@@ -543,7 +543,7 @@ importers:
|
||||
'@types/minimatch': 3.0.5
|
||||
'@types/node': 14.18.33
|
||||
'@types/semver': 7.3.10
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/error-utils': 1.0.8
|
||||
'@vercel/frameworks': 1.3.0
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
@@ -591,8 +591,8 @@ importers:
|
||||
'@types/fs-extra': 11.0.1
|
||||
'@types/node': 14.18.33
|
||||
'@types/react': 18.0.26
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/node': 2.8.17
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/node': 2.9.1
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
ajv: 8.12.0
|
||||
esbuild: 0.14.47
|
||||
@@ -626,7 +626,7 @@ importers:
|
||||
'@types/node': 14.18.33
|
||||
'@types/node-fetch': ^2.3.0
|
||||
'@types/tar': ^4.0.0
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
async-retry: 1.3.1
|
||||
execa: ^1.0.0
|
||||
@@ -658,8 +658,8 @@ importers:
|
||||
specifiers:
|
||||
'@types/jest': 27.5.1
|
||||
'@types/node': 14.18.33
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/static-config': 2.0.11
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/static-config': 2.0.12
|
||||
execa: 3.2.0
|
||||
fs-extra: 11.1.0
|
||||
ts-morph: 12.0.0
|
||||
@@ -689,7 +689,7 @@ importers:
|
||||
'@types/semver': 6.0.0
|
||||
'@types/text-table': 0.2.1
|
||||
'@types/webpack-sources': 3.2.0
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/nft': 0.22.5
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
async-sema: 3.0.1
|
||||
@@ -768,11 +768,11 @@ importers:
|
||||
'@types/node': 14.18.33
|
||||
'@types/node-fetch': ^2.6.1
|
||||
'@types/test-listen': 1.1.0
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
'@vercel/nft': 0.22.5
|
||||
'@vercel/node-bridge': 3.1.10
|
||||
'@vercel/static-config': 2.0.11
|
||||
'@vercel/static-config': 2.0.12
|
||||
content-type: 1.0.4
|
||||
cookie: 0.4.0
|
||||
edge-runtime: 2.0.0
|
||||
@@ -852,7 +852,7 @@ importers:
|
||||
'@types/execa': ^0.9.0
|
||||
'@types/jest': 27.4.1
|
||||
'@types/node': 14.18.33
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
execa: ^1.0.0
|
||||
typescript: 4.3.4
|
||||
@@ -870,7 +870,7 @@ importers:
|
||||
'@types/aws-lambda': 8.10.19
|
||||
'@types/node': 14.18.33
|
||||
'@types/semver': 6.0.0
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/nft': 0.22.5
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
execa: 3.2.0
|
||||
@@ -894,7 +894,7 @@ importers:
|
||||
specifiers:
|
||||
'@types/jest': 27.5.1
|
||||
'@types/node': 14.18.33
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/nft': 0.22.5
|
||||
typescript: 4.9.4
|
||||
dependencies:
|
||||
@@ -925,7 +925,7 @@ importers:
|
||||
specifiers:
|
||||
'@types/fs-extra': 8.0.0
|
||||
'@types/semver': 6.0.0
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/ncc': 0.24.0
|
||||
execa: 2.0.4
|
||||
fs-extra: ^7.0.1
|
||||
@@ -952,14 +952,14 @@ importers:
|
||||
'@types/node-fetch': 2.5.4
|
||||
'@types/promise-timeout': 1.3.0
|
||||
'@types/semver': 7.3.13
|
||||
'@vercel/build-utils': 6.0.1
|
||||
'@vercel/build-utils': 6.2.0
|
||||
'@vercel/frameworks': 1.3.0
|
||||
'@vercel/fs-detectors': 3.7.7
|
||||
'@vercel/fs-detectors': 3.7.9
|
||||
'@vercel/gatsby-plugin-vercel-analytics': 1.0.7
|
||||
'@vercel/gatsby-plugin-vercel-builder': 1.0.3
|
||||
'@vercel/gatsby-plugin-vercel-builder': 1.1.1
|
||||
'@vercel/ncc': 0.24.0
|
||||
'@vercel/routing-utils': 2.1.8
|
||||
'@vercel/static-config': 2.0.11
|
||||
'@vercel/static-config': 2.0.12
|
||||
execa: 3.2.0
|
||||
fs-extra: 10.0.0
|
||||
get-port: 5.0.0
|
||||
|
||||
7
utils/update-next.js
vendored
7
utils/update-next.js
vendored
@@ -58,4 +58,11 @@ module.exports = async ({ github, context }) => {
|
||||
pull_number: pr.data.number,
|
||||
reviewers: ['ijjk', 'styfle'],
|
||||
});
|
||||
|
||||
github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: pr.data.number,
|
||||
labels: ['area: examples', 'semver: none', 'pr: automerge'],
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user