mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
Compare commits
110 Commits
vercel@29.
...
@vercel-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
493a31091d | ||
|
|
8d7206f5b6 | ||
|
|
4bf2ca55ff | ||
|
|
5e5332fbc9 | ||
|
|
281ec776a5 | ||
|
|
ee8f9292b4 | ||
|
|
027bce00b3 | ||
|
|
ca1f41200a | ||
|
|
834b3e652b | ||
|
|
5c6941d18c | ||
|
|
761ede2482 | ||
|
|
1d01703dc3 | ||
|
|
7021279b28 | ||
|
|
28acf50bdf | ||
|
|
718bbd365a | ||
|
|
7e791ee080 | ||
|
|
13769106cb | ||
|
|
aa734efc6c | ||
|
|
acc10e47c7 | ||
|
|
6a0e1e0b66 | ||
|
|
3468922108 | ||
|
|
e4895d979b | ||
|
|
733ff5ed85 | ||
|
|
0867f11a6a | ||
|
|
a6de052ed2 | ||
|
|
f5d48ec3bc | ||
|
|
6ec1180798 | ||
|
|
36db62a491 | ||
|
|
f9266e069f | ||
|
|
8163a153df | ||
|
|
c5e6bd1a7a | ||
|
|
c2f1bebd1f | ||
|
|
3138415533 | ||
|
|
8f6813bb63 | ||
|
|
734499fc03 | ||
|
|
f06988d914 | ||
|
|
71ac16220b | ||
|
|
8b3a4146af | ||
|
|
cfea31e6cf | ||
|
|
7090fec110 | ||
|
|
bc7c80fb9b | ||
|
|
91406abdb0 | ||
|
|
a5af8381ce | ||
|
|
2230ea6cc1 | ||
|
|
f057f0421b | ||
|
|
42c0b32a8d | ||
|
|
d61a1a7988 | ||
|
|
c438bbb362 | ||
|
|
cb5eef0eb5 | ||
|
|
79dee367cf | ||
|
|
dea58dea7e | ||
|
|
fecebfa7fa | ||
|
|
94d5612dce | ||
|
|
3eaf58bb74 | ||
|
|
e63cf40153 | ||
|
|
709c9509f4 | ||
|
|
6107c1ed22 | ||
|
|
7a0f377afe | ||
|
|
a04bf557fc | ||
|
|
b6736e82cf | ||
|
|
7923056bc0 | ||
|
|
71ff193ea3 | ||
|
|
c21d93de44 | ||
|
|
0039c8b5ce | ||
|
|
49c7178567 | ||
|
|
b038b29614 | ||
|
|
7a249a2284 | ||
|
|
a5e32ec31d | ||
|
|
bc5afe24c4 | ||
|
|
5070e3bbbd | ||
|
|
4ad1cbbd7d | ||
|
|
4f4e09477d | ||
|
|
cd35071f60 | ||
|
|
f373c94508 | ||
|
|
553c001eb0 | ||
|
|
f6c3a95783 | ||
|
|
c0bcef0ca4 | ||
|
|
4cd77608e8 | ||
|
|
e6b2980eba | ||
|
|
67e20a6ede | ||
|
|
c63679ea0a | ||
|
|
4280166df4 | ||
|
|
18ae78137c | ||
|
|
ebe4058073 | ||
|
|
942e76840e | ||
|
|
57515d2d07 | ||
|
|
ef30a46c03 | ||
|
|
113b8ac87b | ||
|
|
b56ac2717d | ||
|
|
aa8957ab10 | ||
|
|
c6c19354e8 | ||
|
|
96b2502133 | ||
|
|
2df0262675 | ||
|
|
1e47bbf32f | ||
|
|
00813a3945 | ||
|
|
a73ec6343f | ||
|
|
4bd70d4b6e | ||
|
|
c7bcea4081 | ||
|
|
aab95532d6 | ||
|
|
1b18c853c2 | ||
|
|
1663db7ca3 | ||
|
|
e80247fb99 | ||
|
|
a19edc985b | ||
|
|
4fd593ac09 | ||
|
|
1b0d72aba5 | ||
|
|
c52a59809e | ||
|
|
cdf55b3b1a | ||
|
|
8de42e0a70 | ||
|
|
7ff321310f | ||
|
|
2da72bc5e4 |
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
@@ -1,6 +1,7 @@
|
||||
# Documentation
|
||||
# https://help.github.com/en/articles/about-code-owners
|
||||
|
||||
# Restricted Paths
|
||||
* @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood
|
||||
/.github/workflows @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @ijjk
|
||||
/packages/fs-detectors @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @agadzik @chloetedder
|
||||
@@ -14,3 +15,6 @@
|
||||
/examples/jekyll @styfle
|
||||
/examples/zola @styfle
|
||||
/packages/node @TooTallNate @EndangeredMassa @styfle @cb1kenobi @Ethan-Arrowood @Kikobeats
|
||||
|
||||
# Unrestricted Paths
|
||||
.changeset/
|
||||
|
||||
1
.github/CONTRIBUTING.md
vendored
1
.github/CONTRIBUTING.md
vendored
@@ -15,7 +15,6 @@ git clone https://github.com/vercel/vercel
|
||||
cd vercel
|
||||
corepack enable
|
||||
pnpm install
|
||||
pnpm bootstrap
|
||||
pnpm build
|
||||
pnpm lint
|
||||
pnpm test-unit
|
||||
|
||||
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
@@ -23,6 +23,9 @@ jobs:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Fetch git tags
|
||||
run: git fetch origin 'refs/tags/*:refs/tags/*'
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
@@ -47,8 +50,8 @@ jobs:
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: pnpm version:prepare
|
||||
publish: pnpm release
|
||||
version: pnpm ci:version
|
||||
publish: pnpm ci:publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
NPM_CONFIG_PROVENANCE: 'true'
|
||||
@@ -56,15 +59,6 @@ jobs:
|
||||
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
|
||||
- name: Set latest Release to `vercel` (if a Publish Happened)
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
script: |
|
||||
const script = require('./utils/update-latest-release.js')
|
||||
await script({ github, context })
|
||||
|
||||
- name: Trigger Update (if a Publish Happened)
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
uses: actions/github-script@v6
|
||||
@@ -73,3 +67,12 @@ jobs:
|
||||
script: |
|
||||
const script = require('./utils/trigger-update-workflow.js')
|
||||
await script({ github, context })
|
||||
|
||||
- name: Set latest Release to `vercel` (if a Publish Happened)
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
script: |
|
||||
const script = require('./utils/update-latest-release.js')
|
||||
await script({ github, context })
|
||||
|
||||
16
.github/workflows/test-lint.yml
vendored
16
.github/workflows/test-lint.yml
vendored
@@ -19,6 +19,22 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
jobs:
|
||||
enforce-changeset:
|
||||
name: Enforce Changeset
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.title != 'Version Packages'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: main
|
||||
- run: git checkout ${{ github.event.pull_request.head.ref }}
|
||||
- name: install pnpm@8.3.1
|
||||
run: npm i -g pnpm@8.3.1
|
||||
- run: pnpm install
|
||||
# Enforce a changeset file to be present
|
||||
- run: pnpm exec changeset status --since=main
|
||||
|
||||
test:
|
||||
name: Lint
|
||||
timeout-minutes: 10
|
||||
|
||||
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
echo "Files to test:"
|
||||
echo "$TESTS_ARRAY"
|
||||
echo "tests=$TESTS_ARRAY" >> $GITHUB_OUTPUT
|
||||
- uses: patrickedqvist/wait-for-vercel-preview@ae34b392ef30297f2b672f9afb3c329bde9bd487
|
||||
- uses: patrickedqvist/wait-for-vercel-preview@bfdff514ff78a669f2536e9f4dd4ef5813a704a2
|
||||
id: waitForTarball
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -97,11 +97,21 @@ jobs:
|
||||
if: matrix.runner != 'windows-latest'
|
||||
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
|
||||
|
||||
conclusion:
|
||||
summary:
|
||||
name: Summary
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
if: always()
|
||||
needs:
|
||||
- test
|
||||
runs-on: ubuntu-latest
|
||||
name: E2E
|
||||
steps:
|
||||
- name: Done
|
||||
run: echo "Done."
|
||||
- name: Check All
|
||||
run: |-
|
||||
for status in ${{ join(needs.*.result, ' ') }}
|
||||
do
|
||||
if [ "$status" != "success" ] && [ "$status" != "skipped" ]
|
||||
then
|
||||
echo "Some checks failed"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/concepts/projects/environment-variables).
|
||||
|
||||
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
|
||||
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env.local`.
|
||||
|
||||
We require this to ensure your app works as you intend it to, in the development environment, and to provide you with a way to mirror or separate private environment variables within your applications, for example when connecting to a database.
|
||||
|
||||
@@ -12,11 +12,11 @@ Read below for how to address this error.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
The error message will list environment variables that are required and which file they are required to be included in `.env`.
|
||||
The error message will list environment variables that are required and which file they are required to be included in `.env.local`.
|
||||
|
||||
If the file does not exist yet, please create the file that the error message mentions and insert the missing environment variable into it.
|
||||
|
||||
For example, if the error message shows that the environment variable `TEST` is missing from `.env`, then the `.env` file should look like this:
|
||||
For example, if the error message shows that the environment variable `TEST` is missing from `.env.local`, then the `.env.local` file should look like this:
|
||||
|
||||
```
|
||||
TEST=value
|
||||
|
||||
534
examples/nextjs/package-lock.json
generated
534
examples/nextjs/package-lock.json
generated
@@ -8,17 +8,25 @@
|
||||
"name": "nextjs",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"eslint": "8.40.0",
|
||||
"eslint-config-next": "13.4.3",
|
||||
"next": "13.4.3",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-next": "13.4.8",
|
||||
"next": "13.4.8",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@aashutoshrathi/word-wrap": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
|
||||
"integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.21.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz",
|
||||
"integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==",
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz",
|
||||
"integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==",
|
||||
"dependencies": {
|
||||
"regenerator-runtime": "^0.13.11"
|
||||
},
|
||||
@@ -49,13 +57,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz",
|
||||
"integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz",
|
||||
"integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==",
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"debug": "^4.3.2",
|
||||
"espree": "^9.5.2",
|
||||
"espree": "^9.6.0",
|
||||
"globals": "^13.19.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
@@ -71,17 +79,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "8.40.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz",
|
||||
"integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==",
|
||||
"version": "8.44.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz",
|
||||
"integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.8",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
|
||||
"integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==",
|
||||
"version": "0.11.10",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz",
|
||||
"integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==",
|
||||
"dependencies": {
|
||||
"@humanwhocodes/object-schema": "^1.2.1",
|
||||
"debug": "^4.1.1",
|
||||
@@ -109,22 +117,22 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
||||
},
|
||||
"node_modules/@next/env": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.4.3.tgz",
|
||||
"integrity": "sha512-pa1ErjyFensznttAk3EIv77vFbfSYT6cLzVRK5jx4uiRuCQo+m2wCFAREaHKIy63dlgvOyMlzh6R8Inu8H3KrQ=="
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.4.8.tgz",
|
||||
"integrity": "sha512-twuSf1klb3k9wXI7IZhbZGtFCWvGD4wXTY2rmvzIgVhXhs7ISThrbNyutBx3jWIL8Y/Hk9+woytFz5QsgtcRKQ=="
|
||||
},
|
||||
"node_modules/@next/eslint-plugin-next": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.4.3.tgz",
|
||||
"integrity": "sha512-5B0uOnh7wyUY9vNNdIA6NUvWozhrZaTMZOzdirYAefqD0ZBK5C/h3+KMYdCKrR7JrXGvVpWnHtv54b3dCzwICA==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.4.8.tgz",
|
||||
"integrity": "sha512-cmfVHpxWjjcETFt2WHnoFU6EmY69QcPJRlRNAooQlNe53Ke90vg1Ci/dkPffryJZaxxiRziP9bQrV8lDVCn3Fw==",
|
||||
"dependencies": {
|
||||
"glob": "7.1.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-arm64": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.3.tgz",
|
||||
"integrity": "sha512-yx18udH/ZmR4Bw4M6lIIPE3JxsAZwo04iaucEfA2GMt1unXr2iodHUX/LAKNyi6xoLP2ghi0E+Xi1f4Qb8f1LQ==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.8.tgz",
|
||||
"integrity": "sha512-MSFplVM4dTWOuKAUv0XR9gY7AWtMSBu9os9f+kp+s5rWhM1I2CdR3obFttd6366nS/W/VZxbPM5oEIdlIa46zA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -137,9 +145,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-x64": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.3.tgz",
|
||||
"integrity": "sha512-Mi8xJWh2IOjryAM1mx18vwmal9eokJ2njY4nDh04scy37F0LEGJ/diL6JL6kTXi0UfUCGbMsOItf7vpReNiD2A==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.8.tgz",
|
||||
"integrity": "sha512-Reox+UXgonon9P0WNDE6w85DGtyBqGitl/ryznOvn6TvfxEaZIpTgeu3ZrJLU9dHSMhiK7YAM793mE/Zii2/Qw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -152,9 +160,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-gnu": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.3.tgz",
|
||||
"integrity": "sha512-aBvtry4bxJ1xwKZ/LVPeBGBwWVwxa4bTnNkRRw6YffJnn/f4Tv4EGDPaVeYHZGQVA56wsGbtA6nZMuWs/EIk4Q==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.8.tgz",
|
||||
"integrity": "sha512-kdyzYvAYtqQVgzIKNN7e1rLU8aZv86FDSRqPlOkKZlvqudvTO0iohuTPmnEEDlECeBM6qRPShNffotDcU/R2KA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -167,9 +175,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-musl": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.3.tgz",
|
||||
"integrity": "sha512-krT+2G3kEsEUvZoYte3/2IscscDraYPc2B+fDJFipPktJmrv088Pei/RjrhWm5TMIy5URYjZUoDZdh5k940Dyw==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.8.tgz",
|
||||
"integrity": "sha512-oWxx4yRkUGcR81XwbI+T0zhZ3bDF6V1aVLpG+C7hSG50ULpV8gC39UxVO22/bv93ZlcfMY4zl8xkz9Klct6dpQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -182,9 +190,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-gnu": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.3.tgz",
|
||||
"integrity": "sha512-AMdFX6EKJjC0G/CM6hJvkY8wUjCcbdj3Qg7uAQJ7PVejRWaVt0sDTMavbRfgMchx8h8KsAudUCtdFkG9hlEClw==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.8.tgz",
|
||||
"integrity": "sha512-anhtvuO6eE9YRhYnaEGTfbpH3L5gT/9qPFcNoi6xS432r/4DAtpJY8kNktqkTVevVIC/pVumqO8tV59PR3zbNg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -197,9 +205,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-musl": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.3.tgz",
|
||||
"integrity": "sha512-jySgSXE48shaLtcQbiFO9ajE9mqz7pcAVLnVLvRIlUHyQYR/WyZdK8ehLs65Mz6j9cLrJM+YdmdJPyV4WDaz2g==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.8.tgz",
|
||||
"integrity": "sha512-aR+J4wWfNgH1DwCCBNjan7Iumx0lLtn+2/rEYuhIrYLY4vnxqSVGz9u3fXcgUwo6Q9LT8NFkaqK1vPprdq+BXg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -212,9 +220,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-arm64-msvc": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.3.tgz",
|
||||
"integrity": "sha512-5DxHo8uYcaADiE9pHrg8o28VMt/1kR8voDehmfs9AqS0qSClxAAl+CchjdboUvbCjdNWL1MISCvEfKY2InJ3JA==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.8.tgz",
|
||||
"integrity": "sha512-OWBKIrJwQBTqrat0xhxEB/jcsjJR3+diD9nc/Y8F1mRdQzsn4bPsomgJyuqPVZs6Lz3K18qdIkvywmfSq75SsQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -227,9 +235,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-ia32-msvc": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.3.tgz",
|
||||
"integrity": "sha512-LaqkF3d+GXRA5X6zrUjQUrXm2MN/3E2arXBtn5C7avBCNYfm9G3Xc646AmmmpN3DJZVaMYliMyCIQCMDEzk80w==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.8.tgz",
|
||||
"integrity": "sha512-agiPWGjUndXGTOn4ChbKipQXRA6/UPkywAWIkx7BhgGv48TiJfHTK6MGfBoL9tS6B4mtW39++uy0wFPnfD0JWg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -242,9 +250,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-x64-msvc": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.3.tgz",
|
||||
"integrity": "sha512-jglUk/x7ZWeOJWlVoKyIAkHLTI+qEkOriOOV+3hr1GyiywzcqfI7TpFSiwC7kk1scOiH7NTFKp8mA3XPNO9bDw==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.8.tgz",
|
||||
"integrity": "sha512-UIRKoByVKbuR6SnFG4JM8EMFlJrfEGuUQ1ihxzEleWcNwRMMiVaCj1KyqfTOW8VTQhJ0u8P1Ngg6q1RwnIBTtw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -289,9 +297,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@pkgr/utils": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.0.tgz",
|
||||
"integrity": "sha512-2OCURAmRtdlL8iUDTypMrrxfwe8frXTeXaxGsVOaYtc/wrUyk8Z/0OBetM7cdlsy7ZFWlMX72VogKeh+A4Xcjw==",
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.1.tgz",
|
||||
"integrity": "sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fast-glob": "^3.2.12",
|
||||
@@ -308,9 +316,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rushstack/eslint-patch": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz",
|
||||
"integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg=="
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz",
|
||||
"integrity": "sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw=="
|
||||
},
|
||||
"node_modules/@swc/helpers": {
|
||||
"version": "0.5.1",
|
||||
@@ -326,13 +334,13 @@
|
||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "5.59.6",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.6.tgz",
|
||||
"integrity": "sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==",
|
||||
"version": "5.61.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.61.0.tgz",
|
||||
"integrity": "sha512-yGr4Sgyh8uO6fSi9hw3jAFXNBHbCtKKFMdX2IkT3ZqpKmtAq3lHS4ixB/COFuAIJpwl9/AqF7j72ZDWYKmIfvg==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "5.59.6",
|
||||
"@typescript-eslint/types": "5.59.6",
|
||||
"@typescript-eslint/typescript-estree": "5.59.6",
|
||||
"@typescript-eslint/scope-manager": "5.61.0",
|
||||
"@typescript-eslint/types": "5.61.0",
|
||||
"@typescript-eslint/typescript-estree": "5.61.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -352,12 +360,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "5.59.6",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.6.tgz",
|
||||
"integrity": "sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ==",
|
||||
"version": "5.61.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.61.0.tgz",
|
||||
"integrity": "sha512-W8VoMjoSg7f7nqAROEmTt6LoBpn81AegP7uKhhW5KzYlehs8VV0ZW0fIDVbcZRcaP3aPSW+JZFua+ysQN+m/Nw==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.59.6",
|
||||
"@typescript-eslint/visitor-keys": "5.59.6"
|
||||
"@typescript-eslint/types": "5.61.0",
|
||||
"@typescript-eslint/visitor-keys": "5.61.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
@@ -368,9 +376,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "5.59.6",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.6.tgz",
|
||||
"integrity": "sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA==",
|
||||
"version": "5.61.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.61.0.tgz",
|
||||
"integrity": "sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
@@ -380,12 +388,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "5.59.6",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.6.tgz",
|
||||
"integrity": "sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA==",
|
||||
"version": "5.61.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.61.0.tgz",
|
||||
"integrity": "sha512-Fud90PxONnnLZ36oR5ClJBLTLfU4pIWBmnvGwTbEa2cXIqj70AEDEmOmpkFComjBZ/037ueKrOdHuYmSFVD7Rw==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.59.6",
|
||||
"@typescript-eslint/visitor-keys": "5.59.6",
|
||||
"@typescript-eslint/types": "5.61.0",
|
||||
"@typescript-eslint/visitor-keys": "5.61.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -406,11 +414,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "5.59.6",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.6.tgz",
|
||||
"integrity": "sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q==",
|
||||
"version": "5.61.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.61.0.tgz",
|
||||
"integrity": "sha512-50XQ5VdbWrX06mQXhy93WywSFZZGsv3EOjq+lqp6WC2t+j3mb6A9xYVdrRxafvK88vg9k9u+CT4l6D8PEatjKg==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.59.6",
|
||||
"@typescript-eslint/types": "5.61.0",
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -422,9 +430,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
|
||||
"integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
|
||||
"version": "8.9.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz",
|
||||
"integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -483,11 +491,11 @@
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"node_modules/aria-query": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz",
|
||||
"integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==",
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
||||
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
||||
"dependencies": {
|
||||
"deep-equal": "^2.0.5"
|
||||
"dequal": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/array-buffer-byte-length": {
|
||||
@@ -591,19 +599,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axe-core": {
|
||||
"version": "4.7.1",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.1.tgz",
|
||||
"integrity": "sha512-sCXXUhA+cljomZ3ZAwb8i1p3oOlkABzPy08ZDAoGcYuvtBPlQ1Ytde129ArXyHWDhfeewq7rlx9F+cUx2SSlkg==",
|
||||
"version": "4.7.2",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.2.tgz",
|
||||
"integrity": "sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/axobject-query": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
|
||||
"integrity": "sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==",
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
||||
"integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
|
||||
"dependencies": {
|
||||
"deep-equal": "^2.0.5"
|
||||
"dequal": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
@@ -696,9 +704,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001488",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001488.tgz",
|
||||
"integrity": "sha512-NORIQuuL4xGpIy6iCCQGN4iFjlBXtfKWIenlUuyZJumLRIindLb7wXM+GO8erEhb7vXfcnf4BAg2PrSDN5TNLQ==",
|
||||
"version": "1.0.30001511",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001511.tgz",
|
||||
"integrity": "sha512-NaWPJawcoedlghN4P7bDNeADD7K+rZaY6V8ZcME7PkEZo/nfOg+lnrUgRWiKbNxcQ4/toFKSxnS4WdbyPZnKkw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -789,34 +797,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/deep-equal": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz",
|
||||
"integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==",
|
||||
"dependencies": {
|
||||
"array-buffer-byte-length": "^1.0.0",
|
||||
"call-bind": "^1.0.2",
|
||||
"es-get-iterator": "^1.1.3",
|
||||
"get-intrinsic": "^1.2.0",
|
||||
"is-arguments": "^1.1.1",
|
||||
"is-array-buffer": "^3.0.2",
|
||||
"is-date-object": "^1.0.5",
|
||||
"is-regex": "^1.1.4",
|
||||
"is-shared-array-buffer": "^1.0.2",
|
||||
"isarray": "^2.0.5",
|
||||
"object-is": "^1.1.5",
|
||||
"object-keys": "^1.1.1",
|
||||
"object.assign": "^4.1.4",
|
||||
"regexp.prototype.flags": "^1.5.0",
|
||||
"side-channel": "^1.0.4",
|
||||
"which-boxed-primitive": "^1.0.2",
|
||||
"which-collection": "^1.0.1",
|
||||
"which-typed-array": "^1.1.9"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/deep-is": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
||||
@@ -880,6 +860,14 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/dequal": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
||||
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
@@ -908,9 +896,9 @@
|
||||
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.14.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz",
|
||||
"integrity": "sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==",
|
||||
"version": "5.15.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz",
|
||||
"integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
"tapable": "^2.2.0"
|
||||
@@ -966,25 +954,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/es-get-iterator": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz",
|
||||
"integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.1.3",
|
||||
"has-symbols": "^1.0.3",
|
||||
"is-arguments": "^1.1.1",
|
||||
"is-map": "^2.0.2",
|
||||
"is-set": "^2.0.2",
|
||||
"is-string": "^1.0.7",
|
||||
"isarray": "^2.0.5",
|
||||
"stop-iteration-iterator": "^1.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/es-set-tostringtag": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz",
|
||||
@@ -1034,15 +1003,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.40.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz",
|
||||
"integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==",
|
||||
"version": "8.44.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz",
|
||||
"integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.4.0",
|
||||
"@eslint/eslintrc": "^2.0.3",
|
||||
"@eslint/js": "8.40.0",
|
||||
"@humanwhocodes/config-array": "^0.11.8",
|
||||
"@eslint/eslintrc": "^2.1.0",
|
||||
"@eslint/js": "8.44.0",
|
||||
"@humanwhocodes/config-array": "^0.11.10",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
"ajv": "^6.10.0",
|
||||
@@ -1053,7 +1022,7 @@
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"eslint-scope": "^7.2.0",
|
||||
"eslint-visitor-keys": "^3.4.1",
|
||||
"espree": "^9.5.2",
|
||||
"espree": "^9.6.0",
|
||||
"esquery": "^1.4.2",
|
||||
"esutils": "^2.0.2",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
@@ -1061,20 +1030,19 @@
|
||||
"find-up": "^5.0.0",
|
||||
"glob-parent": "^6.0.2",
|
||||
"globals": "^13.19.0",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.0.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"is-glob": "^4.0.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
"js-sdsl": "^4.1.4",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||
"levn": "^0.4.1",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"minimatch": "^3.1.2",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.9.1",
|
||||
"optionator": "^0.9.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"strip-json-comments": "^3.1.0",
|
||||
"text-table": "^0.2.0"
|
||||
@@ -1090,11 +1058,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-next": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.4.3.tgz",
|
||||
"integrity": "sha512-1lXwdFi29fKxzeugof/TUE7lpHyJQt5+U4LaUHyvQfHjvsWO77vFNicJv5sX6k0VDVSbnfz0lw+avxI+CinbMg==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.4.8.tgz",
|
||||
"integrity": "sha512-2hE0b6lHuhtHBX8VgEXi8v4G8PVrPUBMOSLCTq8qtcQ2qQOX7+uBOLK2kU4FD2qDZzyXNlhmuH+WLT5ptY4XLA==",
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "13.4.3",
|
||||
"@next/eslint-plugin-next": "13.4.8",
|
||||
"@rushstack/eslint-patch": "^1.1.3",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint-import-resolver-node": "^0.3.6",
|
||||
@@ -1158,9 +1126,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-typescript/node_modules/globby": {
|
||||
"version": "13.1.4",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz",
|
||||
"integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==",
|
||||
"version": "13.2.1",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-13.2.1.tgz",
|
||||
"integrity": "sha512-DPCBxctI7dN4EeIqjW2KGqgdcUMbrhJ9AzON+PlxCtvppWhubTLD4+a0GFxiym14ZvacUydTPjLPc2DlKz7EIg==",
|
||||
"dependencies": {
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.2.11",
|
||||
@@ -1403,11 +1371,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "9.5.2",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz",
|
||||
"integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==",
|
||||
"version": "9.6.0",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz",
|
||||
"integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==",
|
||||
"dependencies": {
|
||||
"acorn": "^8.8.0",
|
||||
"acorn": "^8.9.0",
|
||||
"acorn-jsx": "^5.3.2",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
@@ -1484,9 +1452,9 @@
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.2.12",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz",
|
||||
"integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==",
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz",
|
||||
"integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "^2.0.2",
|
||||
"@nodelib/fs.walk": "^1.2.3",
|
||||
@@ -1665,9 +1633,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/get-tsconfig": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.5.0.tgz",
|
||||
"integrity": "sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==",
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.6.2.tgz",
|
||||
"integrity": "sha512-E5XrT4CbbXcXWy+1jChlZmrmCwd5KGx502kDCXJJ7y898TtWW9FwoG5HfOLVRKmlmDGkWN2HM9Ho+/Y8F0sJDg==",
|
||||
"dependencies": {
|
||||
"resolve-pkg-maps": "^1.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
|
||||
}
|
||||
@@ -1702,6 +1673,11 @@
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/glob-to-regexp": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
|
||||
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw=="
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "13.20.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz",
|
||||
@@ -1765,10 +1741,10 @@
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
||||
},
|
||||
"node_modules/grapheme-splitter": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
|
||||
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ=="
|
||||
"node_modules/graphemer": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
|
||||
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag=="
|
||||
},
|
||||
"node_modules/has": {
|
||||
"version": "1.0.3",
|
||||
@@ -1910,21 +1886,6 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/is-arguments": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
|
||||
"integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"has-tostringtag": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-array-buffer": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz",
|
||||
@@ -2050,14 +2011,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-map": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz",
|
||||
"integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-negative-zero": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz",
|
||||
@@ -2114,14 +2067,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-set": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz",
|
||||
"integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-shared-array-buffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz",
|
||||
@@ -2190,14 +2135,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-weakmap": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz",
|
||||
"integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-weakref": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
|
||||
@@ -2209,18 +2146,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-weakset": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz",
|
||||
"integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.1.1"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-wsl": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||
@@ -2246,25 +2171,11 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
|
||||
"integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
|
||||
},
|
||||
"node_modules/js-sdsl": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz",
|
||||
"integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/js-sdsl"
|
||||
}
|
||||
},
|
||||
"node_modules/js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
@@ -2303,12 +2214,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jsx-ast-utils": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz",
|
||||
"integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.4.tgz",
|
||||
"integrity": "sha512-fX2TVdCViod6HwKEtSWGHs57oFhVfCMwieb9PuRDgjDPh5XeqJiHFFFJCHxU5cnTc3Bu/GRL+kPiFmw8XWOfKw==",
|
||||
"dependencies": {
|
||||
"array-includes": "^3.1.5",
|
||||
"object.assign": "^4.1.3"
|
||||
"array-includes": "^3.1.6",
|
||||
"array.prototype.flat": "^1.3.1",
|
||||
"object.assign": "^4.1.4",
|
||||
"object.values": "^1.1.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
@@ -2463,16 +2376,17 @@
|
||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
|
||||
},
|
||||
"node_modules/next": {
|
||||
"version": "13.4.3",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.4.3.tgz",
|
||||
"integrity": "sha512-FV3pBrAAnAIfOclTvncw9dDohyeuEEXPe5KNcva91anT/rdycWbgtu3IjUj4n5yHnWK8YEPo0vrUecHmnmUNbA==",
|
||||
"version": "13.4.8",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.4.8.tgz",
|
||||
"integrity": "sha512-lxUjndYKjZHGK3CWeN2RI+/6ni6EUvjiqGWXAYPxUfGIdFGQ5XoisrqAJ/dF74aP27buAfs8MKIbIMMdxjqSBg==",
|
||||
"dependencies": {
|
||||
"@next/env": "13.4.3",
|
||||
"@next/env": "13.4.8",
|
||||
"@swc/helpers": "0.5.1",
|
||||
"busboy": "1.6.0",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
"postcss": "8.4.14",
|
||||
"styled-jsx": "5.1.1",
|
||||
"watchpack": "2.4.0",
|
||||
"zod": "3.21.4"
|
||||
},
|
||||
"bin": {
|
||||
@@ -2482,20 +2396,19 @@
|
||||
"node": ">=16.8.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@next/swc-darwin-arm64": "13.4.3",
|
||||
"@next/swc-darwin-x64": "13.4.3",
|
||||
"@next/swc-linux-arm64-gnu": "13.4.3",
|
||||
"@next/swc-linux-arm64-musl": "13.4.3",
|
||||
"@next/swc-linux-x64-gnu": "13.4.3",
|
||||
"@next/swc-linux-x64-musl": "13.4.3",
|
||||
"@next/swc-win32-arm64-msvc": "13.4.3",
|
||||
"@next/swc-win32-ia32-msvc": "13.4.3",
|
||||
"@next/swc-win32-x64-msvc": "13.4.3"
|
||||
"@next/swc-darwin-arm64": "13.4.8",
|
||||
"@next/swc-darwin-x64": "13.4.8",
|
||||
"@next/swc-linux-arm64-gnu": "13.4.8",
|
||||
"@next/swc-linux-arm64-musl": "13.4.8",
|
||||
"@next/swc-linux-x64-gnu": "13.4.8",
|
||||
"@next/swc-linux-x64-musl": "13.4.8",
|
||||
"@next/swc-win32-arm64-msvc": "13.4.8",
|
||||
"@next/swc-win32-ia32-msvc": "13.4.8",
|
||||
"@next/swc-win32-x64-msvc": "13.4.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opentelemetry/api": "^1.1.0",
|
||||
"fibers": ">= 3.1.0",
|
||||
"node-sass": "^6.0.0 || ^7.0.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"sass": "^1.3.0"
|
||||
@@ -2507,9 +2420,6 @@
|
||||
"fibers": {
|
||||
"optional": true
|
||||
},
|
||||
"node-sass": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
}
|
||||
@@ -2556,21 +2466,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/object-is": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz",
|
||||
"integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"define-properties": "^1.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/object-keys": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
||||
@@ -2693,16 +2588,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
|
||||
"integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
|
||||
"integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
|
||||
"dependencies": {
|
||||
"@aashutoshrathi/word-wrap": "^1.2.3",
|
||||
"deep-is": "^0.1.3",
|
||||
"fast-levenshtein": "^2.0.6",
|
||||
"levn": "^0.4.1",
|
||||
"prelude-ls": "^1.2.1",
|
||||
"type-check": "^0.4.0",
|
||||
"word-wrap": "^1.2.3"
|
||||
"type-check": "^0.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
@@ -2941,6 +2836,14 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-pkg-maps": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
|
||||
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
|
||||
"funding": {
|
||||
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/reusify": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
|
||||
@@ -3104,9 +3007,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz",
|
||||
"integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==",
|
||||
"version": "7.5.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz",
|
||||
"integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
@@ -3170,17 +3073,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/stop-iteration-iterator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz",
|
||||
"integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==",
|
||||
"dependencies": {
|
||||
"internal-slot": "^1.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/streamsearch": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
|
||||
@@ -3396,9 +3288,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz",
|
||||
"integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA=="
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
|
||||
"integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA=="
|
||||
},
|
||||
"node_modules/tsutils": {
|
||||
"version": "3.21.0",
|
||||
@@ -3455,16 +3347,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz",
|
||||
"integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==",
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz",
|
||||
"integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/unbox-primitive": {
|
||||
@@ -3497,6 +3389,18 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/watchpack": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
|
||||
"dependencies": {
|
||||
"glob-to-regexp": "^0.4.1",
|
||||
"graceful-fs": "^4.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
@@ -3526,20 +3430,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/which-collection": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz",
|
||||
"integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==",
|
||||
"dependencies": {
|
||||
"is-map": "^2.0.1",
|
||||
"is-set": "^2.0.1",
|
||||
"is-weakmap": "^2.0.1",
|
||||
"is-weakset": "^2.0.1"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/which-typed-array": {
|
||||
"version": "1.1.9",
|
||||
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz",
|
||||
@@ -3559,14 +3449,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "8.40.0",
|
||||
"eslint-config-next": "13.4.3",
|
||||
"next": "13.4.3",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-next": "13.4.8",
|
||||
"next": "13.4.8",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
|
||||
2
examples/package.json
vendored
2
examples/package.json
vendored
@@ -9,6 +9,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "27.4.1",
|
||||
"@vercel/frameworks": "1.3.0"
|
||||
"@vercel/frameworks": "1.4.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "preact build",
|
||||
"build": "NODE_OPTIONS=--openssl-legacy-provider preact build",
|
||||
"serve": "sirv build --port 8080 --cors --single",
|
||||
"dev": "preact watch",
|
||||
"lint": "eslint src",
|
||||
"test": "jest"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16.x"
|
||||
"node": "18.x"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "preact",
|
||||
@@ -17,19 +17,19 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-preact-pure": "^2.0.0",
|
||||
"eslint": "^6.0.1",
|
||||
"eslint-config-preact": "^1.1.0",
|
||||
"jest": "^24.9.0",
|
||||
"jest-preset-preact": "^1.0.0",
|
||||
"preact-cli": "^3.0.0",
|
||||
"sirv-cli": "1.0.3"
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-preact-pure": "^4.1.0",
|
||||
"eslint": "^8.41.0",
|
||||
"eslint-config-preact": "^1.3.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest-preset-preact": "^4.0.4",
|
||||
"preact-cli": "^3.4.5",
|
||||
"sirv-cli": "2.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"preact": "^10.3.2",
|
||||
"preact-render-to-string": "^5.1.4",
|
||||
"preact-router": "^3.2.1"
|
||||
"preact": "^10.15.0",
|
||||
"preact-render-to-string": "6.0.3",
|
||||
"preact-router": "^4.1.1"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-preset-preact",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
extends: ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
|
||||
};
|
||||
|
||||
7
examples/remix/.gitignore
vendored
7
examples/remix/.gitignore
vendored
@@ -1,11 +1,12 @@
|
||||
node_modules
|
||||
|
||||
.cache
|
||||
/.cache
|
||||
/build
|
||||
/public/build
|
||||
.env
|
||||
|
||||
.vercel
|
||||
.output
|
||||
|
||||
/build/
|
||||
/public/build
|
||||
/api/index.js
|
||||
/api/index.js.map
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MetaFunction } from "@vercel/remix";
|
||||
import { cssBundleHref } from "@remix-run/css-bundle";
|
||||
import {
|
||||
Links,
|
||||
LiveReload,
|
||||
@@ -8,17 +8,18 @@ import {
|
||||
ScrollRestoration,
|
||||
} from "@remix-run/react";
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
import type { LinksFunction } from "@vercel/remix";
|
||||
|
||||
export const meta: MetaFunction = () => ({
|
||||
charset: "utf-8",
|
||||
title: "New Remix App",
|
||||
viewport: "width=device-width,initial-scale=1",
|
||||
});
|
||||
export const links: LinksFunction = () => [
|
||||
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
|
||||
];
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import type { V2_MetaFunction } from "@vercel/remix";
|
||||
|
||||
export const meta: V2_MetaFunction = () => [{ title: "New Remix App" }];
|
||||
|
||||
export default function Index() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
@@ -1,5 +1,9 @@
|
||||
import type { V2_MetaFunction } from "@vercel/remix";
|
||||
|
||||
export const config = { runtime: "edge" };
|
||||
|
||||
export const meta: V2_MetaFunction = () => [{ title: "Remix@Edge | New Remix App" }];
|
||||
|
||||
export default function Edge() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
|
||||
@@ -3,24 +3,28 @@
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "remix build",
|
||||
"dev": "remix dev"
|
||||
"dev": "remix dev",
|
||||
"start": "remix-serve build",
|
||||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/node": "^1.15.0",
|
||||
"@remix-run/react": "^1.15.0",
|
||||
"@remix-run/serve": "^1.15.0",
|
||||
"@remix-run/css-bundle": "^1.18.0",
|
||||
"@remix-run/node": "^1.18.0",
|
||||
"@remix-run/react": "^1.18.0",
|
||||
"@remix-run/serve": "^1.18.0",
|
||||
"@vercel/analytics": "^0.1.11",
|
||||
"@vercel/remix": "^1.15.0",
|
||||
"@vercel/remix": "^1.18.0",
|
||||
"isbot": "^3.6.8",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@remix-run/dev": "^1.15.0",
|
||||
"@remix-run/eslint-config": "^1.15.0",
|
||||
"@remix-run/dev": "^1.18.0",
|
||||
"@remix-run/eslint-config": "^1.18.0",
|
||||
"@types/react": "^18.0.25",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"eslint": "^8.28.0",
|
||||
"typescript": "^4.9.3"
|
||||
"typescript": "^5.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
|
||||
7492
examples/remix/pnpm-lock.yaml
generated
7492
examples/remix/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,15 @@
|
||||
/**
|
||||
* @type {import('@remix-run/dev').AppConfig}
|
||||
*/
|
||||
/** @type {import('@remix-run/dev').AppConfig} */
|
||||
module.exports = {
|
||||
ignoredRouteFiles: ['**/.*'],
|
||||
future: {
|
||||
v2_dev: true,
|
||||
v2_errorBoundary: true,
|
||||
v2_headers: true,
|
||||
v2_meta: true,
|
||||
v2_normalizeFormMethod: true,
|
||||
v2_routeConvention: true,
|
||||
},
|
||||
ignoredRouteFiles: ["**/.*"],
|
||||
serverModuleFormat: "cjs",
|
||||
// appDirectory: "app",
|
||||
// assetsBuildDirectory: "public/build",
|
||||
// serverBuildPath: "build/index.js",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Saber Example
|
||||
|
||||
This directory is a brief example of a [Saber](https://saber.land) site that can be deployed to Vercel with zero configuration.
|
||||
This directory is a brief example of a [Saber](https://saber.egoist.dev) site that can be deployed to Vercel with zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ layout: page
|
||||
|
||||
This is the Saber port of the base Jekyll theme. Check out the [GitHub project](https://github.com/egoist/saber-theme-minima) for detailed usages.
|
||||
|
||||
You can find out more info about customizing your theme, as well as basic Saber usage documentation at https://saber.land
|
||||
You can find out more info about customizing your theme, as well as basic Saber usage documentation at https://saber.egoist.dev
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"solid-start-vercel": "^0.2.0",
|
||||
"typescript": "^4.8.3",
|
||||
"vite": "^3.1.0"
|
||||
"solid-start-vercel": "^0.2.26",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.3.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"@solidjs/meta": "^0.28.2",
|
||||
"@solidjs/router": "^0.5.0",
|
||||
"solid-js": "^1.6.0",
|
||||
"solid-start": "^0.2.0",
|
||||
"undici": "^5.11.0"
|
||||
"@solidjs/meta": "^0.28.5",
|
||||
"@solidjs/router": "^0.8.2",
|
||||
"solid-js": "^1.7.5",
|
||||
"solid-start": "^0.2.26",
|
||||
"undici": "^5.22.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16.x"
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
4
examples/storybook/vercel.json
Normal file
4
examples/storybook/vercel.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"framework": "storybook",
|
||||
"buildCommand": "storybook build"
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['eslint:recommended', 'prettier'],
|
||||
plugins: ['svelte3'],
|
||||
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
|
||||
extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'],
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020
|
||||
ecmaVersion: 2020,
|
||||
extraFileExtensions: ['.svelte']
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
engine-strict=true
|
||||
resolution-mode=highest
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
# create-svelte
|
||||
# SvelteKit Demo app
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
|
||||
The official demo app for SvelteKit, hosted on Vercel.
|
||||
|
||||
## Creating a project
|
||||
## Deploy Your Own
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fvercel%2Ftree%2Fmain%2Fexamples%2Fsveltekit-1&project-name=sveltekit-vercel&repository-name=sveltekit-vercel&demo-title=SvelteKit%20%2B%20Vercel&demo-url=https%3A%2F%2Fsveltekit-template.vercel.app%2F)
|
||||
|
||||
```bash
|
||||
# create a new project in the current directory
|
||||
npm create svelte@latest
|
||||
|
||||
# create a new project in my-app
|
||||
npm create svelte@latest my-app
|
||||
```
|
||||
_Live Example: https://sveltekit-template.vercel.app_
|
||||
|
||||
## Developing
|
||||
|
||||
@@ -35,4 +29,8 @@ npm run build
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
||||
## Speed Insights
|
||||
|
||||
Once deployed on Vercel, you can benefit from [Speed Insights](https://vercel.com/docs/concepts/speed-insights) simply by navigating to Vercel's dashboard, clicking on the 'Speed Insights' tab, and enabling the product.
|
||||
|
||||
You will get data once your application will be re-deployed and will receive visitors.
|
||||
|
||||
@@ -16,19 +16,20 @@
|
||||
"@fontsource/fira-mono": "^4.5.10",
|
||||
"@neoconfetti/svelte": "^1.0.0",
|
||||
"@playwright/test": "^1.28.1",
|
||||
"@sveltejs/adapter-vercel": "^1.0.0",
|
||||
"@sveltejs/kit": "^1.0.0",
|
||||
"@sveltejs/adapter-vercel": "^3.0.0",
|
||||
"@sveltejs/kit": "^1.5.0",
|
||||
"@types/cookie": "^0.5.1",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-svelte3": "^4.0.0",
|
||||
"eslint-plugin-svelte": "^2.26.0",
|
||||
"prettier": "^2.8.0",
|
||||
"prettier-plugin-svelte": "^2.8.1",
|
||||
"svelte": "^3.54.0",
|
||||
"svelte-check": "^2.9.2",
|
||||
"typescript": "^4.9.3",
|
||||
"vite": "^4.0.0",
|
||||
"vitest": "^0.25.3"
|
||||
"svelte-check": "^3.0.1",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^4.3.0",
|
||||
"vitest": "^0.25.3",
|
||||
"web-vitals": "^3.3.1"
|
||||
},
|
||||
"type": "module"
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ const config = {
|
||||
command: 'npm run build && npm run preview',
|
||||
port: 4173
|
||||
},
|
||||
testDir: 'tests'
|
||||
testDir: 'tests',
|
||||
testMatch: /(.+\.)?(test|spec)\.[jt]s/
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
786
examples/sveltekit-1/pnpm-lock.yaml
generated
786
examples/sveltekit-1/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
15
examples/sveltekit-1/src/app.d.ts
vendored
15
examples/sveltekit-1/src/app.d.ts
vendored
@@ -1,9 +1,12 @@
|
||||
// See https://kit.svelte.dev/docs/types#app
|
||||
// for information about these interfaces
|
||||
// and what to do when importing types
|
||||
declare namespace App {
|
||||
// interface Error {}
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface Platform {}
|
||||
declare global {
|
||||
namespace App {
|
||||
// interface Error {}
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface Platform {}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
|
||||
63
examples/sveltekit-1/src/lib/vitals.js
Normal file
63
examples/sveltekit-1/src/lib/vitals.js
Normal file
@@ -0,0 +1,63 @@
|
||||
import { onCLS, onFCP, onFID, onLCP, onTTFB } from 'web-vitals';
|
||||
|
||||
const vitalsUrl = 'https://vitals.vercel-analytics.com/v1/vitals';
|
||||
|
||||
function getConnectionSpeed() {
|
||||
// @ts-ignore
|
||||
return navigator?.connection?.effectiveType ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("web-vitals").Metric} metric
|
||||
* @param {{ params: { [s: string]: any; } | ArrayLike<any>; path: string; analyticsId: string; debug: boolean; }} options
|
||||
*/
|
||||
function sendToAnalytics(metric, options) {
|
||||
const page = Object.entries(options.params).reduce(
|
||||
(acc, [key, value]) => acc.replace(value, `[${key}]`),
|
||||
options.path
|
||||
);
|
||||
|
||||
const body = {
|
||||
dsn: options.analyticsId,
|
||||
id: metric.id,
|
||||
page,
|
||||
href: location.href,
|
||||
event_name: metric.name,
|
||||
value: metric.value.toString(),
|
||||
speed: getConnectionSpeed()
|
||||
};
|
||||
|
||||
if (options.debug) {
|
||||
console.log('[Web Vitals]', metric.name, JSON.stringify(body, null, 2));
|
||||
}
|
||||
|
||||
const blob = new Blob([new URLSearchParams(body).toString()], {
|
||||
// This content type is necessary for `sendBeacon`
|
||||
type: 'application/x-www-form-urlencoded'
|
||||
});
|
||||
if (navigator.sendBeacon) {
|
||||
navigator.sendBeacon(vitalsUrl, blob);
|
||||
} else
|
||||
fetch(vitalsUrl, {
|
||||
body: blob,
|
||||
method: 'POST',
|
||||
credentials: 'omit',
|
||||
keepalive: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} options
|
||||
*/
|
||||
export function webVitals(options) {
|
||||
try {
|
||||
console.log(`[Web Vitals] for page ${options.path}`);
|
||||
onFID((metric) => sendToAnalytics(metric, options));
|
||||
onTTFB((metric) => sendToAnalytics(metric, options));
|
||||
onLCP((metric) => sendToAnalytics(metric, options));
|
||||
onCLS((metric) => sendToAnalytics(metric, options));
|
||||
onFCP((metric) => sendToAnalytics(metric, options));
|
||||
} catch (err) {
|
||||
console.error(`[Web Vitals] for page ${options.path}`, err);
|
||||
}
|
||||
}
|
||||
6
examples/sveltekit-1/src/routes/+layout.server.js
Normal file
6
examples/sveltekit-1/src/routes/+layout.server.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
/** @type {import('./$types').LayoutServerLoad} */
|
||||
export function load() {
|
||||
return { analyticsId: env.VERCEL_ANALYTICS_ID };
|
||||
}
|
||||
@@ -1,6 +1,20 @@
|
||||
<script>
|
||||
import { browser } from '$app/environment';
|
||||
import { page } from '$app/stores';
|
||||
import { webVitals } from '$lib/vitals';
|
||||
import Header from './Header.svelte';
|
||||
import './styles.css';
|
||||
|
||||
/** @type {import('./$types').LayoutServerData} */
|
||||
export let data;
|
||||
|
||||
$: if (browser && data?.analyticsId) {
|
||||
webVitals({
|
||||
path: $page.url.pathname,
|
||||
params: $page.params,
|
||||
analyticsId: data.analyticsId
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="app">
|
||||
|
||||
@@ -107,11 +107,11 @@
|
||||
<a class="how-to-play" href="/sverdle/how-to-play">How to play</a>
|
||||
|
||||
<div class="grid" class:playing={!won} class:bad-guess={form?.badGuess}>
|
||||
{#each Array(6) as _, row}
|
||||
{#each Array.from(Array(6).keys()) as row (row)}
|
||||
{@const current = row === i}
|
||||
<h2 class="visually-hidden">Row {row + 1}</h2>
|
||||
<div class="row" class:current>
|
||||
{#each Array(5) as _, column}
|
||||
{#each Array.from(Array(5).keys()) as column (column)}
|
||||
{@const answer = data.answers[row]?.[column]}
|
||||
{@const value = data.guesses[row]?.[column] ?? ''}
|
||||
{@const selected = current && column === data.guesses[row].length}
|
||||
|
||||
@@ -2,5 +2,5 @@ import { expect, test } from '@playwright/test';
|
||||
|
||||
test('about page has expected h1', async ({ page }) => {
|
||||
await page.goto('/about');
|
||||
expect(await page.textContent('h1')).toBe('About this app');
|
||||
await expect(page.getByRole('heading', { name: 'About this app' })).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
/** @type {import('vite').UserConfig} */
|
||||
const config = {
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()],
|
||||
test: {
|
||||
include: ['src/**/*.{test,spec}.{js,ts}']
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
});
|
||||
|
||||
@@ -6,20 +6,20 @@
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16.x"
|
||||
"node": "18.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.6.5",
|
||||
"vue": "^3.0.0"
|
||||
"core-js": "^3.30.2",
|
||||
"vue": "^3.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^7.0.0"
|
||||
"@vue/cli-plugin-babel": "~5.0.8",
|
||||
"@vue/cli-plugin-eslint": "~5.0.8",
|
||||
"@vue/cli-service": "~5.0.8",
|
||||
"@vue/compiler-sfc": "^3.3.4",
|
||||
"@babel/eslint-parser": "^7.21.8",
|
||||
"eslint": "^8.4.1",
|
||||
"eslint-plugin-vue": "^9.14.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
@@ -31,7 +31,7 @@
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint"
|
||||
"parser": "@babel/eslint-parser"
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
28
internals/constants/CHANGELOG.md
Normal file
28
internals/constants/CHANGELOG.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# @vercel-internals/constants
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Create new help output and arg parsing for deploy command ([#10090](https://github.com/vercel/vercel/pull/10090))
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c)]:
|
||||
- @vercel/build-utils@6.8.0
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`cd35071f6`](https://github.com/vercel/vercel/commit/cd35071f609d615d47bc04634c123b33768436cb)]:
|
||||
- @vercel/build-utils@6.7.5
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c7bcea408`](https://github.com/vercel/vercel/commit/c7bcea408131df2d65338e50ce319a6d8e4a8a82)]:
|
||||
- @vercel/build-utils@6.7.4
|
||||
@@ -1,17 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/constants",
|
||||
"version": "1.0.4",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.3.2",
|
||||
"@vercel/routing-utils": "2.1.10"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@vercel-internals/tsconfig": "*",
|
||||
"@vercel-internals/tsconfig": "1.0.0",
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
"typescript": "4.9.4"
|
||||
}
|
||||
|
||||
@@ -3,3 +3,7 @@ export const PROJECT_ENV_TARGET = [
|
||||
'preview',
|
||||
'development',
|
||||
] as const;
|
||||
|
||||
export const LOGO = '▲' as const;
|
||||
export const NAME = 'vercel' as const;
|
||||
export const TITLE = 'Vercel' as const;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/get-package-json",
|
||||
"version": "1.0.0",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
@@ -14,7 +15,7 @@
|
||||
"devDependencies": {
|
||||
"@types/jest": "29.5.0",
|
||||
"@types/node": "14.14.31",
|
||||
"@vercel-internals/tsconfig": "*",
|
||||
"@vercel-internals/tsconfig": "1.0.0",
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
"jest": "29.5.0",
|
||||
"ts-jest": "29.1.0",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/tsconfig",
|
||||
"version": "1.0.0",
|
||||
"description": "Node.js tsconfig file based on `@vercel/style-guide`",
|
||||
"files": [
|
||||
"tsconfig.json"
|
||||
|
||||
33
internals/types/CHANGELOG.md
Normal file
33
internals/types/CHANGELOG.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`7021279b2`](https://github.com/vercel/vercel/commit/7021279b284f314a4d1bdbb4306b4c22291efa08), [`718bbd365`](https://github.com/vercel/vercel/commit/718bbd365a50271a980bdca231ca801a0eead32b)]:
|
||||
- @vercel/build-utils@6.8.1
|
||||
- @vercel-internals/constants@1.0.4
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c)]:
|
||||
- @vercel/build-utils@6.8.0
|
||||
- @vercel-internals/constants@1.0.3
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`cd35071f6`](https://github.com/vercel/vercel/commit/cd35071f609d615d47bc04634c123b33768436cb)]:
|
||||
- @vercel/build-utils@6.7.5
|
||||
- @vercel-internals/constants@1.0.2
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c7bcea408`](https://github.com/vercel/vercel/commit/c7bcea408131df2d65338e50ce319a6d8e4a8a82)]:
|
||||
- @vercel/build-utils@6.7.4
|
||||
- @vercel-internals/constants@1.0.1
|
||||
99
internals/types/index.d.ts
vendored
99
internals/types/index.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import type { BuilderFunctions } from '@vercel/build-utils';
|
||||
import type { Readable, Writable } from 'stream';
|
||||
import type * as tty from 'tty';
|
||||
import type { Route } from '@vercel/routing-utils';
|
||||
import { PROJECT_ENV_TARGET } from '@vercel-internals/constants';
|
||||
|
||||
@@ -157,6 +158,7 @@ export type Deployment = {
|
||||
errorLink?: string;
|
||||
errorMessage?: string | null;
|
||||
errorStep?: string;
|
||||
forced?: boolean;
|
||||
functions?: BuilderFunctions | null;
|
||||
gitSource?: {
|
||||
org?: string;
|
||||
@@ -183,6 +185,7 @@ export type Deployment = {
|
||||
ownerId?: string;
|
||||
plan?: 'enterprise' | 'hobby' | 'oss' | 'pro';
|
||||
previewCommentsEnabled?: boolean;
|
||||
private?: boolean;
|
||||
projectId?: string;
|
||||
projectSettings?: {
|
||||
buildCommand?: string | null;
|
||||
@@ -353,7 +356,7 @@ export interface Project extends ProjectSettings {
|
||||
link?: ProjectLinkData;
|
||||
alias?: ProjectAliasTarget[];
|
||||
latestDeployments?: Partial<Deployment>[];
|
||||
lastRollbackTarget: RollbackTarget | null;
|
||||
lastAliasRequest?: LastAliasRequest | null;
|
||||
}
|
||||
|
||||
export interface Org {
|
||||
@@ -363,31 +366,77 @@ export interface Org {
|
||||
}
|
||||
|
||||
export interface ProjectLink {
|
||||
/**
|
||||
* ID of the Vercel Project.
|
||||
*/
|
||||
projectId: string;
|
||||
/**
|
||||
* User or Team ID of the owner of the Vercel Project.
|
||||
*/
|
||||
orgId: string;
|
||||
/**
|
||||
* When linked as a repository, contains the absolute path
|
||||
* to the root directory of the repository.
|
||||
*/
|
||||
repoRoot?: string;
|
||||
/**
|
||||
* When linked as a repository, contains the relative path
|
||||
* to the selected project root directory.
|
||||
*/
|
||||
projectRootDirectory?: string;
|
||||
}
|
||||
|
||||
export interface PaginationOptions {
|
||||
prev: number;
|
||||
/**
|
||||
* Amount of items in the current page.
|
||||
* @example 20
|
||||
*/
|
||||
count: number;
|
||||
next?: number;
|
||||
/**
|
||||
* Timestamp that must be used to request the next page.
|
||||
* @example 1540095775951
|
||||
*/
|
||||
next: number | null;
|
||||
/**
|
||||
* Timestamp that must be used to request the previous page.
|
||||
* @example 1540095775951
|
||||
*/
|
||||
prev: number | null;
|
||||
}
|
||||
|
||||
export type ProjectLinkResult =
|
||||
| { status: 'linked'; org: Org; project: Project }
|
||||
| { status: 'not_linked'; org: null; project: null }
|
||||
| {
|
||||
status: 'error';
|
||||
exitCode: number;
|
||||
reason?:
|
||||
| 'HEADLESS'
|
||||
| 'NOT_AUTHORIZED'
|
||||
| 'TEAM_DELETED'
|
||||
| 'PATH_IS_FILE'
|
||||
| 'INVALID_ROOT_DIRECTORY'
|
||||
| 'MISSING_PROJECT_SETTINGS';
|
||||
};
|
||||
export type ProjectLinked = {
|
||||
status: 'linked';
|
||||
org: Org;
|
||||
project: Project;
|
||||
repoRoot?: string;
|
||||
};
|
||||
|
||||
export type ProjectNotLinked = {
|
||||
status: 'not_linked';
|
||||
org: null;
|
||||
project: null;
|
||||
};
|
||||
|
||||
export type ProjectLinkedError = {
|
||||
status: 'error';
|
||||
exitCode: number;
|
||||
reason?:
|
||||
| 'HEADLESS'
|
||||
| 'NOT_AUTHORIZED'
|
||||
| 'TEAM_DELETED'
|
||||
| 'PATH_IS_FILE'
|
||||
| 'INVALID_ROOT_DIRECTORY'
|
||||
| 'MISSING_PROJECT_SETTINGS';
|
||||
};
|
||||
|
||||
export type ProjectLinkResult =
|
||||
| ProjectLinked
|
||||
| ProjectNotLinked
|
||||
| ProjectLinkedError;
|
||||
|
||||
/**
|
||||
* @deprecated - `RollbackJobStatus` has been replace by `LastAliasRequest['jobStatus']`.
|
||||
*/
|
||||
export type RollbackJobStatus =
|
||||
| 'pending'
|
||||
| 'in-progress'
|
||||
@@ -395,6 +444,10 @@ export type RollbackJobStatus =
|
||||
| 'failed'
|
||||
| 'skipped';
|
||||
|
||||
/**
|
||||
* @deprecated - `RollbackTarget` has been renamed to `LastAliasRequest` so it can
|
||||
* be shared with "promote".
|
||||
*/
|
||||
export interface RollbackTarget {
|
||||
fromDeploymentId: string;
|
||||
jobStatus: RollbackJobStatus;
|
||||
@@ -402,6 +455,14 @@ export interface RollbackTarget {
|
||||
toDeploymentId: string;
|
||||
}
|
||||
|
||||
export interface LastAliasRequest {
|
||||
fromDeploymentId: string;
|
||||
jobStatus: 'pending' | 'in-progress' | 'succeeded' | 'failed' | 'skipped';
|
||||
requestedAt: number;
|
||||
toDeploymentId: string;
|
||||
type: 'rollback' | 'promote';
|
||||
}
|
||||
|
||||
export interface Token {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -571,6 +632,6 @@ export interface WritableTTY extends Writable {
|
||||
|
||||
export interface Stdio {
|
||||
stdin: ReadableTTY;
|
||||
stdout: WritableTTY;
|
||||
stderr: WritableTTY;
|
||||
stdout: tty.WriteStream;
|
||||
stderr: tty.WriteStream;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"version": "1.0.4",
|
||||
"types": "index.d.ts",
|
||||
"main": "index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/node": "14.14.31",
|
||||
"@vercel-internals/constants": "*",
|
||||
"@vercel/build-utils": "6.3.2",
|
||||
"@vercel/routing-utils": "2.1.10"
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel/build-utils": "6.8.1",
|
||||
"@vercel/routing-utils": "2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel-internals/tsconfig": "*",
|
||||
"@vercel-internals/tsconfig": "1.0.0",
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
"typescript": "4.9.4"
|
||||
}
|
||||
|
||||
13
lerna.json
13
lerna.json
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"npmClient": "pnpm",
|
||||
"useWorkspaces": true,
|
||||
"packages": ["packages/*"],
|
||||
"command": {
|
||||
"publish": {
|
||||
"npmClient": "npm",
|
||||
"allowBranch": ["main"],
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
}
|
||||
},
|
||||
"version": "independent"
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "29.1.0",
|
||||
"turbo": "1.9.8",
|
||||
"turbo": "1.10.7",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -48,8 +48,8 @@
|
||||
"prettier-check": "prettier --check .",
|
||||
"prepare": "husky install",
|
||||
"pack": "cd utils && node -r ts-eager/register ./pack.ts",
|
||||
"version:prepare": "changeset version && pnpm install --no-frozen-lockfile",
|
||||
"release": "changeset publish"
|
||||
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
|
||||
"ci:publish": "pnpm publish -r && changeset tag"
|
||||
},
|
||||
"lint-staged": {
|
||||
"./{*,{api,packages,test,utils}/**/*}.{js,ts}": [
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 6.8.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Revert "[build-utils] Allow file-ref sema to be controlled through env flag" ([#10167](https://github.com/vercel/vercel/pull/10167))
|
||||
|
||||
## 6.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- Add `getNodeBinPaths()` and `traverseUpDirectories()` functions ([#10150](https://github.com/vercel/vercel/pull/10150))
|
||||
|
||||
## 6.7.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Publish missing build-utils ([`cd35071f6`](https://github.com/vercel/vercel/commit/cd35071f609d615d47bc04634c123b33768436cb))
|
||||
|
||||
## 6.7.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove usage of `env` from Edge Functions and Middleware ([#10018](https://github.com/vercel/vercel/pull/10018))
|
||||
|
||||
## 6.7.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.7.3",
|
||||
"version": "6.8.1",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -27,12 +27,6 @@ export class EdgeFunction {
|
||||
*/
|
||||
files: Files;
|
||||
|
||||
/**
|
||||
* Extra environment variables in use for the user code, to be
|
||||
* assigned to the edge function.
|
||||
*/
|
||||
envVarsInUse?: string[];
|
||||
|
||||
/**
|
||||
* Extra binary files to be included in the edge function
|
||||
*/
|
||||
@@ -50,7 +44,6 @@ export class EdgeFunction {
|
||||
this.deploymentTarget = params.deploymentTarget;
|
||||
this.entrypoint = params.entrypoint;
|
||||
this.files = params.files;
|
||||
this.envVarsInUse = params.envVarsInUse;
|
||||
this.assets = params.assets;
|
||||
this.regions = params.regions;
|
||||
this.framework = params.framework;
|
||||
|
||||
@@ -5,13 +5,7 @@ import path from 'path';
|
||||
import Sema from 'async-sema';
|
||||
import { FileBase } from './types';
|
||||
|
||||
const DEFAULT_SEMA = 20;
|
||||
const semaToPreventEMFILE = new Sema(
|
||||
parseInt(
|
||||
process.env.VERCEL_INTERNAL_FILE_FS_REF_SEMA || String(DEFAULT_SEMA),
|
||||
10
|
||||
) || DEFAULT_SEMA
|
||||
);
|
||||
const semaToPreventEMFILE = new Sema(20);
|
||||
|
||||
interface FileFsRefOptions {
|
||||
mode?: number;
|
||||
|
||||
@@ -12,13 +12,7 @@ interface FileRefOptions {
|
||||
mutable?: boolean;
|
||||
}
|
||||
|
||||
const DEFAULT_SEMA = 5;
|
||||
const semaToDownloadFromS3 = new Sema(
|
||||
parseInt(
|
||||
process.env.VERCEL_INTERNAL_FILE_REF_SEMA || String(DEFAULT_SEMA),
|
||||
10
|
||||
) || DEFAULT_SEMA
|
||||
);
|
||||
const semaToDownloadFromS3 = new Sema(5);
|
||||
|
||||
class BailableError extends Error {
|
||||
public bail: boolean;
|
||||
|
||||
@@ -44,23 +44,33 @@ export interface ScanParentDirsResult {
|
||||
lockfileVersion?: number;
|
||||
}
|
||||
|
||||
export interface WalkParentDirsProps {
|
||||
export interface TraverseUpDirectoriesProps {
|
||||
/**
|
||||
* The highest directory, typically the workPath root of the project.
|
||||
* If this directory is reached and it doesn't contain the file, null is returned.
|
||||
*/
|
||||
base: string;
|
||||
/**
|
||||
* The directory to start searching, typically the same directory of the entrypoint.
|
||||
* If this directory doesn't contain the file, the parent is checked, etc.
|
||||
* The directory to start iterating from, typically the same directory of the entrypoint.
|
||||
*/
|
||||
start: string;
|
||||
/**
|
||||
* The highest directory, typically the workPath root of the project.
|
||||
*/
|
||||
base?: string;
|
||||
}
|
||||
|
||||
export interface WalkParentDirsProps
|
||||
extends Required<TraverseUpDirectoriesProps> {
|
||||
/**
|
||||
* The name of the file to search for, typically `package.json` or `Gemfile`.
|
||||
*/
|
||||
filename: string;
|
||||
}
|
||||
|
||||
export interface WalkParentDirsMultiProps
|
||||
extends Required<TraverseUpDirectoriesProps> {
|
||||
/**
|
||||
* The name of the file to search for, typically `package.json` or `Gemfile`.
|
||||
*/
|
||||
filenames: string[];
|
||||
}
|
||||
|
||||
export interface SpawnOptionsExtended extends SpawnOptions {
|
||||
/**
|
||||
* Pretty formatted command that is being spawned for logging purposes.
|
||||
@@ -131,6 +141,24 @@ export async function execCommand(command: string, options: SpawnOptions = {}) {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function* traverseUpDirectories({
|
||||
start,
|
||||
base,
|
||||
}: TraverseUpDirectoriesProps) {
|
||||
let current: string | undefined = path.normalize(start);
|
||||
const normalizedRoot = base ? path.normalize(base) : undefined;
|
||||
while (current) {
|
||||
yield current;
|
||||
if (current === normalizedRoot) break;
|
||||
// Go up one directory
|
||||
const next = path.join(current, '..');
|
||||
current = next === current ? undefined : next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `getNodeBinPaths()` instead.
|
||||
*/
|
||||
export async function getNodeBinPath({
|
||||
cwd,
|
||||
}: {
|
||||
@@ -141,6 +169,15 @@ export async function getNodeBinPath({
|
||||
return path.join(dir, 'node_modules', '.bin');
|
||||
}
|
||||
|
||||
export function getNodeBinPaths({
|
||||
start,
|
||||
base,
|
||||
}: TraverseUpDirectoriesProps): string[] {
|
||||
return Array.from(traverseUpDirectories({ start, base })).map(dir =>
|
||||
path.join(dir, 'node_modules/.bin')
|
||||
);
|
||||
}
|
||||
|
||||
async function chmodPlusX(fsPath: string) {
|
||||
const s = await fs.stat(fsPath);
|
||||
const newMode = s.mode | 64 | 8 | 1; // eslint-disable-line no-bitwise
|
||||
@@ -297,22 +334,14 @@ export async function walkParentDirs({
|
||||
}: WalkParentDirsProps): Promise<string | null> {
|
||||
assert(path.isAbsolute(base), 'Expected "base" to be absolute path');
|
||||
assert(path.isAbsolute(start), 'Expected "start" to be absolute path');
|
||||
let parent = '';
|
||||
|
||||
for (let current = start; base.length <= current.length; current = parent) {
|
||||
const fullPath = path.join(current, filename);
|
||||
for (const dir of traverseUpDirectories({ start, base })) {
|
||||
const fullPath = path.join(dir, filename);
|
||||
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
if (await fs.pathExists(fullPath)) {
|
||||
return fullPath;
|
||||
}
|
||||
|
||||
parent = path.dirname(current);
|
||||
|
||||
if (parent === current) {
|
||||
// Reached root directory of the filesystem
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -322,14 +351,9 @@ async function walkParentDirsMulti({
|
||||
base,
|
||||
start,
|
||||
filenames,
|
||||
}: {
|
||||
base: string;
|
||||
start: string;
|
||||
filenames: string[];
|
||||
}): Promise<(string | undefined)[]> {
|
||||
let parent = '';
|
||||
for (let current = start; base.length <= current.length; current = parent) {
|
||||
const fullPaths = filenames.map(f => path.join(current, f));
|
||||
}: WalkParentDirsMultiProps): Promise<(string | undefined)[]> {
|
||||
for (const dir of traverseUpDirectories({ start, base })) {
|
||||
const fullPaths = filenames.map(f => path.join(dir, f));
|
||||
const existResults = await Promise.all(
|
||||
fullPaths.map(f => fs.pathExists(f))
|
||||
);
|
||||
@@ -338,13 +362,6 @@ async function walkParentDirsMulti({
|
||||
if (foundOneOrMore) {
|
||||
return fullPaths.map((f, i) => (existResults[i] ? f : undefined));
|
||||
}
|
||||
|
||||
parent = path.dirname(current);
|
||||
|
||||
if (parent === current) {
|
||||
// Reached root directory of the filesystem
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
|
||||
@@ -30,7 +30,9 @@ import {
|
||||
getNodeVersion,
|
||||
getSpawnOptions,
|
||||
getNodeBinPath,
|
||||
getNodeBinPaths,
|
||||
scanParentDirs,
|
||||
traverseUpDirectories,
|
||||
} from './fs/run-user-scripts';
|
||||
import {
|
||||
getLatestNodeVersion,
|
||||
@@ -43,6 +45,7 @@ import { getPlatformEnv } from './get-platform-env';
|
||||
import { getPrefixedEnvVars } from './get-prefixed-env-vars';
|
||||
import { cloneEnv } from './clone-env';
|
||||
import { hardLinkDir } from './hard-link-dir';
|
||||
import { validateNpmrc } from './validate-npmrc';
|
||||
|
||||
export {
|
||||
FileBlob,
|
||||
@@ -67,6 +70,7 @@ export {
|
||||
spawnCommand,
|
||||
walkParentDirs,
|
||||
getNodeBinPath,
|
||||
getNodeBinPaths,
|
||||
runNpmInstall,
|
||||
runBundleInstall,
|
||||
runPipInstall,
|
||||
@@ -88,6 +92,8 @@ export {
|
||||
getIgnoreFilter,
|
||||
cloneEnv,
|
||||
hardLinkDir,
|
||||
traverseUpDirectories,
|
||||
validateNpmrc,
|
||||
};
|
||||
|
||||
export { EdgeFunction } from './edge-function';
|
||||
|
||||
26
packages/build-utils/src/validate-npmrc.ts
Normal file
26
packages/build-utils/src/validate-npmrc.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { join } from 'path';
|
||||
import { readFile } from 'fs/promises';
|
||||
|
||||
/**
|
||||
* Checks if there is a `.npmrc` in the cwd (project root) and makes sure it
|
||||
* doesn't contain a `use-node-version`. This config setting is not supported
|
||||
* since it causes the package manager to install the Node.js version which in
|
||||
* the case of newer Node.js versions is not compatible with AWS due to
|
||||
* outdated GLIBC binaries.
|
||||
*
|
||||
* @see https://pnpm.io/npmrc#use-node-version
|
||||
*
|
||||
* @param cwd The current working directory (e.g. project root);
|
||||
*/
|
||||
export async function validateNpmrc(cwd: string): Promise<void> {
|
||||
const npmrc = await readFile(join(cwd, '.npmrc'), 'utf-8').catch(err => {
|
||||
if (err.code !== 'ENOENT') throw err;
|
||||
});
|
||||
|
||||
const nodeRegExp = /(?<!#.*)use-node-version/;
|
||||
if (npmrc?.match(nodeRegExp)) {
|
||||
throw new Error(
|
||||
'Detected unsupported "use-node-version" in your ".npmrc". Please use "engines" in your "package.json" instead.'
|
||||
);
|
||||
}
|
||||
}
|
||||
2
packages/build-utils/test/fixtures/29-npmrc/comment-use-node-version/.npmrc
vendored
Normal file
2
packages/build-utils/test/fixtures/29-npmrc/comment-use-node-version/.npmrc
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
foo=bar
|
||||
# use-node-version=16.16.0
|
||||
1
packages/build-utils/test/fixtures/29-npmrc/good/.npmrc
vendored
Normal file
1
packages/build-utils/test/fixtures/29-npmrc/good/.npmrc
vendored
Normal file
@@ -0,0 +1 @@
|
||||
foo=bar
|
||||
3
packages/build-utils/test/fixtures/29-npmrc/has-use-node-version/.npmrc
vendored
Normal file
3
packages/build-utils/test/fixtures/29-npmrc/has-use-node-version/.npmrc
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
foo=bar
|
||||
# the next line is not supported
|
||||
use-node-version=16.16.0
|
||||
17
packages/build-utils/test/unit.get-node-bin-paths.test.ts
vendored
Normal file
17
packages/build-utils/test/unit.get-node-bin-paths.test.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { join } from 'path';
|
||||
import { getNodeBinPaths } from '../src/fs/run-user-scripts';
|
||||
|
||||
describe('getNodeBinPaths()', () => {
|
||||
const cwd = process.cwd();
|
||||
|
||||
it('should return array of `node_modules/.bin` paths', () => {
|
||||
const start = join(cwd, 'foo/bar/baz');
|
||||
const paths = getNodeBinPaths({ start, base: cwd });
|
||||
expect(paths).toEqual([
|
||||
join(cwd, 'foo/bar/baz/node_modules/.bin'),
|
||||
join(cwd, 'foo/bar/node_modules/.bin'),
|
||||
join(cwd, 'foo/node_modules/.bin'),
|
||||
join(cwd, 'node_modules/.bin'),
|
||||
]);
|
||||
});
|
||||
});
|
||||
50
packages/build-utils/test/unit.traverse-up-directories.test.ts
vendored
Normal file
50
packages/build-utils/test/unit.traverse-up-directories.test.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import { traverseUpDirectories } from '../src/fs/run-user-scripts';
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
describe('traverseUpDirectories()', () => {
|
||||
test.each(
|
||||
isWindows
|
||||
? [
|
||||
{
|
||||
start: 'C:\\foo\\bar\\baz',
|
||||
expected: ['C:\\foo\\bar\\baz', 'C:\\foo\\bar', 'C:\\foo', 'C:\\'],
|
||||
},
|
||||
{
|
||||
start: 'C:\\foo\\..\\bar\\.\\baz',
|
||||
expected: ['C:\\bar\\baz', 'C:\\bar', 'C:\\'],
|
||||
},
|
||||
{
|
||||
start: 'C:\\foo\\bar\\baz\\another',
|
||||
base: 'C:\\foo\\bar',
|
||||
expected: [
|
||||
'C:\\foo\\bar\\baz\\another',
|
||||
'C:\\foo\\bar\\baz',
|
||||
'C:\\foo\\bar',
|
||||
],
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
start: '/foo/bar/baz',
|
||||
expected: ['/foo/bar/baz', '/foo/bar', '/foo', '/'],
|
||||
},
|
||||
{
|
||||
start: '/foo/../bar/./baz',
|
||||
expected: ['/bar/baz', '/bar', '/'],
|
||||
},
|
||||
{
|
||||
start: '/foo/bar/baz/another',
|
||||
base: '/foo/bar',
|
||||
expected: ['/foo/bar/baz/another', '/foo/bar/baz', '/foo/bar'],
|
||||
},
|
||||
]
|
||||
)(
|
||||
'should traverse start="$start", base="$base"',
|
||||
({ start, base, expected }) => {
|
||||
expect(Array.from(traverseUpDirectories({ start, base }))).toEqual(
|
||||
expected
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
22
packages/build-utils/test/unit.validate-npmrc.test.ts
vendored
Normal file
22
packages/build-utils/test/unit.validate-npmrc.test.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { join } from 'path';
|
||||
import { validateNpmrc } from '../src/validate-npmrc';
|
||||
|
||||
const fixture = (name: string) => join(__dirname, 'fixtures', '29-npmrc', name);
|
||||
|
||||
describe('validateNpmrc', () => {
|
||||
it('should not error with no use-node-version', async () => {
|
||||
await expect(validateNpmrc(fixture('good'))).resolves.toBe(undefined);
|
||||
});
|
||||
|
||||
it('should throw when use-node-version is found', async () => {
|
||||
await expect(
|
||||
validateNpmrc(fixture('has-use-node-version'))
|
||||
).rejects.toThrow('Detected unsupported');
|
||||
});
|
||||
|
||||
it('should not error when use-node-version is commented out', async () => {
|
||||
await expect(
|
||||
validateNpmrc(fixture('comment-use-node-version'))
|
||||
).resolves.toBe(undefined);
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,169 @@
|
||||
# vercel
|
||||
|
||||
## 31.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Allow additional project settings in `createProject()` ([#10172](https://github.com/vercel/vercel/pull/10172))
|
||||
|
||||
- Run local Project detection during `vc link --repo`. ([#10094](https://github.com/vercel/vercel/pull/10094))
|
||||
This allows for creation of new Projects that do not yet exist under the selected scope.
|
||||
|
||||
- Redeploy command no longer redeploys preview deployments to production ([#10186](https://github.com/vercel/vercel/pull/10186))
|
||||
|
||||
- Added trailing new line at end of help output ([#10170](https://github.com/vercel/vercel/pull/10170))
|
||||
|
||||
- Create new help output and arg parsing for deploy command ([#10090](https://github.com/vercel/vercel/pull/10090))
|
||||
|
||||
- [cli] Remove `preinstall` script ([#10157](https://github.com/vercel/vercel/pull/10157))
|
||||
|
||||
- Updated dependencies [[`7021279b2`](https://github.com/vercel/vercel/commit/7021279b284f314a4d1bdbb4306b4c22291efa08), [`5e5332fbc`](https://github.com/vercel/vercel/commit/5e5332fbc9317a8f3cc4ed0b72ec1a2c76020891), [`027bce00b`](https://github.com/vercel/vercel/commit/027bce00b3821d9b4a8f7ec320cd1c43ab9f4215)]:
|
||||
- @vercel/build-utils@6.8.1
|
||||
- @vercel/node@2.15.4
|
||||
- @vercel/remix-builder@1.8.16
|
||||
- @vercel/static-build@1.3.39
|
||||
|
||||
## 31.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`aa734efc6`](https://github.com/vercel/vercel/commit/aa734efc6c42badd4aa9bf64487904aa64e9bd49)]:
|
||||
- @vercel/next@3.8.8
|
||||
|
||||
## 31.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- Update `vc dev` redirect response to match production behavior ([#10143](https://github.com/vercel/vercel/pull/10143))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- require `--yes` to promote preview deployment ([#10135](https://github.com/vercel/vercel/pull/10135))
|
||||
|
||||
- [cli] Optimize write build result for vc build ([#10154](https://github.com/vercel/vercel/pull/10154))
|
||||
|
||||
- Only show relevant Project matches in Project selector ([#10114](https://github.com/vercel/vercel/pull/10114))
|
||||
|
||||
- [cli] Fix error message when token is invalid ([#10131](https://github.com/vercel/vercel/pull/10131))
|
||||
|
||||
- Updated dependencies [[`e4895d979`](https://github.com/vercel/vercel/commit/e4895d979b57e369e0618481c5974243887d72cc), [`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c), [`346892210`](https://github.com/vercel/vercel/commit/3468922108f411482a72acd0331f0f2ee52a6d4c), [`a6de052ed`](https://github.com/vercel/vercel/commit/a6de052ed2f09cc80bf4c2d0f06bedd267a63cdc)]:
|
||||
- @vercel/next@3.8.7
|
||||
- @vercel/static-build@1.3.38
|
||||
- @vercel/build-utils@6.8.0
|
||||
- @vercel/remix-builder@1.8.15
|
||||
- @vercel/node@2.15.3
|
||||
|
||||
## 30.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] do not force auto-assign value on deployments ([#10110](https://github.com/vercel/vercel/pull/10110))
|
||||
|
||||
- Updated dependencies [[`91406abdb`](https://github.com/vercel/vercel/commit/91406abdb0c332152fc6c7c1e4bd3a872b084434), [`2230ea6cc`](https://github.com/vercel/vercel/commit/2230ea6cc1b84c1f03227a4e197b7684635b5955), [`8b3a4146a`](https://github.com/vercel/vercel/commit/8b3a4146af68d2b7288c80a5b919d832dba929b5)]:
|
||||
- @vercel/node@2.15.2
|
||||
- @vercel/remix-builder@1.8.14
|
||||
- @vercel/static-build@1.3.37
|
||||
|
||||
## 30.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] vc env pull should add `.env*.local` to `.gitignore` ([#10085](https://github.com/vercel/vercel/pull/10085))
|
||||
|
||||
- [cli] Fix team validation bug where you are apart of a team ([#10092](https://github.com/vercel/vercel/pull/10092))
|
||||
|
||||
- Add support for `vc dev` command with repo link ([#10082](https://github.com/vercel/vercel/pull/10082))
|
||||
|
||||
- Add support for `vc deploy --prebuilt` command with repo link ([#10083](https://github.com/vercel/vercel/pull/10083))
|
||||
|
||||
- Move readme copy logic to a helper function for `vc link` ([#10084](https://github.com/vercel/vercel/pull/10084))
|
||||
|
||||
- Add support for `vc pull` command with repo link ([#10078](https://github.com/vercel/vercel/pull/10078))
|
||||
|
||||
- Add support for `vc build` command with repo link ([#10075](https://github.com/vercel/vercel/pull/10075))
|
||||
|
||||
## 30.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`a04bf557f`](https://github.com/vercel/vercel/commit/a04bf557fc6e1080a117428977d0993dec78b004)]:
|
||||
- @vercel/node@2.15.1
|
||||
- @vercel/static-build@1.3.36
|
||||
|
||||
## 30.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [node] Add isomorphic functions ([#9947](https://github.com/vercel/vercel/pull/9947))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Add `client.fetchPaginated()` helper function ([#10054](https://github.com/vercel/vercel/pull/10054))
|
||||
|
||||
- Updated dependencies [[`bc5afe24c`](https://github.com/vercel/vercel/commit/bc5afe24c4547dbf798b939199e8212c4b34038e), [`49c717856`](https://github.com/vercel/vercel/commit/49c7178567ec5bcebe633b598c8c9c0e1aa40fbb), [`0039c8b5c`](https://github.com/vercel/vercel/commit/0039c8b5cea975316a62c4f6aaca5d66d731cc0d)]:
|
||||
- @vercel/node@2.15.0
|
||||
- @vercel/remix-builder@1.8.13
|
||||
- @vercel/static-build@1.3.35
|
||||
|
||||
## 30.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Publish missing build-utils ([`cd35071f6`](https://github.com/vercel/vercel/commit/cd35071f609d615d47bc04634c123b33768436cb))
|
||||
|
||||
- Updated dependencies [[`cd35071f6`](https://github.com/vercel/vercel/commit/cd35071f609d615d47bc04634c123b33768436cb)]:
|
||||
- @vercel/build-utils@6.7.5
|
||||
- @vercel/node@2.14.5
|
||||
- @vercel/remix-builder@1.8.12
|
||||
- @vercel/static-build@1.3.34
|
||||
|
||||
## 30.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [cli] vc build ignore '.env\*' & ignore files for '@vercel/static' ([#10056](https://github.com/vercel/vercel/pull/10056))
|
||||
|
||||
- [cli] Ensure .npmrc does not contain use-node-version ([#10049](https://github.com/vercel/vercel/pull/10049))
|
||||
|
||||
## 30.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- New `vc promote` command ([#9984](https://github.com/vercel/vercel/pull/9984))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Support `deploy` subcommand in "repo linked" mode ([#10013](https://github.com/vercel/vercel/pull/10013))
|
||||
|
||||
- [cli] Update `vc rollback` to use `lastRequestAlias` instead of `lastRollbackTarget` ([#10019](https://github.com/vercel/vercel/pull/10019))
|
||||
|
||||
- Fix `--cwd` flag with a relative path for `env`, `link`, `promote`, and `rollback` subcommands ([#10031](https://github.com/vercel/vercel/pull/10031))
|
||||
|
||||
- Updated dependencies [[`c6c19354e`](https://github.com/vercel/vercel/commit/c6c19354e852cfc1338b223058c4b07fdc71c723), [`b56ac2717`](https://github.com/vercel/vercel/commit/b56ac2717d6769eb400f9746f0a05431929b4501), [`c63679ea0`](https://github.com/vercel/vercel/commit/c63679ea0a6bc48c0759ccf3c0c0a8106bd324f0), [`c7bcea408`](https://github.com/vercel/vercel/commit/c7bcea408131df2d65338e50ce319a6d8e4a8a82)]:
|
||||
- @vercel/next@3.8.6
|
||||
- @vercel/build-utils@6.7.4
|
||||
- @vercel/node@2.14.4
|
||||
- @vercel/remix-builder@1.8.11
|
||||
- @vercel/static-build@1.3.33
|
||||
|
||||
## 30.0.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- Change `vc env pull` default output file to `.env.local` ([#9892](https://github.com/vercel/vercel/pull/9892))
|
||||
|
||||
- Remove `--platform-version` global common arg ([#9807](https://github.com/vercel/vercel/pull/9807))
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [cli] implement `vc deploy --prod --skip-build` ([#9836](https://github.com/vercel/vercel/pull/9836))
|
||||
|
||||
- New `vc redeploy` command ([#9956](https://github.com/vercel/vercel/pull/9956))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix `vercel git connect` command when passing a URL parameter ([#9967](https://github.com/vercel/vercel/pull/9967))
|
||||
|
||||
## 29.4.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "29.4.0",
|
||||
"version": "31.0.2",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -11,7 +11,6 @@
|
||||
"directory": "packages/cli"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"test": "jest --env node --verbose --bail",
|
||||
"test-unit": "pnpm test test/unit/",
|
||||
"test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
|
||||
@@ -32,20 +31,20 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.7.3",
|
||||
"@vercel/build-utils": "6.8.1",
|
||||
"@vercel/go": "2.5.1",
|
||||
"@vercel/hydrogen": "0.0.64",
|
||||
"@vercel/next": "3.8.5",
|
||||
"@vercel/node": "2.14.3",
|
||||
"@vercel/next": "3.8.8",
|
||||
"@vercel/node": "2.15.4",
|
||||
"@vercel/python": "3.1.60",
|
||||
"@vercel/redwood": "1.1.15",
|
||||
"@vercel/remix-builder": "1.8.10",
|
||||
"@vercel/remix-builder": "1.8.16",
|
||||
"@vercel/ruby": "1.3.76",
|
||||
"@vercel/static-build": "1.3.32"
|
||||
"@vercel/static-build": "1.3.39"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
"@edge-runtime/node-utils": "2.0.3",
|
||||
"@edge-runtime/node-utils": "2.1.0",
|
||||
"@next/env": "11.1.2",
|
||||
"@sentry/node": "5.5.0",
|
||||
"@sindresorhus/slugify": "0.11.0",
|
||||
@@ -85,13 +84,13 @@
|
||||
"@types/which": "3.0.0",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel-internals/constants": "*",
|
||||
"@vercel-internals/get-package-json": "*",
|
||||
"@vercel-internals/types": "*",
|
||||
"@vercel/client": "12.5.1",
|
||||
"@vercel-internals/constants": "1.0.4",
|
||||
"@vercel-internals/get-package-json": "1.0.0",
|
||||
"@vercel-internals/types": "1.0.4",
|
||||
"@vercel/client": "12.6.4",
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/frameworks": "1.4.2",
|
||||
"@vercel/fs-detectors": "3.9.3",
|
||||
"@vercel/frameworks": "1.4.3",
|
||||
"@vercel/fs-detectors": "4.0.1",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
@@ -119,6 +118,7 @@
|
||||
"escape-html": "1.0.3",
|
||||
"esm": "3.1.4",
|
||||
"execa": "3.2.0",
|
||||
"expect": "29.5.0",
|
||||
"express": "4.17.1",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"find-up": "4.1.0",
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
const { join } = require('path');
|
||||
const { statSync } = require('fs');
|
||||
const pkg = require('../package');
|
||||
|
||||
function error(command) {
|
||||
console.error('> Error:', command);
|
||||
}
|
||||
|
||||
function debug(str) {
|
||||
if (
|
||||
process.argv.find(str => str === '--debug') ||
|
||||
process.env.PREINSTALL_DEBUG
|
||||
) {
|
||||
console.log(`[debug] [${new Date().toISOString()}]`, str);
|
||||
}
|
||||
}
|
||||
|
||||
function isYarn() {
|
||||
return process.env.npm_config_heading !== 'npm';
|
||||
}
|
||||
|
||||
function isGlobal() {
|
||||
const cmd = JSON.parse(process.env.npm_config_argv || '{ "original": [] }');
|
||||
|
||||
return isYarn()
|
||||
? cmd.original.includes('global')
|
||||
: Boolean(process.env.npm_config_global);
|
||||
}
|
||||
|
||||
function isVercel() {
|
||||
return pkg.name === 'vercel';
|
||||
}
|
||||
|
||||
function validateNodeVersion() {
|
||||
let semver = '>= 0';
|
||||
let major = '1';
|
||||
|
||||
try {
|
||||
major = process.versions.node.split('.')[0];
|
||||
const pkg = require('../package.json');
|
||||
semver = pkg.engines.node;
|
||||
} catch (e) {
|
||||
debug('Failed to read package.json engines');
|
||||
}
|
||||
|
||||
const isValid = eval(`${major} ${semver}`);
|
||||
return { isValid, expected: semver, actual: process.versions.node };
|
||||
}
|
||||
|
||||
function isInNodeModules(name) {
|
||||
try {
|
||||
const nodeModules = join(__dirname, '..', '..');
|
||||
const stat = statSync(join(nodeModules, name));
|
||||
return stat.isDirectory();
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
if (!isGlobal()) {
|
||||
debug('Skipping preinstall since Vercel CLI is being installed locally');
|
||||
return;
|
||||
}
|
||||
|
||||
const ver = validateNodeVersion();
|
||||
|
||||
if (!ver.isValid) {
|
||||
error(
|
||||
`Detected unsupported Node.js version.\n` +
|
||||
`Expected "${ver.expected}" but found "${ver.actual}".\n` +
|
||||
`Please update to the latest Node.js LTS version to install Vercel CLI.`
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (isVercel() && isInNodeModules('now')) {
|
||||
const uninstall = isYarn()
|
||||
? 'yarn global remove now'
|
||||
: 'npm uninstall -g now';
|
||||
console.error(`NOTE: Run \`${uninstall}\` to uninstall \`now\`\n`);
|
||||
}
|
||||
}
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
console.error('Unhandled Rejection:');
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', err => {
|
||||
console.error('Uncaught Exception:');
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -24,7 +24,9 @@ export const help = () => `
|
||||
ls | list [app] Lists deployments
|
||||
login [email] Logs into your account or creates a new one
|
||||
logout Logs out of your account
|
||||
promote [url|id] Promote an existing deployment to current
|
||||
pull [path] Pull your Project Settings from the cloud
|
||||
redeploy [url|id] Rebuild and deploy a previous deployment.
|
||||
rollback [url|id] Quickly revert back to a previous deployment
|
||||
switch [scope] Switches between teams and your personal account
|
||||
|
||||
|
||||
@@ -6,21 +6,19 @@ import chalk, { Chalk } from 'chalk';
|
||||
import { URLSearchParams, parse } from 'url';
|
||||
|
||||
import box from '../../util/output/box';
|
||||
import sleep from '../../util/sleep';
|
||||
import formatDate from '../../util/format-date';
|
||||
import link from '../../util/output/link';
|
||||
import logo from '../../util/output/logo';
|
||||
import getArgs from '../../util/get-args';
|
||||
import Client from '../../util/client';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import { Deployment, PaginationOptions } from '@vercel-internals/types';
|
||||
import { Deployment } from '@vercel-internals/types';
|
||||
import { normalizeURL } from '../../util/bisect/normalize-url';
|
||||
import getScope from '../../util/get-scope';
|
||||
import getDeployment from '../../util/get-deployment';
|
||||
|
||||
interface Deployments {
|
||||
deployments: Deployment[];
|
||||
pagination: PaginationOptions;
|
||||
}
|
||||
|
||||
const pkgName = getPkgName();
|
||||
@@ -206,44 +204,34 @@ export default async function main(client: Client): Promise<number> {
|
||||
|
||||
// Fetch all the project's "READY" deployments with the pagination API
|
||||
let deployments: Deployment[] = [];
|
||||
let next: number | undefined = badDeployment.createdAt + 1;
|
||||
do {
|
||||
const query = new URLSearchParams();
|
||||
query.set('projectId', projectId);
|
||||
if (badDeployment.target) {
|
||||
query.set('target', badDeployment.target);
|
||||
}
|
||||
query.set('limit', '100');
|
||||
query.set('state', 'READY');
|
||||
if (next) {
|
||||
query.set('until', String(next));
|
||||
}
|
||||
|
||||
const res = await client.fetch<Deployments>(`/v6/deployments?${query}`, {
|
||||
const query = new URLSearchParams();
|
||||
query.set('projectId', projectId);
|
||||
if (badDeployment.target) {
|
||||
query.set('target', badDeployment.target);
|
||||
}
|
||||
query.set('state', 'READY');
|
||||
query.set('until', String(badDeployment.createdAt + 1));
|
||||
|
||||
for await (const chunk of client.fetchPaginated<Deployments>(
|
||||
`/v6/deployments?${query}`,
|
||||
{
|
||||
accountId: badDeployment.ownerId,
|
||||
});
|
||||
|
||||
next = res.pagination.next;
|
||||
|
||||
let newDeployments = res.deployments;
|
||||
}
|
||||
)) {
|
||||
let newDeployments = chunk.deployments;
|
||||
|
||||
// If we have the "good" deployment in this chunk, then we're done
|
||||
for (let i = 0; i < newDeployments.length; i++) {
|
||||
if (newDeployments[i].url === good) {
|
||||
// grab all deployments up until the good one
|
||||
newDeployments = newDeployments.slice(0, i);
|
||||
next = undefined;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
deployments = deployments.concat(newDeployments);
|
||||
|
||||
if (next) {
|
||||
// Small sleep to avoid rate limiting
|
||||
await sleep(100);
|
||||
}
|
||||
} while (next);
|
||||
}
|
||||
|
||||
if (!deployments.length) {
|
||||
output.error(
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import fs from 'fs-extra';
|
||||
import chalk from 'chalk';
|
||||
import dotenv from 'dotenv';
|
||||
import semver from 'semver';
|
||||
import minimatch from 'minimatch';
|
||||
import { join, normalize, relative, resolve, sep } from 'path';
|
||||
import frameworks from '@vercel/frameworks';
|
||||
import {
|
||||
getDiscontinuedNodeVersions,
|
||||
normalizePath,
|
||||
@@ -17,13 +20,14 @@ import {
|
||||
BuildResultV3,
|
||||
NowBuildError,
|
||||
Cron,
|
||||
validateNpmrc,
|
||||
} from '@vercel/build-utils';
|
||||
import {
|
||||
detectBuilders,
|
||||
detectFrameworkRecord,
|
||||
detectFrameworkVersion,
|
||||
LocalFileSystemDetector,
|
||||
} from '@vercel/fs-detectors';
|
||||
import minimatch from 'minimatch';
|
||||
import {
|
||||
appendRoutesToPhase,
|
||||
getTransformedRoutes,
|
||||
@@ -48,7 +52,7 @@ import {
|
||||
ProjectLinkAndSettings,
|
||||
readProjectSettings,
|
||||
} from '../util/projects/project-settings';
|
||||
import { VERCEL_DIR } from '../util/projects/link';
|
||||
import { getProjectLink, VERCEL_DIR } from '../util/projects/link';
|
||||
import confirm from '../util/input/confirm';
|
||||
import { emoji, prependEmoji } from '../util/emoji';
|
||||
import stamp from '../util/output/stamp';
|
||||
@@ -62,11 +66,7 @@ import { initCorepack, cleanupCorepack } from '../util/build/corepack';
|
||||
import { sortBuilders } from '../util/build/sort-builders';
|
||||
import { toEnumerableError } from '../util/error';
|
||||
import { validateConfig } from '../util/validate-config';
|
||||
|
||||
import { setMonorepoDefaultSettings } from '../util/build/monorepo';
|
||||
import frameworks from '@vercel/frameworks';
|
||||
import { detectFrameworkVersion } from '@vercel/fs-detectors';
|
||||
import semver from 'semver';
|
||||
|
||||
type BuildResult = BuildResultV2 | BuildResultV3;
|
||||
|
||||
@@ -133,6 +133,7 @@ const help = () => {
|
||||
};
|
||||
|
||||
export default async function main(client: Client): Promise<number> {
|
||||
let { cwd } = client;
|
||||
const { output } = client;
|
||||
|
||||
// Ensure that `vc build` is not being invoked recursively
|
||||
@@ -165,16 +166,29 @@ export default async function main(client: Client): Promise<number> {
|
||||
return 2;
|
||||
}
|
||||
|
||||
const cwd = process.cwd();
|
||||
|
||||
// Build `target` influences which environment variables will be used
|
||||
const target = argv['--prod'] ? 'production' : 'preview';
|
||||
const yes = Boolean(argv['--yes']);
|
||||
|
||||
try {
|
||||
await validateNpmrc(cwd);
|
||||
} catch (err) {
|
||||
output.prettyError(err);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// If repo linked, update `cwd` to the repo root
|
||||
const link = await getProjectLink(client, cwd);
|
||||
const projectRootDirectory = link?.projectRootDirectory ?? '';
|
||||
if (link?.repoRoot) {
|
||||
cwd = client.cwd = link.repoRoot;
|
||||
}
|
||||
|
||||
// TODO: read project settings from the API, fall back to local `project.json` if that fails
|
||||
|
||||
// Read project settings, and pull them from Vercel if necessary
|
||||
let project = await readProjectSettings(join(cwd, VERCEL_DIR));
|
||||
const vercelDir = join(cwd, projectRootDirectory, VERCEL_DIR);
|
||||
let project = await readProjectSettings(vercelDir);
|
||||
const isTTY = process.stdin.isTTY;
|
||||
while (!project?.settings) {
|
||||
let confirmed = yes;
|
||||
@@ -201,6 +215,7 @@ export default async function main(client: Client): Promise<number> {
|
||||
return 0;
|
||||
}
|
||||
const { argv: originalArgv } = client;
|
||||
client.cwd = join(cwd, projectRootDirectory);
|
||||
client.argv = [
|
||||
...originalArgv.slice(0, 2),
|
||||
'pull',
|
||||
@@ -211,12 +226,13 @@ export default async function main(client: Client): Promise<number> {
|
||||
if (result !== 0) {
|
||||
return result;
|
||||
}
|
||||
client.cwd = cwd;
|
||||
client.argv = originalArgv;
|
||||
project = await readProjectSettings(join(cwd, VERCEL_DIR));
|
||||
project = await readProjectSettings(vercelDir);
|
||||
}
|
||||
|
||||
// Delete output directory from potential previous build
|
||||
const defaultOutputDir = join(cwd, OUTPUT_DIR);
|
||||
const defaultOutputDir = join(cwd, projectRootDirectory, OUTPUT_DIR);
|
||||
const outputDir = argv['--output']
|
||||
? resolve(argv['--output'])
|
||||
: defaultOutputDir;
|
||||
@@ -235,7 +251,12 @@ export default async function main(client: Client): Promise<number> {
|
||||
const envToUnset = new Set<string>(['VERCEL', 'NOW_BUILDER']);
|
||||
|
||||
try {
|
||||
const envPath = join(cwd, VERCEL_DIR, `.env.${target}.local`);
|
||||
const envPath = join(
|
||||
cwd,
|
||||
projectRootDirectory,
|
||||
VERCEL_DIR,
|
||||
`.env.${target}.local`
|
||||
);
|
||||
// TODO (maybe?): load env vars from the API, fall back to the local file if that fails
|
||||
const dotenvResult = dotenv.config({
|
||||
path: envPath,
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import chalk from 'chalk';
|
||||
import logo from '../../util/output/logo';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
|
||||
export const help = () => {
|
||||
return `
|
||||
${chalk.bold(`${logo} ${getPkgName()} [deploy]`)} [path-to-project] [options]
|
||||
|
||||
--prod Create a production deployment
|
||||
-p, --public Deployment is public (${chalk.dim(
|
||||
'`/_src`'
|
||||
)} is exposed)
|
||||
-e, --env Include an env var during run time (e.g.: ${chalk.dim(
|
||||
'`-e KEY=value`'
|
||||
)}). Can appear many times.
|
||||
-b, --build-env Similar to ${chalk.dim(
|
||||
'`--env`'
|
||||
)} but for build time only.
|
||||
-m, --meta Add metadata for the deployment (e.g.: ${chalk.dim(
|
||||
'`-m KEY=value`'
|
||||
)}). Can appear many times.
|
||||
--no-wait Don't wait for the deployment to finish
|
||||
-f, --force Force a new deployment even if nothing has changed
|
||||
--with-cache Retain build cache when using "--force"
|
||||
--regions Set default regions to enable the deployment on
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
${chalk.gray('–')} Deploy the current directory
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()}`)}
|
||||
|
||||
${chalk.gray('–')} Deploy a custom path
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} /usr/src/project`)}
|
||||
|
||||
${chalk.gray('–')} Deploy with Environment Variables
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} -e NODE_ENV=production`)}
|
||||
|
||||
${chalk.gray('–')} Deploy with prebuilt outputs
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} build`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} deploy --prebuilt`)}
|
||||
|
||||
${chalk.gray('–')} Write Deployment URL to a file
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} > deployment-url.txt`)}
|
||||
`;
|
||||
};
|
||||
181
packages/cli/src/commands/deploy/command.ts
Normal file
181
packages/cli/src/commands/deploy/command.ts
Normal file
@@ -0,0 +1,181 @@
|
||||
import { Command } from '../help';
|
||||
|
||||
export const deployCommand: Command = {
|
||||
name: 'deploy',
|
||||
description:
|
||||
'Deploy your project to Vercel. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`).',
|
||||
arguments: [
|
||||
{
|
||||
name: 'project-path',
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'force',
|
||||
shorthand: 'f',
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Force a new deployment even if nothing has changed',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'with-cache',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Retain build cache when using "--force"',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'public',
|
||||
shorthand: 'p',
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Deployment is public (`/_src`) is exposed)',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'env',
|
||||
shorthand: 'e',
|
||||
type: 'string',
|
||||
argument: 'key=value',
|
||||
deprecated: false,
|
||||
multi: true,
|
||||
description:
|
||||
'Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)',
|
||||
},
|
||||
{
|
||||
name: 'build-env',
|
||||
shorthand: 'b',
|
||||
type: 'string',
|
||||
argument: 'key=value',
|
||||
deprecated: false,
|
||||
multi: true,
|
||||
description:
|
||||
'Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)',
|
||||
},
|
||||
{
|
||||
name: 'meta',
|
||||
shorthand: 'm',
|
||||
type: 'string',
|
||||
argument: 'key=value',
|
||||
deprecated: false,
|
||||
multi: true,
|
||||
description:
|
||||
'Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)',
|
||||
},
|
||||
{
|
||||
name: 'regions',
|
||||
shorthand: null,
|
||||
type: 'string',
|
||||
deprecated: false,
|
||||
description: 'Set default regions to enable the deployment on',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'prebuilt',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description:
|
||||
'Use in combination with `vc build`. Deploy an existing build',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'prod',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Create a production deployment',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'archive',
|
||||
shorthand: null,
|
||||
type: 'string',
|
||||
deprecated: false,
|
||||
description:
|
||||
'Compress the deployment code into a file before uploading it',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'no-wait',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: "Don't wait for the deployment to finish",
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'skip-domain',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: undefined,
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'yes',
|
||||
shorthand: 'y',
|
||||
type: 'boolean',
|
||||
deprecated: false,
|
||||
description: 'Use default options to skip all prompts',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'name',
|
||||
shorthand: 'n',
|
||||
type: 'string',
|
||||
deprecated: true,
|
||||
description: 'Provide a Vercel Project name',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'no-clipboard',
|
||||
shorthand: null,
|
||||
type: 'boolean',
|
||||
deprecated: true,
|
||||
description: 'Do not copy deployment URL to clipboard',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'target',
|
||||
shorthand: null,
|
||||
type: 'string',
|
||||
deprecated: true,
|
||||
description: 'Specify the target deployment environment',
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
name: 'confirm',
|
||||
shorthand: 'c',
|
||||
type: 'boolean',
|
||||
deprecated: true,
|
||||
description: 'Use default options to skip all prompts',
|
||||
multi: false,
|
||||
},
|
||||
],
|
||||
examples: [
|
||||
{
|
||||
name: 'Deploy the current directory',
|
||||
value: 'vercel',
|
||||
},
|
||||
{
|
||||
name: 'Deploy a custom path',
|
||||
value: 'vercel /usr/src/project',
|
||||
},
|
||||
{
|
||||
name: 'Deploy with run-time Environment Variables',
|
||||
value: 'vercel -e NODE_ENV=production',
|
||||
},
|
||||
{
|
||||
name: 'Deploy with prebuilt outputs',
|
||||
value: ['vercel build', 'vercel deploy --prebuilt'],
|
||||
},
|
||||
{
|
||||
name: 'Write Deployment URL to a file',
|
||||
value: 'vercel > deployment-url.txt',
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -2,7 +2,7 @@ import ms from 'ms';
|
||||
import fs from 'fs-extra';
|
||||
import bytes from 'bytes';
|
||||
import chalk from 'chalk';
|
||||
import { join, resolve, basename } from 'path';
|
||||
import { join, resolve } from 'path';
|
||||
import {
|
||||
fileNameSymbol,
|
||||
VALID_ARCHIVE_FORMATS,
|
||||
@@ -21,7 +21,6 @@ import stamp from '../../util/output/stamp';
|
||||
import createDeploy from '../../util/deploy/create-deploy';
|
||||
import getDeployment from '../../util/get-deployment';
|
||||
import parseMeta from '../../util/parse-meta';
|
||||
import linkStyle from '../../util/output/link';
|
||||
import param from '../../util/output/param';
|
||||
import {
|
||||
BuildsRateLimited,
|
||||
@@ -59,9 +58,7 @@ import validatePaths, {
|
||||
validateRootDirectory,
|
||||
} from '../../util/validate-paths';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import { getPreferredPreviewURL } from '../../util/deploy/get-preferred-preview-url';
|
||||
import { Output } from '../../util/output';
|
||||
import { help } from './args';
|
||||
import { getDeploymentChecks } from '../../util/deploy/get-deployment-checks';
|
||||
import parseTarget from '../../util/deploy/parse-target';
|
||||
import getPrebuiltJson from '../../util/deploy/get-prebuilt-json';
|
||||
@@ -70,45 +67,39 @@ import { isValidArchive } from '../../util/deploy/validate-archive-format';
|
||||
import { parseEnv } from '../../util/parse-env';
|
||||
import { errorToString, isErrnoException, isError } from '@vercel/error-utils';
|
||||
import { pickOverrides } from '../../util/projects/project-settings';
|
||||
import { isDeploying } from '../../util/deploy/is-deploying';
|
||||
import type { Deployment } from '@vercel-internals/types';
|
||||
import { printDeploymentStatus } from '../../util/deploy/print-deployment-status';
|
||||
import { help } from '../help';
|
||||
import { deployCommand } from './command';
|
||||
|
||||
export default async (client: Client): Promise<number> => {
|
||||
const { output } = client;
|
||||
|
||||
let argv = null;
|
||||
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--force': Boolean,
|
||||
'--with-cache': Boolean,
|
||||
'--public': Boolean,
|
||||
'--env': [String],
|
||||
'--build-env': [String],
|
||||
'--meta': [String],
|
||||
// This is not an array in favor of matching
|
||||
// the config property name.
|
||||
'--regions': String,
|
||||
'--prebuilt': Boolean,
|
||||
'--prod': Boolean,
|
||||
'--archive': String,
|
||||
'--no-wait': Boolean,
|
||||
'--yes': Boolean,
|
||||
'-f': '--force',
|
||||
'-p': '--public',
|
||||
'-e': '--env',
|
||||
'-b': '--build-env',
|
||||
'-m': '--meta',
|
||||
'-y': '--yes',
|
||||
const argOptions: {
|
||||
[k: string]:
|
||||
| BooleanConstructor
|
||||
| StringConstructor
|
||||
| string
|
||||
| [StringConstructor];
|
||||
} = {};
|
||||
for (const option of deployCommand.options) {
|
||||
argOptions[`--${option.name}`] =
|
||||
option.type === 'boolean' ? Boolean : String;
|
||||
if (option.shorthand) {
|
||||
argOptions[`-${option.shorthand}`] = `--${option.name}`;
|
||||
}
|
||||
if (
|
||||
option.name === 'env' ||
|
||||
option.name === 'build-env' ||
|
||||
option.name === 'meta'
|
||||
) {
|
||||
argOptions[`--${option.name}`] = [String];
|
||||
}
|
||||
}
|
||||
|
||||
// deprecated
|
||||
'--name': String,
|
||||
'-n': '--name',
|
||||
'--no-clipboard': Boolean,
|
||||
'--target': String,
|
||||
'--confirm': Boolean,
|
||||
'-c': '--confirm',
|
||||
});
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), argOptions);
|
||||
|
||||
if ('--confirm' in argv) {
|
||||
output.warn('`--confirm` is deprecated, please use `--yes` instead');
|
||||
@@ -120,7 +111,7 @@ export default async (client: Client): Promise<number> => {
|
||||
}
|
||||
|
||||
if (argv['--help']) {
|
||||
output.print(help());
|
||||
output.print(help(deployCommand, { columns: client.stderr.columns }));
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -132,24 +123,19 @@ export default async (client: Client): Promise<number> => {
|
||||
if (argv._.length > 0) {
|
||||
// If path is relative: resolve
|
||||
// if path is absolute: clear up strange `/` etc
|
||||
paths = argv._.map(item => resolve(process.cwd(), item));
|
||||
paths = argv._.map(item => resolve(client.cwd, item));
|
||||
} else {
|
||||
paths = [process.cwd()];
|
||||
paths = [client.cwd];
|
||||
}
|
||||
|
||||
// check paths
|
||||
const pathValidation = await validatePaths(client, paths);
|
||||
|
||||
if (!pathValidation.valid) {
|
||||
return pathValidation.exitCode;
|
||||
}
|
||||
|
||||
let localConfig = client.localConfig || readLocalConfig(paths[0]);
|
||||
|
||||
for (const path of paths) {
|
||||
try {
|
||||
await fs.stat(path);
|
||||
} catch (err) {
|
||||
output.error(
|
||||
`The specified file or directory "${basename(path)}" does not exist.`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (localConfig) {
|
||||
const { version } = localConfig;
|
||||
const file = highlight(localConfig[fileNameSymbol]!);
|
||||
@@ -178,14 +164,7 @@ export default async (client: Client): Promise<number> => {
|
||||
|
||||
const quiet = !client.stdout.isTTY;
|
||||
|
||||
// check paths
|
||||
const pathValidation = await validatePaths(client, paths);
|
||||
|
||||
if (!pathValidation.valid) {
|
||||
return pathValidation.exitCode;
|
||||
}
|
||||
|
||||
const { path } = pathValidation;
|
||||
let { path: cwd } = pathValidation;
|
||||
const autoConfirm = argv['--yes'];
|
||||
|
||||
// deprecate --name
|
||||
@@ -217,56 +196,6 @@ export default async (client: Client): Promise<number> => {
|
||||
return target;
|
||||
}
|
||||
|
||||
// build `--prebuilt`
|
||||
if (argv['--prebuilt']) {
|
||||
const prebuiltExists = await fs.pathExists(join(path, '.vercel/output'));
|
||||
if (!prebuiltExists) {
|
||||
error(
|
||||
`The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used, but no prebuilt output found in ".vercel/output". Run ${getCommandName(
|
||||
'build'
|
||||
)} to generate a local build.`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const prebuiltBuild = await getPrebuiltJson(path);
|
||||
|
||||
// Ensure that there was not a build error
|
||||
const prebuiltError =
|
||||
prebuiltBuild?.error ||
|
||||
prebuiltBuild?.builds?.find(build => 'error' in build)?.error;
|
||||
if (prebuiltError) {
|
||||
output.log(
|
||||
`Prebuilt deployment cannot be created because ${getCommandName(
|
||||
'build'
|
||||
)} failed with error:\n`
|
||||
);
|
||||
prettyError(prebuiltError);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Ensure that the deploy target matches the build target
|
||||
const assumedTarget = target || 'preview';
|
||||
if (prebuiltBuild?.target && prebuiltBuild.target !== assumedTarget) {
|
||||
let specifyTarget = '';
|
||||
if (prebuiltBuild.target === 'production') {
|
||||
specifyTarget = ` --prod`;
|
||||
}
|
||||
|
||||
prettyError({
|
||||
message: `The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used with the target environment "${assumedTarget}", but the prebuilt output found in ".vercel/output" was built with target environment "${
|
||||
prebuiltBuild.target
|
||||
}". Please run ${getCommandName(`--prebuilt${specifyTarget}`)}.`,
|
||||
link: 'https://vercel.link/prebuilt-environment-mismatch',
|
||||
});
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
const archive = argv['--archive'];
|
||||
if (typeof archive === 'string' && !isValidArchive(archive)) {
|
||||
output.error(`Format must be one of: ${VALID_ARCHIVE_FORMATS.join(', ')}`);
|
||||
@@ -274,7 +203,7 @@ export default async (client: Client): Promise<number> => {
|
||||
}
|
||||
|
||||
// retrieve `project` and `org` from .vercel
|
||||
const link = await getLinkedProject(client, path);
|
||||
const link = await getLinkedProject(client, cwd);
|
||||
|
||||
if (link.status === 'error') {
|
||||
return link.exitCode;
|
||||
@@ -291,7 +220,7 @@ export default async (client: Client): Promise<number> => {
|
||||
autoConfirm ||
|
||||
(await confirm(
|
||||
client,
|
||||
`Set up and deploy ${chalk.cyan(`“${toHumanPath(path)}”`)}?`,
|
||||
`Set up and deploy ${chalk.cyan(`“${toHumanPath(cwd)}”`)}?`,
|
||||
true
|
||||
));
|
||||
|
||||
@@ -338,7 +267,7 @@ export default async (client: Client): Promise<number> => {
|
||||
|
||||
if (typeof projectOrNewProjectName === 'string') {
|
||||
newProjectName = projectOrNewProjectName;
|
||||
rootDirectory = await inputRootDirectory(client, path, autoConfirm);
|
||||
rootDirectory = await inputRootDirectory(client, cwd, autoConfirm);
|
||||
} else {
|
||||
project = projectOrNewProjectName;
|
||||
rootDirectory = project.rootDirectory;
|
||||
@@ -346,8 +275,8 @@ export default async (client: Client): Promise<number> => {
|
||||
|
||||
// we can already link the project
|
||||
await linkFolderToProject(
|
||||
output,
|
||||
path,
|
||||
client,
|
||||
cwd,
|
||||
{
|
||||
projectId: project.id,
|
||||
orgId: org.id,
|
||||
@@ -359,11 +288,76 @@ export default async (client: Client): Promise<number> => {
|
||||
}
|
||||
}
|
||||
|
||||
// For repo-style linking, reset the path to the root of the repository
|
||||
if (link.status === 'linked' && link.repoRoot) {
|
||||
cwd = link.repoRoot;
|
||||
}
|
||||
|
||||
// At this point `org` should be populated
|
||||
if (!org) {
|
||||
throw new Error(`"org" is not defined`);
|
||||
}
|
||||
|
||||
// build `--prebuilt`
|
||||
if (argv['--prebuilt']) {
|
||||
// For repo-style linking, update `cwd` to be the Project
|
||||
// subdirectory when `rootDirectory` setting is defined
|
||||
if (
|
||||
link.status === 'linked' &&
|
||||
link.repoRoot &&
|
||||
link.project.rootDirectory
|
||||
) {
|
||||
cwd = join(cwd, link.project.rootDirectory);
|
||||
}
|
||||
|
||||
const prebuiltExists = await fs.pathExists(join(cwd, '.vercel/output'));
|
||||
if (!prebuiltExists) {
|
||||
error(
|
||||
`The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used, but no prebuilt output found in ".vercel/output". Run ${getCommandName(
|
||||
'build'
|
||||
)} to generate a local build.`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const prebuiltBuild = await getPrebuiltJson(cwd);
|
||||
|
||||
// Ensure that there was not a build error
|
||||
const prebuiltError =
|
||||
prebuiltBuild?.error ||
|
||||
prebuiltBuild?.builds?.find(build => 'error' in build)?.error;
|
||||
if (prebuiltError) {
|
||||
output.log(
|
||||
`Prebuilt deployment cannot be created because ${getCommandName(
|
||||
'build'
|
||||
)} failed with error:\n`
|
||||
);
|
||||
prettyError(prebuiltError);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Ensure that the deploy target matches the build target
|
||||
const assumedTarget = target || 'preview';
|
||||
if (prebuiltBuild?.target && prebuiltBuild.target !== assumedTarget) {
|
||||
let specifyTarget = '';
|
||||
if (prebuiltBuild.target === 'production') {
|
||||
specifyTarget = ` --prod`;
|
||||
}
|
||||
|
||||
prettyError({
|
||||
message: `The ${param(
|
||||
'--prebuilt'
|
||||
)} option was used with the target environment "${assumedTarget}", but the prebuilt output found in ".vercel/output" was built with target environment "${
|
||||
prebuiltBuild.target
|
||||
}". Please run ${getCommandName(`--prebuilt${specifyTarget}`)}.`,
|
||||
link: 'https://vercel.link/prebuilt-environment-mismatch',
|
||||
});
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the `contextName` and `currentTeam` as specified by the
|
||||
// Project Settings, so that API calls happen with the proper scope
|
||||
const contextName = org.slug;
|
||||
@@ -373,14 +367,14 @@ export default async (client: Client): Promise<number> => {
|
||||
// and upload the entire directory.
|
||||
const sourcePath =
|
||||
rootDirectory && !sourceFilesOutsideRootDirectory
|
||||
? join(path, rootDirectory)
|
||||
: path;
|
||||
? join(cwd, rootDirectory)
|
||||
: cwd;
|
||||
|
||||
if (
|
||||
rootDirectory &&
|
||||
(await validateRootDirectory(
|
||||
output,
|
||||
path,
|
||||
cwd,
|
||||
sourcePath,
|
||||
project
|
||||
? `To change your Project Settings, go to https://vercel.com/${org?.slug}/${project.name}/settings`
|
||||
@@ -393,7 +387,7 @@ export default async (client: Client): Promise<number> => {
|
||||
// If Root Directory is used we'll try to read the config
|
||||
// from there instead and use it if it exists.
|
||||
if (rootDirectory) {
|
||||
const rootDirectoryConfig = readLocalConfig(join(path, rootDirectory));
|
||||
const rootDirectoryConfig = readLocalConfig(join(cwd, rootDirectory));
|
||||
|
||||
if (rootDirectoryConfig) {
|
||||
debug(`Read local config from root directory (${rootDirectory})`);
|
||||
@@ -469,7 +463,7 @@ export default async (client: Client): Promise<number> => {
|
||||
parseMeta(argv['--meta'])
|
||||
);
|
||||
|
||||
const gitMetadata = await createGitMeta(path, output, project);
|
||||
const gitMetadata = await createGitMeta(cwd, output, project);
|
||||
|
||||
// Merge dotenv config, `env` from vercel.json, and `--env` / `-e` arguments
|
||||
const deploymentEnv = Object.assign(
|
||||
@@ -520,6 +514,9 @@ export default async (client: Client): Promise<number> => {
|
||||
}
|
||||
|
||||
try {
|
||||
// if this flag is not set, use `undefined` to allow the project setting to be used
|
||||
const autoAssignCustomDomains = argv['--skip-domain'] ? false : undefined;
|
||||
|
||||
const createArgs: CreateOptions = {
|
||||
name,
|
||||
env: deploymentEnv,
|
||||
@@ -543,6 +540,7 @@ export default async (client: Client): Promise<number> => {
|
||||
target,
|
||||
skipAutoDetectionConfirmation: autoConfirm,
|
||||
noWait,
|
||||
autoAssignCustomDomains,
|
||||
};
|
||||
|
||||
if (!localConfig.builds || localConfig.builds.length === 0) {
|
||||
@@ -559,11 +557,11 @@ export default async (client: Client): Promise<number> => {
|
||||
client,
|
||||
now,
|
||||
contextName,
|
||||
[sourcePath],
|
||||
sourcePath,
|
||||
createArgs,
|
||||
org,
|
||||
!project,
|
||||
path,
|
||||
cwd,
|
||||
archive
|
||||
);
|
||||
|
||||
@@ -595,11 +593,11 @@ export default async (client: Client): Promise<number> => {
|
||||
client,
|
||||
now,
|
||||
contextName,
|
||||
[sourcePath],
|
||||
sourcePath,
|
||||
createArgs,
|
||||
org,
|
||||
false,
|
||||
path
|
||||
cwd
|
||||
);
|
||||
}
|
||||
|
||||
@@ -728,7 +726,7 @@ export default async (client: Client): Promise<number> => {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return printDeploymentStatus(output, client, deployment, deployStamp, noWait);
|
||||
return printDeploymentStatus(client, deployment, deployStamp, noWait);
|
||||
};
|
||||
|
||||
function handleCreateDeployError(
|
||||
@@ -835,112 +833,3 @@ const addProcessEnv = async (
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const printDeploymentStatus = async (
|
||||
output: Output,
|
||||
client: Client,
|
||||
{
|
||||
readyState,
|
||||
alias: aliasList,
|
||||
aliasError,
|
||||
target,
|
||||
indications,
|
||||
url: deploymentUrl,
|
||||
aliasWarning,
|
||||
}: {
|
||||
readyState: Deployment['readyState'];
|
||||
alias: string[];
|
||||
aliasError: Error;
|
||||
target: string;
|
||||
indications: any;
|
||||
url: string;
|
||||
aliasWarning?: {
|
||||
code: string;
|
||||
message: string;
|
||||
link?: string;
|
||||
action?: string;
|
||||
};
|
||||
},
|
||||
deployStamp: () => string,
|
||||
noWait: boolean
|
||||
) => {
|
||||
indications = indications || [];
|
||||
const isProdDeployment = target === 'production';
|
||||
|
||||
let isStillBuilding = false;
|
||||
if (noWait) {
|
||||
if (isDeploying(readyState)) {
|
||||
isStillBuilding = true;
|
||||
output.print(
|
||||
prependEmoji(
|
||||
'Note: Deployment is still processing...',
|
||||
emoji('notice')
|
||||
) + '\n'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isStillBuilding && readyState !== 'READY') {
|
||||
output.error(
|
||||
`Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (aliasError) {
|
||||
output.warn(
|
||||
`Failed to assign aliases${
|
||||
aliasError.message ? `: ${aliasError.message}` : ''
|
||||
}`
|
||||
);
|
||||
} else {
|
||||
// print preview/production url
|
||||
let previewUrl: string;
|
||||
// if `noWait` is true, then use the deployment url, not an alias
|
||||
if (!noWait && Array.isArray(aliasList) && aliasList.length > 0) {
|
||||
const previewUrlInfo = await getPreferredPreviewURL(client, aliasList);
|
||||
if (previewUrlInfo) {
|
||||
previewUrl = previewUrlInfo.previewUrl;
|
||||
} else {
|
||||
previewUrl = `https://${deploymentUrl}`;
|
||||
}
|
||||
} else {
|
||||
// fallback to deployment url
|
||||
previewUrl = `https://${deploymentUrl}`;
|
||||
}
|
||||
|
||||
output.print(
|
||||
prependEmoji(
|
||||
`${isProdDeployment ? 'Production' : 'Preview'}: ${chalk.bold(
|
||||
previewUrl
|
||||
)} ${deployStamp()}`,
|
||||
emoji('success')
|
||||
) + `\n`
|
||||
);
|
||||
}
|
||||
|
||||
if (aliasWarning?.message) {
|
||||
indications.push({
|
||||
type: 'warning',
|
||||
payload: aliasWarning.message,
|
||||
link: aliasWarning.link,
|
||||
action: aliasWarning.action,
|
||||
});
|
||||
}
|
||||
|
||||
const newline = '\n';
|
||||
for (let indication of indications) {
|
||||
const message =
|
||||
prependEmoji(chalk.dim(indication.payload), emoji(indication.type)) +
|
||||
newline;
|
||||
let link = '';
|
||||
if (indication.link)
|
||||
link =
|
||||
chalk.dim(
|
||||
`${indication.action || 'Learn More'}: ${linkStyle(indication.link)}`
|
||||
) + newline;
|
||||
output.print(message + link);
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
@@ -58,7 +58,13 @@ export default async function dev(
|
||||
let projectSettings: ProjectSettings | undefined;
|
||||
let envValues: Record<string, string> = {};
|
||||
if (link.status === 'linked') {
|
||||
const { project, org } = link;
|
||||
const { project, org, repoRoot } = link;
|
||||
|
||||
// If repo linked, update `cwd` to the repo root
|
||||
if (repoRoot) {
|
||||
cwd = repoRoot;
|
||||
}
|
||||
|
||||
client.config.currentTeam = org.type === 'team' ? org.id : undefined;
|
||||
|
||||
projectSettings = project;
|
||||
|
||||
6
packages/cli/src/commands/env/index.ts
vendored
6
packages/cli/src/commands/env/index.ts
vendored
@@ -26,7 +26,7 @@ const help = () => {
|
||||
ls [environment] [gitbranch] List all variables for the specified Environment
|
||||
add [name] [environment] [gitbranch] Add an Environment Variable (see examples below)
|
||||
rm [name] [environment] [gitbranch] Remove an Environment Variable (see examples below)
|
||||
pull [filename] Pull all Development Environment Variables from the cloud and write to a file [.env]
|
||||
pull [filename] Pull all Development Environment Variables from the cloud and write to a file [.env.local]
|
||||
|
||||
${chalk.dim('Options:')}
|
||||
|
||||
@@ -130,10 +130,9 @@ export default async function main(client: Client) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
const cwd = argv['--cwd'] || process.cwd();
|
||||
const subArgs = argv._.slice(1);
|
||||
const { subcommand, args } = getSubcommand(subArgs, COMMAND_CONFIG);
|
||||
const { output, config } = client;
|
||||
const { cwd, output, config } = client;
|
||||
|
||||
const target = argv['--environment']?.toLowerCase() || 'development';
|
||||
if (!isValidEnvTarget(target)) {
|
||||
@@ -168,6 +167,7 @@ export default async function main(client: Client) {
|
||||
case 'pull':
|
||||
return pull(
|
||||
client,
|
||||
link,
|
||||
project,
|
||||
target,
|
||||
argv,
|
||||
|
||||
27
packages/cli/src/commands/env/pull.ts
vendored
27
packages/cli/src/commands/env/pull.ts
vendored
@@ -2,7 +2,11 @@ import chalk from 'chalk';
|
||||
import { outputFile } from 'fs-extra';
|
||||
import { closeSync, openSync, readSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import type {
|
||||
Project,
|
||||
ProjectEnvTarget,
|
||||
ProjectLinked,
|
||||
} from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import { emoji, prependEmoji } from '../../util/emoji';
|
||||
import confirm from '../../util/input/confirm';
|
||||
@@ -19,6 +23,7 @@ import {
|
||||
createEnvObject,
|
||||
} from '../../util/env/diff-env-files';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import { addToGitIgnore } from '../../util/link/add-to-gitignore';
|
||||
|
||||
const CONTENTS_PREFIX = '# Created by Vercel CLI\n';
|
||||
|
||||
@@ -51,6 +56,7 @@ function tryReadHeadSync(path: string, length: number) {
|
||||
|
||||
export default async function pull(
|
||||
client: Client,
|
||||
link: ProjectLinked,
|
||||
project: Project,
|
||||
environment: ProjectEnvTarget,
|
||||
opts: Partial<Options>,
|
||||
@@ -67,7 +73,7 @@ export default async function pull(
|
||||
}
|
||||
|
||||
// handle relative or absolute filename
|
||||
const [filename = '.env'] = args;
|
||||
const [filename = '.env.local'] = args;
|
||||
const fullPath = resolve(cwd, filename);
|
||||
const skipConfirmation = opts['--yes'];
|
||||
const gitBranch = opts['--git-branch'];
|
||||
@@ -136,11 +142,22 @@ export default async function pull(
|
||||
output.log('No changes found.');
|
||||
}
|
||||
|
||||
let isGitIgnoreUpdated = false;
|
||||
if (filename === '.env.local') {
|
||||
// When the file is `.env.local`, we also add it to `.gitignore`
|
||||
// to avoid accidentally committing it to git.
|
||||
// We use '.env*.local' to match the default .gitignore from
|
||||
// create-next-app template. See:
|
||||
// https://github.com/vercel/next.js/blob/06abd634899095b6cc28e6e8315b1e8b9c8df939/packages/create-next-app/templates/app/js/gitignore#L28
|
||||
const rootPath = link.repoRoot ?? cwd;
|
||||
isGitIgnoreUpdated = await addToGitIgnore(rootPath, '.env*.local');
|
||||
}
|
||||
|
||||
output.print(
|
||||
`${prependEmoji(
|
||||
`${exists ? 'Updated' : 'Created'} ${chalk.bold(
|
||||
filename
|
||||
)} file ${chalk.gray(pullStamp())}`,
|
||||
`${exists ? 'Updated' : 'Created'} ${chalk.bold(filename)} file ${
|
||||
isGitIgnoreUpdated ? 'and added it to .gitignore' : ''
|
||||
} ${chalk.gray(pullStamp())}`,
|
||||
emoji('success')
|
||||
)}\n`
|
||||
);
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
parseRepoUrl,
|
||||
printRemoteUrls,
|
||||
} from '../../util/git/connect-git-provider';
|
||||
import validatePaths from '../../util/validate-paths';
|
||||
|
||||
interface GitRepoCheckParams {
|
||||
client: Client;
|
||||
@@ -56,7 +55,7 @@ export default async function connect(
|
||||
project: Project | undefined,
|
||||
org: Org | undefined
|
||||
) {
|
||||
const { output } = client;
|
||||
const { cwd, output } = client;
|
||||
const confirm = Boolean(argv['--yes']);
|
||||
const repoArg = argv._[1];
|
||||
|
||||
@@ -77,19 +76,11 @@ export default async function connect(
|
||||
return 1;
|
||||
}
|
||||
|
||||
let paths = [process.cwd()];
|
||||
|
||||
const validate = await validatePaths(client, paths);
|
||||
if (!validate.valid) {
|
||||
return validate.exitCode;
|
||||
}
|
||||
const { path } = validate;
|
||||
|
||||
const gitProviderLink = project.link;
|
||||
client.config.currentTeam = org.type === 'team' ? org.id : undefined;
|
||||
|
||||
// get project from .git
|
||||
const gitConfigPath = join(path, '.git/config');
|
||||
const gitConfigPath = join(cwd, '.git/config');
|
||||
const gitConfig = await parseGitConfig(gitConfigPath, output);
|
||||
|
||||
if (repoArg) {
|
||||
@@ -116,7 +107,7 @@ export default async function connect(
|
||||
confirm,
|
||||
org,
|
||||
project,
|
||||
repoInfo: repoArg,
|
||||
repoInfo: parsedUrlArg,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import getInvalidSubcommand from '../../util/get-invalid-subcommand';
|
||||
import handleError from '../../util/handle-error';
|
||||
import logo from '../../util/output/logo';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import validatePaths from '../../util/validate-paths';
|
||||
import connect from './connect';
|
||||
import disconnect from './disconnect';
|
||||
|
||||
@@ -81,16 +80,9 @@ export default async function main(client: Client) {
|
||||
subcommand = argv._[0];
|
||||
const args = argv._.slice(1);
|
||||
const autoConfirm = Boolean(argv['--yes']);
|
||||
const { output } = client;
|
||||
const { cwd, output } = client;
|
||||
|
||||
let paths = [process.cwd()];
|
||||
const pathValidation = await validatePaths(client, paths);
|
||||
if (!pathValidation.valid) {
|
||||
return pathValidation.exitCode;
|
||||
}
|
||||
const { path } = pathValidation;
|
||||
|
||||
const linkedProject = await ensureLink('git', client, path, { autoConfirm });
|
||||
const linkedProject = await ensureLink('git', client, cwd, { autoConfirm });
|
||||
if (typeof linkedProject === 'number') {
|
||||
return linkedProject;
|
||||
}
|
||||
|
||||
229
packages/cli/src/commands/help.ts
Normal file
229
packages/cli/src/commands/help.ts
Normal file
@@ -0,0 +1,229 @@
|
||||
import chalk from 'chalk';
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import { LOGO, NAME } from '@vercel-internals/constants';
|
||||
|
||||
const INDENT = ' '.repeat(2);
|
||||
const NEWLINE = '\n';
|
||||
|
||||
export interface CommandOption {
|
||||
name: string;
|
||||
shorthand: string | null;
|
||||
type: 'boolean' | 'string';
|
||||
argument?: string;
|
||||
deprecated: boolean;
|
||||
description?: string;
|
||||
multi: boolean;
|
||||
}
|
||||
export interface CommandArgument {
|
||||
name: string;
|
||||
required: boolean;
|
||||
}
|
||||
export interface CommandExample {
|
||||
name: string;
|
||||
value: string | string[];
|
||||
}
|
||||
export interface Command {
|
||||
name: string;
|
||||
description: string;
|
||||
arguments: CommandArgument[];
|
||||
options: CommandOption[];
|
||||
examples: CommandExample[];
|
||||
}
|
||||
|
||||
export function calcLineLength(line: string[]) {
|
||||
return stripAnsi(lineToString(line)).length;
|
||||
}
|
||||
|
||||
// Insert spaces in between non-whitespace items only
|
||||
export function lineToString(line: string[]) {
|
||||
let string = '';
|
||||
for (let i = 0; i < line.length; i++) {
|
||||
if (i === line.length - 1) {
|
||||
string += line[i];
|
||||
} else {
|
||||
const curr = line[i];
|
||||
const next = line[i + 1];
|
||||
string += curr;
|
||||
if (curr.trim() !== '' && next.trim() !== '') {
|
||||
string += ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
export function outputArrayToString(outputArray: string[]) {
|
||||
return outputArray.join(NEWLINE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Example: `▲ vercel deploy [path] [options]`
|
||||
* @param command
|
||||
* @returns
|
||||
*/
|
||||
export function buildCommandSynopsisLine(command: Command) {
|
||||
const line: string[] = [LOGO, chalk.bold(NAME), chalk.bold(command.name)];
|
||||
if (command.arguments.length > 0) {
|
||||
for (const argument of command.arguments) {
|
||||
line.push(argument.required ? argument.name : `[${argument.name}]`);
|
||||
}
|
||||
}
|
||||
if (command.options.length > 0) {
|
||||
line.push('[options]');
|
||||
}
|
||||
return lineToString(line);
|
||||
}
|
||||
|
||||
export function buildCommandOptionLines(
|
||||
command: Command,
|
||||
options: BuildHelpOutputOptions
|
||||
) {
|
||||
// Filter out deprecated and intentionally undocumented options
|
||||
command.options = command.options.filter(
|
||||
option => !option.deprecated && option.description !== undefined
|
||||
);
|
||||
|
||||
// Initialize output array with header and empty line
|
||||
const outputArray: string[] = [chalk.dim(`Options:`), ''];
|
||||
|
||||
// Start building option lines
|
||||
const optionLines: string[][] = [];
|
||||
// Sort command options alphabetically
|
||||
command.options.sort((a, b) =>
|
||||
a.name < b.name ? -1 : a.name > b.name ? 1 : 0
|
||||
);
|
||||
// Keep track of longest "start" of an option line to determine description spacing
|
||||
let maxLineStartLength = 0;
|
||||
// Iterate over options and create the "start" of each option (e.g. ` -b, --build-env <key=value>`)
|
||||
for (const option of command.options) {
|
||||
const startLine: string[] = [INDENT];
|
||||
if (option.shorthand) {
|
||||
startLine.push(`-${option.shorthand},`);
|
||||
}
|
||||
startLine.push(`--${option.name}`);
|
||||
if (option.argument) {
|
||||
startLine.push(`<${option.argument}>`);
|
||||
}
|
||||
// the length includes the INDENT
|
||||
const lineLength = calcLineLength(startLine);
|
||||
maxLineStartLength = Math.max(lineLength, maxLineStartLength);
|
||||
optionLines.push(startLine);
|
||||
}
|
||||
/*
|
||||
* Iterate over in-progress option lines to add space-filler and description
|
||||
* For Example:
|
||||
* | --archive My description starts here.
|
||||
* |
|
||||
* | -b, --build-env <key=value> Start of description here then
|
||||
* | it wraps here.
|
||||
* |
|
||||
* | -e, --env <key=value> My description is short.
|
||||
*
|
||||
* Breaking down option lines:
|
||||
* | -b, --build-env <key=value> Start of description here then
|
||||
* |[][ ][][ ]
|
||||
* |↑ ↑ ↑ ↑
|
||||
* |1 2 3 4
|
||||
* | it wraps here.
|
||||
* |[][ ][ ]
|
||||
* |↑ ↑ ↑
|
||||
* |5 6 7
|
||||
* | 1, 5 = indent
|
||||
* | 2 = start
|
||||
* | 3, 6 = space-filler
|
||||
* | 4, 7 = description
|
||||
*/
|
||||
for (let i = 0; i < optionLines.length; i++) {
|
||||
const optionLine = optionLines[i];
|
||||
const option = command.options[i];
|
||||
// Add only 2 spaces to the longest line, and then make all shorter lines the same length.
|
||||
optionLine.push(
|
||||
' '.repeat(2 + (maxLineStartLength - calcLineLength(optionLine)))
|
||||
);
|
||||
|
||||
// Descriptions may be longer than max line length. Wrap them to the same column as the first description line
|
||||
const lines: string[][] = [optionLine];
|
||||
if (option.description) {
|
||||
for (const descriptionWord of option.description.split(' ')) {
|
||||
// insert a new line when the next word would match or exceed the maximum line length
|
||||
if (
|
||||
calcLineLength(lines[lines.length - 1]) +
|
||||
stripAnsi(descriptionWord).length >=
|
||||
options.columns
|
||||
) {
|
||||
// initialize the new line with the necessary whitespace. The INDENT is apart of `maxLineStartLength`
|
||||
lines.push([' '.repeat(maxLineStartLength + 2)]);
|
||||
}
|
||||
// insert the word to the current last line
|
||||
lines[lines.length - 1].push(descriptionWord);
|
||||
}
|
||||
}
|
||||
// for every line, transform into a string and push it to the output
|
||||
for (const line of lines) {
|
||||
outputArray.push(lineToString(line));
|
||||
}
|
||||
// add an empty line in between in each option block for readability (skip the last block)
|
||||
if (i !== optionLines.length - 1) outputArray.push('');
|
||||
}
|
||||
|
||||
// return the entire list of options as a single string after delete the last '\n' added to the option list
|
||||
return outputArrayToString(outputArray);
|
||||
}
|
||||
|
||||
export function buildCommandExampleLines(command: Command) {
|
||||
const outputArray: string[] = [chalk.dim(`Examples:`), ''];
|
||||
for (const example of command.examples) {
|
||||
const nameLine: string[] = [INDENT];
|
||||
nameLine.push(chalk.gray('-'));
|
||||
nameLine.push(example.name);
|
||||
outputArray.push(lineToString(nameLine));
|
||||
outputArray.push('');
|
||||
const buildValueLine = (value: string) => {
|
||||
return lineToString([INDENT, INDENT, chalk.cyan(`$ ${value}`)]);
|
||||
};
|
||||
if (Array.isArray(example.value)) {
|
||||
for (const line of example.value) {
|
||||
outputArray.push(buildValueLine(line));
|
||||
}
|
||||
} else {
|
||||
outputArray.push(buildValueLine(example.value));
|
||||
}
|
||||
outputArray.push('');
|
||||
}
|
||||
// delete the last newline added after examples iteration
|
||||
outputArray.splice(-1);
|
||||
|
||||
return outputArrayToString(outputArray);
|
||||
}
|
||||
|
||||
interface BuildHelpOutputOptions {
|
||||
columns: number;
|
||||
}
|
||||
|
||||
export function buildHelpOutput(
|
||||
command: Command,
|
||||
options: BuildHelpOutputOptions
|
||||
) {
|
||||
const outputArray: string[] = [
|
||||
buildCommandSynopsisLine(command),
|
||||
'',
|
||||
command.description,
|
||||
'',
|
||||
buildCommandOptionLines(command, options),
|
||||
'',
|
||||
buildCommandExampleLines(command),
|
||||
'',
|
||||
];
|
||||
|
||||
return outputArrayToString(outputArray);
|
||||
}
|
||||
|
||||
export interface HelpOptions {
|
||||
columns?: number;
|
||||
}
|
||||
|
||||
export function help(command: Command, options: HelpOptions) {
|
||||
return buildHelpOutput(command, {
|
||||
columns: options.columns ?? 80,
|
||||
});
|
||||
}
|
||||
@@ -26,7 +26,9 @@ export default new Map([
|
||||
['ls', 'list'],
|
||||
['project', 'project'],
|
||||
['projects', 'project'],
|
||||
['promote', 'promote'],
|
||||
['pull', 'pull'],
|
||||
['redeploy', 'redeploy'],
|
||||
['remove', 'remove'],
|
||||
['rm', 'remove'],
|
||||
['rollback', 'rollback'],
|
||||
|
||||
@@ -90,14 +90,14 @@ export default async function main(client: Client) {
|
||||
)} instead`
|
||||
);
|
||||
} else {
|
||||
cwd = process.cwd();
|
||||
cwd = client.cwd;
|
||||
}
|
||||
|
||||
if (argv['--repo']) {
|
||||
client.output.warn(
|
||||
`The ${cmd('--repo')} flag is in alpha, please report issues`
|
||||
);
|
||||
await ensureRepoLink(client, cwd, yes);
|
||||
await ensureRepoLink(client, cwd, { yes, overwrite: true });
|
||||
} else {
|
||||
const link = await ensureLink('link', client, cwd, {
|
||||
autoConfirm: yes,
|
||||
|
||||
@@ -15,7 +15,6 @@ import getCommandFlags from '../util/get-command-flags';
|
||||
import { getPkgName, getCommandName } from '../util/pkg-name';
|
||||
import Client from '../util/client';
|
||||
import { Deployment } from '@vercel/client';
|
||||
import validatePaths from '../util/validate-paths';
|
||||
import { getLinkedProject } from '../util/projects/link';
|
||||
import { ensureLink } from '../util/link/ensure-link';
|
||||
import getScope from '../util/get-scope';
|
||||
@@ -94,7 +93,7 @@ export default async function main(client: Client) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const { output, config } = client;
|
||||
const { cwd, output, config } = client;
|
||||
|
||||
if ('--confirm' in argv) {
|
||||
output.warn('`--confirm` is deprecated, please use `--yes` instead');
|
||||
@@ -115,19 +114,10 @@ export default async function main(client: Client) {
|
||||
|
||||
const autoConfirm = !!argv['--yes'];
|
||||
const prod = argv['--prod'] || false;
|
||||
|
||||
const meta = parseMeta(argv['--meta']);
|
||||
|
||||
let paths = [process.cwd()];
|
||||
const pathValidation = await validatePaths(client, paths);
|
||||
if (!pathValidation.valid) {
|
||||
return pathValidation.exitCode;
|
||||
}
|
||||
|
||||
const { path } = pathValidation;
|
||||
|
||||
// retrieve `project` and `org` from .vercel
|
||||
let link = await getLinkedProject(client, path);
|
||||
let link = await getLinkedProject(client, cwd);
|
||||
|
||||
if (link.status === 'error') {
|
||||
return link.exitCode;
|
||||
@@ -146,7 +136,7 @@ export default async function main(client: Client) {
|
||||
// If there's no linked project and user doesn't pass `app` arg,
|
||||
// prompt to link their current directory.
|
||||
if (status === 'not_linked' && !app) {
|
||||
const linkedProject = await ensureLink('list', client, path, {
|
||||
const linkedProject = await ensureLink('list', client, cwd, {
|
||||
autoConfirm,
|
||||
link,
|
||||
});
|
||||
|
||||
124
packages/cli/src/commands/promote/index.ts
Normal file
124
packages/cli/src/commands/promote/index.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../../util/client';
|
||||
import getArgs from '../../util/get-args';
|
||||
import getProjectByCwdOrLink from '../../util/projects/get-project-by-cwd-or-link';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import handleError from '../../util/handle-error';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import logo from '../../util/output/logo';
|
||||
import ms from 'ms';
|
||||
import requestPromote from './request-promote';
|
||||
import promoteStatus from './status';
|
||||
|
||||
const help = () => {
|
||||
console.log(`
|
||||
${chalk.bold(`${logo} ${getPkgName()} promote`)} [deployment id/url]
|
||||
|
||||
Promote an existing deployment to current.
|
||||
|
||||
${chalk.dim('Options:')}
|
||||
|
||||
-h, --help Output usage information
|
||||
-A ${chalk.bold.underline('FILE')}, --local-config=${chalk.bold.underline(
|
||||
'FILE'
|
||||
)} Path to the local ${'`vercel.json`'} file
|
||||
-Q ${chalk.bold.underline('DIR')}, --global-config=${chalk.bold.underline(
|
||||
'DIR'
|
||||
)} Path to the global ${'`.vercel`'} directory
|
||||
-d, --debug Debug mode [off]
|
||||
--no-color No color mode [off]
|
||||
-t ${chalk.bold.underline('TOKEN')}, --token=${chalk.bold.underline(
|
||||
'TOKEN'
|
||||
)} Login token
|
||||
--timeout=${chalk.bold.underline(
|
||||
'TIME'
|
||||
)} Time to wait for promotion completion [3m]
|
||||
-y, --yes Skip questions when setting up new project using default scope and settings
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
${chalk.gray('–')} Show the status of any current pending promotions
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} promote`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} promote status`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} promote status <project>`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} promote status --timeout 30s`)}
|
||||
|
||||
${chalk.gray('–')} Promote a deployment using id or url
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} promote <deployment id/url>`)}
|
||||
`);
|
||||
};
|
||||
|
||||
/**
|
||||
* `vc promote` command
|
||||
* @param {Client} client
|
||||
* @returns {Promise<number>} Resolves an exit code; 0 on success
|
||||
*/
|
||||
export default async (client: Client): Promise<number> => {
|
||||
let argv;
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--timeout': String,
|
||||
'--yes': Boolean,
|
||||
'-y': '--yes',
|
||||
});
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argv['--help'] || argv._[0] === 'help') {
|
||||
help();
|
||||
return 2;
|
||||
}
|
||||
|
||||
const yes = argv['--yes'] ?? false;
|
||||
|
||||
// validate the timeout
|
||||
let timeout = argv['--timeout'];
|
||||
if (timeout && ms(timeout) === undefined) {
|
||||
client.output.error(`Invalid timeout "${timeout}"`);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const actionOrDeployId = argv._[1] || 'status';
|
||||
|
||||
try {
|
||||
if (actionOrDeployId === 'status') {
|
||||
const project = await getProjectByCwdOrLink({
|
||||
autoConfirm: Boolean(argv['--yes']),
|
||||
client,
|
||||
commandName: 'promote',
|
||||
cwd: client.cwd,
|
||||
projectNameOrId: argv._[2],
|
||||
});
|
||||
|
||||
return await promoteStatus({
|
||||
client,
|
||||
project,
|
||||
timeout,
|
||||
});
|
||||
}
|
||||
|
||||
return await requestPromote({
|
||||
client,
|
||||
deployId: actionOrDeployId,
|
||||
timeout,
|
||||
yes,
|
||||
});
|
||||
} catch (err) {
|
||||
if (isErrnoException(err)) {
|
||||
if (err.code === 'ERR_CANCELED') {
|
||||
return 0;
|
||||
}
|
||||
if (err.code === 'ERR_INVALID_CWD' || err.code === 'ERR_LINK_PROJECT') {
|
||||
// do not show the message
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
client.output.prettyError(err);
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
70
packages/cli/src/commands/promote/request-promote.ts
Normal file
70
packages/cli/src/commands/promote/request-promote.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../../util/client';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import getProjectByDeployment from '../../util/projects/get-project-by-deployment';
|
||||
import ms from 'ms';
|
||||
import promoteStatus from './status';
|
||||
import confirm from '../../util/input/confirm';
|
||||
|
||||
/**
|
||||
* Requests a promotion and waits for it complete.
|
||||
* @param {Client} client - The Vercel client instance
|
||||
* @param {string} deployId - The deployment name or id to promote
|
||||
* @param {string} [timeout] - Time to poll for succeeded/failed state
|
||||
* @returns {Promise<number>} Resolves an exit code; 0 on success
|
||||
*/
|
||||
export default async function requestPromote({
|
||||
client,
|
||||
deployId,
|
||||
timeout,
|
||||
yes,
|
||||
}: {
|
||||
client: Client;
|
||||
deployId: string;
|
||||
timeout?: string;
|
||||
yes: boolean;
|
||||
}): Promise<number> {
|
||||
const { output } = client;
|
||||
|
||||
const { contextName, deployment, project } = await getProjectByDeployment({
|
||||
client,
|
||||
deployId,
|
||||
output: client.output,
|
||||
});
|
||||
|
||||
if (deployment.target !== 'production' && !yes) {
|
||||
const question =
|
||||
'This deployment does not target production, therefore promotion will not apply production environment variables. Are you sure you want to continue?';
|
||||
const answer = await confirm(client, question, false);
|
||||
if (!answer) {
|
||||
output.error('Canceled');
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// request the promotion
|
||||
await client.fetch(`/v9/projects/${project.id}/promote/${deployment.id}`, {
|
||||
body: {}, // required
|
||||
json: false,
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
if (timeout !== undefined && ms(timeout) === 0) {
|
||||
output.log(
|
||||
`Successfully requested promote of ${chalk.bold(project.name)} to ${
|
||||
deployment.url
|
||||
} (${deployment.id})`
|
||||
);
|
||||
output.log(`To check promote status, run ${getCommandName('promote')}.`);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// check the status
|
||||
return await promoteStatus({
|
||||
client,
|
||||
contextName,
|
||||
deployment,
|
||||
project,
|
||||
timeout,
|
||||
});
|
||||
}
|
||||
265
packages/cli/src/commands/promote/status.ts
Normal file
265
packages/cli/src/commands/promote/status.ts
Normal file
@@ -0,0 +1,265 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../../util/client';
|
||||
import type {
|
||||
Deployment,
|
||||
LastAliasRequest,
|
||||
PaginationOptions,
|
||||
Project,
|
||||
} from '@vercel-internals/types';
|
||||
import elapsed from '../../util/output/elapsed';
|
||||
import formatDate from '../../util/format-date';
|
||||
import getDeployment from '../../util/get-deployment';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import getProjectByNameOrId from '../../util/projects/get-project-by-id-or-name';
|
||||
import getScope from '../../util/get-scope';
|
||||
import ms from 'ms';
|
||||
import { ProjectNotFound } from '../../util/errors-ts';
|
||||
import renderAliasStatus from '../../util/alias/render-alias-status';
|
||||
import sleep from '../../util/sleep';
|
||||
|
||||
interface DeploymentAlias {
|
||||
alias: {
|
||||
alias: string;
|
||||
deploymentId: string;
|
||||
};
|
||||
id: string;
|
||||
status: 'completed' | 'in-progress' | 'pending' | 'failed';
|
||||
}
|
||||
|
||||
interface AliasesResponse {
|
||||
aliases: DeploymentAlias[];
|
||||
pagination: PaginationOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Continuously checks a deployment status until it has succeeded, failed, or
|
||||
* taken longer than the timeout (default 3 minutes).
|
||||
*
|
||||
* @param {Client} client - The Vercel client instance
|
||||
* @param {string} [contextName] - The scope name; if not specified, it will be
|
||||
* extracted from the `client`
|
||||
* @param {Deployment} [deployment] - Info about the deployment which is used
|
||||
* to display different output following a promotion request
|
||||
* @param {Project} project - Project info instance
|
||||
* @param {string} [timeout] - Milliseconds to poll for succeeded/failed state
|
||||
* @returns {Promise<number>} Resolves an exit code; 0 on success
|
||||
*/
|
||||
export default async function promoteStatus({
|
||||
client,
|
||||
contextName,
|
||||
deployment,
|
||||
project,
|
||||
timeout = '3m',
|
||||
}: {
|
||||
client: Client;
|
||||
contextName?: string;
|
||||
deployment?: Deployment;
|
||||
project: Project;
|
||||
timeout?: string;
|
||||
}): Promise<number> {
|
||||
const { output } = client;
|
||||
const recentThreshold = Date.now() - ms('3m');
|
||||
const promoteTimeout = Date.now() + ms(timeout);
|
||||
let counter = 0;
|
||||
let spinnerMessage = deployment
|
||||
? 'Promote in progress'
|
||||
: `Checking promotion status of ${project.name}`;
|
||||
|
||||
if (!contextName) {
|
||||
({ contextName } = await getScope(client));
|
||||
}
|
||||
|
||||
try {
|
||||
output.spinner(`${spinnerMessage}…`);
|
||||
|
||||
// continuously loop until the promotion has explicitly succeeded, failed,
|
||||
// or timed out
|
||||
for (;;) {
|
||||
const projectCheck = await getProjectByNameOrId(
|
||||
client,
|
||||
project.id,
|
||||
project.accountId,
|
||||
true
|
||||
);
|
||||
if (projectCheck instanceof ProjectNotFound) {
|
||||
throw projectCheck;
|
||||
}
|
||||
|
||||
const {
|
||||
jobStatus,
|
||||
requestedAt,
|
||||
toDeploymentId,
|
||||
type,
|
||||
}: Partial<LastAliasRequest> = projectCheck.lastAliasRequest ?? {};
|
||||
|
||||
if (
|
||||
!jobStatus ||
|
||||
(jobStatus !== 'in-progress' && jobStatus !== 'pending')
|
||||
) {
|
||||
output.stopSpinner();
|
||||
output.log(`${spinnerMessage}…`);
|
||||
}
|
||||
|
||||
if (
|
||||
!jobStatus ||
|
||||
!requestedAt ||
|
||||
!toDeploymentId ||
|
||||
requestedAt < recentThreshold
|
||||
) {
|
||||
output.log('No deployment promotion in progress');
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (jobStatus === 'skipped' && type === 'promote') {
|
||||
output.log('Promote deployment was skipped');
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (jobStatus === 'succeeded') {
|
||||
return await renderJobSucceeded({
|
||||
client,
|
||||
contextName,
|
||||
performingPromote: !!deployment,
|
||||
requestedAt,
|
||||
project,
|
||||
toDeploymentId,
|
||||
});
|
||||
}
|
||||
|
||||
if (jobStatus === 'failed') {
|
||||
return await renderJobFailed({
|
||||
client,
|
||||
contextName,
|
||||
deployment,
|
||||
project,
|
||||
toDeploymentId,
|
||||
});
|
||||
}
|
||||
|
||||
// lastly, if we're not pending/in-progress, then we don't know what
|
||||
// the status is, so bail
|
||||
if (jobStatus !== 'pending' && jobStatus !== 'in-progress') {
|
||||
output.log(`Unknown promote deployment status "${jobStatus}"`);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// check if we have been running for too long
|
||||
if (requestedAt < recentThreshold || Date.now() >= promoteTimeout) {
|
||||
output.log(
|
||||
`The promotion exceeded its deadline - rerun ${chalk.bold(
|
||||
`${getPkgName()} promote ${toDeploymentId}`
|
||||
)} to try again`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// if we've done our first poll and not rolling back, then print the
|
||||
// requested at date/time
|
||||
if (counter++ === 0 && !deployment) {
|
||||
spinnerMessage += ` requested at ${formatDate(requestedAt)}`;
|
||||
}
|
||||
output.spinner(`${spinnerMessage}…`);
|
||||
|
||||
await sleep(250);
|
||||
}
|
||||
} finally {
|
||||
output.stopSpinner();
|
||||
}
|
||||
}
|
||||
|
||||
async function renderJobFailed({
|
||||
client,
|
||||
contextName,
|
||||
deployment,
|
||||
project,
|
||||
toDeploymentId,
|
||||
}: {
|
||||
client: Client;
|
||||
contextName: string;
|
||||
deployment?: Deployment;
|
||||
project: Project;
|
||||
toDeploymentId: string;
|
||||
}) {
|
||||
const { output } = client;
|
||||
|
||||
try {
|
||||
const name = (
|
||||
deployment || (await getDeployment(client, contextName, toDeploymentId))
|
||||
)?.url;
|
||||
output.error(
|
||||
`Failed to remap all aliases to the requested deployment ${name} (${toDeploymentId})`
|
||||
);
|
||||
} catch (e) {
|
||||
output.error(
|
||||
`Failed to remap all aliases to the requested deployment ${toDeploymentId}`
|
||||
);
|
||||
}
|
||||
|
||||
// aliases are paginated, so continuously loop until all of them have been
|
||||
// fetched
|
||||
let nextTimestamp;
|
||||
for (;;) {
|
||||
let url = `/v9/projects/${project.id}/promote/aliases?failedOnly=true&limit=20`;
|
||||
if (nextTimestamp) {
|
||||
url += `&until=${nextTimestamp}`;
|
||||
}
|
||||
|
||||
const { aliases, pagination } = await client.fetch<AliasesResponse>(url);
|
||||
|
||||
for (const { alias, status } of aliases) {
|
||||
output.log(
|
||||
` ${renderAliasStatus(status).padEnd(11)} ${alias.alias} (${
|
||||
alias.deploymentId
|
||||
})`
|
||||
);
|
||||
}
|
||||
|
||||
if (pagination?.next) {
|
||||
nextTimestamp = pagination.next;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
async function renderJobSucceeded({
|
||||
client,
|
||||
contextName,
|
||||
performingPromote,
|
||||
project,
|
||||
requestedAt,
|
||||
toDeploymentId,
|
||||
}: {
|
||||
client: Client;
|
||||
contextName: string;
|
||||
performingPromote: boolean;
|
||||
project: Project;
|
||||
requestedAt: number;
|
||||
toDeploymentId: string;
|
||||
}) {
|
||||
const { output } = client;
|
||||
|
||||
// attempt to get the new deployment url
|
||||
let deploymentInfo = '';
|
||||
try {
|
||||
const deployment = await getDeployment(client, contextName, toDeploymentId);
|
||||
deploymentInfo = `${chalk.bold(deployment.url)} (${toDeploymentId})`;
|
||||
} catch (err: any) {
|
||||
output.debug(
|
||||
`Failed to get deployment url for ${toDeploymentId}: ${
|
||||
err?.toString() || err
|
||||
}`
|
||||
);
|
||||
deploymentInfo = chalk.bold(toDeploymentId);
|
||||
}
|
||||
|
||||
const duration = performingPromote ? elapsed(Date.now() - requestedAt) : '';
|
||||
output.log(
|
||||
`Success! ${chalk.bold(
|
||||
project.name
|
||||
)} was promoted to ${deploymentInfo} ${duration}`
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
import chalk from 'chalk';
|
||||
import { join } from 'path';
|
||||
import Client from '../util/client';
|
||||
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import type {
|
||||
Project,
|
||||
ProjectEnvTarget,
|
||||
ProjectLinked,
|
||||
} from '@vercel-internals/types';
|
||||
import { emoji, prependEmoji } from '../util/emoji';
|
||||
import getArgs from '../util/get-args';
|
||||
import logo from '../util/output/logo';
|
||||
@@ -15,6 +19,7 @@ import {
|
||||
getEnvTargetPlaceholder,
|
||||
} from '../util/env/env-target';
|
||||
import { ensureLink } from '../util/link/ensure-link';
|
||||
import humanizePath from '../util/humanize-path';
|
||||
|
||||
const help = () => {
|
||||
return console.log(`
|
||||
@@ -81,6 +86,7 @@ function parseArgs(client: Client) {
|
||||
async function pullAllEnvFiles(
|
||||
environment: ProjectEnvTarget,
|
||||
client: Client,
|
||||
link: ProjectLinked,
|
||||
project: Project,
|
||||
argv: ReturnType<typeof processArgs>,
|
||||
cwd: string
|
||||
@@ -88,6 +94,7 @@ async function pullAllEnvFiles(
|
||||
const environmentFile = `.env.${environment}.local`;
|
||||
return envPull(
|
||||
client,
|
||||
link,
|
||||
project,
|
||||
environment,
|
||||
argv,
|
||||
@@ -115,7 +122,7 @@ export default async function main(client: Client) {
|
||||
return argv;
|
||||
}
|
||||
|
||||
const cwd = argv._[1] || process.cwd();
|
||||
let cwd = argv._[1] || client.cwd;
|
||||
const autoConfirm = Boolean(argv['--yes']);
|
||||
const environment = parseEnvironment(argv['--environment'] || undefined);
|
||||
|
||||
@@ -124,13 +131,18 @@ export default async function main(client: Client) {
|
||||
return link;
|
||||
}
|
||||
|
||||
const { project, org } = link;
|
||||
const { project, org, repoRoot } = link;
|
||||
|
||||
if (repoRoot) {
|
||||
cwd = join(repoRoot, project.rootDirectory || '');
|
||||
}
|
||||
|
||||
client.config.currentTeam = org.type === 'team' ? org.id : undefined;
|
||||
|
||||
const pullResultCode = await pullAllEnvFiles(
|
||||
environment,
|
||||
client,
|
||||
link,
|
||||
project,
|
||||
argv,
|
||||
cwd
|
||||
@@ -141,13 +153,14 @@ export default async function main(client: Client) {
|
||||
|
||||
client.output.print('\n');
|
||||
client.output.log('Downloading project settings');
|
||||
await writeProjectSettings(cwd, project, org);
|
||||
const isRepoLinked = typeof repoRoot === 'string';
|
||||
await writeProjectSettings(cwd, project, org, isRepoLinked);
|
||||
|
||||
const settingsStamp = stamp();
|
||||
client.output.print(
|
||||
`${prependEmoji(
|
||||
`Downloaded project settings to ${chalk.bold(
|
||||
join(VERCEL_DIR, VERCEL_DIR_PROJECT)
|
||||
humanizePath(join(cwd, VERCEL_DIR, VERCEL_DIR_PROJECT))
|
||||
)} ${chalk.gray(settingsStamp())}`,
|
||||
emoji('success')
|
||||
)}\n`
|
||||
|
||||
204
packages/cli/src/commands/redeploy.ts
Normal file
204
packages/cli/src/commands/redeploy.ts
Normal file
@@ -0,0 +1,204 @@
|
||||
import chalk from 'chalk';
|
||||
import { checkDeploymentStatus } from '@vercel/client';
|
||||
import type Client from '../util/client';
|
||||
import { emoji, prependEmoji } from '../util/emoji';
|
||||
import getArgs from '../util/get-args';
|
||||
import { getCommandName, getPkgName } from '../util/pkg-name';
|
||||
import { getDeploymentByIdOrURL } from '../util/deploy/get-deployment-by-id-or-url';
|
||||
import getScope from '../util/get-scope';
|
||||
import handleError from '../util/handle-error';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import logo from '../util/output/logo';
|
||||
import Now from '../util';
|
||||
import { printDeploymentStatus } from '../util/deploy/print-deployment-status';
|
||||
import stamp from '../util/output/stamp';
|
||||
import ua from '../util/ua';
|
||||
import type { VercelClientOptions } from '@vercel/client';
|
||||
|
||||
const help = () => {
|
||||
console.log(`
|
||||
${chalk.bold(
|
||||
`${logo} ${getPkgName()} redeploy`
|
||||
)} [deploymentId|deploymentName]
|
||||
|
||||
Rebuild and deploy a previous deployment.
|
||||
|
||||
${chalk.dim('Options:')}
|
||||
|
||||
-h, --help Output usage information
|
||||
-A ${chalk.bold.underline('FILE')}, --local-config=${chalk.bold.underline(
|
||||
'FILE'
|
||||
)} Path to the local ${'`vercel.json`'} file
|
||||
-Q ${chalk.bold.underline('DIR')}, --global-config=${chalk.bold.underline(
|
||||
'DIR'
|
||||
)} Path to the global ${'`.vercel`'} directory
|
||||
-d, --debug Debug mode [off]
|
||||
--no-color No color mode [off]
|
||||
--no-wait Don't wait for the redeploy to finish
|
||||
-t ${chalk.bold.underline('TOKEN')}, --token=${chalk.bold.underline(
|
||||
'TOKEN'
|
||||
)} Login token
|
||||
-y, --yes Skip questions when setting up new project using default scope and settings
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
${chalk.gray('–')} Rebuild and deploy an existing deployment using id or url
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} redeploy my-deployment.vercel.app`)}
|
||||
|
||||
${chalk.gray('–')} Write Deployment URL to a file
|
||||
|
||||
${chalk.cyan(
|
||||
`$ ${getPkgName()} redeploy my-deployment.vercel.app > deployment-url.txt`
|
||||
)}
|
||||
`);
|
||||
};
|
||||
|
||||
/**
|
||||
* `vc redeploy` command
|
||||
* @param {Client} client
|
||||
* @returns {Promise<number>} Resolves an exit code; 0 on success
|
||||
*/
|
||||
export default async (client: Client): Promise<number> => {
|
||||
let argv;
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--no-wait': Boolean,
|
||||
'--yes': Boolean,
|
||||
'-y': '--yes',
|
||||
});
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argv['--help'] || argv._[0] === 'help') {
|
||||
help();
|
||||
return 2;
|
||||
}
|
||||
|
||||
const { output } = client;
|
||||
const deployIdOrUrl = argv._[1];
|
||||
if (!deployIdOrUrl) {
|
||||
output.error(
|
||||
`Missing required deployment id or url: ${getCommandName(
|
||||
`redeploy <deployment-id-or-url>`
|
||||
)}`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const { contextName } = await getScope(client);
|
||||
const noWait = !!argv['--no-wait'];
|
||||
|
||||
try {
|
||||
const fromDeployment = await getDeploymentByIdOrURL({
|
||||
client,
|
||||
contextName,
|
||||
deployIdOrUrl,
|
||||
});
|
||||
|
||||
const deployStamp = stamp();
|
||||
output.spinner(`Redeploying project ${fromDeployment.id}`, 0);
|
||||
|
||||
let deployment = await client.fetch<any>(`/v13/deployments?forceNew=1`, {
|
||||
body: {
|
||||
deploymentId: fromDeployment.id,
|
||||
meta: {
|
||||
action: 'redeploy',
|
||||
},
|
||||
name: fromDeployment.name,
|
||||
target: fromDeployment.target,
|
||||
},
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
output.stopSpinner();
|
||||
output.print(
|
||||
`${prependEmoji(
|
||||
`Inspect: ${chalk.bold(deployment.inspectorUrl)} ${deployStamp()}`,
|
||||
emoji('inspect')
|
||||
)}\n`
|
||||
);
|
||||
|
||||
if (!client.stdout.isTTY) {
|
||||
client.stdout.write(`https://${deployment.url}`);
|
||||
}
|
||||
|
||||
if (!noWait) {
|
||||
output.spinner(
|
||||
deployment.readyState === 'QUEUED' ? 'Queued' : 'Building',
|
||||
0
|
||||
);
|
||||
|
||||
if (deployment.readyState === 'READY' && deployment.aliasAssigned) {
|
||||
output.spinner('Completing', 0);
|
||||
} else {
|
||||
try {
|
||||
const clientOptions: VercelClientOptions = {
|
||||
agent: client.agent,
|
||||
apiUrl: client.apiUrl,
|
||||
debug: client.output.debugEnabled,
|
||||
path: '', // unused by checkDeploymentStatus()
|
||||
teamId: fromDeployment.team?.id,
|
||||
token: client.authConfig.token!,
|
||||
userAgent: ua,
|
||||
};
|
||||
|
||||
for await (const event of checkDeploymentStatus(
|
||||
deployment,
|
||||
clientOptions
|
||||
)) {
|
||||
if (event.type === 'building') {
|
||||
output.spinner('Building', 0);
|
||||
} else if (
|
||||
event.type === 'ready' &&
|
||||
((event.payload as any).checksState
|
||||
? (event.payload as any).checksState === 'completed'
|
||||
: true)
|
||||
) {
|
||||
output.spinner('Completing', 0);
|
||||
} else if (event.type === 'checks-running') {
|
||||
output.spinner('Running Checks', 0);
|
||||
} else if (
|
||||
event.type === 'alias-assigned' ||
|
||||
event.type === 'checks-conclusion-failed'
|
||||
) {
|
||||
output.stopSpinner();
|
||||
deployment = event.payload;
|
||||
break;
|
||||
} else if (event.type === 'canceled') {
|
||||
output.stopSpinner();
|
||||
output.print('The deployment has been canceled.\n');
|
||||
return 1;
|
||||
} else if (event.type === 'error') {
|
||||
output.stopSpinner();
|
||||
|
||||
const now = new Now({
|
||||
client,
|
||||
currentTeam: fromDeployment.team?.id,
|
||||
});
|
||||
const error = await now.handleDeploymentError(event.payload, {
|
||||
env: {},
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
output.prettyError(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return printDeploymentStatus(client, deployment, deployStamp, noWait);
|
||||
} catch (err: unknown) {
|
||||
output.prettyError(err);
|
||||
if (isErrnoException(err) && err.code === 'ERR_INVALID_TEAM') {
|
||||
output.error(
|
||||
`Use ${chalk.bold('vc switch')} to change your current team`
|
||||
);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
@@ -1,20 +1,18 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../util/client';
|
||||
import { ensureLink } from '../util/link/ensure-link';
|
||||
import getArgs from '../util/get-args';
|
||||
import { getPkgName } from '../util/pkg-name';
|
||||
import handleError from '../util/handle-error';
|
||||
import logo from '../util/output/logo';
|
||||
import type Client from '../../util/client';
|
||||
import getArgs from '../../util/get-args';
|
||||
import getProjectByCwdOrLink from '../../util/projects/get-project-by-cwd-or-link';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import handleError from '../../util/handle-error';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import logo from '../../util/output/logo';
|
||||
import ms from 'ms';
|
||||
import requestRollback from '../util/rollback/request-rollback';
|
||||
import rollbackStatus from '../util/rollback/status';
|
||||
import validatePaths from '../util/validate-paths';
|
||||
import requestRollback from './request-rollback';
|
||||
import rollbackStatus from './status';
|
||||
|
||||
const help = () => {
|
||||
console.log(`
|
||||
${chalk.bold(
|
||||
`${logo} ${getPkgName()} rollback`
|
||||
)} [deploymentId|deploymentName]
|
||||
${chalk.bold(`${logo} ${getPkgName()} rollback`)} [deployment id/url]
|
||||
|
||||
Quickly revert back to a previous deployment.
|
||||
|
||||
@@ -43,6 +41,7 @@ const help = () => {
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} rollback`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} rollback status`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} rollback status <project>`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} rollback status --timeout 30s`)}
|
||||
|
||||
${chalk.gray('–')} Rollback a deployment using id or url
|
||||
@@ -60,8 +59,6 @@ export default async (client: Client): Promise<number> => {
|
||||
let argv;
|
||||
try {
|
||||
argv = getArgs(client.argv.slice(2), {
|
||||
'--debug': Boolean,
|
||||
'-d': '--debug',
|
||||
'--timeout': String,
|
||||
'--yes': Boolean,
|
||||
'-y': '--yes',
|
||||
@@ -76,26 +73,6 @@ export default async (client: Client): Promise<number> => {
|
||||
return 2;
|
||||
}
|
||||
|
||||
// ensure the current directory is good
|
||||
const cwd = argv['--cwd'] || process.cwd();
|
||||
const pathValidation = await validatePaths(client, [cwd]);
|
||||
if (!pathValidation.valid) {
|
||||
return pathValidation.exitCode;
|
||||
}
|
||||
|
||||
// ensure the current directory is a linked project
|
||||
const linkedProject = await ensureLink(
|
||||
'rollback',
|
||||
client,
|
||||
pathValidation.path,
|
||||
{
|
||||
autoConfirm: Boolean(argv['--yes']),
|
||||
}
|
||||
);
|
||||
if (typeof linkedProject === 'number') {
|
||||
return linkedProject;
|
||||
}
|
||||
|
||||
// validate the timeout
|
||||
let timeout = argv['--timeout'];
|
||||
if (timeout && ms(timeout) === undefined) {
|
||||
@@ -103,21 +80,42 @@ export default async (client: Client): Promise<number> => {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const { project } = linkedProject;
|
||||
const actionOrDeployId = argv._[1] || 'status';
|
||||
|
||||
if (actionOrDeployId === 'status') {
|
||||
return await rollbackStatus({
|
||||
try {
|
||||
if (actionOrDeployId === 'status') {
|
||||
const project = await getProjectByCwdOrLink({
|
||||
autoConfirm: Boolean(argv['--yes']),
|
||||
client,
|
||||
commandName: 'promote',
|
||||
cwd: client.cwd,
|
||||
projectNameOrId: argv._[2],
|
||||
});
|
||||
|
||||
return await rollbackStatus({
|
||||
client,
|
||||
project,
|
||||
timeout,
|
||||
});
|
||||
}
|
||||
|
||||
return await requestRollback({
|
||||
client,
|
||||
project,
|
||||
deployId: actionOrDeployId,
|
||||
timeout,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
if (isErrnoException(err)) {
|
||||
if (err.code === 'ERR_CANCELED') {
|
||||
return 0;
|
||||
}
|
||||
if (err.code === 'ERR_INVALID_CWD' || err.code === 'ERR_LINK_PROJECT') {
|
||||
// do not show the message
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return await requestRollback({
|
||||
client,
|
||||
deployId: actionOrDeployId,
|
||||
project,
|
||||
timeout,
|
||||
});
|
||||
client.output.prettyError(err);
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
56
packages/cli/src/commands/rollback/request-rollback.ts
Normal file
56
packages/cli/src/commands/rollback/request-rollback.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../../util/client';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import getProjectByDeployment from '../../util/projects/get-project-by-deployment';
|
||||
import ms from 'ms';
|
||||
import rollbackStatus from './status';
|
||||
|
||||
/**
|
||||
* Requests a rollback and waits for it complete.
|
||||
* @param {Client} client - The Vercel client instance
|
||||
* @param {string} deployIdOrUrl - The deployment name or id to rollback
|
||||
* @param {string} [timeout] - Time to poll for succeeded/failed state
|
||||
* @returns {Promise<number>} Resolves an exit code; 0 on success
|
||||
*/
|
||||
export default async function requestRollback({
|
||||
client,
|
||||
deployId,
|
||||
timeout,
|
||||
}: {
|
||||
client: Client;
|
||||
deployId: string;
|
||||
timeout?: string;
|
||||
}): Promise<number> {
|
||||
const { output } = client;
|
||||
|
||||
const { contextName, deployment, project } = await getProjectByDeployment({
|
||||
client,
|
||||
deployId,
|
||||
output: client.output,
|
||||
});
|
||||
|
||||
// create the rollback
|
||||
await client.fetch(`/v9/projects/${project.id}/rollback/${deployment.id}`, {
|
||||
body: {}, // required
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
if (timeout !== undefined && ms(timeout) === 0) {
|
||||
output.log(
|
||||
`Successfully requested rollback of ${chalk.bold(project.name)} to ${
|
||||
deployment.url
|
||||
} (${deployment.id})`
|
||||
);
|
||||
output.log(`To check rollback status, run ${getCommandName('rollback')}.`);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// check the status
|
||||
return await rollbackStatus({
|
||||
client,
|
||||
contextName,
|
||||
deployment,
|
||||
project,
|
||||
timeout,
|
||||
});
|
||||
}
|
||||
@@ -1,18 +1,21 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../client';
|
||||
import type Client from '../../util/client';
|
||||
import type {
|
||||
Deployment,
|
||||
LastAliasRequest,
|
||||
PaginationOptions,
|
||||
Project,
|
||||
RollbackTarget,
|
||||
} from '@vercel-internals/types';
|
||||
import elapsed from '../output/elapsed';
|
||||
import formatDate from '../format-date';
|
||||
import getDeployment from '../get-deployment';
|
||||
import getScope from '../get-scope';
|
||||
import elapsed from '../../util/output/elapsed';
|
||||
import formatDate from '../../util/format-date';
|
||||
import getDeployment from '../../util/get-deployment';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import getProjectByNameOrId from '../../util/projects/get-project-by-id-or-name';
|
||||
import getScope from '../../util/get-scope';
|
||||
import ms from 'ms';
|
||||
import renderAliasStatus from './render-alias-status';
|
||||
import sleep from '../sleep';
|
||||
import { ProjectNotFound } from '../../util/errors-ts';
|
||||
import renderAliasStatus from '../../util/alias/render-alias-status';
|
||||
import sleep from '../../util/sleep';
|
||||
|
||||
interface RollbackAlias {
|
||||
alias: {
|
||||
@@ -61,13 +64,6 @@ export default async function rollbackStatus({
|
||||
? 'Rollback in progress'
|
||||
: `Checking rollback status of ${project.name}`;
|
||||
|
||||
const check = async () => {
|
||||
const { lastRollbackTarget } = await client.fetch<any>(
|
||||
`/v9/projects/${project.id}?rollbackInfo=true`
|
||||
);
|
||||
return lastRollbackTarget;
|
||||
};
|
||||
|
||||
if (!contextName) {
|
||||
({ contextName } = await getScope(client));
|
||||
}
|
||||
@@ -78,8 +74,22 @@ export default async function rollbackStatus({
|
||||
// continuously loop until the rollback has explicitly succeeded, failed,
|
||||
// or timed out
|
||||
for (;;) {
|
||||
const { jobStatus, requestedAt, toDeploymentId }: RollbackTarget =
|
||||
(await check()) ?? {};
|
||||
const projectCheck = await getProjectByNameOrId(
|
||||
client,
|
||||
project.id,
|
||||
project.accountId,
|
||||
true
|
||||
);
|
||||
if (projectCheck instanceof ProjectNotFound) {
|
||||
throw projectCheck;
|
||||
}
|
||||
|
||||
const {
|
||||
jobStatus,
|
||||
requestedAt,
|
||||
toDeploymentId,
|
||||
type,
|
||||
}: Partial<LastAliasRequest> = projectCheck.lastAliasRequest ?? {};
|
||||
|
||||
if (
|
||||
!jobStatus ||
|
||||
@@ -89,12 +99,17 @@ export default async function rollbackStatus({
|
||||
output.log(`${spinnerMessage}…`);
|
||||
}
|
||||
|
||||
if (!jobStatus || requestedAt < recentThreshold) {
|
||||
if (
|
||||
!jobStatus ||
|
||||
!requestedAt ||
|
||||
!toDeploymentId ||
|
||||
requestedAt < recentThreshold
|
||||
) {
|
||||
output.log('No deployment rollback in progress');
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (jobStatus === 'skipped') {
|
||||
if (jobStatus === 'skipped' && type === 'rollback') {
|
||||
output.log('Rollback was skipped');
|
||||
return 0;
|
||||
}
|
||||
@@ -131,7 +146,7 @@ export default async function rollbackStatus({
|
||||
if (requestedAt < recentThreshold || Date.now() >= rollbackTimeout) {
|
||||
output.log(
|
||||
`The rollback exceeded its deadline - rerun ${chalk.bold(
|
||||
`vercel rollback ${toDeploymentId}`
|
||||
`${getPkgName()} rollback ${toDeploymentId}`
|
||||
)} to try again`
|
||||
);
|
||||
return 1;
|
||||
@@ -144,12 +144,6 @@ const main = async () => {
|
||||
return 1;
|
||||
}
|
||||
|
||||
let cwd = argv['--cwd'];
|
||||
if (cwd) {
|
||||
process.chdir(cwd);
|
||||
}
|
||||
cwd = process.cwd();
|
||||
|
||||
// The second argument to the command can be:
|
||||
//
|
||||
// * a path to deploy (as in: `vercel path/`)
|
||||
@@ -277,6 +271,12 @@ const main = async () => {
|
||||
argv: process.argv,
|
||||
});
|
||||
|
||||
// The `--cwd` flag is respected for all sub-commands
|
||||
if (argv['--cwd']) {
|
||||
client.cwd = argv['--cwd'];
|
||||
}
|
||||
const { cwd } = client;
|
||||
|
||||
// Gets populated to the subcommand name when a built-in is
|
||||
// provided, otherwise it remains undefined for an extension
|
||||
let subcommand: string | undefined = undefined;
|
||||
@@ -571,9 +571,15 @@ const main = async () => {
|
||||
case 'project':
|
||||
func = require('./commands/project').default;
|
||||
break;
|
||||
case 'promote':
|
||||
func = require('./commands/promote').default;
|
||||
break;
|
||||
case 'pull':
|
||||
func = require('./commands/pull').default;
|
||||
break;
|
||||
case 'redeploy':
|
||||
func = require('./commands/redeploy').default;
|
||||
break;
|
||||
case 'remove':
|
||||
func = require('./commands/remove').default;
|
||||
break;
|
||||
|
||||
@@ -25,10 +25,6 @@ const ARG_COMMON = {
|
||||
'--api': String,
|
||||
|
||||
'--cwd': String,
|
||||
|
||||
// Deprecated
|
||||
'--platform-version': Number,
|
||||
'-V': '--platform-version',
|
||||
};
|
||||
|
||||
export default () => ARG_COMMON;
|
||||
|
||||
@@ -12,7 +12,10 @@ export const build: BuildV2 = async ({ entrypoint, files, config }) => {
|
||||
if (
|
||||
filename.startsWith('.git/') ||
|
||||
filename === 'vercel.json' ||
|
||||
filename === 'now.json'
|
||||
filename === '.vercelignore' ||
|
||||
filename === 'now.json' ||
|
||||
filename === '.nowignore' ||
|
||||
filename.startsWith('.env')
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ async function writeBuildResultV2(
|
||||
|
||||
const lambdas = new Map<Lambda, string>();
|
||||
const overrides: Record<string, PathOverride> = {};
|
||||
|
||||
for (const [path, output] of Object.entries(buildResult.output)) {
|
||||
const normalizedPath = stripDuplicateSlashes(path);
|
||||
if (isLambda(output)) {
|
||||
@@ -156,11 +157,26 @@ async function writeBuildResultV2(
|
||||
const ext = getFileExtension(fallback);
|
||||
const fallbackName = `${normalizedPath}.prerender-fallback${ext}`;
|
||||
const fallbackPath = join(outputDir, 'functions', fallbackName);
|
||||
const stream = fallback.toStream();
|
||||
await pipe(
|
||||
stream,
|
||||
fs.createWriteStream(fallbackPath, { mode: fallback.mode })
|
||||
);
|
||||
|
||||
// if file is already on the disk we can hard link
|
||||
// instead of creating a new copy
|
||||
let usedHardLink = false;
|
||||
if ('fsPath' in fallback) {
|
||||
try {
|
||||
await fs.link(fallback.fsPath, fallbackPath);
|
||||
usedHardLink = true;
|
||||
} catch (_) {
|
||||
// if link fails we continue attempting to copy
|
||||
}
|
||||
}
|
||||
|
||||
if (!usedHardLink) {
|
||||
const stream = fallback.toStream();
|
||||
await pipe(
|
||||
stream,
|
||||
fs.createWriteStream(fallbackPath, { mode: fallback.mode })
|
||||
);
|
||||
}
|
||||
fallback = new FileFsRef({
|
||||
...output.fallback,
|
||||
fsPath: basename(fallbackName),
|
||||
@@ -288,6 +304,14 @@ async function writeStaticFile(
|
||||
const dest = join(outputDir, 'static', fsPath);
|
||||
await fs.mkdirp(dirname(dest));
|
||||
|
||||
// if already on disk hard link instead of copying
|
||||
if ('fsPath' in file) {
|
||||
try {
|
||||
return await fs.link(file.fsPath, dest);
|
||||
} catch (_) {
|
||||
// if link fails we continue attempting to copy
|
||||
}
|
||||
}
|
||||
await downloadFile(file, dest);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,14 @@ import type {
|
||||
JSONObject,
|
||||
Stdio,
|
||||
ReadableTTY,
|
||||
WritableTTY,
|
||||
PaginationOptions,
|
||||
} from '@vercel-internals/types';
|
||||
import { sharedPromise } from './promise';
|
||||
import { APIError } from './errors-ts';
|
||||
import { normalizeError } from '@vercel/error-utils';
|
||||
import type { Agent } from 'http';
|
||||
import sleep from './sleep';
|
||||
import type * as tty from 'tty';
|
||||
|
||||
const isSAMLError = (v: any): v is SAMLError => {
|
||||
return v && v.saml;
|
||||
@@ -57,8 +59,8 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
apiUrl: string;
|
||||
authConfig: AuthConfig;
|
||||
stdin: ReadableTTY;
|
||||
stdout: WritableTTY;
|
||||
stderr: WritableTTY;
|
||||
stdout: tty.WriteStream;
|
||||
stderr: tty.WriteStream;
|
||||
output: Output;
|
||||
config: GlobalConfig;
|
||||
agent?: Agent;
|
||||
@@ -176,6 +178,31 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
}, opts.retry);
|
||||
}
|
||||
|
||||
async *fetchPaginated<T>(
|
||||
url: string | URL,
|
||||
opts?: FetchOptions
|
||||
): AsyncGenerator<T & { pagination: PaginationOptions }> {
|
||||
const endpoint =
|
||||
typeof url === 'string' ? new URL(url, this.apiUrl) : new URL(url.href);
|
||||
if (!endpoint.searchParams.has('limit')) {
|
||||
endpoint.searchParams.set('limit', '100');
|
||||
}
|
||||
let next: number | null | undefined;
|
||||
do {
|
||||
if (next) {
|
||||
// Small sleep to avoid rate limiting
|
||||
await sleep(100);
|
||||
endpoint.searchParams.set('until', String(next));
|
||||
}
|
||||
const res = await this.fetch<T & { pagination: PaginationOptions }>(
|
||||
endpoint.href,
|
||||
opts
|
||||
);
|
||||
yield res;
|
||||
next = res.pagination?.next;
|
||||
} while (next);
|
||||
}
|
||||
|
||||
reauthenticate = sharedPromise(async function (
|
||||
this: Client,
|
||||
error: SAMLError
|
||||
@@ -207,4 +234,12 @@ export default class Client extends EventEmitter implements Stdio {
|
||||
output: this.stderr as NodeJS.WriteStream,
|
||||
});
|
||||
}
|
||||
|
||||
get cwd(): string {
|
||||
return process.cwd();
|
||||
}
|
||||
|
||||
set cwd(v: string) {
|
||||
process.chdir(v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,21 +12,21 @@ export default async function createDeploy(
|
||||
client: Client,
|
||||
now: Now,
|
||||
contextName: string,
|
||||
paths: string[],
|
||||
path: string,
|
||||
createArgs: CreateOptions,
|
||||
org: Org,
|
||||
isSettingUpProject: boolean,
|
||||
cwd?: string,
|
||||
cwd: string,
|
||||
archive?: ArchiveFormat
|
||||
): Promise<any | DeploymentError> {
|
||||
try {
|
||||
return await now.create(
|
||||
paths,
|
||||
path,
|
||||
createArgs,
|
||||
org,
|
||||
isSettingUpProject,
|
||||
archive,
|
||||
cwd
|
||||
cwd,
|
||||
archive
|
||||
);
|
||||
} catch (err: unknown) {
|
||||
if (ERRORS_TS.isAPIError(err)) {
|
||||
@@ -109,10 +109,11 @@ export default async function createDeploy(
|
||||
client,
|
||||
now,
|
||||
contextName,
|
||||
paths,
|
||||
path,
|
||||
createArgs,
|
||||
org,
|
||||
isSettingUpProject
|
||||
isSettingUpProject,
|
||||
cwd
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
89
packages/cli/src/util/deploy/get-deployment-by-id-or-url.ts
Normal file
89
packages/cli/src/util/deploy/get-deployment-by-id-or-url.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import chalk from 'chalk';
|
||||
import getDeployment from '../get-deployment';
|
||||
import getTeamById from '../teams/get-team-by-id';
|
||||
import { isValidName } from '../is-valid-name';
|
||||
import type Client from '../client';
|
||||
import type { Deployment, Team } from '@vercel-internals/types';
|
||||
|
||||
/**
|
||||
* Renders feedback while retrieving a deployment, then validates the
|
||||
* deployment belongs to the current team.
|
||||
*
|
||||
* @param client - The CLI client instance.
|
||||
* @param contextName - The context/team name.
|
||||
* @param deployIdOrUrl - The deployment id or URL.
|
||||
* @returns The deployment info.
|
||||
*/
|
||||
export async function getDeploymentByIdOrURL({
|
||||
client,
|
||||
contextName,
|
||||
deployIdOrUrl,
|
||||
}: {
|
||||
client: Client;
|
||||
contextName: string;
|
||||
deployIdOrUrl: string;
|
||||
}): Promise<Deployment> {
|
||||
const { config, output } = client;
|
||||
|
||||
if (!isValidName(deployIdOrUrl)) {
|
||||
throw new Error(
|
||||
`The provided argument "${deployIdOrUrl}" is not a valid deployment ID or URL`
|
||||
);
|
||||
}
|
||||
|
||||
let deployment: Deployment;
|
||||
let team: Team | undefined;
|
||||
|
||||
try {
|
||||
output.spinner(
|
||||
`Fetching deployment "${deployIdOrUrl}" in ${chalk.bold(contextName)}…`
|
||||
);
|
||||
|
||||
const [teamResult, deploymentResult] = await Promise.allSettled([
|
||||
config.currentTeam ? getTeamById(client, config.currentTeam) : undefined,
|
||||
getDeployment(client, contextName, deployIdOrUrl),
|
||||
]);
|
||||
|
||||
if (teamResult.status === 'rejected') {
|
||||
throw new Error(
|
||||
`Failed to retrieve team information: ${teamResult.reason}`
|
||||
);
|
||||
}
|
||||
|
||||
if (deploymentResult.status === 'rejected') {
|
||||
throw new Error(deploymentResult.reason.message);
|
||||
}
|
||||
|
||||
team = teamResult.value;
|
||||
deployment = deploymentResult.value;
|
||||
|
||||
// re-render the spinner text because it goes so fast
|
||||
output.log(
|
||||
`Fetching deployment "${deployIdOrUrl}" in ${chalk.bold(contextName)}…`
|
||||
);
|
||||
} finally {
|
||||
output.stopSpinner();
|
||||
}
|
||||
|
||||
if (deployment.team?.id) {
|
||||
if (!team || deployment.team.id !== team.id) {
|
||||
const err: NodeJS.ErrnoException = new Error(
|
||||
team
|
||||
? `Deployment doesn't belong to current team ${chalk.bold(
|
||||
contextName
|
||||
)}`
|
||||
: `Deployment belongs to a different team`
|
||||
);
|
||||
err.code = 'ERR_INVALID_TEAM';
|
||||
throw err;
|
||||
}
|
||||
} else if (team) {
|
||||
const err: NodeJS.ErrnoException = new Error(
|
||||
`Deployment doesn't belong to current team ${chalk.bold(contextName)}`
|
||||
);
|
||||
err.code = 'ERR_INVALID_TEAM';
|
||||
throw err;
|
||||
}
|
||||
|
||||
return deployment;
|
||||
}
|
||||
117
packages/cli/src/util/deploy/print-deployment-status.ts
Normal file
117
packages/cli/src/util/deploy/print-deployment-status.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../client';
|
||||
import type { Deployment } from '@vercel-internals/types';
|
||||
import { getPreferredPreviewURL } from '../../util/deploy/get-preferred-preview-url';
|
||||
import { isDeploying } from '../../util/deploy/is-deploying';
|
||||
import linkStyle from '../output/link';
|
||||
import { prependEmoji, emoji } from '../../util/emoji';
|
||||
|
||||
export async function printDeploymentStatus(
|
||||
client: Client,
|
||||
{
|
||||
readyState,
|
||||
alias: aliasList,
|
||||
aliasError,
|
||||
target,
|
||||
indications,
|
||||
url: deploymentUrl,
|
||||
aliasWarning,
|
||||
}: {
|
||||
readyState: Deployment['readyState'];
|
||||
alias: string[];
|
||||
aliasError: Error;
|
||||
target: string;
|
||||
indications: any;
|
||||
url: string;
|
||||
aliasWarning?: {
|
||||
code: string;
|
||||
message: string;
|
||||
link?: string;
|
||||
action?: string;
|
||||
};
|
||||
},
|
||||
deployStamp: () => string,
|
||||
noWait: boolean
|
||||
): Promise<number> {
|
||||
const { output } = client;
|
||||
|
||||
indications = indications || [];
|
||||
const isProdDeployment = target === 'production';
|
||||
|
||||
let isStillBuilding = false;
|
||||
if (noWait) {
|
||||
if (isDeploying(readyState)) {
|
||||
isStillBuilding = true;
|
||||
output.print(
|
||||
prependEmoji(
|
||||
'Note: Deployment is still processing...',
|
||||
emoji('notice')
|
||||
) + '\n'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isStillBuilding && readyState !== 'READY') {
|
||||
output.error(
|
||||
`Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (aliasError) {
|
||||
output.warn(
|
||||
`Failed to assign aliases${
|
||||
aliasError.message ? `: ${aliasError.message}` : ''
|
||||
}`
|
||||
);
|
||||
} else {
|
||||
// print preview/production url
|
||||
let previewUrl: string;
|
||||
// if `noWait` is true, then use the deployment url, not an alias
|
||||
if (!noWait && Array.isArray(aliasList) && aliasList.length > 0) {
|
||||
const previewUrlInfo = await getPreferredPreviewURL(client, aliasList);
|
||||
if (previewUrlInfo) {
|
||||
previewUrl = previewUrlInfo.previewUrl;
|
||||
} else {
|
||||
previewUrl = `https://${deploymentUrl}`;
|
||||
}
|
||||
} else {
|
||||
// fallback to deployment url
|
||||
previewUrl = `https://${deploymentUrl}`;
|
||||
}
|
||||
|
||||
output.print(
|
||||
prependEmoji(
|
||||
`${isProdDeployment ? 'Production' : 'Preview'}: ${chalk.bold(
|
||||
previewUrl
|
||||
)} ${deployStamp()}`,
|
||||
emoji('success')
|
||||
) + `\n`
|
||||
);
|
||||
}
|
||||
|
||||
if (aliasWarning?.message) {
|
||||
indications.push({
|
||||
type: 'warning',
|
||||
payload: aliasWarning.message,
|
||||
link: aliasWarning.link,
|
||||
action: aliasWarning.action,
|
||||
});
|
||||
}
|
||||
|
||||
const newline = '\n';
|
||||
for (let indication of indications) {
|
||||
const message =
|
||||
prependEmoji(chalk.dim(indication.payload), emoji(indication.type)) +
|
||||
newline;
|
||||
let link = '';
|
||||
if (indication.link)
|
||||
link =
|
||||
chalk.dim(
|
||||
`${indication.action || 'Learn More'}: ${linkStyle(indication.link)}`
|
||||
) + newline;
|
||||
output.print(message + link);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user