mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
Compare commits
64 Commits
vercel@29.
...
@vercel-in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
46950633f4 | ||
|
|
44b1dfe7c5 | ||
|
|
0278c7b7b9 | ||
|
|
761db597be | ||
|
|
671e63e7b8 | ||
|
|
f7bdc6cc26 | ||
|
|
e94a153b2f | ||
|
|
74e639a772 | ||
|
|
f00b08a820 | ||
|
|
6cdd38d130 | ||
|
|
2c950d47ae | ||
|
|
71b9f3a94b | ||
|
|
91b7f6dcd9 | ||
|
|
ba10fb4dd4 | ||
|
|
18c1c45ce3 | ||
|
|
67e556bc80 | ||
|
|
7235000181 | ||
|
|
5124d431ea | ||
|
|
c879401bbc | ||
|
|
6c6f3ce9d2 | ||
|
|
aa83680832 | ||
|
|
06113d3e39 | ||
|
|
5150f21404 | ||
|
|
eb6bb98406 | ||
|
|
d8e3b6e738 | ||
|
|
25da051d62 | ||
|
|
f57af66dc2 | ||
|
|
b2f71d5352 | ||
|
|
6115f0d74a | ||
|
|
14c877e468 | ||
|
|
d80732d74f |
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
|
||||
|
||||
16
.github/workflows/release.yml
vendored
16
.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'
|
||||
@@ -64,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 })
|
||||
|
||||
26
.github/workflows/required-pr-label.yml
vendored
26
.github/workflows/required-pr-label.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Required PR Label
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, labeled, unlabeled, synchronize]
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check PR Labels
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
let missing = false;
|
||||
const labels = context.payload.pull_request.labels.map(l => l.name);
|
||||
if (labels.filter(l => l.startsWith('area:')).length === 0) {
|
||||
console.error('::error::Missing label: Please add at least one "area" label.');
|
||||
missing = true;
|
||||
}
|
||||
if (labels.filter(l => l.startsWith('semver:')).length !== 1) {
|
||||
console.error('::error::Missing label: Please add exactly one "semver" label.');
|
||||
missing = true;
|
||||
}
|
||||
if (missing) {
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('::notice::Success: This pull request has correct labels, thanks!');
|
||||
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
|
||||
|
||||
@@ -32,4 +32,4 @@ packages/**/test/fixtures
|
||||
packages/**/test/dev/fixtures
|
||||
packages/**/test/build-fixtures
|
||||
packages/**/test/cache-fixtures
|
||||
|
||||
packages/cli/src/util/dev/templates/*.ts
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
|
||||
## Vercel
|
||||
|
||||
Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.
|
||||
|
||||
We enable teams to iterate quickly and develop, preview, and ship delightful user experiences. Vercel has zero-configuration support for 35+ frontend frameworks and integrates with your headless content, commerce, or database of choice.
|
||||
Vercel's frontend cloud gives developers frameworks, workflows, and infrastructure to build a faster, more personalized web.
|
||||
|
||||
## Deploy
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -41,7 +41,7 @@ export default function Home() {
|
||||
|
||||
<div className={styles.grid}>
|
||||
<a
|
||||
href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
|
||||
className={styles.card}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
|
||||
273
examples/nextjs/package-lock.json
generated
273
examples/nextjs/package-lock.json
generated
@@ -8,9 +8,9 @@
|
||||
"name": "nextjs",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"eslint": "8.39.0",
|
||||
"eslint-config-next": "13.4.1",
|
||||
"next": "13.4.1",
|
||||
"eslint": "8.41.0",
|
||||
"eslint-config-next": "13.4.4",
|
||||
"next": "13.4.4",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
@@ -49,13 +49,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz",
|
||||
"integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz",
|
||||
"integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==",
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"debug": "^4.3.2",
|
||||
"espree": "^9.5.1",
|
||||
"espree": "^9.5.2",
|
||||
"globals": "^13.19.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
@@ -71,9 +71,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "8.39.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz",
|
||||
"integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==",
|
||||
"version": "8.41.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz",
|
||||
"integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
@@ -109,22 +109,22 @@
|
||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA=="
|
||||
},
|
||||
"node_modules/@next/env": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.4.1.tgz",
|
||||
"integrity": "sha512-eD6WCBMFjLFooLM19SIhSkWBHtaFrZFfg2Cxnyl3vS3DAdFRfnx5TY2RxlkuKXdIRCC0ySbtK9JXXt8qLCqzZg=="
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.4.4.tgz",
|
||||
"integrity": "sha512-q/y7VZj/9YpgzDe64Zi6rY1xPizx80JjlU2BTevlajtaE3w1LqweH1gGgxou2N7hdFosXHjGrI4OUvtFXXhGLg=="
|
||||
},
|
||||
"node_modules/@next/eslint-plugin-next": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.4.1.tgz",
|
||||
"integrity": "sha512-tVPS/2FKlA3ANCRCYZVT5jdbUKasBU8LG6bYqcNhyORDFTlDYa4cAWQJjZ7msIgLwMQIbL8CAsxrOL8maa/4Lg==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.4.4.tgz",
|
||||
"integrity": "sha512-5jnh7q6I15efnjR/rR+/TGTc9hn53g3JTbEjAMjmeQiExKqEUgIXqrHI5zlTNlNyzCPkBB860/ctxXheZaF2Vw==",
|
||||
"dependencies": {
|
||||
"glob": "7.1.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-arm64": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.1.tgz",
|
||||
"integrity": "sha512-eF8ARHtYfnoYtDa6xFHriUKA/Mfj/cCbmKb3NofeKhMccs65G6/loZ15a6wYCCx4rPAd6x4t1WmVYtri7EdeBg==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.4.tgz",
|
||||
"integrity": "sha512-xfjgXvp4KalNUKZMHmsFxr1Ug+aGmmO6NWP0uoh4G3WFqP/mJ1xxfww0gMOeMeSq/Jyr5k7DvoZ2Pv+XOITTtw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -137,9 +137,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-darwin-x64": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.1.tgz",
|
||||
"integrity": "sha512-7cmDgF9tGWTgn5Gw+vP17miJbH4wcraMHDCOHTYWkO/VeKT73dUWG23TNRLfgtCNSPgH4V5B4uLHoZTanx9bAw==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.4.tgz",
|
||||
"integrity": "sha512-ZY9Ti1hkIwJsxGus3nlubIkvYyB0gNOYxKrfsOrLEqD0I2iCX8D7w8v6QQZ2H+dDl6UT29oeEUdDUNGk4UEpfg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -152,9 +152,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-gnu": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.1.tgz",
|
||||
"integrity": "sha512-qwJqmCri2ie8aTtE5gjTSr8S6O8B67KCYgVZhv9gKH44yvc/zXbAY8u23QGULsYOyh1islWE5sWfQNLOj9iryg==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.4.tgz",
|
||||
"integrity": "sha512-+KZnDeMShYkpkqAvGCEDeqYTRADJXc6SY1jWXz+Uo6qWQO/Jd9CoyhTJwRSxvQA16MoYzvILkGaDqirkRNctyA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -167,9 +167,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-arm64-musl": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.1.tgz",
|
||||
"integrity": "sha512-qcC54tWNGDv/VVIFkazxhqH1Bnagjfs4enzELVRlUOoJPD2BGJTPI7z08pQPbbgxLtRiu8gl2mXvpB8WlOkMeA==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.4.tgz",
|
||||
"integrity": "sha512-evC1twrny2XDT4uOftoubZvW3EG0zs0ZxMwEtu/dDGVRO5n5pT48S8qqEIBGBUZYu/Xx4zzpOkIxx1vpWdE+9A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -182,9 +182,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-gnu": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.1.tgz",
|
||||
"integrity": "sha512-9TeWFlpLsBosZ+tsm/rWBaMwt5It9tPH8m3nawZqFUUrZyGRfGcI67js774vtx0k3rL9qbyY6+3pw9BCVpaYUA==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.4.tgz",
|
||||
"integrity": "sha512-PX706XcCHr2FfkyhP2lpf+pX/tUvq6/ke7JYnnr0ykNdEMo+sb7cC/o91gnURh4sPYSiZJhsF2gbIqg9rciOHQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -197,9 +197,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-linux-x64-musl": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.1.tgz",
|
||||
"integrity": "sha512-sNDGaWmSqTS4QRUzw61wl4mVPeSqNIr1OOjLlQTRuyInxMxtqImRqdvzDvFTlDfdeUMU/DZhWGYoHrXLlZXe6A==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.4.tgz",
|
||||
"integrity": "sha512-TKUUx3Ftd95JlHV6XagEnqpT204Y+IsEa3awaYIjayn0MOGjgKZMZibqarK3B1FsMSPaieJf2FEAcu9z0yT5aA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -212,9 +212,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-arm64-msvc": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.1.tgz",
|
||||
"integrity": "sha512-+CXZC7u1iXdLRudecoUYbhbsXpglYv8KFYsFxKBPn7kg+bk7eJo738wAA4jXIl8grTF2mPdmO93JOQym+BlYGA==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.4.tgz",
|
||||
"integrity": "sha512-FP8AadgSq4+HPtim7WBkCMGbhr5vh9FePXiWx9+YOdjwdQocwoCK5ZVC3OW8oh3TWth6iJ0AXJ/yQ1q1cwSZ3A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -227,9 +227,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-ia32-msvc": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.1.tgz",
|
||||
"integrity": "sha512-vIoXVVc7UYO68VwVMDKwJC2+HqAZQtCYiVlApyKEeIPIQpz2gpufzGxk1z3/gwrJt/kJ5CDZjlhYDCzd3hdz+g==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.4.tgz",
|
||||
"integrity": "sha512-3WekVmtuA2MCdcAOrgrI+PuFiFURtSyyrN1I3UPtS0ckR2HtLqyqmS334Eulf15g1/bdwMteePdK363X/Y9JMg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -242,9 +242,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@next/swc-win32-x64-msvc": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.1.tgz",
|
||||
"integrity": "sha512-n8V5ImLQZibKTu10UUdI3nIeTLkliEXe628qxqW9v8My3BAH2a7H0SaCqkV2OgqFnn8sG1wxKYw9/SNJ632kSA==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.4.tgz",
|
||||
"integrity": "sha512-AHRITu/CrlQ+qzoqQtEMfaTu7GHaQ6bziQln/pVWpOYC1wU+Mq6VQQFlsDtMCnDztPZtppAXdvvbNS7pcfRzlw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -289,9 +289,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 +308,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.0",
|
||||
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.0.tgz",
|
||||
"integrity": "sha512-IthPJsJR85GhOkp3Hvp8zFOPK5ynKn6STyHa/WZpioK7E1aYDiBzpqQPrngc14DszIUkIrdd3k9Iu0XSzlP/1w=="
|
||||
},
|
||||
"node_modules/@swc/helpers": {
|
||||
"version": "0.5.1",
|
||||
@@ -326,13 +326,13 @@
|
||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "5.59.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.2.tgz",
|
||||
"integrity": "sha512-uq0sKyw6ao1iFOZZGk9F8Nro/8+gfB5ezl1cA06SrqbgJAt0SRoFhb9pXaHvkrxUpZaoLxt8KlovHNk8Gp6/HQ==",
|
||||
"version": "5.59.7",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.7.tgz",
|
||||
"integrity": "sha512-VhpsIEuq/8i5SF+mPg9jSdIwgMBBp0z9XqjiEay+81PYLJuroN+ET1hM5IhkiYMJd9MkTz8iJLt7aaGAgzWUbQ==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "5.59.2",
|
||||
"@typescript-eslint/types": "5.59.2",
|
||||
"@typescript-eslint/typescript-estree": "5.59.2",
|
||||
"@typescript-eslint/scope-manager": "5.59.7",
|
||||
"@typescript-eslint/types": "5.59.7",
|
||||
"@typescript-eslint/typescript-estree": "5.59.7",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -352,12 +352,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "5.59.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz",
|
||||
"integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==",
|
||||
"version": "5.59.7",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.7.tgz",
|
||||
"integrity": "sha512-FL6hkYWK9zBGdxT2wWEd2W8ocXMu3K94i3gvMrjXpx+koFYdYV7KprKfirpgY34vTGzEPPuKoERpP8kD5h7vZQ==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.59.2",
|
||||
"@typescript-eslint/visitor-keys": "5.59.2"
|
||||
"@typescript-eslint/types": "5.59.7",
|
||||
"@typescript-eslint/visitor-keys": "5.59.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
@@ -368,9 +368,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "5.59.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz",
|
||||
"integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==",
|
||||
"version": "5.59.7",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.7.tgz",
|
||||
"integrity": "sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
@@ -380,12 +380,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "5.59.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz",
|
||||
"integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==",
|
||||
"version": "5.59.7",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.7.tgz",
|
||||
"integrity": "sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.59.2",
|
||||
"@typescript-eslint/visitor-keys": "5.59.2",
|
||||
"@typescript-eslint/types": "5.59.7",
|
||||
"@typescript-eslint/visitor-keys": "5.59.7",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -406,11 +406,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "5.59.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz",
|
||||
"integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==",
|
||||
"version": "5.59.7",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.7.tgz",
|
||||
"integrity": "sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.59.2",
|
||||
"@typescript-eslint/types": "5.59.7",
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -591,9 +591,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axe-core": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz",
|
||||
"integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==",
|
||||
"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"
|
||||
}
|
||||
@@ -696,9 +696,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001482",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001482.tgz",
|
||||
"integrity": "sha512-F1ZInsg53cegyjroxLNW9DmrEQ1SuGRTO1QlpA0o2/6OpQ0gFeDRoq1yFmnr8Sakn9qwwt9DmbxHB6w167OSuQ==",
|
||||
"version": "1.0.30001489",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001489.tgz",
|
||||
"integrity": "sha512-x1mgZEXK8jHIfAxm+xgdpHpk50IN3z3q3zP261/WS+uvePxW8izXuCu6AHz0lkuYTlATDehiZ/tNyYBdSQsOUQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -908,9 +908,9 @@
|
||||
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.13.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz",
|
||||
"integrity": "sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg==",
|
||||
"version": "5.14.1",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.1.tgz",
|
||||
"integrity": "sha512-Vklwq2vDKtl0y/vtwjSesgJ5MYS7Etuk5txS8VdKL4AOS1aUlD96zqIfsOSLQsdv3xgMRbtkWM8eG9XDfKUPow==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
"tapable": "^2.2.0"
|
||||
@@ -1034,14 +1034,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.39.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz",
|
||||
"integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==",
|
||||
"version": "8.41.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz",
|
||||
"integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.4.0",
|
||||
"@eslint/eslintrc": "^2.0.2",
|
||||
"@eslint/js": "8.39.0",
|
||||
"@eslint/eslintrc": "^2.0.3",
|
||||
"@eslint/js": "8.41.0",
|
||||
"@humanwhocodes/config-array": "^0.11.8",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
@@ -1052,8 +1052,8 @@
|
||||
"doctrine": "^3.0.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"eslint-scope": "^7.2.0",
|
||||
"eslint-visitor-keys": "^3.4.0",
|
||||
"espree": "^9.5.1",
|
||||
"eslint-visitor-keys": "^3.4.1",
|
||||
"espree": "^9.5.2",
|
||||
"esquery": "^1.4.2",
|
||||
"esutils": "^2.0.2",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
@@ -1061,13 +1061,12 @@
|
||||
"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",
|
||||
@@ -1090,11 +1089,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-next": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.4.1.tgz",
|
||||
"integrity": "sha512-ajuxjCkW1hvirr0EQZb3/B/bFH52Z7CT89uCtTcICFL9l30i5c8hN4p0LXvTjdOXNPV5fEDcxBgGHgXdzTj1/A==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.4.4.tgz",
|
||||
"integrity": "sha512-z/PMbm6L0iC/fwISULxe8IVy4DtNqZk2wQY711o35klenq70O6ns82A8yuMVCFjHC0DIyB2lyugesRtuk9u8dQ==",
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "13.4.1",
|
||||
"@next/eslint-plugin-next": "13.4.4",
|
||||
"@rushstack/eslint-patch": "^1.1.3",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint-import-resolver-node": "^0.3.6",
|
||||
@@ -1392,9 +1391,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-visitor-keys": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz",
|
||||
"integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==",
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz",
|
||||
"integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
@@ -1403,13 +1402,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "9.5.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz",
|
||||
"integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==",
|
||||
"version": "9.5.2",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz",
|
||||
"integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==",
|
||||
"dependencies": {
|
||||
"acorn": "^8.8.0",
|
||||
"acorn-jsx": "^5.3.2",
|
||||
"eslint-visitor-keys": "^3.4.0"
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
@@ -1625,12 +1624,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz",
|
||||
"integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==",
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz",
|
||||
"integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"has": "^1.0.3",
|
||||
"has-proto": "^1.0.1",
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"funding": {
|
||||
@@ -1764,10 +1764,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",
|
||||
@@ -1975,9 +1975,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.12.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz",
|
||||
"integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==",
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz",
|
||||
"integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==",
|
||||
"dependencies": {
|
||||
"has": "^1.0.3"
|
||||
},
|
||||
@@ -2255,15 +2255,6 @@
|
||||
"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",
|
||||
@@ -2462,11 +2453,11 @@
|
||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="
|
||||
},
|
||||
"node_modules/next": {
|
||||
"version": "13.4.1",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.4.1.tgz",
|
||||
"integrity": "sha512-JBw2kAIyhKDpjhEWvNVoFeIzNp9xNxg8wrthDOtMctfn3EpqGCmW0FSviNyGgOSOSn6zDaX48pmvbdf6X2W9xA==",
|
||||
"version": "13.4.4",
|
||||
"resolved": "https://registry.npmjs.org/next/-/next-13.4.4.tgz",
|
||||
"integrity": "sha512-C5S0ysM0Ily9McL4Jb48nOQHT1BukOWI59uC3X/xCMlYIh9rJZCv7nzG92J6e1cOBqQbKovlpgvHWFmz4eKKEA==",
|
||||
"dependencies": {
|
||||
"@next/env": "13.4.1",
|
||||
"@next/env": "13.4.4",
|
||||
"@swc/helpers": "0.5.1",
|
||||
"busboy": "1.6.0",
|
||||
"caniuse-lite": "^1.0.30001406",
|
||||
@@ -2481,20 +2472,19 @@
|
||||
"node": ">=16.8.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@next/swc-darwin-arm64": "13.4.1",
|
||||
"@next/swc-darwin-x64": "13.4.1",
|
||||
"@next/swc-linux-arm64-gnu": "13.4.1",
|
||||
"@next/swc-linux-arm64-musl": "13.4.1",
|
||||
"@next/swc-linux-x64-gnu": "13.4.1",
|
||||
"@next/swc-linux-x64-musl": "13.4.1",
|
||||
"@next/swc-win32-arm64-msvc": "13.4.1",
|
||||
"@next/swc-win32-ia32-msvc": "13.4.1",
|
||||
"@next/swc-win32-x64-msvc": "13.4.1"
|
||||
"@next/swc-darwin-arm64": "13.4.4",
|
||||
"@next/swc-darwin-x64": "13.4.4",
|
||||
"@next/swc-linux-arm64-gnu": "13.4.4",
|
||||
"@next/swc-linux-arm64-musl": "13.4.4",
|
||||
"@next/swc-linux-x64-gnu": "13.4.4",
|
||||
"@next/swc-linux-x64-musl": "13.4.4",
|
||||
"@next/swc-win32-arm64-msvc": "13.4.4",
|
||||
"@next/swc-win32-ia32-msvc": "13.4.4",
|
||||
"@next/swc-win32-x64-msvc": "13.4.4"
|
||||
},
|
||||
"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"
|
||||
@@ -2506,9 +2496,6 @@
|
||||
"fibers": {
|
||||
"optional": true
|
||||
},
|
||||
"node-sass": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
}
|
||||
@@ -3103,9 +3090,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz",
|
||||
"integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==",
|
||||
"version": "7.5.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz",
|
||||
"integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
@@ -3395,9 +3382,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
|
||||
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz",
|
||||
"integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA=="
|
||||
},
|
||||
"node_modules/tsutils": {
|
||||
"version": "3.21.0",
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "8.39.0",
|
||||
"eslint-config-next": "13.4.1",
|
||||
"next": "13.4.1",
|
||||
"eslint": "8.41.0",
|
||||
"eslint-config-next": "13.4.4",
|
||||
"next": "13.4.4",
|
||||
"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.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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
8
internals/constants/CHANGELOG.md
Normal file
8
internals/constants/CHANGELOG.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# @vercel-internals/constants
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c7bcea408`](https://github.com/vercel/vercel/commit/c7bcea408131df2d65338e50ce319a6d8e4a8a82)]:
|
||||
- @vercel/build-utils@6.7.4
|
||||
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/constants",
|
||||
"version": "1.0.1",
|
||||
"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"
|
||||
"@vercel/build-utils": "6.7.4",
|
||||
"@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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
9
internals/types/CHANGELOG.md
Normal file
9
internals/types/CHANGELOG.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# @vercel-internals/types
|
||||
|
||||
## 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
|
||||
32
internals/types/index.d.ts
vendored
32
internals/types/index.d.ts
vendored
@@ -157,6 +157,7 @@ export type Deployment = {
|
||||
errorLink?: string;
|
||||
errorMessage?: string | null;
|
||||
errorStep?: string;
|
||||
forced?: boolean;
|
||||
functions?: BuilderFunctions | null;
|
||||
gitSource?: {
|
||||
org?: string;
|
||||
@@ -183,6 +184,7 @@ export type Deployment = {
|
||||
ownerId?: string;
|
||||
plan?: 'enterprise' | 'hobby' | 'oss' | 'pro';
|
||||
previewCommentsEnabled?: boolean;
|
||||
private?: boolean;
|
||||
projectId?: string;
|
||||
projectSettings?: {
|
||||
buildCommand?: string | null;
|
||||
@@ -353,7 +355,7 @@ export interface Project extends ProjectSettings {
|
||||
link?: ProjectLinkData;
|
||||
alias?: ProjectAliasTarget[];
|
||||
latestDeployments?: Partial<Deployment>[];
|
||||
lastRollbackTarget: RollbackTarget | null;
|
||||
lastAliasRequest?: LastAliasRequest | null;
|
||||
}
|
||||
|
||||
export interface Org {
|
||||
@@ -363,8 +365,19 @@ 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;
|
||||
}
|
||||
|
||||
export interface PaginationOptions {
|
||||
@@ -374,7 +387,7 @@ export interface PaginationOptions {
|
||||
}
|
||||
|
||||
export type ProjectLinkResult =
|
||||
| { status: 'linked'; org: Org; project: Project }
|
||||
| { status: 'linked'; org: Org; project: Project; repoRoot?: string }
|
||||
| { status: 'not_linked'; org: null; project: null }
|
||||
| {
|
||||
status: 'error';
|
||||
@@ -388,6 +401,9 @@ export type ProjectLinkResult =
|
||||
| 'MISSING_PROJECT_SETTINGS';
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated - `RollbackJobStatus` has been replace by `LastAliasRequest['jobStatus']`.
|
||||
*/
|
||||
export type RollbackJobStatus =
|
||||
| 'pending'
|
||||
| 'in-progress'
|
||||
@@ -395,6 +411,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 +422,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;
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"version": "1.0.1",
|
||||
"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.1",
|
||||
"@vercel/build-utils": "6.7.4",
|
||||
"@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"
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"eslint-plugin-jest": "26.1.5",
|
||||
"execa": "3.2.0",
|
||||
"fs-extra": "11.1.0",
|
||||
"glob": "10.2.3",
|
||||
"husky": "7.0.4",
|
||||
"jest": "29.5.0",
|
||||
"json5": "2.1.1",
|
||||
@@ -31,7 +32,7 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "29.1.0",
|
||||
"turbo": "1.9.3",
|
||||
"turbo": "1.9.9",
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -47,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}": [
|
||||
|
||||
13
packages/build-utils/CHANGELOG.md
Normal file
13
packages/build-utils/CHANGELOG.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# @vercel/build-utils
|
||||
|
||||
## 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
|
||||
|
||||
- Deprecate Node.js 14.x and 16.x with warning ([#9976](https://github.com/vercel/vercel/pull/9976))
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.7.2",
|
||||
"version": "6.7.4",
|
||||
"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;
|
||||
|
||||
@@ -6,8 +6,18 @@ import debug from '../debug';
|
||||
function getOptions() {
|
||||
const options = [
|
||||
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
||||
{ major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
||||
{ major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
||||
{
|
||||
major: 16,
|
||||
range: '16.x',
|
||||
runtime: 'nodejs16.x',
|
||||
discontinueDate: new Date('2023-08-15'),
|
||||
},
|
||||
{
|
||||
major: 14,
|
||||
range: '14.x',
|
||||
runtime: 'nodejs14.x',
|
||||
discontinueDate: new Date('2023-08-15'),
|
||||
},
|
||||
{
|
||||
major: 12,
|
||||
range: '12.x',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": "16.14.0"
|
||||
"node": "18.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": "14.x"
|
||||
"node": "18.x"
|
||||
}
|
||||
}
|
||||
|
||||
66
packages/build-utils/test/unit.test.ts
vendored
66
packages/build-utils/test/unit.test.ts
vendored
@@ -140,20 +140,20 @@ it('should ignore node version in vercel dev getNodeVersion()', async () => {
|
||||
|
||||
it('should select project setting from config when no package.json is found and fallback undefined', async () => {
|
||||
expect(
|
||||
await getNodeVersion('/tmp', undefined, { nodeVersion: '16.x' }, {})
|
||||
).toHaveProperty('range', '16.x');
|
||||
await getNodeVersion('/tmp', undefined, { nodeVersion: '18.x' }, {})
|
||||
).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('should select project setting from config when no package.json is found and fallback is null', async () => {
|
||||
expect(
|
||||
await getNodeVersion('/tmp', null as any, { nodeVersion: '16.x' }, {})
|
||||
).toHaveProperty('range', '16.x');
|
||||
await getNodeVersion('/tmp', null as any, { nodeVersion: '18.x' }, {})
|
||||
).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('should select project setting from fallback when no package.json is found', async () => {
|
||||
expect(await getNodeVersion('/tmp', '16.x')).toHaveProperty('range', '16.x');
|
||||
expect(await getNodeVersion('/tmp', '18.x')).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
});
|
||||
|
||||
@@ -165,9 +165,9 @@ it('should prefer package.json engines over project setting from config and warn
|
||||
{ nodeVersion: '12.x' },
|
||||
{}
|
||||
)
|
||||
).toHaveProperty('range', '14.x');
|
||||
).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([
|
||||
'Warning: Due to "engines": { "node": "14.x" } in your `package.json` file, the Node.js Version defined in your Project Settings ("12.x") will not apply. Learn More: http://vercel.link/node-version',
|
||||
'Warning: Due to "engines": { "node": "18.x" } in your `package.json` file, the Node.js Version defined in your Project Settings ("12.x") will not apply. Learn More: http://vercel.link/node-version',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -179,9 +179,9 @@ it('should warn when package.json engines is exact version', async () => {
|
||||
{},
|
||||
{}
|
||||
)
|
||||
).toHaveProperty('range', '16.x');
|
||||
).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([
|
||||
'Warning: Detected "engines": { "node": "16.14.0" } in your `package.json` with major.minor.patch, but only major Node.js Version can be selected. Learn More: http://vercel.link/node-version',
|
||||
'Warning: Detected "engines": { "node": "18.2.0" } in your `package.json` with major.minor.patch, but only major Node.js Version can be selected. Learn More: http://vercel.link/node-version',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -204,30 +204,30 @@ it('should not warn when package.json engines matches project setting from confi
|
||||
await getNodeVersion(
|
||||
path.join(__dirname, 'pkg-engine-node'),
|
||||
undefined,
|
||||
{ nodeVersion: '14' },
|
||||
{ nodeVersion: '18' },
|
||||
{}
|
||||
)
|
||||
).toHaveProperty('range', '14.x');
|
||||
).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
|
||||
expect(
|
||||
await getNodeVersion(
|
||||
path.join(__dirname, 'pkg-engine-node'),
|
||||
undefined,
|
||||
{ nodeVersion: '14.x' },
|
||||
{ nodeVersion: '18.x' },
|
||||
{}
|
||||
)
|
||||
).toHaveProperty('range', '14.x');
|
||||
).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
|
||||
expect(
|
||||
await getNodeVersion(
|
||||
path.join(__dirname, 'pkg-engine-node'),
|
||||
undefined,
|
||||
{ nodeVersion: '<15' },
|
||||
{ nodeVersion: '<19' },
|
||||
{}
|
||||
)
|
||||
).toHaveProperty('range', '14.x');
|
||||
).toHaveProperty('range', '18.x');
|
||||
expect(warningMessages).toStrictEqual([]);
|
||||
});
|
||||
|
||||
@@ -238,7 +238,7 @@ it('should get latest node version', async () => {
|
||||
it('should throw for discontinued versions', async () => {
|
||||
// Mock a future date so that Node 8 and 10 become discontinued
|
||||
const realDateNow = Date.now.bind(global.Date);
|
||||
global.Date.now = () => new Date('2022-10-15').getTime();
|
||||
global.Date.now = () => new Date('2023-10-01').getTime();
|
||||
|
||||
expect(getSupportedNodeVersion('8.10.x', false)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('8.10.x', true)).rejects.toThrow();
|
||||
@@ -246,12 +246,18 @@ it('should throw for discontinued versions', async () => {
|
||||
expect(getSupportedNodeVersion('10.x', true)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('12.x', false)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('12.x', true)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('14.x', false)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('14.x', true)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('16.x', false)).rejects.toThrow();
|
||||
expect(getSupportedNodeVersion('16.x', true)).rejects.toThrow();
|
||||
|
||||
const discontinued = getDiscontinuedNodeVersions();
|
||||
expect(discontinued.length).toBe(3);
|
||||
expect(discontinued[0]).toHaveProperty('range', '12.x');
|
||||
expect(discontinued[1]).toHaveProperty('range', '10.x');
|
||||
expect(discontinued[2]).toHaveProperty('range', '8.10.x');
|
||||
expect(discontinued.length).toBe(5);
|
||||
expect(discontinued[0]).toHaveProperty('range', '16.x');
|
||||
expect(discontinued[1]).toHaveProperty('range', '14.x');
|
||||
expect(discontinued[2]).toHaveProperty('range', '12.x');
|
||||
expect(discontinued[3]).toHaveProperty('range', '10.x');
|
||||
expect(discontinued[4]).toHaveProperty('range', '8.10.x');
|
||||
|
||||
global.Date.now = realDateNow;
|
||||
});
|
||||
@@ -277,11 +283,31 @@ it('should warn for deprecated versions, soon to be discontinued', async () => {
|
||||
'major',
|
||||
12
|
||||
);
|
||||
expect(await getSupportedNodeVersion('14.x', false)).toHaveProperty(
|
||||
'major',
|
||||
14
|
||||
);
|
||||
expect(await getSupportedNodeVersion('14.x', true)).toHaveProperty(
|
||||
'major',
|
||||
14
|
||||
);
|
||||
expect(await getSupportedNodeVersion('16.x', false)).toHaveProperty(
|
||||
'major',
|
||||
16
|
||||
);
|
||||
expect(await getSupportedNodeVersion('16.x', true)).toHaveProperty(
|
||||
'major',
|
||||
16
|
||||
);
|
||||
expect(warningMessages).toStrictEqual([
|
||||
'Error: Node.js version 10.x has reached End-of-Life. Deployments created on or after 2021-04-20 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 10.x has reached End-of-Life. Deployments created on or after 2021-04-20 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 12.x has reached End-of-Life. Deployments created on or after 2022-10-03 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 14.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set "engines": { "node": "18.x" } in your `package.json` file to use Node.js 18.',
|
||||
'Error: Node.js version 16.x has reached End-of-Life. Deployments created on or after 2023-08-15 will fail to build. Please set Node.js Version to 18.x in your Project Settings to use Node.js 18.',
|
||||
]);
|
||||
|
||||
global.Date.now = realDateNow;
|
||||
|
||||
@@ -1,5 +1,96 @@
|
||||
# vercel
|
||||
|
||||
## 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
|
||||
|
||||
- Add `vercel link --repo` flag to link to repository (multiple projects), rather than an individual project (alpha) ([#8931](https://github.com/vercel/vercel/pull/8931))
|
||||
|
||||
## 29.3.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @vercel/static-build@1.3.32
|
||||
|
||||
## 29.3.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`2c950d47a`](https://github.com/vercel/vercel/commit/2c950d47aeb22a3de16f983259ea6f37a4555189), [`71b9f3a94`](https://github.com/vercel/vercel/commit/71b9f3a94b7922607f8f24bf7b2bd1742e62cc05), [`f00b08a82`](https://github.com/vercel/vercel/commit/f00b08a82085c3a63059f34f67f10ced92f2979c)]:
|
||||
- @vercel/static-build@1.3.31
|
||||
- @vercel/build-utils@6.7.3
|
||||
- @vercel/next@3.8.5
|
||||
- @vercel/node@2.14.3
|
||||
- @vercel/remix-builder@1.8.10
|
||||
|
||||
## 29.3.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`67e556bc8`](https://github.com/vercel/vercel/commit/67e556bc80c821c233120a2ec1611adb8e195baa), [`ba10fb4dd`](https://github.com/vercel/vercel/commit/ba10fb4dd4155a75df79b98a0c43a6c42eac7b62)]:
|
||||
- @vercel/remix-builder@1.8.9
|
||||
- @vercel/next@3.8.4
|
||||
|
||||
## 29.3.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6c6f3ce9d`](https://github.com/vercel/vercel/commit/6c6f3ce9d228b1e038641e4bafb38c3487e7dff7)]:
|
||||
- @vercel/next@3.8.3
|
||||
|
||||
## 29.3.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [vc dev] Fix serverless function size limit condition ([#9961](https://github.com/vercel/vercel/pull/9961))
|
||||
|
||||
## 29.3.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Sort environment variables alphabetically in `vercel env pull` ([#9949](https://github.com/vercel/vercel/pull/9949))
|
||||
- Skip 50MB zip size limit for Python ([#9944](https://github.com/vercel/vercel/pull/9944))
|
||||
|
||||
## 29.3.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
|
||||
## Usage
|
||||
|
||||
Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.
|
||||
|
||||
We enable teams to iterate quickly and develop, preview, and ship delightful user experiences. Vercel has zero-configuration support for 35+ frontend frameworks and integrates with your headless content, commerce, or database of choice.
|
||||
Vercel's frontend cloud gives developers frameworks, workflows, and infrastructure to build a faster, more personalized web.
|
||||
|
||||
To install the latest version of Vercel CLI, run this command:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "29.3.0",
|
||||
"version": "30.1.0",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -32,16 +32,16 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.7.2",
|
||||
"@vercel/build-utils": "6.7.4",
|
||||
"@vercel/go": "2.5.1",
|
||||
"@vercel/hydrogen": "0.0.64",
|
||||
"@vercel/next": "3.8.2",
|
||||
"@vercel/node": "2.14.2",
|
||||
"@vercel/next": "3.8.6",
|
||||
"@vercel/node": "2.14.4",
|
||||
"@vercel/python": "3.1.60",
|
||||
"@vercel/redwood": "1.1.15",
|
||||
"@vercel/remix-builder": "1.8.8",
|
||||
"@vercel/remix-builder": "1.8.11",
|
||||
"@vercel/ruby": "1.3.76",
|
||||
"@vercel/static-build": "1.3.30"
|
||||
"@vercel/static-build": "1.3.33"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
@@ -85,13 +85,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.0",
|
||||
"@vercel-internals/constants": "1.0.1",
|
||||
"@vercel-internals/get-package-json": "1.0.0",
|
||||
"@vercel-internals/types": "1.0.1",
|
||||
"@vercel/client": "12.6.1",
|
||||
"@vercel/error-utils": "1.0.10",
|
||||
"@vercel/frameworks": "1.4.2",
|
||||
"@vercel/fs-detectors": "3.9.2",
|
||||
"@vercel/fs-detectors": "3.9.3",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.2.1",
|
||||
@@ -119,6 +119,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",
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ const help = () => {
|
||||
};
|
||||
|
||||
export default async function main(client: Client): Promise<number> {
|
||||
const { output } = client;
|
||||
const { cwd, output } = client;
|
||||
|
||||
// Ensure that `vc build` is not being invoked recursively
|
||||
if (process.env.__VERCEL_BUILD_RUNNING) {
|
||||
@@ -165,8 +165,6 @@ 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']);
|
||||
|
||||
@@ -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,7 +58,6 @@ 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';
|
||||
@@ -70,8 +68,7 @@ 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';
|
||||
|
||||
export default async (client: Client): Promise<number> => {
|
||||
const { output } = client;
|
||||
@@ -93,6 +90,7 @@ export default async (client: Client): Promise<number> => {
|
||||
'--prod': Boolean,
|
||||
'--archive': String,
|
||||
'--no-wait': Boolean,
|
||||
'--skip-domain': Boolean,
|
||||
'--yes': Boolean,
|
||||
'-f': '--force',
|
||||
'-p': '--public',
|
||||
@@ -132,24 +130,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 +171,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
|
||||
@@ -219,7 +205,7 @@ export default async (client: Client): Promise<number> => {
|
||||
|
||||
// build `--prebuilt`
|
||||
if (argv['--prebuilt']) {
|
||||
const prebuiltExists = await fs.pathExists(join(path, '.vercel/output'));
|
||||
const prebuiltExists = await fs.pathExists(join(cwd, '.vercel/output'));
|
||||
if (!prebuiltExists) {
|
||||
error(
|
||||
`The ${param(
|
||||
@@ -231,7 +217,7 @@ export default async (client: Client): Promise<number> => {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const prebuiltBuild = await getPrebuiltJson(path);
|
||||
const prebuiltBuild = await getPrebuiltJson(cwd);
|
||||
|
||||
// Ensure that there was not a build error
|
||||
const prebuiltError =
|
||||
@@ -274,7 +260,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 +277,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 +324,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 +332,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,6 +345,11 @@ 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`);
|
||||
@@ -373,14 +364,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 +384,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 +460,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 +511,8 @@ export default async (client: Client): Promise<number> => {
|
||||
}
|
||||
|
||||
try {
|
||||
const autoAssignCustomDomains = !argv['--skip-domain'];
|
||||
|
||||
const createArgs: CreateOptions = {
|
||||
name,
|
||||
env: deploymentEnv,
|
||||
@@ -543,6 +536,7 @@ export default async (client: Client): Promise<number> => {
|
||||
target,
|
||||
skipAutoDetectionConfirmation: autoConfirm,
|
||||
noWait,
|
||||
autoAssignCustomDomains,
|
||||
};
|
||||
|
||||
if (!localConfig.builds || localConfig.builds.length === 0) {
|
||||
@@ -559,11 +553,11 @@ export default async (client: Client): Promise<number> => {
|
||||
client,
|
||||
now,
|
||||
contextName,
|
||||
[sourcePath],
|
||||
sourcePath,
|
||||
createArgs,
|
||||
org,
|
||||
!project,
|
||||
path,
|
||||
cwd,
|
||||
archive
|
||||
);
|
||||
|
||||
@@ -595,11 +589,11 @@ export default async (client: Client): Promise<number> => {
|
||||
client,
|
||||
now,
|
||||
contextName,
|
||||
[sourcePath],
|
||||
sourcePath,
|
||||
createArgs,
|
||||
org,
|
||||
false,
|
||||
path
|
||||
cwd
|
||||
);
|
||||
}
|
||||
|
||||
@@ -728,7 +722,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 +829,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;
|
||||
};
|
||||
|
||||
5
packages/cli/src/commands/env/index.ts
vendored
5
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)) {
|
||||
|
||||
7
packages/cli/src/commands/env/pull.ts
vendored
7
packages/cli/src/commands/env/pull.ts
vendored
@@ -67,7 +67,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'];
|
||||
@@ -122,8 +122,9 @@ export default async function pull(
|
||||
|
||||
const contents =
|
||||
CONTENTS_PREFIX +
|
||||
Object.entries(records)
|
||||
.map(([key, value]) => `${key}="${escapeValue(value)}"`)
|
||||
Object.keys(records)
|
||||
.sort()
|
||||
.map(key => `${key}="${escapeValue(records[key])}"`)
|
||||
.join('\n') +
|
||||
'\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;
|
||||
}
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -2,8 +2,10 @@ import chalk from 'chalk';
|
||||
import Client from '../../util/client';
|
||||
import getArgs from '../../util/get-args';
|
||||
import logo from '../../util/output/logo';
|
||||
import cmd from '../../util/output/cmd';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import { ensureLink } from '../../util/link/ensure-link';
|
||||
import { ensureRepoLink } from '../../util/link/repo';
|
||||
|
||||
const help = () => {
|
||||
console.log(`
|
||||
@@ -12,6 +14,7 @@ const help = () => {
|
||||
${chalk.dim('Options:')}
|
||||
|
||||
-h, --help Output usage information
|
||||
-r, --repo Link multiple projects based on Git repository (alpha)
|
||||
-A ${chalk.bold.underline('FILE')}, --local-config=${chalk.bold.underline(
|
||||
'FILE'
|
||||
)} Path to the local ${'`vercel.json`'} file
|
||||
@@ -42,7 +45,14 @@ const help = () => {
|
||||
|
||||
${chalk.gray('–')} Link a specific directory to a Vercel Project
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} link /usr/src/project`)}
|
||||
${chalk.cyan(`$ ${getPkgName()} link --cwd /path/to/project`)}
|
||||
|
||||
${chalk.gray('–')} ${chalk.yellow(
|
||||
'(alpha)'
|
||||
)} Link to the current Git repository, allowing for multiple
|
||||
Vercel Projects to be linked simultaneously (useful for monorepos)
|
||||
|
||||
${chalk.cyan(`$ ${getPkgName()} link --repo`)}
|
||||
`);
|
||||
};
|
||||
|
||||
@@ -52,6 +62,8 @@ export default async function main(client: Client) {
|
||||
'-y': '--yes',
|
||||
'--project': String,
|
||||
'-p': '--project',
|
||||
'--repo': Boolean,
|
||||
'-r': '--repo',
|
||||
|
||||
// deprecated
|
||||
'--confirm': Boolean,
|
||||
@@ -68,17 +80,36 @@ export default async function main(client: Client) {
|
||||
argv['--yes'] = argv['--confirm'];
|
||||
}
|
||||
|
||||
const cwd = argv._[1] || process.cwd();
|
||||
const yes = !!argv['--yes'];
|
||||
|
||||
const link = await ensureLink('link', client, cwd, {
|
||||
autoConfirm: !!argv['--yes'],
|
||||
forceDelete: true,
|
||||
projectName: argv['--project'],
|
||||
successEmoji: 'success',
|
||||
});
|
||||
|
||||
if (typeof link === 'number') {
|
||||
return link;
|
||||
let cwd = argv._[1];
|
||||
if (cwd) {
|
||||
client.output.warn(
|
||||
`The ${cmd('vc link <directory>')} syntax is deprecated, please use ${cmd(
|
||||
`vc link --cwd ${cwd}`
|
||||
)} instead`
|
||||
);
|
||||
} else {
|
||||
cwd = client.cwd;
|
||||
}
|
||||
|
||||
if (argv['--repo']) {
|
||||
client.output.warn(
|
||||
`The ${cmd('--repo')} flag is in alpha, please report issues`
|
||||
);
|
||||
await ensureRepoLink(client, cwd, yes);
|
||||
} else {
|
||||
const link = await ensureLink('link', client, cwd, {
|
||||
autoConfirm: yes,
|
||||
forceDelete: true,
|
||||
projectName: argv['--project'],
|
||||
successEmoji: 'success',
|
||||
});
|
||||
|
||||
if (typeof link === 'number') {
|
||||
return link;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
121
packages/cli/src/commands/promote/index.ts
Normal file
121
packages/cli/src/commands/promote/index.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
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;
|
||||
}
|
||||
|
||||
// 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,
|
||||
});
|
||||
} 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;
|
||||
}
|
||||
};
|
||||
57
packages/cli/src/commands/promote/request-promote.ts
Normal file
57
packages/cli/src/commands/promote/request-promote.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
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';
|
||||
|
||||
/**
|
||||
* 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,
|
||||
}: {
|
||||
client: Client;
|
||||
deployId: string;
|
||||
timeout?: string;
|
||||
}): Promise<number> {
|
||||
const { output } = client;
|
||||
|
||||
const { contextName, deployment, project } = await getProjectByDeployment({
|
||||
client,
|
||||
deployId,
|
||||
output: client.output,
|
||||
});
|
||||
|
||||
// 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;
|
||||
}
|
||||
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 || 'production',
|
||||
},
|
||||
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;
|
||||
|
||||
@@ -207,4 +207,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;
|
||||
}
|
||||
@@ -40,8 +40,7 @@ export default async function processDeployment({
|
||||
...args
|
||||
}: {
|
||||
now: Now;
|
||||
output: Output;
|
||||
paths: string[];
|
||||
path: string;
|
||||
requestBody: DeploymentOptions;
|
||||
uploadStamp: () => string;
|
||||
deployStamp: () => string;
|
||||
@@ -54,15 +53,14 @@ export default async function processDeployment({
|
||||
isSettingUpProject: boolean;
|
||||
archive?: ArchiveFormat;
|
||||
skipAutoDetectionConfirmation?: boolean;
|
||||
cwd?: string;
|
||||
cwd: string;
|
||||
rootDirectory?: string | null;
|
||||
noWait?: boolean;
|
||||
agent?: Agent;
|
||||
}) {
|
||||
let {
|
||||
now,
|
||||
output,
|
||||
paths,
|
||||
path,
|
||||
requestBody,
|
||||
deployStamp,
|
||||
force,
|
||||
@@ -72,10 +70,9 @@ export default async function processDeployment({
|
||||
rootDirectory,
|
||||
} = args;
|
||||
|
||||
const { debug } = output;
|
||||
|
||||
const client = now._client;
|
||||
const { output } = client;
|
||||
const { env = {} } = requestBody;
|
||||
|
||||
const token = now._token;
|
||||
if (!token) {
|
||||
throw new Error('Missing authentication token');
|
||||
@@ -87,7 +84,7 @@ export default async function processDeployment({
|
||||
token,
|
||||
debug: now._debug,
|
||||
userAgent: ua,
|
||||
path: paths[0],
|
||||
path,
|
||||
force,
|
||||
withCache,
|
||||
prebuilt,
|
||||
@@ -114,7 +111,7 @@ export default async function processDeployment({
|
||||
|
||||
if (event.type === 'file-count') {
|
||||
const { total, missing, uploads } = event.payload;
|
||||
debug(`Total files ${total.size}, ${missing.length} changed`);
|
||||
output.debug(`Total files ${total.size}, ${missing.length} changed`);
|
||||
|
||||
const missingSize = missing
|
||||
.map((sha: string) => total.get(sha).data.length)
|
||||
@@ -157,7 +154,7 @@ export default async function processDeployment({
|
||||
}
|
||||
|
||||
if (event.type === 'file-uploaded') {
|
||||
debug(
|
||||
output.debug(
|
||||
`Uploaded: ${event.payload.file.names.join(' ')} (${bytes(
|
||||
event.payload.file.data.length
|
||||
)})`
|
||||
@@ -166,8 +163,8 @@ export default async function processDeployment({
|
||||
|
||||
if (event.type === 'created') {
|
||||
await linkFolderToProject(
|
||||
output,
|
||||
cwd || paths[0],
|
||||
client,
|
||||
cwd,
|
||||
{
|
||||
orgId: org.id,
|
||||
projectId: event.payload.projectId,
|
||||
|
||||
@@ -337,7 +337,10 @@ export async function executeBuild(
|
||||
// Enforce the lambda zip size soft watermark
|
||||
const maxLambdaBytes = bytes('50mb');
|
||||
for (const asset of Object.values(result.output)) {
|
||||
if (asset.type === 'Lambda') {
|
||||
if (
|
||||
asset.type === 'Lambda' &&
|
||||
!(typeof asset.runtime === 'string' && asset.runtime.startsWith('python'))
|
||||
) {
|
||||
const size = asset.zipBuffer.length;
|
||||
if (size > maxLambdaBytes) {
|
||||
throw new LambdaSizeExceededError(size, maxLambdaBytes);
|
||||
|
||||
@@ -10,7 +10,7 @@ import mapCertError from './certs/map-cert-error';
|
||||
import toHost from './to-host';
|
||||
|
||||
/**
|
||||
* Retrieves a v13 deployment.
|
||||
* Retrieves a deployment by id or URL.
|
||||
*
|
||||
* @param client - The Vercel CLI client instance.
|
||||
* @param contextName - The scope context/team name.
|
||||
|
||||
@@ -50,6 +50,7 @@ export interface CreateOptions {
|
||||
projectSettings?: any;
|
||||
skipAutoDetectionConfirmation?: boolean;
|
||||
noWait?: boolean;
|
||||
autoAssignCustomDomains: boolean;
|
||||
}
|
||||
|
||||
export interface RemoveOptions {
|
||||
@@ -106,7 +107,7 @@ export default class Now extends EventEmitter {
|
||||
}
|
||||
|
||||
async create(
|
||||
paths: string[],
|
||||
path: string,
|
||||
{
|
||||
// Legacy
|
||||
nowConfig: nowConfig = {},
|
||||
@@ -130,11 +131,12 @@ export default class Now extends EventEmitter {
|
||||
projectSettings,
|
||||
skipAutoDetectionConfirmation,
|
||||
noWait,
|
||||
autoAssignCustomDomains,
|
||||
}: CreateOptions,
|
||||
org: Org,
|
||||
isSettingUpProject: boolean,
|
||||
archive?: ArchiveFormat,
|
||||
cwd?: string
|
||||
cwd: string,
|
||||
archive?: ArchiveFormat
|
||||
) {
|
||||
let hashes: any = {};
|
||||
const uploadStamp = stamp();
|
||||
@@ -152,6 +154,7 @@ export default class Now extends EventEmitter {
|
||||
target: target || undefined,
|
||||
projectSettings,
|
||||
source: 'cli',
|
||||
autoAssignCustomDomains,
|
||||
};
|
||||
|
||||
// Ignore specific items from vercel.json
|
||||
@@ -160,9 +163,8 @@ export default class Now extends EventEmitter {
|
||||
|
||||
const deployment = await processDeployment({
|
||||
now: this,
|
||||
output: this._output,
|
||||
agent: this._client.agent,
|
||||
paths,
|
||||
path,
|
||||
requestBody,
|
||||
uploadStamp,
|
||||
deployStamp,
|
||||
|
||||
31
packages/cli/src/util/link/add-to-gitignore.ts
Normal file
31
packages/cli/src/util/link/add-to-gitignore.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import os from 'os';
|
||||
import { join } from 'path';
|
||||
import { readFile, writeFile } from 'fs-extra';
|
||||
import { VERCEL_DIR } from '../projects/link';
|
||||
|
||||
export async function addToGitIgnore(path: string, ignore = VERCEL_DIR) {
|
||||
let isGitIgnoreUpdated = false;
|
||||
try {
|
||||
const gitIgnorePath = join(path, '.gitignore');
|
||||
|
||||
let gitIgnore =
|
||||
(await readFile(gitIgnorePath, 'utf8').catch(() => null)) ?? '';
|
||||
const EOL = gitIgnore.includes('\r\n') ? '\r\n' : os.EOL;
|
||||
let contentModified = false;
|
||||
|
||||
if (!gitIgnore.split(EOL).includes(ignore)) {
|
||||
gitIgnore += `${
|
||||
gitIgnore.endsWith(EOL) || gitIgnore.length === 0 ? '' : EOL
|
||||
}${ignore}${EOL}`;
|
||||
contentModified = true;
|
||||
}
|
||||
|
||||
if (contentModified) {
|
||||
await writeFile(gitIgnorePath, gitIgnore);
|
||||
isGitIgnoreUpdated = true;
|
||||
}
|
||||
} catch (error) {
|
||||
// ignore errors since this is non-critical
|
||||
}
|
||||
return isGitIgnoreUpdated;
|
||||
}
|
||||
294
packages/cli/src/util/link/repo.ts
Normal file
294
packages/cli/src/util/link/repo.ts
Normal file
@@ -0,0 +1,294 @@
|
||||
import chalk from 'chalk';
|
||||
import pluralize from 'pluralize';
|
||||
import { homedir } from 'os';
|
||||
import { join, normalize } from 'path';
|
||||
import { normalizePath } from '@vercel/build-utils';
|
||||
import { lstat, readJSON, outputJSON, writeFile, readFile } from 'fs-extra';
|
||||
import confirm from '../input/confirm';
|
||||
import toHumanPath from '../humanize-path';
|
||||
import {
|
||||
VERCEL_DIR,
|
||||
VERCEL_DIR_README,
|
||||
VERCEL_DIR_REPO,
|
||||
} from '../projects/link';
|
||||
import { getRemoteUrls } from '../create-git-meta';
|
||||
import link from '../output/link';
|
||||
import { emoji, prependEmoji } from '../emoji';
|
||||
import selectOrg from '../input/select-org';
|
||||
import { addToGitIgnore } from './add-to-gitignore';
|
||||
import type Client from '../client';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
|
||||
const home = homedir();
|
||||
|
||||
export interface RepoProjectConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
directory: string;
|
||||
}
|
||||
|
||||
export interface RepoProjectsConfig {
|
||||
orgId: string;
|
||||
remoteName: string;
|
||||
projects: RepoProjectConfig[];
|
||||
}
|
||||
|
||||
export interface RepoLink {
|
||||
rootPath: string;
|
||||
repoConfigPath: string;
|
||||
repoConfig?: RepoProjectsConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a directory path `cwd`, finds the root of the Git repository
|
||||
* and returns the parsed `.vercel/repo.json` file if the repository
|
||||
* has already been linked.
|
||||
*/
|
||||
export async function getRepoLink(cwd: string): Promise<RepoLink | undefined> {
|
||||
// Determine where the root of the repo is
|
||||
const rootPath = await findRepoRoot(cwd);
|
||||
if (!rootPath) return undefined;
|
||||
|
||||
// Read the `repo.json`, if this repo has already been linked
|
||||
const repoConfigPath = join(rootPath, VERCEL_DIR, VERCEL_DIR_REPO);
|
||||
const repoConfig: RepoProjectsConfig = await readJSON(repoConfigPath).catch(
|
||||
err => {
|
||||
if (err.code !== 'ENOENT') throw err;
|
||||
}
|
||||
);
|
||||
|
||||
return { rootPath, repoConfig, repoConfigPath };
|
||||
}
|
||||
|
||||
export async function ensureRepoLink(
|
||||
client: Client,
|
||||
cwd: string,
|
||||
yes = false
|
||||
): Promise<RepoLink | undefined> {
|
||||
const { output } = client;
|
||||
|
||||
const repoLink = await getRepoLink(cwd);
|
||||
if (repoLink) {
|
||||
output.debug(`Found Git repository root directory: ${repoLink.rootPath}`);
|
||||
} else {
|
||||
throw new Error('Could not determine Git repository root directory');
|
||||
}
|
||||
let { rootPath, repoConfig, repoConfigPath } = repoLink;
|
||||
|
||||
if (!repoConfig) {
|
||||
// Not yet linked, so prompt user to begin linking
|
||||
let shouldLink =
|
||||
yes ||
|
||||
(await confirm(
|
||||
client,
|
||||
`Link Git repository at ${chalk.cyan(
|
||||
`“${toHumanPath(rootPath)}”`
|
||||
)} to your Project(s)?`,
|
||||
true
|
||||
));
|
||||
|
||||
if (!shouldLink) {
|
||||
output.print(`Canceled. Repository not linked.\n`);
|
||||
return;
|
||||
}
|
||||
|
||||
const org = await selectOrg(
|
||||
client,
|
||||
'Which scope should contain your Project(s)?',
|
||||
yes
|
||||
);
|
||||
client.config.currentTeam = org.type === 'team' ? org.id : undefined;
|
||||
|
||||
const remoteUrls = await getRemoteUrls(
|
||||
join(rootPath, '.git/config'),
|
||||
output
|
||||
);
|
||||
if (!remoteUrls) {
|
||||
throw new Error('Could not determine Git remote URLs');
|
||||
}
|
||||
const remoteNames = Object.keys(remoteUrls);
|
||||
let remoteName: string;
|
||||
if (remoteNames.length === 1) {
|
||||
remoteName = remoteNames[0];
|
||||
} else {
|
||||
// Prompt user to select which remote to use
|
||||
const originIndex = remoteNames.indexOf('origin');
|
||||
const answer = await client.prompt({
|
||||
type: 'list',
|
||||
name: 'value',
|
||||
message: 'Which Git remote should be used?',
|
||||
choices: remoteNames.map(name => {
|
||||
return { name: name, value: name };
|
||||
}),
|
||||
default: originIndex === -1 ? 0 : originIndex,
|
||||
});
|
||||
remoteName = answer.value;
|
||||
}
|
||||
const repoUrl = remoteUrls[remoteName];
|
||||
output.spinner(
|
||||
`Fetching Projects for ${link(repoUrl)} under ${chalk.bold(org.slug)}…`
|
||||
);
|
||||
// TODO: Add pagination to fetch all Projects
|
||||
const query = new URLSearchParams({ repoUrl, limit: '100' });
|
||||
const projects: Project[] = await client.fetch(`/v2/projects?${query}`);
|
||||
if (projects.length === 0) {
|
||||
output.log(
|
||||
`No Projects are linked to ${link(repoUrl)} under ${chalk.bold(
|
||||
org.slug
|
||||
)}.`
|
||||
);
|
||||
// TODO: run detection logic to find potential projects.
|
||||
// then prompt user to select valid projects.
|
||||
// then create new Projects
|
||||
} else {
|
||||
output.log(
|
||||
`Found ${chalk.bold(projects.length)} ${pluralize(
|
||||
'Project',
|
||||
projects.length
|
||||
)} linked to ${link(repoUrl)} under ${chalk.bold(org.slug)}:`
|
||||
);
|
||||
}
|
||||
|
||||
for (const project of projects) {
|
||||
output.print(` * ${chalk.cyan(`${org.slug}/${project.name}\n`)}`);
|
||||
}
|
||||
|
||||
shouldLink =
|
||||
yes ||
|
||||
(await confirm(
|
||||
client,
|
||||
`Link to ${projects.length === 1 ? 'it' : 'them'}?`,
|
||||
true
|
||||
));
|
||||
|
||||
if (!shouldLink) {
|
||||
output.print(`Canceled. Repository not linked.\n`);
|
||||
return;
|
||||
}
|
||||
|
||||
repoConfig = {
|
||||
orgId: org.id,
|
||||
remoteName,
|
||||
projects: projects.map(project => {
|
||||
return {
|
||||
id: project.id,
|
||||
name: project.name,
|
||||
directory: normalize(project.rootDirectory || ''),
|
||||
};
|
||||
}),
|
||||
};
|
||||
await outputJSON(repoConfigPath, repoConfig, { spaces: 2 });
|
||||
|
||||
await writeFile(
|
||||
join(rootPath, VERCEL_DIR, VERCEL_DIR_README),
|
||||
await readFile(join(__dirname, 'VERCEL_DIR_README.txt'), 'utf8')
|
||||
);
|
||||
|
||||
// update .gitignore
|
||||
const isGitIgnoreUpdated = await addToGitIgnore(rootPath);
|
||||
|
||||
output.print(
|
||||
prependEmoji(
|
||||
`Linked to ${link(repoUrl)} under ${chalk.bold(
|
||||
org.slug
|
||||
)} (created ${VERCEL_DIR}${
|
||||
isGitIgnoreUpdated ? ' and added it to .gitignore' : ''
|
||||
})`,
|
||||
emoji('link')
|
||||
) + '\n'
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
repoConfig,
|
||||
repoConfigPath,
|
||||
rootPath,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a `start` directory, traverses up the directory hierarchy until
|
||||
* the nearest `.git/config` file is found. Returns the directory where
|
||||
* the Git config was found, or `undefined` when no Git repo was found.
|
||||
*/
|
||||
export async function findRepoRoot(start: string): Promise<string | undefined> {
|
||||
for (const current of traverseUpDirectories(start)) {
|
||||
if (current === home) {
|
||||
// Sometimes the $HOME directory is set up as a Git repo
|
||||
// (for dotfiles, etc.). In this case it's safe to say that
|
||||
// this isn't the repo we're looking for. Bail.
|
||||
break;
|
||||
}
|
||||
|
||||
// if `.vercel/repo.json` exists (already linked),
|
||||
// then consider this the repo root
|
||||
const repoConfigPath = join(current, VERCEL_DIR, VERCEL_DIR_REPO);
|
||||
let stat = await lstat(repoConfigPath).catch(err => {
|
||||
if (err.code !== 'ENOENT') throw err;
|
||||
});
|
||||
if (stat) {
|
||||
return current;
|
||||
}
|
||||
|
||||
// if `.git/config` exists (unlinked),
|
||||
// then consider this the repo root
|
||||
const gitConfigPath = join(current, '.git/config');
|
||||
stat = await lstat(gitConfigPath).catch(err => {
|
||||
if (err.code !== 'ENOENT') throw err;
|
||||
});
|
||||
if (stat) {
|
||||
return current;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function* traverseUpDirectories(start: string) {
|
||||
let current: string | undefined = normalize(start);
|
||||
while (current) {
|
||||
yield current;
|
||||
// Go up one directory
|
||||
const next = join(current, '..');
|
||||
current = next === current ? undefined : next;
|
||||
}
|
||||
}
|
||||
|
||||
function sortByDirectory(a: RepoProjectConfig, b: RepoProjectConfig): number {
|
||||
const aParts = a.directory.split('/');
|
||||
const bParts = b.directory.split('/');
|
||||
return bParts.length - aParts.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the matching Projects from an array of Project links
|
||||
* where the provided relative path is within the Project's
|
||||
* root directory.
|
||||
*/
|
||||
export function findProjectsFromPath(
|
||||
projects: RepoProjectConfig[],
|
||||
path: string
|
||||
): RepoProjectConfig[] {
|
||||
const normalizedPath = normalizePath(path);
|
||||
return projects
|
||||
.slice()
|
||||
.sort(sortByDirectory)
|
||||
.filter(project => {
|
||||
if (project.directory === '.') {
|
||||
// Project has no "Root Directory" setting, so any path is valid
|
||||
return true;
|
||||
}
|
||||
return (
|
||||
normalizedPath === project.directory ||
|
||||
normalizedPath.startsWith(`${project.directory}/`)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: remove
|
||||
*/
|
||||
export function findProjectFromPath(
|
||||
projects: RepoProjectConfig[],
|
||||
path: string
|
||||
): RepoProjectConfig | undefined {
|
||||
return findProjectsFromPath(projects, path)[0];
|
||||
}
|
||||
@@ -133,7 +133,7 @@ export default async function setupAndLink(
|
||||
const project = projectOrNewProjectName;
|
||||
|
||||
await linkFolderToProject(
|
||||
output,
|
||||
client,
|
||||
path,
|
||||
{
|
||||
projectId: project.id,
|
||||
@@ -200,13 +200,14 @@ export default async function setupAndLink(
|
||||
...localConfigurationOverrides,
|
||||
sourceFilesOutsideRootDirectory,
|
||||
},
|
||||
autoAssignCustomDomains: true,
|
||||
};
|
||||
|
||||
const deployment = await createDeploy(
|
||||
client,
|
||||
now,
|
||||
config.currentTeam || 'current user',
|
||||
[sourcePath],
|
||||
sourcePath,
|
||||
createArgs,
|
||||
org,
|
||||
true,
|
||||
@@ -250,7 +251,7 @@ export default async function setupAndLink(
|
||||
Object.assign(project, settings);
|
||||
|
||||
await linkFolderToProject(
|
||||
output,
|
||||
client,
|
||||
path,
|
||||
{
|
||||
projectId: project.id,
|
||||
|
||||
40
packages/cli/src/util/projects/get-project-by-cwd-or-link.ts
Normal file
40
packages/cli/src/util/projects/get-project-by-cwd-or-link.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type Client from '../client';
|
||||
import { ProjectNotFound } from '../errors-ts';
|
||||
import { ensureLink } from '../link/ensure-link';
|
||||
import getProjectByNameOrId from './get-project-by-id-or-name';
|
||||
import type { Project } from '@vercel-internals/types';
|
||||
|
||||
export default async function getProjectByCwdOrLink({
|
||||
autoConfirm,
|
||||
client,
|
||||
commandName,
|
||||
cwd,
|
||||
projectNameOrId,
|
||||
}: {
|
||||
autoConfirm?: boolean;
|
||||
client: Client;
|
||||
commandName: string;
|
||||
cwd: string;
|
||||
projectNameOrId?: string;
|
||||
}): Promise<Project> {
|
||||
if (projectNameOrId) {
|
||||
const project = await getProjectByNameOrId(client, projectNameOrId);
|
||||
if (project instanceof ProjectNotFound) {
|
||||
throw project;
|
||||
}
|
||||
return project;
|
||||
}
|
||||
|
||||
// ensure the current directory is a linked project
|
||||
const linkedProject = await ensureLink(commandName, client, cwd, {
|
||||
autoConfirm,
|
||||
});
|
||||
|
||||
if (typeof linkedProject === 'number') {
|
||||
const err: NodeJS.ErrnoException = new Error('Link project error');
|
||||
err.code = 'ERR_LINK_PROJECT';
|
||||
throw err;
|
||||
}
|
||||
|
||||
return linkedProject.project;
|
||||
}
|
||||
104
packages/cli/src/util/projects/get-project-by-deployment.ts
Normal file
104
packages/cli/src/util/projects/get-project-by-deployment.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../client';
|
||||
import type { Deployment, Project, Team } from '@vercel-internals/types';
|
||||
import getDeployment from '../get-deployment';
|
||||
import getProjectByNameOrId from './get-project-by-id-or-name';
|
||||
import getScope from '../get-scope';
|
||||
import getTeamById from '../teams/get-team-by-id';
|
||||
import { isValidName } from '../is-valid-name';
|
||||
import { Output } from '../output';
|
||||
import { ProjectNotFound } from '../errors-ts';
|
||||
|
||||
export default async function getProjectByDeployment({
|
||||
client,
|
||||
deployId,
|
||||
output,
|
||||
}: {
|
||||
client: Client;
|
||||
deployId: string;
|
||||
output?: Output;
|
||||
}): Promise<{
|
||||
contextName: string;
|
||||
deployment: Deployment;
|
||||
project: Project;
|
||||
}> {
|
||||
const { config } = client;
|
||||
const { contextName } = await getScope(client);
|
||||
|
||||
if (!isValidName(deployId)) {
|
||||
throw new Error(
|
||||
`The provided argument "${deployId}" is not a valid deployment ID or URL`
|
||||
);
|
||||
}
|
||||
|
||||
let deployment: Deployment;
|
||||
let team: Team | undefined;
|
||||
|
||||
try {
|
||||
output?.spinner(
|
||||
`Fetching deployment "${deployId}" in ${chalk.bold(contextName)}…`
|
||||
);
|
||||
|
||||
const [teamResult, deploymentResult] = await Promise.allSettled([
|
||||
config.currentTeam ? getTeamById(client, config.currentTeam) : undefined,
|
||||
getDeployment(client, contextName, deployId),
|
||||
]);
|
||||
|
||||
if (teamResult.status === 'rejected') {
|
||||
throw new Error(
|
||||
`Failed to retrieve team information: ${teamResult.reason}`
|
||||
);
|
||||
}
|
||||
|
||||
if (deploymentResult.status === 'rejected') {
|
||||
throw new Error(deploymentResult.reason);
|
||||
}
|
||||
|
||||
team = teamResult.value;
|
||||
deployment = deploymentResult.value;
|
||||
|
||||
// re-render the spinner text
|
||||
output?.log(
|
||||
`Fetching deployment "${deployId}" in ${chalk.bold(contextName)}…`
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (!deployment.projectId) {
|
||||
throw new Error('Deployment is not associated to a project');
|
||||
}
|
||||
|
||||
const project = await getProjectByNameOrId(client, deployment.projectId);
|
||||
if (project instanceof ProjectNotFound) {
|
||||
throw project;
|
||||
}
|
||||
|
||||
return {
|
||||
contextName,
|
||||
deployment,
|
||||
project,
|
||||
};
|
||||
} finally {
|
||||
output?.stopSpinner();
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,13 @@ import { isAPIError, ProjectNotFound } from '../errors-ts';
|
||||
export default async function getProjectByNameOrId(
|
||||
client: Client,
|
||||
projectNameOrId: string,
|
||||
accountId?: string
|
||||
accountId?: string,
|
||||
includeRollbackInfo?: boolean
|
||||
) {
|
||||
try {
|
||||
const qs = includeRollbackInfo ? '?rollbackInfo=true' : '';
|
||||
const project = await client.fetch<Project>(
|
||||
`/v8/projects/${encodeURIComponent(projectNameOrId)}`,
|
||||
`/v9/projects/${encodeURIComponent(projectNameOrId)}${qs}`,
|
||||
{ accountId }
|
||||
);
|
||||
return project;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import AJV from 'ajv';
|
||||
import chalk from 'chalk';
|
||||
import { join } from 'path';
|
||||
import { join, relative } from 'path';
|
||||
import { ensureDir } from 'fs-extra';
|
||||
import { promisify } from 'util';
|
||||
|
||||
@@ -11,7 +10,6 @@ import Client from '../client';
|
||||
import { InvalidToken, isAPIError, ProjectNotFound } from '../errors-ts';
|
||||
import getUser from '../get-user';
|
||||
import getTeamById from '../teams/get-team-by-id';
|
||||
import { Output } from '../output';
|
||||
import type {
|
||||
Project,
|
||||
ProjectLinkResult,
|
||||
@@ -23,6 +21,9 @@ import { isDirectory } from '../config/global-path';
|
||||
import { NowBuildError, getPlatformEnv } from '@vercel/build-utils';
|
||||
import outputCode from '../output/code';
|
||||
import { isErrnoException, isError } from '@vercel/error-utils';
|
||||
import { findProjectsFromPath, getRepoLink } from '../link/repo';
|
||||
import { addToGitIgnore } from '../link/add-to-gitignore';
|
||||
import type { RepoProjectConfig } from '../link/repo';
|
||||
|
||||
const readFile = promisify(fs.readFile);
|
||||
const writeFile = promisify(fs.writeFile);
|
||||
@@ -31,6 +32,7 @@ export const VERCEL_DIR = '.vercel';
|
||||
export const VERCEL_DIR_FALLBACK = '.now';
|
||||
export const VERCEL_DIR_README = 'README.txt';
|
||||
export const VERCEL_DIR_PROJECT = 'project.json';
|
||||
export const VERCEL_DIR_REPO = 'repo.json';
|
||||
|
||||
const linkSchema = {
|
||||
type: 'object',
|
||||
@@ -53,7 +55,7 @@ const linkSchema = {
|
||||
*
|
||||
* Throws an error if *both* `.vercel` and `.now` directories exist.
|
||||
*/
|
||||
export function getVercelDirectory(cwd: string = process.cwd()): string {
|
||||
export function getVercelDirectory(cwd: string): string {
|
||||
const possibleDirs = [join(cwd, VERCEL_DIR), join(cwd, VERCEL_DIR_FALLBACK)];
|
||||
const existingDirs = possibleDirs.filter(d => isDirectory(d));
|
||||
if (existingDirs.length > 1) {
|
||||
@@ -67,9 +69,51 @@ export function getVercelDirectory(cwd: string = process.cwd()): string {
|
||||
return existingDirs[0] || possibleDirs[0];
|
||||
}
|
||||
|
||||
async function getLink(path?: string): Promise<ProjectLink | null> {
|
||||
const dir = getVercelDirectory(path);
|
||||
return getLinkFromDir(dir);
|
||||
async function getProjectLink(
|
||||
client: Client,
|
||||
path: string
|
||||
): Promise<ProjectLink | null> {
|
||||
return (
|
||||
(await getProjectLinkFromRepoLink(client, path)) ||
|
||||
(await getLinkFromDir(getVercelDirectory(path)))
|
||||
);
|
||||
}
|
||||
|
||||
async function getProjectLinkFromRepoLink(
|
||||
client: Client,
|
||||
path: string
|
||||
): Promise<ProjectLink | null> {
|
||||
const repoLink = await getRepoLink(path);
|
||||
if (!repoLink?.repoConfig) {
|
||||
return null;
|
||||
}
|
||||
const projects = findProjectsFromPath(
|
||||
repoLink.repoConfig.projects,
|
||||
relative(repoLink.rootPath, path)
|
||||
);
|
||||
let project: RepoProjectConfig | undefined;
|
||||
if (projects.length === 1) {
|
||||
project = projects[0];
|
||||
} else {
|
||||
const { p } = await client.prompt({
|
||||
name: 'p',
|
||||
type: 'list',
|
||||
message: `Please select a Project:`,
|
||||
choices: repoLink.repoConfig.projects.map(p => ({
|
||||
value: p,
|
||||
name: p.name,
|
||||
})),
|
||||
});
|
||||
project = p;
|
||||
}
|
||||
if (project) {
|
||||
return {
|
||||
orgId: repoLink.repoConfig.orgId,
|
||||
projectId: project.id,
|
||||
repoRoot: repoLink.rootPath,
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function getLinkFromDir<T = ProjectLink>(
|
||||
@@ -121,9 +165,45 @@ async function getOrgById(client: Client, orgId: string): Promise<Org | null> {
|
||||
return { type: 'user', id: orgId, slug: user.username };
|
||||
}
|
||||
|
||||
async function hasProjectLink(
|
||||
projectLink: ProjectLink,
|
||||
path: string
|
||||
): Promise<boolean> {
|
||||
// "linked" via env vars?
|
||||
const VERCEL_ORG_ID = getPlatformEnv('ORG_ID');
|
||||
const VERCEL_PROJECT_ID = getPlatformEnv('PROJECT_ID');
|
||||
if (
|
||||
VERCEL_ORG_ID === projectLink.orgId &&
|
||||
VERCEL_PROJECT_ID === projectLink.projectId
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// linked via `repo.json`?
|
||||
const repoLink = await getRepoLink(path);
|
||||
if (
|
||||
repoLink?.repoConfig?.orgId === projectLink.orgId &&
|
||||
repoLink.repoConfig.projects.find(p => p.id === projectLink.projectId)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// if the project is already linked, we skip linking
|
||||
const link = await getLinkFromDir(getVercelDirectory(path));
|
||||
if (
|
||||
link &&
|
||||
link.orgId === projectLink.orgId &&
|
||||
link.projectId === projectLink.projectId
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function getLinkedProject(
|
||||
client: Client,
|
||||
path?: string
|
||||
path = client.cwd
|
||||
): Promise<ProjectLinkResult> {
|
||||
const { output } = client;
|
||||
const VERCEL_ORG_ID = getPlatformEnv('ORG_ID');
|
||||
@@ -144,7 +224,7 @@ export async function getLinkedProject(
|
||||
const link =
|
||||
VERCEL_ORG_ID && VERCEL_PROJECT_ID
|
||||
? { orgId: VERCEL_ORG_ID, projectId: VERCEL_PROJECT_ID }
|
||||
: await getLink(path);
|
||||
: await getProjectLink(client, path);
|
||||
|
||||
if (!link) {
|
||||
return { status: 'not_linked', org: null, project: null };
|
||||
@@ -201,32 +281,19 @@ export async function getLinkedProject(
|
||||
return { status: 'not_linked', org: null, project: null };
|
||||
}
|
||||
|
||||
return { status: 'linked', org, project };
|
||||
return { status: 'linked', org, project, repoRoot: link.repoRoot };
|
||||
}
|
||||
|
||||
export async function linkFolderToProject(
|
||||
output: Output,
|
||||
client: Client,
|
||||
path: string,
|
||||
projectLink: ProjectLink,
|
||||
projectName: string,
|
||||
orgSlug: string,
|
||||
successEmoji: EmojiLabel = 'link'
|
||||
) {
|
||||
const VERCEL_ORG_ID = getPlatformEnv('ORG_ID');
|
||||
const VERCEL_PROJECT_ID = getPlatformEnv('PROJECT_ID');
|
||||
|
||||
// if defined, skip linking
|
||||
if (VERCEL_ORG_ID || VERCEL_PROJECT_ID) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if the project is already linked, we skip linking
|
||||
const link = await getLink(path);
|
||||
if (
|
||||
link &&
|
||||
link.orgId === projectLink.orgId &&
|
||||
link.projectId === projectLink.projectId
|
||||
) {
|
||||
if (await hasProjectLink(projectLink, path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,31 +319,9 @@ export async function linkFolderToProject(
|
||||
);
|
||||
|
||||
// update .gitignore
|
||||
let isGitIgnoreUpdated = false;
|
||||
try {
|
||||
const gitIgnorePath = join(path, '.gitignore');
|
||||
const isGitIgnoreUpdated = await addToGitIgnore(path);
|
||||
|
||||
let gitIgnore =
|
||||
(await readFile(gitIgnorePath, 'utf8').catch(() => null)) ?? '';
|
||||
const EOL = gitIgnore.includes('\r\n') ? '\r\n' : os.EOL;
|
||||
let contentModified = false;
|
||||
|
||||
if (!gitIgnore.split(EOL).includes(VERCEL_DIR)) {
|
||||
gitIgnore += `${
|
||||
gitIgnore.endsWith(EOL) || gitIgnore.length === 0 ? '' : EOL
|
||||
}${VERCEL_DIR}${EOL}`;
|
||||
contentModified = true;
|
||||
}
|
||||
|
||||
if (contentModified) {
|
||||
await writeFile(gitIgnorePath, gitIgnore);
|
||||
isGitIgnoreUpdated = true;
|
||||
}
|
||||
} catch (error) {
|
||||
// ignore errors since this is non-critical
|
||||
}
|
||||
|
||||
output.print(
|
||||
client.output.print(
|
||||
prependEmoji(
|
||||
`Linked to ${chalk.bold(
|
||||
`${orgSlug}/${projectName}`
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
import chalk from 'chalk';
|
||||
import type Client from '../client';
|
||||
import type { Deployment, Project, Team } from '@vercel-internals/types';
|
||||
import { getCommandName } from '../pkg-name';
|
||||
import getDeployment from '../get-deployment';
|
||||
import getScope from '../get-scope';
|
||||
import getTeamById from '../teams/get-team-by-id';
|
||||
import { isValidName } from '../is-valid-name';
|
||||
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} deployId - The deployment name or id to rollback
|
||||
* @param {Project} project - Project info instance
|
||||
* @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,
|
||||
project,
|
||||
timeout,
|
||||
}: {
|
||||
client: Client;
|
||||
deployId: string;
|
||||
project: Project;
|
||||
timeout?: string;
|
||||
}): Promise<number> {
|
||||
const { config, output } = client;
|
||||
const { contextName } = await getScope(client);
|
||||
|
||||
if (!isValidName(deployId)) {
|
||||
output.error(
|
||||
`The provided argument "${deployId}" is not a valid deployment or project`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
let deployment: Deployment;
|
||||
let team: Team | undefined;
|
||||
|
||||
try {
|
||||
output.spinner(
|
||||
`Fetching deployment "${deployId}" in ${chalk.bold(contextName)}…`
|
||||
);
|
||||
|
||||
const [teamResult, deploymentResult] = await Promise.allSettled([
|
||||
config.currentTeam ? getTeamById(client, config.currentTeam) : undefined,
|
||||
getDeployment(client, contextName, deployId),
|
||||
]);
|
||||
|
||||
if (teamResult.status === 'rejected') {
|
||||
output.error(`Failed to retrieve team information: ${teamResult.reason}`);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (deploymentResult.status === 'rejected') {
|
||||
output.error(deploymentResult.reason);
|
||||
return 1;
|
||||
}
|
||||
|
||||
team = teamResult.value;
|
||||
deployment = deploymentResult.value;
|
||||
|
||||
// re-render the spinner text because it goes so fast
|
||||
output.log(
|
||||
`Fetching deployment "${deployId}" in ${chalk.bold(contextName)}…`
|
||||
);
|
||||
} finally {
|
||||
output.stopSpinner();
|
||||
}
|
||||
|
||||
if (deployment.team?.id) {
|
||||
if (!team || deployment.team.id !== team.id) {
|
||||
output.error(
|
||||
team
|
||||
? `Deployment doesn't belong to current team ${chalk.bold(
|
||||
contextName
|
||||
)}`
|
||||
: `Deployment belongs to a different team`
|
||||
);
|
||||
output.error(
|
||||
`Use ${chalk.bold('vc switch')} to change your current team`
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
} else if (team) {
|
||||
output.error(
|
||||
`Deployment doesn't belong to current team ${chalk.bold(contextName)}`
|
||||
);
|
||||
output.error(`Use ${chalk.bold('vc switch')} to change your current team`);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// create the rollback
|
||||
await client.fetch<any>(
|
||||
`/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,5 +1,4 @@
|
||||
import { lstat as lstatRaw } from 'fs';
|
||||
import { promisify } from 'util';
|
||||
import { lstat } from 'fs-extra';
|
||||
import { Output } from './output';
|
||||
import chalk from 'chalk';
|
||||
import { homedir } from 'os';
|
||||
@@ -7,8 +6,6 @@ import confirm from './input/confirm';
|
||||
import toHumanPath from './humanize-path';
|
||||
import Client from './client';
|
||||
|
||||
const stat = promisify(lstatRaw);
|
||||
|
||||
/**
|
||||
* A helper function to validate the `rootDirectory` input.
|
||||
*/
|
||||
@@ -18,7 +15,7 @@ export async function validateRootDirectory(
|
||||
path: string,
|
||||
errorSuffix: string
|
||||
) {
|
||||
const pathStat = await stat(path).catch(() => null);
|
||||
const pathStat = await lstat(path).catch(() => null);
|
||||
const suffix = errorSuffix ? ` ${errorSuffix}` : '';
|
||||
|
||||
if (!pathStat) {
|
||||
@@ -66,7 +63,7 @@ export default async function validatePaths(
|
||||
const path = paths[0];
|
||||
|
||||
// can only deploy a directory
|
||||
const pathStat = await stat(path).catch(() => null);
|
||||
const pathStat = await lstat(path).catch(() => null);
|
||||
|
||||
if (!pathStat) {
|
||||
output.error(`Could not find ${chalk.cyan(`“${toHumanPath(path)}”`)}`);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "nextjs-node",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "next",
|
||||
@@ -9,5 +10,6 @@
|
||||
"next": "13.0.4",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{
|
||||
"name": "10a-nextjs-routes",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"next": "13.0.4",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "nextjs-src-dir",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "next",
|
||||
@@ -9,5 +10,6 @@
|
||||
"next": "13.0.4",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
"next": "latest",
|
||||
"react": "latest",
|
||||
"react-dom": "latest"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -6,5 +6,6 @@
|
||||
"next": "9.0.0",
|
||||
"react": "16.8.6",
|
||||
"react-dom": "16.8.6"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
"next": "12.1.6",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "force-module-commonjs",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next",
|
||||
@@ -15,5 +16,6 @@
|
||||
"@types/node": "18.x",
|
||||
"@types/react": "18.0.25",
|
||||
"typescript": "4.9.3"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "nested-tsconfig",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next",
|
||||
@@ -15,5 +16,6 @@
|
||||
"@types/node": "18.x",
|
||||
"@types/react": "18.0.25",
|
||||
"typescript": "4.9.3"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"next": "13.0.4"
|
||||
}
|
||||
},
|
||||
"ignoreNextjsUpdates": true
|
||||
}
|
||||
|
||||
11
packages/cli/test/fixtures/unit/commands/deploy/monorepo-static/.vercel/repo.json
vendored
Normal file
11
packages/cli/test/fixtures/unit/commands/deploy/monorepo-static/.vercel/repo.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"orgId": "team_dummy",
|
||||
"remoteName": "origin",
|
||||
"projects": [
|
||||
{
|
||||
"id": "QmbKpqpiUqbcke",
|
||||
"name": "app",
|
||||
"directory": "app"
|
||||
}
|
||||
]
|
||||
}
|
||||
1
packages/cli/test/fixtures/unit/commands/deploy/static/.gitignore
vendored
Normal file
1
packages/cli/test/fixtures/unit/commands/deploy/static/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!.vercel
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user